diff --git a/PagarmeApiSDK.Standard/Controllers/BalanceOperationsController.cs b/PagarmeApiSDK.Standard/Controllers/BalanceOperationsController.cs index f47fc77..8b7acc2 100644 --- a/PagarmeApiSDK.Standard/Controllers/BalanceOperationsController.cs +++ b/PagarmeApiSDK.Standard/Controllers/BalanceOperationsController.cs @@ -32,32 +32,6 @@ internal class BalanceOperationsController : BaseController, IBalanceOperationsC /// internal BalanceOperationsController(GlobalConfiguration globalConfiguration) : base(globalConfiguration) { } - /// - /// GetBalanceOperationById EndPoint. - /// - /// Required parameter: Example: . - /// Returns the Models.GetBalanceOperationResponse response from the API call. - public Models.GetBalanceOperationResponse GetBalanceOperationById( - long id) - => CoreHelper.RunTask(GetBalanceOperationByIdAsync(id)); - - /// - /// GetBalanceOperationById EndPoint. - /// - /// Required parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetBalanceOperationResponse response from the API call. - public async Task GetBalanceOperationByIdAsync( - long id, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/balance/operations/{id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("id", id)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// GetBalanceOperations EndPoint. /// @@ -98,5 +72,31 @@ public Models.ListBalanceOperationResponse GetBalanceOperations( .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) .Query(_query => _query.Setup("recipient_id", recipientId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// GetBalanceOperationById EndPoint. + /// + /// Required parameter: Example: . + /// Returns the Models.GetBalanceOperationResponse response from the API call. + public Models.GetBalanceOperationResponse GetBalanceOperationById( + long id) + => CoreHelper.RunTask(GetBalanceOperationByIdAsync(id)); + + /// + /// GetBalanceOperationById EndPoint. + /// + /// Required parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetBalanceOperationResponse response from the API call. + public async Task GetBalanceOperationByIdAsync( + long id, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/balance/operations/{id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("id", id)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/ChargesController.cs b/PagarmeApiSDK.Standard/Controllers/ChargesController.cs index dfc9dea..2befbb8 100644 --- a/PagarmeApiSDK.Standard/Controllers/ChargesController.cs +++ b/PagarmeApiSDK.Standard/Controllers/ChargesController.cs @@ -69,34 +69,34 @@ public Models.GetChargeResponse UpdateChargeMetadata( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Captures a charge. + /// Updates a charge's payment method. /// /// Required parameter: Charge id. - /// Optional parameter: Request for capturing a charge. + /// Required parameter: Request for updating the payment method from a charge. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse CaptureCharge( + public Models.GetChargeResponse UpdateChargePaymentMethod( string chargeId, - Models.CreateCaptureChargeRequest request = null, + Models.UpdateChargePaymentMethodRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(CaptureChargeAsync(chargeId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateChargePaymentMethodAsync(chargeId, request, idempotencyKey)); /// - /// Captures a charge. + /// Updates a charge's payment method. /// /// Required parameter: Charge id. - /// Optional parameter: Request for capturing a charge. + /// Required parameter: Request for updating the payment method from a charge. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - public async Task CaptureChargeAsync( + public async Task UpdateChargePaymentMethodAsync( string chargeId, - Models.CreateCaptureChargeRequest request = null, + Models.UpdateChargePaymentMethodRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/charges/{charge_id}/capture") + .Setup(new HttpMethod("PATCH"), "/charges/{charge_id}/payment-method") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -105,60 +105,70 @@ public Models.GetChargeResponse CaptureCharge( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Get a charge from its id. + /// GetChargeTransactions EndPoint. /// - /// Required parameter: Charge id. - /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse GetCharge( - string chargeId) - => CoreHelper.RunTask(GetChargeAsync(chargeId)); + /// Required parameter: Charge Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListChargeTransactionsResponse response from the API call. + public Models.ListChargeTransactionsResponse GetChargeTransactions( + string chargeId, + int? page = null, + int? size = null) + => CoreHelper.RunTask(GetChargeTransactionsAsync(chargeId, page, size)); /// - /// Get a charge from its id. + /// GetChargeTransactions EndPoint. /// - /// Required parameter: Charge id. + /// Required parameter: Charge Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. /// cancellationToken. - /// Returns the Models.GetChargeResponse response from the API call. - public async Task GetChargeAsync( + /// Returns the Models.ListChargeTransactionsResponse response from the API call. + public async Task GetChargeTransactionsAsync( string chargeId, + int? page = null, + int? size = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/charges/{charge_id}") + .Setup(HttpMethod.Get, "/charges/{charge_id}/transactions") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("charge_id", chargeId)))) + .Template(_template => _template.Setup("charge_id", chargeId)) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// ConfirmPayment EndPoint. + /// Updates the due date from a charge. /// - /// Required parameter: Example: . - /// Optional parameter: Request for confirm payment. + /// Required parameter: Charge Id. + /// Required parameter: Request for updating the due date. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse ConfirmPayment( + public Models.GetChargeResponse UpdateChargeDueDate( string chargeId, - Models.CreateConfirmPaymentRequest request = null, + Models.UpdateChargeDueDateRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(ConfirmPaymentAsync(chargeId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateChargeDueDateAsync(chargeId, request, idempotencyKey)); /// - /// ConfirmPayment EndPoint. + /// Updates the due date from a charge. /// - /// Required parameter: Example: . - /// Optional parameter: Request for confirm payment. + /// Required parameter: Charge Id. + /// Required parameter: Request for updating the due date. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - public async Task ConfirmPaymentAsync( + public async Task UpdateChargeDueDateAsync( string chargeId, - Models.CreateConfirmPaymentRequest request = null, + Models.UpdateChargeDueDateRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/charges/{charge_id}/confirm-payment") + .Setup(new HttpMethod("PATCH"), "/Charges/{charge_id}/due-date") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -167,70 +177,100 @@ public Models.GetChargeResponse ConfirmPayment( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetChargeTransactions EndPoint. + /// Lists all charges. /// - /// Required parameter: Charge Id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Returns the Models.ListChargeTransactionsResponse response from the API call. - public Models.ListChargeTransactionsResponse GetChargeTransactions( - string chargeId, + /// Optional parameter: Filter for charge's code. + /// Optional parameter: Filter for charge's status. + /// Optional parameter: Filter for charge's payment method. + /// Optional parameter: Filter for charge's customer id. + /// Optional parameter: Filter for charge's order id. + /// Optional parameter: Filter for the beginning of the range for charge's creation. + /// Optional parameter: Filter for the end of the range for charge's creation. + /// Returns the Models.ListChargesResponse response from the API call. + public Models.ListChargesResponse GetCharges( int? page = null, - int? size = null) - => CoreHelper.RunTask(GetChargeTransactionsAsync(chargeId, page, size)); + int? size = null, + string code = null, + string status = null, + string paymentMethod = null, + string customerId = null, + string orderId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) + => CoreHelper.RunTask(GetChargesAsync(page, size, code, status, paymentMethod, customerId, orderId, createdSince, createdUntil)); /// - /// GetChargeTransactions EndPoint. + /// Lists all charges. /// - /// Required parameter: Charge Id. /// Optional parameter: Page number. /// Optional parameter: Page size. + /// Optional parameter: Filter for charge's code. + /// Optional parameter: Filter for charge's status. + /// Optional parameter: Filter for charge's payment method. + /// Optional parameter: Filter for charge's customer id. + /// Optional parameter: Filter for charge's order id. + /// Optional parameter: Filter for the beginning of the range for charge's creation. + /// Optional parameter: Filter for the end of the range for charge's creation. /// cancellationToken. - /// Returns the Models.ListChargeTransactionsResponse response from the API call. - public async Task GetChargeTransactionsAsync( - string chargeId, + /// Returns the Models.ListChargesResponse response from the API call. + public async Task GetChargesAsync( int? page = null, int? size = null, + string code = null, + string status = null, + string paymentMethod = null, + string customerId = null, + string orderId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/charges/{charge_id}/transactions") + .Setup(HttpMethod.Get, "/charges") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("charge_id", chargeId)) .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)))) + .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("code", code)) + .Query(_query => _query.Setup("status", status)) + .Query(_query => _query.Setup("payment_method", paymentMethod)) + .Query(_query => _query.Setup("customer_id", customerId)) + .Query(_query => _query.Setup("order_id", orderId)) + .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the card from a charge. + /// Captures a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating a charge's card. + /// Optional parameter: Request for capturing a charge. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse UpdateChargeCard( + public Models.GetChargeResponse CaptureCharge( string chargeId, - Models.UpdateChargeCardRequest request, + Models.CreateCaptureChargeRequest request = null, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateChargeCardAsync(chargeId, request, idempotencyKey)); + => CoreHelper.RunTask(CaptureChargeAsync(chargeId, request, idempotencyKey)); /// - /// Updates the card from a charge. + /// Captures a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating a charge's card. + /// Optional parameter: Request for capturing a charge. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - public async Task UpdateChargeCardAsync( + public async Task CaptureChargeAsync( string chargeId, - Models.UpdateChargeCardRequest request, + Models.CreateCaptureChargeRequest request = null, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/charges/{charge_id}/card") + .Setup(HttpMethod.Post, "/charges/{charge_id}/capture") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -239,65 +279,34 @@ public Models.GetChargeResponse UpdateChargeCard( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a new charge. - /// - /// Required parameter: Request for creating a charge. - /// Optional parameter: Example: . - /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse CreateCharge( - Models.CreateChargeRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(CreateChargeAsync(request, idempotencyKey)); - - /// - /// Creates a new charge. - /// - /// Required parameter: Request for creating a charge. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetChargeResponse response from the API call. - public async Task CreateChargeAsync( - Models.CreateChargeRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/Charges") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Updates a charge's payment method. + /// Updates the card from a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating the payment method from a charge. + /// Required parameter: Request for updating a charge's card. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse UpdateChargePaymentMethod( + public Models.GetChargeResponse UpdateChargeCard( string chargeId, - Models.UpdateChargePaymentMethodRequest request, + Models.UpdateChargeCardRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateChargePaymentMethodAsync(chargeId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateChargeCardAsync(chargeId, request, idempotencyKey)); /// - /// Updates a charge's payment method. + /// Updates the card from a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating the payment method from a charge. + /// Required parameter: Request for updating a charge's card. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - public async Task UpdateChargePaymentMethodAsync( + public async Task UpdateChargeCardAsync( string chargeId, - Models.UpdateChargePaymentMethodRequest request, + Models.UpdateChargeCardRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/charges/{charge_id}/payment-method") + .Setup(new HttpMethod("PATCH"), "/charges/{charge_id}/card") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -306,39 +315,29 @@ public Models.GetChargeResponse UpdateChargePaymentMethod( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the due date from a charge. + /// Get a charge from its id. /// - /// Required parameter: Charge Id. - /// Required parameter: Request for updating the due date. - /// Optional parameter: Example: . + /// Required parameter: Charge id. /// Returns the Models.GetChargeResponse response from the API call. - public Models.GetChargeResponse UpdateChargeDueDate( - string chargeId, - Models.UpdateChargeDueDateRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateChargeDueDateAsync(chargeId, request, idempotencyKey)); + public Models.GetChargeResponse GetCharge( + string chargeId) + => CoreHelper.RunTask(GetChargeAsync(chargeId)); /// - /// Updates the due date from a charge. + /// Get a charge from its id. /// - /// Required parameter: Charge Id. - /// Required parameter: Request for updating the due date. - /// Optional parameter: Example: . + /// Required parameter: Charge id. /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - public async Task UpdateChargeDueDateAsync( + public async Task GetChargeAsync( string chargeId, - Models.UpdateChargeDueDateRequest request, - string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/Charges/{charge_id}/due-date") + .Setup(HttpMethod.Get, "/charges/{charge_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("charge_id", chargeId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Template(_template => _template.Setup("charge_id", chargeId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// @@ -408,72 +407,6 @@ public Models.GetChargeResponse RetryCharge( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// - /// Lists all charges. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for charge's code. - /// Optional parameter: Filter for charge's status. - /// Optional parameter: Filter for charge's payment method. - /// Optional parameter: Filter for charge's customer id. - /// Optional parameter: Filter for charge's order id. - /// Optional parameter: Filter for the beginning of the range for charge's creation. - /// Optional parameter: Filter for the end of the range for charge's creation. - /// Returns the Models.ListChargesResponse response from the API call. - public Models.ListChargesResponse GetCharges( - int? page = null, - int? size = null, - string code = null, - string status = null, - string paymentMethod = null, - string customerId = null, - string orderId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) - => CoreHelper.RunTask(GetChargesAsync(page, size, code, status, paymentMethod, customerId, orderId, createdSince, createdUntil)); - - /// - /// Lists all charges. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for charge's code. - /// Optional parameter: Filter for charge's status. - /// Optional parameter: Filter for charge's payment method. - /// Optional parameter: Filter for charge's customer id. - /// Optional parameter: Filter for charge's order id. - /// Optional parameter: Filter for the beginning of the range for charge's creation. - /// Optional parameter: Filter for the end of the range for charge's creation. - /// cancellationToken. - /// Returns the Models.ListChargesResponse response from the API call. - public async Task GetChargesAsync( - int? page = null, - int? size = null, - string code = null, - string status = null, - string paymentMethod = null, - string customerId = null, - string orderId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/charges") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)) - .Query(_query => _query.Setup("code", code)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("payment_method", paymentMethod)) - .Query(_query => _query.Setup("customer_id", customerId)) - .Query(_query => _query.Setup("order_id", orderId)) - .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// Cancel a charge. /// @@ -509,5 +442,72 @@ public Models.GetChargeResponse CancelCharge( .Template(_template => _template.Setup("charge_id", chargeId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Creates a new charge. + /// + /// Required parameter: Request for creating a charge. + /// Optional parameter: Example: . + /// Returns the Models.GetChargeResponse response from the API call. + public Models.GetChargeResponse CreateCharge( + Models.CreateChargeRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(CreateChargeAsync(request, idempotencyKey)); + + /// + /// Creates a new charge. + /// + /// Required parameter: Request for creating a charge. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetChargeResponse response from the API call. + public async Task CreateChargeAsync( + Models.CreateChargeRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/Charges") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// ConfirmPayment EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Request for confirm payment. + /// Optional parameter: Example: . + /// Returns the Models.GetChargeResponse response from the API call. + public Models.GetChargeResponse ConfirmPayment( + string chargeId, + Models.CreateConfirmPaymentRequest request = null, + string idempotencyKey = null) + => CoreHelper.RunTask(ConfirmPaymentAsync(chargeId, request, idempotencyKey)); + + /// + /// ConfirmPayment EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Request for confirm payment. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetChargeResponse response from the API call. + public async Task ConfirmPaymentAsync( + string chargeId, + Models.CreateConfirmPaymentRequest request = null, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/charges/{charge_id}/confirm-payment") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("charge_id", chargeId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/CustomersController.cs b/PagarmeApiSDK.Standard/Controllers/CustomersController.cs index 8a78c8b..5326527 100644 --- a/PagarmeApiSDK.Standard/Controllers/CustomersController.cs +++ b/PagarmeApiSDK.Standard/Controllers/CustomersController.cs @@ -33,79 +33,84 @@ internal class CustomersController : BaseController, ICustomersController internal CustomersController(GlobalConfiguration globalConfiguration) : base(globalConfiguration) { } /// - /// Creates a new address for a customer. + /// Updates a card. /// /// Required parameter: Customer Id. - /// Required parameter: Request for creating an address. + /// Required parameter: Card id. + /// Required parameter: Request for updating a card. /// Optional parameter: Example: . - /// Returns the Models.GetAddressResponse response from the API call. - public Models.GetAddressResponse CreateAddress( + /// Returns the Models.GetCardResponse response from the API call. + public Models.GetCardResponse UpdateCard( string customerId, - Models.CreateAddressRequest request, + string cardId, + Models.UpdateCardRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(CreateAddressAsync(customerId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateCardAsync(customerId, cardId, request, idempotencyKey)); /// - /// Creates a new address for a customer. + /// Updates a card. /// /// Required parameter: Customer Id. - /// Required parameter: Request for creating an address. + /// Required parameter: Card id. + /// Required parameter: Request for updating a card. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetAddressResponse response from the API call. - public async Task CreateAddressAsync( + /// Returns the Models.GetCardResponse response from the API call. + public async Task UpdateCardAsync( string customerId, - Models.CreateAddressRequest request, + string cardId, + Models.UpdateCardRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/customers/{customer_id}/addresses") + .Setup(HttpMethod.Put, "/customers/{customer_id}/cards/{card_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("customer_id", customerId)) + .Template(_template => _template.Setup("card_id", cardId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates a card. + /// Updates an address. /// /// Required parameter: Customer Id. - /// Required parameter: Card id. - /// Required parameter: Request for updating a card. + /// Required parameter: Address Id. + /// Required parameter: Request for updating an address. /// Optional parameter: Example: . - /// Returns the Models.GetCardResponse response from the API call. - public Models.GetCardResponse UpdateCard( + /// Returns the Models.GetAddressResponse response from the API call. + public Models.GetAddressResponse UpdateAddress( string customerId, - string cardId, - Models.UpdateCardRequest request, + string addressId, + Models.UpdateAddressRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateCardAsync(customerId, cardId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateAddressAsync(customerId, addressId, request, idempotencyKey)); /// - /// Updates a card. + /// Updates an address. /// /// Required parameter: Customer Id. - /// Required parameter: Card id. - /// Required parameter: Request for updating a card. + /// Required parameter: Address Id. + /// Required parameter: Request for updating an address. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - public async Task UpdateCardAsync( + /// Returns the Models.GetAddressResponse response from the API call. + public async Task UpdateAddressAsync( string customerId, - string cardId, - Models.UpdateCardRequest request, + string addressId, + Models.UpdateAddressRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Put, "/customers/{customer_id}/cards/{card_id}") + .Setup(HttpMethod.Put, "/customers/{customer_id}/addresses/{address_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("customer_id", customerId)) - .Template(_template => _template.Setup("card_id", cardId)) + .Template(_template => _template.Setup("address_id", addressId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); @@ -177,70 +182,65 @@ public Models.GetCustomerResponse CreateCustomer( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Delete a Customer's access tokens. + /// Creates a new address for a customer. /// /// Required parameter: Customer Id. - /// Returns the Models.ListAccessTokensResponse response from the API call. - public Models.ListAccessTokensResponse DeleteAccessTokens( - string customerId) - => CoreHelper.RunTask(DeleteAccessTokensAsync(customerId)); + /// Required parameter: Request for creating an address. + /// Optional parameter: Example: . + /// Returns the Models.GetAddressResponse response from the API call. + public Models.GetAddressResponse CreateAddress( + string customerId, + Models.CreateAddressRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(CreateAddressAsync(customerId, request, idempotencyKey)); /// - /// Delete a Customer's access tokens. + /// Creates a new address for a customer. /// /// Required parameter: Customer Id. + /// Required parameter: Request for creating an address. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListAccessTokensResponse response from the API call. - public async Task DeleteAccessTokensAsync( + /// Returns the Models.GetAddressResponse response from the API call. + public async Task CreateAddressAsync( string customerId, + Models.CreateAddressRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/customers/{customer_id}/access-tokens/") + .Setup(HttpMethod.Post, "/customers/{customer_id}/addresses") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("customer_id", customerId)))) + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("customer_id", customerId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates an address. + /// Delete a Customer's access tokens. /// /// Required parameter: Customer Id. - /// Required parameter: Address Id. - /// Required parameter: Request for updating an address. - /// Optional parameter: Example: . - /// Returns the Models.GetAddressResponse response from the API call. - public Models.GetAddressResponse UpdateAddress( - string customerId, - string addressId, - Models.UpdateAddressRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateAddressAsync(customerId, addressId, request, idempotencyKey)); + /// Returns the Models.ListAccessTokensResponse response from the API call. + public Models.ListAccessTokensResponse DeleteAccessTokens( + string customerId) + => CoreHelper.RunTask(DeleteAccessTokensAsync(customerId)); /// - /// Updates an address. + /// Delete a Customer's access tokens. /// /// Required parameter: Customer Id. - /// Required parameter: Address Id. - /// Required parameter: Request for updating an address. - /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetAddressResponse response from the API call. - public async Task UpdateAddressAsync( + /// Returns the Models.ListAccessTokensResponse response from the API call. + public async Task DeleteAccessTokensAsync( string customerId, - string addressId, - Models.UpdateAddressRequest request, - string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Put, "/customers/{customer_id}/addresses/{address_id}") + .Setup(HttpMethod.Get, "/customers/{customer_id}/access-tokens/") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("customer_id", customerId)) - .Template(_template => _template.Setup("address_id", addressId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Template(_template => _template.Setup("customer_id", customerId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// @@ -310,6 +310,42 @@ public Models.GetAddressResponse DeleteAddress( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Creates a new card for a customer. + /// + /// Required parameter: Customer id. + /// Required parameter: Request for creating a card. + /// Optional parameter: Example: . + /// Returns the Models.GetCardResponse response from the API call. + public Models.GetCardResponse CreateCard( + string customerId, + Models.CreateCardRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(CreateCardAsync(customerId, request, idempotencyKey)); + + /// + /// Creates a new card for a customer. + /// + /// Required parameter: Customer id. + /// Required parameter: Request for creating a card. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetCardResponse response from the API call. + public async Task CreateCardAsync( + string customerId, + Models.CreateCardRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/customers/{customer_id}/cards") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("customer_id", customerId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Get all Customers. /// @@ -362,141 +398,182 @@ public Models.ListCustomersResponse GetCustomers( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Get all access tokens from a customer. + /// Updates a customer. /// - /// Required parameter: Customer Id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Returns the Models.ListAccessTokensResponse response from the API call. - public Models.ListAccessTokensResponse GetAccessTokens( + /// Required parameter: Customer id. + /// Required parameter: Request for updating a customer. + /// Optional parameter: Example: . + /// Returns the Models.GetCustomerResponse response from the API call. + public Models.GetCustomerResponse UpdateCustomer( string customerId, - int? page = null, - int? size = null) - => CoreHelper.RunTask(GetAccessTokensAsync(customerId, page, size)); + Models.UpdateCustomerRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateCustomerAsync(customerId, request, idempotencyKey)); /// - /// Get all access tokens from a customer. + /// Updates a customer. /// - /// Required parameter: Customer Id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. + /// Required parameter: Customer id. + /// Required parameter: Request for updating a customer. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListAccessTokensResponse response from the API call. - public async Task GetAccessTokensAsync( + /// Returns the Models.GetCustomerResponse response from the API call. + public async Task UpdateCustomerAsync( string customerId, - int? page = null, - int? size = null, + Models.UpdateCustomerRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/customers/{customer_id}/access-tokens") + .Setup(HttpMethod.Put, "/customers/{customer_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("customer_id", customerId)) - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)))) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Delete a customer's card. + /// Creates a access token for a customer. /// /// Required parameter: Customer Id. - /// Required parameter: Card Id. + /// Required parameter: Request for creating a access token. /// Optional parameter: Example: . - /// Returns the Models.GetCardResponse response from the API call. - public Models.GetCardResponse DeleteCard( + /// Returns the Models.GetAccessTokenResponse response from the API call. + public Models.GetAccessTokenResponse CreateAccessToken( string customerId, - string cardId, + Models.CreateAccessTokenRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(DeleteCardAsync(customerId, cardId, idempotencyKey)); + => CoreHelper.RunTask(CreateAccessTokenAsync(customerId, request, idempotencyKey)); /// - /// Delete a customer's card. + /// Creates a access token for a customer. /// /// Required parameter: Customer Id. - /// Required parameter: Card Id. + /// Required parameter: Request for creating a access token. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - public async Task DeleteCardAsync( + /// Returns the Models.GetAccessTokenResponse response from the API call. + public async Task CreateAccessTokenAsync( string customerId, - string cardId, + Models.CreateAccessTokenRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/customers/{customer_id}/cards/{card_id}") + .Setup(HttpMethod.Post, "/customers/{customer_id}/access-tokens") .WithAuth("httpBasic") .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("customer_id", customerId)) - .Template(_template => _template.Setup("card_id", cardId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Get a customer's card. + /// Get all access tokens from a customer. /// - /// Required parameter: Customer id. - /// Required parameter: Card id. - /// Returns the Models.GetCardResponse response from the API call. - public Models.GetCardResponse GetCard( + /// Required parameter: Customer Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListAccessTokensResponse response from the API call. + public Models.ListAccessTokensResponse GetAccessTokens( string customerId, - string cardId) - => CoreHelper.RunTask(GetCardAsync(customerId, cardId)); - + int? page = null, + int? size = null) + => CoreHelper.RunTask(GetAccessTokensAsync(customerId, page, size)); + /// - /// Get a customer's card. + /// Get all access tokens from a customer. /// - /// Required parameter: Customer id. - /// Required parameter: Card id. + /// Required parameter: Customer Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - public async Task GetCardAsync( + /// Returns the Models.ListAccessTokensResponse response from the API call. + public async Task GetAccessTokensAsync( string customerId, - string cardId, + int? page = null, + int? size = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/customers/{customer_id}/cards/{card_id}") + .Setup(HttpMethod.Get, "/customers/{customer_id}/access-tokens") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("customer_id", customerId)) - .Template(_template => _template.Setup("card_id", cardId)))) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a new card for a customer. + /// Get all cards from a customer. + /// + /// Required parameter: Customer Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListCardsResponse response from the API call. + public Models.ListCardsResponse GetCards( + string customerId, + int? page = null, + int? size = null) + => CoreHelper.RunTask(GetCardsAsync(customerId, page, size)); + + /// + /// Get all cards from a customer. + /// + /// Required parameter: Customer Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// cancellationToken. + /// Returns the Models.ListCardsResponse response from the API call. + public async Task GetCardsAsync( + string customerId, + int? page = null, + int? size = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/customers/{customer_id}/cards") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("customer_id", customerId)) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Renew a card. /// /// Required parameter: Customer id. - /// Required parameter: Request for creating a card. + /// Required parameter: Card Id. /// Optional parameter: Example: . /// Returns the Models.GetCardResponse response from the API call. - public Models.GetCardResponse CreateCard( + public Models.GetCardResponse RenewCard( string customerId, - Models.CreateCardRequest request, + string cardId, string idempotencyKey = null) - => CoreHelper.RunTask(CreateCardAsync(customerId, request, idempotencyKey)); + => CoreHelper.RunTask(RenewCardAsync(customerId, cardId, idempotencyKey)); /// - /// Creates a new card for a customer. + /// Renew a card. /// /// Required parameter: Customer id. - /// Required parameter: Request for creating a card. + /// Required parameter: Card Id. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetCardResponse response from the API call. - public async Task CreateCardAsync( + public async Task RenewCardAsync( string customerId, - Models.CreateCardRequest request, + string cardId, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/customers/{customer_id}/cards") + .Setup(HttpMethod.Post, "/customers/{customer_id}/cards/{card_id}/renew") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("customer_id", customerId)) + .Template(_template => _template.Setup("card_id", cardId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); @@ -532,70 +609,34 @@ public Models.GetAccessTokenResponse GetAccessToken( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Gets all adressess from a customer. - /// - /// Required parameter: Customer id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Returns the Models.ListAddressesResponse response from the API call. - public Models.ListAddressesResponse GetAddresses( - string customerId, - int? page = null, - int? size = null) - => CoreHelper.RunTask(GetAddressesAsync(customerId, page, size)); - - /// - /// Gets all adressess from a customer. - /// - /// Required parameter: Customer id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// cancellationToken. - /// Returns the Models.ListAddressesResponse response from the API call. - public async Task GetAddressesAsync( - string customerId, - int? page = null, - int? size = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/customers/{customer_id}/addresses") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("customer_id", customerId)) - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Updates a customer. + /// Updates the metadata a customer. /// - /// Required parameter: Customer id. - /// Required parameter: Request for updating a customer. + /// Required parameter: The customer id. + /// Required parameter: Request for updating the customer metadata. /// Optional parameter: Example: . /// Returns the Models.GetCustomerResponse response from the API call. - public Models.GetCustomerResponse UpdateCustomer( + public Models.GetCustomerResponse UpdateCustomerMetadata( string customerId, - Models.UpdateCustomerRequest request, + Models.UpdateMetadataRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateCustomerAsync(customerId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateCustomerMetadataAsync(customerId, request, idempotencyKey)); /// - /// Updates a customer. + /// Updates the metadata a customer. /// - /// Required parameter: Customer id. - /// Required parameter: Request for updating a customer. + /// Required parameter: The customer id. + /// Required parameter: Request for updating the customer metadata. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetCustomerResponse response from the API call. - public async Task UpdateCustomerAsync( + public async Task UpdateCustomerMetadataAsync( string customerId, - Models.UpdateCustomerRequest request, + Models.UpdateMetadataRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Put, "/customers/{customer_id}") + .Setup(new HttpMethod("PATCH"), "/Customers/{customer_id}/metadata") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -604,70 +645,70 @@ public Models.GetCustomerResponse UpdateCustomer( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a access token for a customer. + /// Delete a customer's card. /// /// Required parameter: Customer Id. - /// Required parameter: Request for creating a access token. + /// Required parameter: Card Id. /// Optional parameter: Example: . - /// Returns the Models.GetAccessTokenResponse response from the API call. - public Models.GetAccessTokenResponse CreateAccessToken( + /// Returns the Models.GetCardResponse response from the API call. + public Models.GetCardResponse DeleteCard( string customerId, - Models.CreateAccessTokenRequest request, + string cardId, string idempotencyKey = null) - => CoreHelper.RunTask(CreateAccessTokenAsync(customerId, request, idempotencyKey)); + => CoreHelper.RunTask(DeleteCardAsync(customerId, cardId, idempotencyKey)); /// - /// Creates a access token for a customer. + /// Delete a customer's card. /// /// Required parameter: Customer Id. - /// Required parameter: Request for creating a access token. + /// Required parameter: Card Id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetAccessTokenResponse response from the API call. - public async Task CreateAccessTokenAsync( + /// Returns the Models.GetCardResponse response from the API call. + public async Task DeleteCardAsync( string customerId, - Models.CreateAccessTokenRequest request, + string cardId, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/customers/{customer_id}/access-tokens") + .Setup(HttpMethod.Delete, "/customers/{customer_id}/cards/{card_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("customer_id", customerId)) + .Template(_template => _template.Setup("card_id", cardId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Get all cards from a customer. + /// Gets all adressess from a customer. /// - /// Required parameter: Customer Id. + /// Required parameter: Customer id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Returns the Models.ListCardsResponse response from the API call. - public Models.ListCardsResponse GetCards( + /// Returns the Models.ListAddressesResponse response from the API call. + public Models.ListAddressesResponse GetAddresses( string customerId, int? page = null, int? size = null) - => CoreHelper.RunTask(GetCardsAsync(customerId, page, size)); + => CoreHelper.RunTask(GetAddressesAsync(customerId, page, size)); /// - /// Get all cards from a customer. + /// Gets all adressess from a customer. /// - /// Required parameter: Customer Id. + /// Required parameter: Customer id. /// Optional parameter: Page number. /// Optional parameter: Page size. /// cancellationToken. - /// Returns the Models.ListCardsResponse response from the API call. - public async Task GetCardsAsync( + /// Returns the Models.ListAddressesResponse response from the API call. + public async Task GetAddressesAsync( string customerId, int? page = null, int? size = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/customers/{customer_id}/cards") + .Setup(HttpMethod.Get, "/customers/{customer_id}/addresses") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("customer_id", customerId)) @@ -676,101 +717,60 @@ public Models.ListCardsResponse GetCards( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Renew a card. - /// - /// Required parameter: Customer id. - /// Required parameter: Card Id. - /// Optional parameter: Example: . - /// Returns the Models.GetCardResponse response from the API call. - public Models.GetCardResponse RenewCard( - string customerId, - string cardId, - string idempotencyKey = null) - => CoreHelper.RunTask(RenewCardAsync(customerId, cardId, idempotencyKey)); - - /// - /// Renew a card. - /// - /// Required parameter: Customer id. - /// Required parameter: Card Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - public async Task RenewCardAsync( - string customerId, - string cardId, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/customers/{customer_id}/cards/{card_id}/renew") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("customer_id", customerId)) - .Template(_template => _template.Setup("card_id", cardId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Updates the metadata a customer. + /// Get a customer. /// - /// Required parameter: The customer id. - /// Required parameter: Request for updating the customer metadata. - /// Optional parameter: Example: . + /// Required parameter: Customer Id. /// Returns the Models.GetCustomerResponse response from the API call. - public Models.GetCustomerResponse UpdateCustomerMetadata( - string customerId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateCustomerMetadataAsync(customerId, request, idempotencyKey)); + public Models.GetCustomerResponse GetCustomer( + string customerId) + => CoreHelper.RunTask(GetCustomerAsync(customerId)); /// - /// Updates the metadata a customer. + /// Get a customer. /// - /// Required parameter: The customer id. - /// Required parameter: Request for updating the customer metadata. - /// Optional parameter: Example: . + /// Required parameter: Customer Id. /// cancellationToken. /// Returns the Models.GetCustomerResponse response from the API call. - public async Task UpdateCustomerMetadataAsync( + public async Task GetCustomerAsync( string customerId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/Customers/{customer_id}/metadata") + .Setup(HttpMethod.Get, "/customers/{customer_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("customer_id", customerId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Template(_template => _template.Setup("customer_id", customerId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Get a customer. + /// Get a customer's card. /// - /// Required parameter: Customer Id. - /// Returns the Models.GetCustomerResponse response from the API call. - public Models.GetCustomerResponse GetCustomer( - string customerId) - => CoreHelper.RunTask(GetCustomerAsync(customerId)); + /// Required parameter: Customer id. + /// Required parameter: Card id. + /// Returns the Models.GetCardResponse response from the API call. + public Models.GetCardResponse GetCard( + string customerId, + string cardId) + => CoreHelper.RunTask(GetCardAsync(customerId, cardId)); /// - /// Get a customer. + /// Get a customer's card. /// - /// Required parameter: Customer Id. + /// Required parameter: Customer id. + /// Required parameter: Card id. /// cancellationToken. - /// Returns the Models.GetCustomerResponse response from the API call. - public async Task GetCustomerAsync( + /// Returns the Models.GetCardResponse response from the API call. + public async Task GetCardAsync( string customerId, + string cardId, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/customers/{customer_id}") + .Setup(HttpMethod.Get, "/customers/{customer_id}/cards/{card_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("customer_id", customerId)))) + .Template(_template => _template.Setup("customer_id", customerId)) + .Template(_template => _template.Setup("card_id", cardId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/IBalanceOperationsController.cs b/PagarmeApiSDK.Standard/Controllers/IBalanceOperationsController.cs index 408c650..c429e9a 100644 --- a/PagarmeApiSDK.Standard/Controllers/IBalanceOperationsController.cs +++ b/PagarmeApiSDK.Standard/Controllers/IBalanceOperationsController.cs @@ -22,24 +22,6 @@ namespace PagarmeApiSDK.Standard.Controllers /// public interface IBalanceOperationsController { - /// - /// GetBalanceOperationById EndPoint. - /// - /// Required parameter: Example: . - /// Returns the Models.GetBalanceOperationResponse response from the API call. - Models.GetBalanceOperationResponse GetBalanceOperationById( - long id); - - /// - /// GetBalanceOperationById EndPoint. - /// - /// Required parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetBalanceOperationResponse response from the API call. - Task GetBalanceOperationByIdAsync( - long id, - CancellationToken cancellationToken = default); - /// /// GetBalanceOperations EndPoint. /// @@ -69,5 +51,23 @@ Models.ListBalanceOperationResponse GetBalanceOperations( DateTime? createdUntil = null, string recipientId = null, CancellationToken cancellationToken = default); + + /// + /// GetBalanceOperationById EndPoint. + /// + /// Required parameter: Example: . + /// Returns the Models.GetBalanceOperationResponse response from the API call. + Models.GetBalanceOperationResponse GetBalanceOperationById( + long id); + + /// + /// GetBalanceOperationById EndPoint. + /// + /// Required parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetBalanceOperationResponse response from the API call. + Task GetBalanceOperationByIdAsync( + long id, + CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/IChargesController.cs b/PagarmeApiSDK.Standard/Controllers/IChargesController.cs index 71d5dab..360ae21 100644 --- a/PagarmeApiSDK.Standard/Controllers/IChargesController.cs +++ b/PagarmeApiSDK.Standard/Controllers/IChargesController.cs @@ -49,199 +49,201 @@ Models.GetChargeResponse UpdateChargeMetadata( CancellationToken cancellationToken = default); /// - /// Captures a charge. + /// Updates a charge's payment method. /// /// Required parameter: Charge id. - /// Optional parameter: Request for capturing a charge. + /// Required parameter: Request for updating the payment method from a charge. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse CaptureCharge( + Models.GetChargeResponse UpdateChargePaymentMethod( string chargeId, - Models.CreateCaptureChargeRequest request = null, + Models.UpdateChargePaymentMethodRequest request, string idempotencyKey = null); /// - /// Captures a charge. + /// Updates a charge's payment method. /// /// Required parameter: Charge id. - /// Optional parameter: Request for capturing a charge. + /// Required parameter: Request for updating the payment method from a charge. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - Task CaptureChargeAsync( + Task UpdateChargePaymentMethodAsync( string chargeId, - Models.CreateCaptureChargeRequest request = null, + Models.UpdateChargePaymentMethodRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Get a charge from its id. + /// GetChargeTransactions EndPoint. /// - /// Required parameter: Charge id. - /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse GetCharge( - string chargeId); + /// Required parameter: Charge Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListChargeTransactionsResponse response from the API call. + Models.ListChargeTransactionsResponse GetChargeTransactions( + string chargeId, + int? page = null, + int? size = null); /// - /// Get a charge from its id. + /// GetChargeTransactions EndPoint. /// - /// Required parameter: Charge id. + /// Required parameter: Charge Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. /// cancellationToken. - /// Returns the Models.GetChargeResponse response from the API call. - Task GetChargeAsync( + /// Returns the Models.ListChargeTransactionsResponse response from the API call. + Task GetChargeTransactionsAsync( string chargeId, + int? page = null, + int? size = null, CancellationToken cancellationToken = default); /// - /// ConfirmPayment EndPoint. + /// Updates the due date from a charge. /// - /// Required parameter: Example: . - /// Optional parameter: Request for confirm payment. + /// Required parameter: Charge Id. + /// Required parameter: Request for updating the due date. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse ConfirmPayment( + Models.GetChargeResponse UpdateChargeDueDate( string chargeId, - Models.CreateConfirmPaymentRequest request = null, + Models.UpdateChargeDueDateRequest request, string idempotencyKey = null); /// - /// ConfirmPayment EndPoint. + /// Updates the due date from a charge. /// - /// Required parameter: Example: . - /// Optional parameter: Request for confirm payment. + /// Required parameter: Charge Id. + /// Required parameter: Request for updating the due date. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - Task ConfirmPaymentAsync( + Task UpdateChargeDueDateAsync( string chargeId, - Models.CreateConfirmPaymentRequest request = null, + Models.UpdateChargeDueDateRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// GetChargeTransactions EndPoint. + /// Lists all charges. /// - /// Required parameter: Charge Id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Returns the Models.ListChargeTransactionsResponse response from the API call. - Models.ListChargeTransactionsResponse GetChargeTransactions( - string chargeId, + /// Optional parameter: Filter for charge's code. + /// Optional parameter: Filter for charge's status. + /// Optional parameter: Filter for charge's payment method. + /// Optional parameter: Filter for charge's customer id. + /// Optional parameter: Filter for charge's order id. + /// Optional parameter: Filter for the beginning of the range for charge's creation. + /// Optional parameter: Filter for the end of the range for charge's creation. + /// Returns the Models.ListChargesResponse response from the API call. + Models.ListChargesResponse GetCharges( int? page = null, - int? size = null); + int? size = null, + string code = null, + string status = null, + string paymentMethod = null, + string customerId = null, + string orderId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null); /// - /// GetChargeTransactions EndPoint. + /// Lists all charges. /// - /// Required parameter: Charge Id. /// Optional parameter: Page number. /// Optional parameter: Page size. + /// Optional parameter: Filter for charge's code. + /// Optional parameter: Filter for charge's status. + /// Optional parameter: Filter for charge's payment method. + /// Optional parameter: Filter for charge's customer id. + /// Optional parameter: Filter for charge's order id. + /// Optional parameter: Filter for the beginning of the range for charge's creation. + /// Optional parameter: Filter for the end of the range for charge's creation. /// cancellationToken. - /// Returns the Models.ListChargeTransactionsResponse response from the API call. - Task GetChargeTransactionsAsync( - string chargeId, + /// Returns the Models.ListChargesResponse response from the API call. + Task GetChargesAsync( int? page = null, int? size = null, + string code = null, + string status = null, + string paymentMethod = null, + string customerId = null, + string orderId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, CancellationToken cancellationToken = default); /// - /// Updates the card from a charge. + /// Captures a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating a charge's card. + /// Optional parameter: Request for capturing a charge. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse UpdateChargeCard( + Models.GetChargeResponse CaptureCharge( string chargeId, - Models.UpdateChargeCardRequest request, + Models.CreateCaptureChargeRequest request = null, string idempotencyKey = null); /// - /// Updates the card from a charge. + /// Captures a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating a charge's card. + /// Optional parameter: Request for capturing a charge. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - Task UpdateChargeCardAsync( + Task CaptureChargeAsync( string chargeId, - Models.UpdateChargeCardRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Creates a new charge. - /// - /// Required parameter: Request for creating a charge. - /// Optional parameter: Example: . - /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse CreateCharge( - Models.CreateChargeRequest request, - string idempotencyKey = null); - - /// - /// Creates a new charge. - /// - /// Required parameter: Request for creating a charge. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetChargeResponse response from the API call. - Task CreateChargeAsync( - Models.CreateChargeRequest request, + Models.CreateCaptureChargeRequest request = null, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Updates a charge's payment method. + /// Updates the card from a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating the payment method from a charge. + /// Required parameter: Request for updating a charge's card. /// Optional parameter: Example: . /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse UpdateChargePaymentMethod( + Models.GetChargeResponse UpdateChargeCard( string chargeId, - Models.UpdateChargePaymentMethodRequest request, + Models.UpdateChargeCardRequest request, string idempotencyKey = null); /// - /// Updates a charge's payment method. + /// Updates the card from a charge. /// /// Required parameter: Charge id. - /// Required parameter: Request for updating the payment method from a charge. + /// Required parameter: Request for updating a charge's card. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - Task UpdateChargePaymentMethodAsync( + Task UpdateChargeCardAsync( string chargeId, - Models.UpdateChargePaymentMethodRequest request, + Models.UpdateChargeCardRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Updates the due date from a charge. + /// Get a charge from its id. /// - /// Required parameter: Charge Id. - /// Required parameter: Request for updating the due date. - /// Optional parameter: Example: . + /// Required parameter: Charge id. /// Returns the Models.GetChargeResponse response from the API call. - Models.GetChargeResponse UpdateChargeDueDate( - string chargeId, - Models.UpdateChargeDueDateRequest request, - string idempotencyKey = null); + Models.GetChargeResponse GetCharge( + string chargeId); /// - /// Updates the due date from a charge. + /// Get a charge from its id. /// - /// Required parameter: Charge Id. - /// Required parameter: Request for updating the due date. - /// Optional parameter: Example: . + /// Required parameter: Charge id. /// cancellationToken. /// Returns the Models.GetChargeResponse response from the API call. - Task UpdateChargeDueDateAsync( + Task GetChargeAsync( string chargeId, - Models.UpdateChargeDueDateRequest request, - string idempotencyKey = null, CancellationToken cancellationToken = default); /// @@ -292,56 +294,6 @@ Models.GetChargeResponse RetryCharge( string idempotencyKey = null, CancellationToken cancellationToken = default); - /// - /// Lists all charges. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for charge's code. - /// Optional parameter: Filter for charge's status. - /// Optional parameter: Filter for charge's payment method. - /// Optional parameter: Filter for charge's customer id. - /// Optional parameter: Filter for charge's order id. - /// Optional parameter: Filter for the beginning of the range for charge's creation. - /// Optional parameter: Filter for the end of the range for charge's creation. - /// Returns the Models.ListChargesResponse response from the API call. - Models.ListChargesResponse GetCharges( - int? page = null, - int? size = null, - string code = null, - string status = null, - string paymentMethod = null, - string customerId = null, - string orderId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null); - - /// - /// Lists all charges. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for charge's code. - /// Optional parameter: Filter for charge's status. - /// Optional parameter: Filter for charge's payment method. - /// Optional parameter: Filter for charge's customer id. - /// Optional parameter: Filter for charge's order id. - /// Optional parameter: Filter for the beginning of the range for charge's creation. - /// Optional parameter: Filter for the end of the range for charge's creation. - /// cancellationToken. - /// Returns the Models.ListChargesResponse response from the API call. - Task GetChargesAsync( - int? page = null, - int? size = null, - string code = null, - string status = null, - string paymentMethod = null, - string customerId = null, - string orderId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - CancellationToken cancellationToken = default); - /// /// Cancel a charge. /// @@ -367,5 +319,53 @@ Models.GetChargeResponse CancelCharge( Models.CreateCancelChargeRequest request = null, string idempotencyKey = null, CancellationToken cancellationToken = default); + + /// + /// Creates a new charge. + /// + /// Required parameter: Request for creating a charge. + /// Optional parameter: Example: . + /// Returns the Models.GetChargeResponse response from the API call. + Models.GetChargeResponse CreateCharge( + Models.CreateChargeRequest request, + string idempotencyKey = null); + + /// + /// Creates a new charge. + /// + /// Required parameter: Request for creating a charge. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetChargeResponse response from the API call. + Task CreateChargeAsync( + Models.CreateChargeRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// ConfirmPayment EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Request for confirm payment. + /// Optional parameter: Example: . + /// Returns the Models.GetChargeResponse response from the API call. + Models.GetChargeResponse ConfirmPayment( + string chargeId, + Models.CreateConfirmPaymentRequest request = null, + string idempotencyKey = null); + + /// + /// ConfirmPayment EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Request for confirm payment. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetChargeResponse response from the API call. + Task ConfirmPaymentAsync( + string chargeId, + Models.CreateConfirmPaymentRequest request = null, + string idempotencyKey = null, + CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/ICustomersController.cs b/PagarmeApiSDK.Standard/Controllers/ICustomersController.cs index e20ed74..63021cc 100644 --- a/PagarmeApiSDK.Standard/Controllers/ICustomersController.cs +++ b/PagarmeApiSDK.Standard/Controllers/ICustomersController.cs @@ -23,58 +23,62 @@ namespace PagarmeApiSDK.Standard.Controllers public interface ICustomersController { /// - /// Creates a new address for a customer. + /// Updates a card. /// /// Required parameter: Customer Id. - /// Required parameter: Request for creating an address. + /// Required parameter: Card id. + /// Required parameter: Request for updating a card. /// Optional parameter: Example: . - /// Returns the Models.GetAddressResponse response from the API call. - Models.GetAddressResponse CreateAddress( + /// Returns the Models.GetCardResponse response from the API call. + Models.GetCardResponse UpdateCard( string customerId, - Models.CreateAddressRequest request, + string cardId, + Models.UpdateCardRequest request, string idempotencyKey = null); /// - /// Creates a new address for a customer. + /// Updates a card. /// /// Required parameter: Customer Id. - /// Required parameter: Request for creating an address. + /// Required parameter: Card id. + /// Required parameter: Request for updating a card. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetAddressResponse response from the API call. - Task CreateAddressAsync( + /// Returns the Models.GetCardResponse response from the API call. + Task UpdateCardAsync( string customerId, - Models.CreateAddressRequest request, + string cardId, + Models.UpdateCardRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Updates a card. + /// Updates an address. /// /// Required parameter: Customer Id. - /// Required parameter: Card id. - /// Required parameter: Request for updating a card. + /// Required parameter: Address Id. + /// Required parameter: Request for updating an address. /// Optional parameter: Example: . - /// Returns the Models.GetCardResponse response from the API call. - Models.GetCardResponse UpdateCard( + /// Returns the Models.GetAddressResponse response from the API call. + Models.GetAddressResponse UpdateAddress( string customerId, - string cardId, - Models.UpdateCardRequest request, + string addressId, + Models.UpdateAddressRequest request, string idempotencyKey = null); /// - /// Updates a card. + /// Updates an address. /// /// Required parameter: Customer Id. - /// Required parameter: Card id. - /// Required parameter: Request for updating a card. + /// Required parameter: Address Id. + /// Required parameter: Request for updating an address. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - Task UpdateCardAsync( + /// Returns the Models.GetAddressResponse response from the API call. + Task UpdateAddressAsync( string customerId, - string cardId, - Models.UpdateCardRequest request, + string addressId, + Models.UpdateAddressRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); @@ -127,51 +131,47 @@ Models.GetCustomerResponse CreateCustomer( CancellationToken cancellationToken = default); /// - /// Delete a Customer's access tokens. + /// Creates a new address for a customer. /// /// Required parameter: Customer Id. - /// Returns the Models.ListAccessTokensResponse response from the API call. - Models.ListAccessTokensResponse DeleteAccessTokens( - string customerId); + /// Required parameter: Request for creating an address. + /// Optional parameter: Example: . + /// Returns the Models.GetAddressResponse response from the API call. + Models.GetAddressResponse CreateAddress( + string customerId, + Models.CreateAddressRequest request, + string idempotencyKey = null); /// - /// Delete a Customer's access tokens. + /// Creates a new address for a customer. /// /// Required parameter: Customer Id. + /// Required parameter: Request for creating an address. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListAccessTokensResponse response from the API call. - Task DeleteAccessTokensAsync( + /// Returns the Models.GetAddressResponse response from the API call. + Task CreateAddressAsync( string customerId, + Models.CreateAddressRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Updates an address. + /// Delete a Customer's access tokens. /// /// Required parameter: Customer Id. - /// Required parameter: Address Id. - /// Required parameter: Request for updating an address. - /// Optional parameter: Example: . - /// Returns the Models.GetAddressResponse response from the API call. - Models.GetAddressResponse UpdateAddress( - string customerId, - string addressId, - Models.UpdateAddressRequest request, - string idempotencyKey = null); + /// Returns the Models.ListAccessTokensResponse response from the API call. + Models.ListAccessTokensResponse DeleteAccessTokens( + string customerId); /// - /// Updates an address. + /// Delete a Customer's access tokens. /// /// Required parameter: Customer Id. - /// Required parameter: Address Id. - /// Required parameter: Request for updating an address. - /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetAddressResponse response from the API call. - Task UpdateAddressAsync( + /// Returns the Models.ListAccessTokensResponse response from the API call. + Task DeleteAccessTokensAsync( string customerId, - string addressId, - Models.UpdateAddressRequest request, - string idempotencyKey = null, CancellationToken cancellationToken = default); /// @@ -222,6 +222,32 @@ Models.GetAddressResponse DeleteAddress( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Creates a new card for a customer. + /// + /// Required parameter: Customer id. + /// Required parameter: Request for creating a card. + /// Optional parameter: Example: . + /// Returns the Models.GetCardResponse response from the API call. + Models.GetCardResponse CreateCard( + string customerId, + Models.CreateCardRequest request, + string idempotencyKey = null); + + /// + /// Creates a new card for a customer. + /// + /// Required parameter: Customer id. + /// Required parameter: Request for creating a card. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetCardResponse response from the API call. + Task CreateCardAsync( + string customerId, + Models.CreateCardRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Get all Customers. /// @@ -260,154 +286,6 @@ Models.ListCustomersResponse GetCustomers( string code = null, CancellationToken cancellationToken = default); - /// - /// Get all access tokens from a customer. - /// - /// Required parameter: Customer Id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Returns the Models.ListAccessTokensResponse response from the API call. - Models.ListAccessTokensResponse GetAccessTokens( - string customerId, - int? page = null, - int? size = null); - - /// - /// Get all access tokens from a customer. - /// - /// Required parameter: Customer Id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// cancellationToken. - /// Returns the Models.ListAccessTokensResponse response from the API call. - Task GetAccessTokensAsync( - string customerId, - int? page = null, - int? size = null, - CancellationToken cancellationToken = default); - - /// - /// Delete a customer's card. - /// - /// Required parameter: Customer Id. - /// Required parameter: Card Id. - /// Optional parameter: Example: . - /// Returns the Models.GetCardResponse response from the API call. - Models.GetCardResponse DeleteCard( - string customerId, - string cardId, - string idempotencyKey = null); - - /// - /// Delete a customer's card. - /// - /// Required parameter: Customer Id. - /// Required parameter: Card Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - Task DeleteCardAsync( - string customerId, - string cardId, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Get a customer's card. - /// - /// Required parameter: Customer id. - /// Required parameter: Card id. - /// Returns the Models.GetCardResponse response from the API call. - Models.GetCardResponse GetCard( - string customerId, - string cardId); - - /// - /// Get a customer's card. - /// - /// Required parameter: Customer id. - /// Required parameter: Card id. - /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - Task GetCardAsync( - string customerId, - string cardId, - CancellationToken cancellationToken = default); - - /// - /// Creates a new card for a customer. - /// - /// Required parameter: Customer id. - /// Required parameter: Request for creating a card. - /// Optional parameter: Example: . - /// Returns the Models.GetCardResponse response from the API call. - Models.GetCardResponse CreateCard( - string customerId, - Models.CreateCardRequest request, - string idempotencyKey = null); - - /// - /// Creates a new card for a customer. - /// - /// Required parameter: Customer id. - /// Required parameter: Request for creating a card. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetCardResponse response from the API call. - Task CreateCardAsync( - string customerId, - Models.CreateCardRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Get a Customer's access token. - /// - /// Required parameter: Customer Id. - /// Required parameter: Token Id. - /// Returns the Models.GetAccessTokenResponse response from the API call. - Models.GetAccessTokenResponse GetAccessToken( - string customerId, - string tokenId); - - /// - /// Get a Customer's access token. - /// - /// Required parameter: Customer Id. - /// Required parameter: Token Id. - /// cancellationToken. - /// Returns the Models.GetAccessTokenResponse response from the API call. - Task GetAccessTokenAsync( - string customerId, - string tokenId, - CancellationToken cancellationToken = default); - - /// - /// Gets all adressess from a customer. - /// - /// Required parameter: Customer id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Returns the Models.ListAddressesResponse response from the API call. - Models.ListAddressesResponse GetAddresses( - string customerId, - int? page = null, - int? size = null); - - /// - /// Gets all adressess from a customer. - /// - /// Required parameter: Customer id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// cancellationToken. - /// Returns the Models.ListAddressesResponse response from the API call. - Task GetAddressesAsync( - string customerId, - int? page = null, - int? size = null, - CancellationToken cancellationToken = default); - /// /// Updates a customer. /// @@ -460,6 +338,32 @@ Models.GetAccessTokenResponse CreateAccessToken( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Get all access tokens from a customer. + /// + /// Required parameter: Customer Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListAccessTokensResponse response from the API call. + Models.ListAccessTokensResponse GetAccessTokens( + string customerId, + int? page = null, + int? size = null); + + /// + /// Get all access tokens from a customer. + /// + /// Required parameter: Customer Id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// cancellationToken. + /// Returns the Models.ListAccessTokensResponse response from the API call. + Task GetAccessTokensAsync( + string customerId, + int? page = null, + int? size = null, + CancellationToken cancellationToken = default); + /// /// Get all cards from a customer. /// @@ -512,6 +416,28 @@ Models.GetCardResponse RenewCard( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Get a Customer's access token. + /// + /// Required parameter: Customer Id. + /// Required parameter: Token Id. + /// Returns the Models.GetAccessTokenResponse response from the API call. + Models.GetAccessTokenResponse GetAccessToken( + string customerId, + string tokenId); + + /// + /// Get a Customer's access token. + /// + /// Required parameter: Customer Id. + /// Required parameter: Token Id. + /// cancellationToken. + /// Returns the Models.GetAccessTokenResponse response from the API call. + Task GetAccessTokenAsync( + string customerId, + string tokenId, + CancellationToken cancellationToken = default); + /// /// Updates the metadata a customer. /// @@ -538,6 +464,58 @@ Models.GetCustomerResponse UpdateCustomerMetadata( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Delete a customer's card. + /// + /// Required parameter: Customer Id. + /// Required parameter: Card Id. + /// Optional parameter: Example: . + /// Returns the Models.GetCardResponse response from the API call. + Models.GetCardResponse DeleteCard( + string customerId, + string cardId, + string idempotencyKey = null); + + /// + /// Delete a customer's card. + /// + /// Required parameter: Customer Id. + /// Required parameter: Card Id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetCardResponse response from the API call. + Task DeleteCardAsync( + string customerId, + string cardId, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// Gets all adressess from a customer. + /// + /// Required parameter: Customer id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListAddressesResponse response from the API call. + Models.ListAddressesResponse GetAddresses( + string customerId, + int? page = null, + int? size = null); + + /// + /// Gets all adressess from a customer. + /// + /// Required parameter: Customer id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// cancellationToken. + /// Returns the Models.ListAddressesResponse response from the API call. + Task GetAddressesAsync( + string customerId, + int? page = null, + int? size = null, + CancellationToken cancellationToken = default); + /// /// Get a customer. /// @@ -555,5 +533,27 @@ Models.GetCustomerResponse GetCustomer( Task GetCustomerAsync( string customerId, CancellationToken cancellationToken = default); + + /// + /// Get a customer's card. + /// + /// Required parameter: Customer id. + /// Required parameter: Card id. + /// Returns the Models.GetCardResponse response from the API call. + Models.GetCardResponse GetCard( + string customerId, + string cardId); + + /// + /// Get a customer's card. + /// + /// Required parameter: Customer id. + /// Required parameter: Card id. + /// cancellationToken. + /// Returns the Models.GetCardResponse response from the API call. + Task GetCardAsync( + string customerId, + string cardId, + CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/IInvoicesController.cs b/PagarmeApiSDK.Standard/Controllers/IInvoicesController.cs index dc775f5..1e2a206 100644 --- a/PagarmeApiSDK.Standard/Controllers/IInvoicesController.cs +++ b/PagarmeApiSDK.Standard/Controllers/IInvoicesController.cs @@ -22,6 +22,102 @@ namespace PagarmeApiSDK.Standard.Controllers /// public interface IInvoicesController { + /// + /// Updates the metadata from an invoice. + /// + /// Required parameter: The invoice id. + /// Required parameter: Request for updating the invoice metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetInvoiceResponse response from the API call. + Models.GetInvoiceResponse UpdateInvoiceMetadata( + string invoiceId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null); + + /// + /// Updates the metadata from an invoice. + /// + /// Required parameter: The invoice id. + /// Required parameter: Request for updating the invoice metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetInvoiceResponse response from the API call. + Task UpdateInvoiceMetadataAsync( + string invoiceId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// GetPartialInvoice EndPoint. + /// + /// Required parameter: Subscription Id. + /// Returns the Models.GetInvoiceResponse response from the API call. + Models.GetInvoiceResponse GetPartialInvoice( + string subscriptionId); + + /// + /// GetPartialInvoice EndPoint. + /// + /// Required parameter: Subscription Id. + /// cancellationToken. + /// Returns the Models.GetInvoiceResponse response from the API call. + Task GetPartialInvoiceAsync( + string subscriptionId, + CancellationToken cancellationToken = default); + + /// + /// Cancels an invoice. + /// + /// Required parameter: Invoice id. + /// Optional parameter: Example: . + /// Returns the Models.GetInvoiceResponse response from the API call. + Models.GetInvoiceResponse CancelInvoice( + string invoiceId, + string idempotencyKey = null); + + /// + /// Cancels an invoice. + /// + /// Required parameter: Invoice id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetInvoiceResponse response from the API call. + Task CancelInvoiceAsync( + string invoiceId, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// Create an Invoice. + /// + /// Required parameter: Subscription Id. + /// Required parameter: Cycle Id. + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.GetInvoiceResponse response from the API call. + Models.GetInvoiceResponse CreateInvoice( + string subscriptionId, + string cycleId, + Models.CreateInvoiceRequest request = null, + string idempotencyKey = null); + + /// + /// Create an Invoice. + /// + /// Required parameter: Subscription Id. + /// Required parameter: Cycle Id. + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetInvoiceResponse response from the API call. + Task CreateInvoiceAsync( + string subscriptionId, + string cycleId, + Models.CreateInvoiceRequest request = null, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Gets all invoices. /// @@ -81,25 +177,21 @@ Models.ListInvoicesResponse GetInvoices( CancellationToken cancellationToken = default); /// - /// Cancels an invoice. + /// Gets an invoice. /// - /// Required parameter: Invoice id. - /// Optional parameter: Example: . + /// Required parameter: Invoice Id. /// Returns the Models.GetInvoiceResponse response from the API call. - Models.GetInvoiceResponse CancelInvoice( - string invoiceId, - string idempotencyKey = null); + Models.GetInvoiceResponse GetInvoice( + string invoiceId); /// - /// Cancels an invoice. + /// Gets an invoice. /// - /// Required parameter: Invoice id. - /// Optional parameter: Example: . + /// Required parameter: Invoice Id. /// cancellationToken. /// Returns the Models.GetInvoiceResponse response from the API call. - Task CancelInvoiceAsync( + Task GetInvoiceAsync( string invoiceId, - string idempotencyKey = null, CancellationToken cancellationToken = default); /// @@ -127,97 +219,5 @@ Models.GetInvoiceResponse UpdateInvoiceStatus( Models.UpdateInvoiceStatusRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); - - /// - /// Updates the metadata from an invoice. - /// - /// Required parameter: The invoice id. - /// Required parameter: Request for updating the invoice metadata. - /// Optional parameter: Example: . - /// Returns the Models.GetInvoiceResponse response from the API call. - Models.GetInvoiceResponse UpdateInvoiceMetadata( - string invoiceId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null); - - /// - /// Updates the metadata from an invoice. - /// - /// Required parameter: The invoice id. - /// Required parameter: Request for updating the invoice metadata. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetInvoiceResponse response from the API call. - Task UpdateInvoiceMetadataAsync( - string invoiceId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// GetPartialInvoice EndPoint. - /// - /// Required parameter: Subscription Id. - /// Returns the Models.GetInvoiceResponse response from the API call. - Models.GetInvoiceResponse GetPartialInvoice( - string subscriptionId); - - /// - /// GetPartialInvoice EndPoint. - /// - /// Required parameter: Subscription Id. - /// cancellationToken. - /// Returns the Models.GetInvoiceResponse response from the API call. - Task GetPartialInvoiceAsync( - string subscriptionId, - CancellationToken cancellationToken = default); - - /// - /// Create an Invoice. - /// - /// Required parameter: Subscription Id. - /// Required parameter: Cycle Id. - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Returns the Models.GetInvoiceResponse response from the API call. - Models.GetInvoiceResponse CreateInvoice( - string subscriptionId, - string cycleId, - Models.CreateInvoiceRequest request = null, - string idempotencyKey = null); - - /// - /// Create an Invoice. - /// - /// Required parameter: Subscription Id. - /// Required parameter: Cycle Id. - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetInvoiceResponse response from the API call. - Task CreateInvoiceAsync( - string subscriptionId, - string cycleId, - Models.CreateInvoiceRequest request = null, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Gets an invoice. - /// - /// Required parameter: Invoice Id. - /// Returns the Models.GetInvoiceResponse response from the API call. - Models.GetInvoiceResponse GetInvoice( - string invoiceId); - - /// - /// Gets an invoice. - /// - /// Required parameter: Invoice Id. - /// cancellationToken. - /// Returns the Models.GetInvoiceResponse response from the API call. - Task GetInvoiceAsync( - string invoiceId, - CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/IOrdersController.cs b/PagarmeApiSDK.Standard/Controllers/IOrdersController.cs index 9bae0fc..bd8b2ec 100644 --- a/PagarmeApiSDK.Standard/Controllers/IOrdersController.cs +++ b/PagarmeApiSDK.Standard/Controllers/IOrdersController.cs @@ -22,120 +22,6 @@ namespace PagarmeApiSDK.Standard.Controllers /// public interface IOrdersController { - /// - /// DeleteAllOrderItems EndPoint. - /// - /// Required parameter: Order Id. - /// Optional parameter: Example: . - /// Returns the Models.GetOrderResponse response from the API call. - Models.GetOrderResponse DeleteAllOrderItems( - string orderId, - string idempotencyKey = null); - - /// - /// DeleteAllOrderItems EndPoint. - /// - /// Required parameter: Order Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetOrderResponse response from the API call. - Task DeleteAllOrderItemsAsync( - string orderId, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// GetOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// Returns the Models.GetOrderItemResponse response from the API call. - Models.GetOrderItemResponse GetOrderItem( - string orderId, - string itemId); - - /// - /// GetOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// cancellationToken. - /// Returns the Models.GetOrderItemResponse response from the API call. - Task GetOrderItemAsync( - string orderId, - string itemId, - CancellationToken cancellationToken = default); - - /// - /// Updates the metadata from an order. - /// - /// Required parameter: The order id. - /// Required parameter: Request for updating the order metadata. - /// Optional parameter: Example: . - /// Returns the Models.GetOrderResponse response from the API call. - Models.GetOrderResponse UpdateOrderMetadata( - string orderId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null); - - /// - /// Updates the metadata from an order. - /// - /// Required parameter: The order id. - /// Required parameter: Request for updating the order metadata. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetOrderResponse response from the API call. - Task UpdateOrderMetadataAsync( - string orderId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// DeleteOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// Optional parameter: Example: . - /// Returns the Models.GetOrderItemResponse response from the API call. - Models.GetOrderItemResponse DeleteOrderItem( - string orderId, - string itemId, - string idempotencyKey = null); - - /// - /// DeleteOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetOrderItemResponse response from the API call. - Task DeleteOrderItemAsync( - string orderId, - string itemId, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Gets an order. - /// - /// Required parameter: Order id. - /// Returns the Models.GetOrderResponse response from the API call. - Models.GetOrderResponse GetOrder( - string orderId); - - /// - /// Gets an order. - /// - /// Required parameter: Order id. - /// cancellationToken. - /// Returns the Models.GetOrderResponse response from the API call. - Task GetOrderAsync( - string orderId, - CancellationToken cancellationToken = default); - /// /// Gets all orders. /// @@ -208,6 +94,54 @@ Models.GetOrderItemResponse UpdateOrderItem( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// DeleteAllOrderItems EndPoint. + /// + /// Required parameter: Order Id. + /// Optional parameter: Example: . + /// Returns the Models.GetOrderResponse response from the API call. + Models.GetOrderResponse DeleteAllOrderItems( + string orderId, + string idempotencyKey = null); + + /// + /// DeleteAllOrderItems EndPoint. + /// + /// Required parameter: Order Id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetOrderResponse response from the API call. + Task DeleteAllOrderItemsAsync( + string orderId, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// DeleteOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// Optional parameter: Example: . + /// Returns the Models.GetOrderItemResponse response from the API call. + Models.GetOrderItemResponse DeleteOrderItem( + string orderId, + string itemId, + string idempotencyKey = null); + + /// + /// DeleteOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetOrderItemResponse response from the API call. + Task DeleteOrderItemAsync( + string orderId, + string itemId, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// CloseOrder EndPoint. /// @@ -281,5 +215,71 @@ Models.GetOrderItemResponse CreateOrderItem( Models.CreateOrderItemRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); + + /// + /// GetOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// Returns the Models.GetOrderItemResponse response from the API call. + Models.GetOrderItemResponse GetOrderItem( + string orderId, + string itemId); + + /// + /// GetOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// cancellationToken. + /// Returns the Models.GetOrderItemResponse response from the API call. + Task GetOrderItemAsync( + string orderId, + string itemId, + CancellationToken cancellationToken = default); + + /// + /// Updates the metadata from an order. + /// + /// Required parameter: The order id. + /// Required parameter: Request for updating the order metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetOrderResponse response from the API call. + Models.GetOrderResponse UpdateOrderMetadata( + string orderId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null); + + /// + /// Updates the metadata from an order. + /// + /// Required parameter: The order id. + /// Required parameter: Request for updating the order metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetOrderResponse response from the API call. + Task UpdateOrderMetadataAsync( + string orderId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// Gets an order. + /// + /// Required parameter: Order id. + /// Returns the Models.GetOrderResponse response from the API call. + Models.GetOrderResponse GetOrder( + string orderId); + + /// + /// Gets an order. + /// + /// Required parameter: Order id. + /// cancellationToken. + /// Returns the Models.GetOrderResponse response from the API call. + Task GetOrderAsync( + string orderId, + CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/IPlansController.cs b/PagarmeApiSDK.Standard/Controllers/IPlansController.cs index 4c56177..7a5639b 100644 --- a/PagarmeApiSDK.Standard/Controllers/IPlansController.cs +++ b/PagarmeApiSDK.Standard/Controllers/IPlansController.cs @@ -41,28 +41,24 @@ Models.GetPlanResponse GetPlan( CancellationToken cancellationToken = default); /// - /// Removes an item from a plan. + /// Deletes a plan. /// /// Required parameter: Plan id. - /// Required parameter: Plan item id. /// Optional parameter: Example: . - /// Returns the Models.GetPlanItemResponse response from the API call. - Models.GetPlanItemResponse DeletePlanItem( + /// Returns the Models.GetPlanResponse response from the API call. + Models.GetPlanResponse DeletePlan( string planId, - string planItemId, string idempotencyKey = null); /// - /// Removes an item from a plan. + /// Deletes a plan. /// /// Required parameter: Plan id. - /// Required parameter: Plan item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - Task DeletePlanItemAsync( + /// Returns the Models.GetPlanResponse response from the API call. + Task DeletePlanAsync( string planId, - string planItemId, string idempotencyKey = null, CancellationToken cancellationToken = default); @@ -93,72 +89,128 @@ Models.GetPlanResponse UpdatePlanMetadata( CancellationToken cancellationToken = default); /// - /// Creates a new plan. + /// Updates a plan item. /// - /// Required parameter: Request for creating a plan. + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Required parameter: Request for updating the plan item. /// Optional parameter: Example: . - /// Returns the Models.GetPlanResponse response from the API call. - Models.GetPlanResponse CreatePlan( - Models.CreatePlanRequest body, + /// Returns the Models.GetPlanItemResponse response from the API call. + Models.GetPlanItemResponse UpdatePlanItem( + string planId, + string planItemId, + Models.UpdatePlanItemRequest body, string idempotencyKey = null); /// - /// Creates a new plan. + /// Updates a plan item. /// - /// Required parameter: Request for creating a plan. + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Required parameter: Request for updating the plan item. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanResponse response from the API call. - Task CreatePlanAsync( - Models.CreatePlanRequest body, + /// Returns the Models.GetPlanItemResponse response from the API call. + Task UpdatePlanItemAsync( + string planId, + string planItemId, + Models.UpdatePlanItemRequest body, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Updates a plan. + /// Adds a new item to a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for updating a plan. + /// Required parameter: Request for creating a plan item. /// Optional parameter: Example: . - /// Returns the Models.GetPlanResponse response from the API call. - Models.GetPlanResponse UpdatePlan( + /// Returns the Models.GetPlanItemResponse response from the API call. + Models.GetPlanItemResponse CreatePlanItem( string planId, - Models.UpdatePlanRequest request, + Models.CreatePlanItemRequest request, string idempotencyKey = null); /// - /// Updates a plan. + /// Adds a new item to a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for updating a plan. + /// Required parameter: Request for creating a plan item. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanResponse response from the API call. - Task UpdatePlanAsync( + /// Returns the Models.GetPlanItemResponse response from the API call. + Task CreatePlanItemAsync( string planId, - Models.UpdatePlanRequest request, + Models.CreatePlanItemRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Deletes a plan. + /// Gets a plan item. + /// + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Returns the Models.GetPlanItemResponse response from the API call. + Models.GetPlanItemResponse GetPlanItem( + string planId, + string planItemId); + + /// + /// Gets a plan item. /// /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// cancellationToken. + /// Returns the Models.GetPlanItemResponse response from the API call. + Task GetPlanItemAsync( + string planId, + string planItemId, + CancellationToken cancellationToken = default); + + /// + /// Creates a new plan. + /// + /// Required parameter: Request for creating a plan. /// Optional parameter: Example: . /// Returns the Models.GetPlanResponse response from the API call. - Models.GetPlanResponse DeletePlan( + Models.GetPlanResponse CreatePlan( + Models.CreatePlanRequest body, + string idempotencyKey = null); + + /// + /// Creates a new plan. + /// + /// Required parameter: Request for creating a plan. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetPlanResponse response from the API call. + Task CreatePlanAsync( + Models.CreatePlanRequest body, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// Removes an item from a plan. + /// + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Optional parameter: Example: . + /// Returns the Models.GetPlanItemResponse response from the API call. + Models.GetPlanItemResponse DeletePlanItem( string planId, + string planItemId, string idempotencyKey = null); /// - /// Deletes a plan. + /// Removes an item from a plan. /// /// Required parameter: Plan id. + /// Required parameter: Plan item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanResponse response from the API call. - Task DeletePlanAsync( + /// Returns the Models.GetPlanItemResponse response from the API call. + Task DeletePlanItemAsync( string planId, + string planItemId, string idempotencyKey = null, CancellationToken cancellationToken = default); @@ -205,81 +257,29 @@ Models.ListPlansResponse GetPlans( CancellationToken cancellationToken = default); /// - /// Updates a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// Required parameter: Request for updating the plan item. - /// Optional parameter: Example: . - /// Returns the Models.GetPlanItemResponse response from the API call. - Models.GetPlanItemResponse UpdatePlanItem( - string planId, - string planItemId, - Models.UpdatePlanItemRequest body, - string idempotencyKey = null); - - /// - /// Updates a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// Required parameter: Request for updating the plan item. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - Task UpdatePlanItemAsync( - string planId, - string planItemId, - Models.UpdatePlanItemRequest body, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Adds a new item to a plan. + /// Updates a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for creating a plan item. + /// Required parameter: Request for updating a plan. /// Optional parameter: Example: . - /// Returns the Models.GetPlanItemResponse response from the API call. - Models.GetPlanItemResponse CreatePlanItem( + /// Returns the Models.GetPlanResponse response from the API call. + Models.GetPlanResponse UpdatePlan( string planId, - Models.CreatePlanItemRequest request, + Models.UpdatePlanRequest request, string idempotencyKey = null); /// - /// Adds a new item to a plan. + /// Updates a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for creating a plan item. + /// Required parameter: Request for updating a plan. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - Task CreatePlanItemAsync( + /// Returns the Models.GetPlanResponse response from the API call. + Task UpdatePlanAsync( string planId, - Models.CreatePlanItemRequest request, + Models.UpdatePlanRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); - - /// - /// Gets a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// Returns the Models.GetPlanItemResponse response from the API call. - Models.GetPlanItemResponse GetPlanItem( - string planId, - string planItemId); - - /// - /// Gets a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - Task GetPlanItemAsync( - string planId, - string planItemId, - CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/IRecipientsController.cs b/PagarmeApiSDK.Standard/Controllers/IRecipientsController.cs index b0efb7a..5de14d1 100644 --- a/PagarmeApiSDK.Standard/Controllers/IRecipientsController.cs +++ b/PagarmeApiSDK.Standard/Controllers/IRecipientsController.cs @@ -49,61 +49,55 @@ Models.GetRecipientResponse UpdateRecipient( CancellationToken cancellationToken = default); /// - /// GetWithdrawById EndPoint. - /// - /// Required parameter: Example: . - /// Required parameter: Example: . - /// Returns the Models.GetWithdrawResponse response from the API call. - Models.GetWithdrawResponse GetWithdrawById( - string recipientId, - string withdrawalId); - - /// - /// GetWithdrawById EndPoint. + /// Creates an anticipation. /// - /// Required parameter: Example: . - /// Required parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetWithdrawResponse response from the API call. - Task GetWithdrawByIdAsync( + /// Required parameter: Recipient id. + /// Required parameter: Anticipation data. + /// Optional parameter: Example: . + /// Returns the Models.GetAnticipationResponse response from the API call. + Models.GetAnticipationResponse CreateAnticipation( string recipientId, - string withdrawalId, - CancellationToken cancellationToken = default); - - /// - /// Retrieves recipient information. - /// - /// Required parameter: Recipiend id. - /// Returns the Models.GetRecipientResponse response from the API call. - Models.GetRecipientResponse GetRecipient( - string recipientId); + Models.CreateAnticipationRequest request, + string idempotencyKey = null); /// - /// Retrieves recipient information. + /// Creates an anticipation. /// - /// Required parameter: Recipiend id. + /// Required parameter: Recipient id. + /// Required parameter: Anticipation data. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetRecipientResponse response from the API call. - Task GetRecipientAsync( + /// Returns the Models.GetAnticipationResponse response from the API call. + Task CreateAnticipationAsync( string recipientId, + Models.CreateAnticipationRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Get balance information for a recipient. + /// Gets the anticipation limits for a recipient. /// /// Required parameter: Recipient id. - /// Returns the Models.GetBalanceResponse response from the API call. - Models.GetBalanceResponse GetBalance( - string recipientId); + /// Required parameter: Timeframe. + /// Required parameter: Anticipation payment date. + /// Returns the Models.GetAnticipationLimitResponse response from the API call. + Models.GetAnticipationLimitResponse GetAnticipationLimits( + string recipientId, + string timeframe, + DateTime paymentDate); /// - /// Get balance information for a recipient. + /// Gets the anticipation limits for a recipient. /// /// Required parameter: Recipient id. + /// Required parameter: Timeframe. + /// Required parameter: Anticipation payment date. /// cancellationToken. - /// Returns the Models.GetBalanceResponse response from the API call. - Task GetBalanceAsync( + /// Returns the Models.GetAnticipationLimitResponse response from the API call. + Task GetAnticipationLimitsAsync( string recipientId, + string timeframe, + DateTime paymentDate, CancellationToken cancellationToken = default); /// @@ -128,6 +122,28 @@ Models.ListRecipientResponse GetRecipients( int? size = null, CancellationToken cancellationToken = default); + /// + /// GetWithdrawById EndPoint. + /// + /// Required parameter: Example: . + /// Required parameter: Example: . + /// Returns the Models.GetWithdrawResponse response from the API call. + Models.GetWithdrawResponse GetWithdrawById( + string recipientId, + string withdrawalId); + + /// + /// GetWithdrawById EndPoint. + /// + /// Required parameter: Example: . + /// Required parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetWithdrawResponse response from the API call. + Task GetWithdrawByIdAsync( + string recipientId, + string withdrawalId, + CancellationToken cancellationToken = default); + /// /// Updates the default bank account from a recipient. /// @@ -154,6 +170,32 @@ Models.GetRecipientResponse UpdateRecipientDefaultBankAccount( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetRecipientResponse response from the API call. + Models.GetRecipientResponse UpdateRecipientMetadata( + string recipientId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null); + + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetRecipientResponse response from the API call. + Task UpdateRecipientMetadataAsync( + string recipientId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Gets a paginated list of transfers for the recipient. /// @@ -236,6 +278,32 @@ Models.GetWithdrawResponse CreateWithdraw( Models.CreateWithdrawRequest request, CancellationToken cancellationToken = default); + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetRecipientResponse response from the API call. + Models.GetRecipientResponse UpdateAutomaticAnticipationSettings( + string recipientId, + Models.UpdateAutomaticAnticipationSettingsRequest request, + string idempotencyKey = null); + + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetRecipientResponse response from the API call. + Task UpdateAutomaticAnticipationSettingsAsync( + string recipientId, + Models.UpdateAutomaticAnticipationSettingsRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Gets an anticipation. /// @@ -284,48 +352,128 @@ Models.GetRecipientResponse UpdateRecipientTransferSettings( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Retrieves a paginated list of anticipations from a recipient. + /// + /// Required parameter: Recipient id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for anticipation status. + /// Optional parameter: Filter for anticipation timeframe. + /// Optional parameter: Filter for start range for anticipation payment date. + /// Optional parameter: Filter for end range for anticipation payment date. + /// Optional parameter: Filter for start range for anticipation creation date. + /// Optional parameter: Filter for end range for anticipation creation date. + /// Returns the Models.ListAnticipationResponse response from the API call. + Models.ListAnticipationResponse GetAnticipations( + string recipientId, + int? page = null, + int? size = null, + string status = null, + string timeframe = null, + DateTime? paymentDateSince = null, + DateTime? paymentDateUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null); + + /// + /// Retrieves a paginated list of anticipations from a recipient. + /// + /// Required parameter: Recipient id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for anticipation status. + /// Optional parameter: Filter for anticipation timeframe. + /// Optional parameter: Filter for start range for anticipation payment date. + /// Optional parameter: Filter for end range for anticipation payment date. + /// Optional parameter: Filter for start range for anticipation creation date. + /// Optional parameter: Filter for end range for anticipation creation date. + /// cancellationToken. + /// Returns the Models.ListAnticipationResponse response from the API call. + Task GetAnticipationsAsync( + string recipientId, + int? page = null, + int? size = null, + string status = null, + string timeframe = null, + DateTime? paymentDateSince = null, + DateTime? paymentDateUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + CancellationToken cancellationToken = default); + /// /// Retrieves recipient information. /// - /// Required parameter: Recipient code. + /// Required parameter: Recipiend id. /// Returns the Models.GetRecipientResponse response from the API call. - Models.GetRecipientResponse GetRecipientByCode( - string code); + Models.GetRecipientResponse GetRecipient( + string recipientId); /// /// Retrieves recipient information. /// - /// Required parameter: Recipient code. + /// Required parameter: Recipiend id. /// cancellationToken. /// Returns the Models.GetRecipientResponse response from the API call. - Task GetRecipientByCodeAsync( - string code, + Task GetRecipientAsync( + string recipientId, CancellationToken cancellationToken = default); /// - /// Updates recipient metadata. + /// Get balance information for a recipient. /// /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . - /// Returns the Models.GetRecipientResponse response from the API call. - Models.GetRecipientResponse UpdateAutomaticAnticipationSettings( - string recipientId, - Models.UpdateAutomaticAnticipationSettingsRequest request, - string idempotencyKey = null); + /// Returns the Models.GetBalanceResponse response from the API call. + Models.GetBalanceResponse GetBalance( + string recipientId); /// - /// Updates recipient metadata. + /// Get balance information for a recipient. /// /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetRecipientResponse response from the API call. - Task UpdateAutomaticAnticipationSettingsAsync( + /// Returns the Models.GetBalanceResponse response from the API call. + Task GetBalanceAsync( string recipientId, - Models.UpdateAutomaticAnticipationSettingsRequest request, - string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// Gets a paginated list of transfers for the recipient. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.ListWithdrawals response from the API call. + Models.ListWithdrawals GetWithdrawals( + string recipientId, + int? page = null, + int? size = null, + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null); + + /// + /// Gets a paginated list of transfers for the recipient. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.ListWithdrawals response from the API call. + Task GetWithdrawalsAsync( + string recipientId, + int? page = null, + int? size = null, + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, CancellationToken cancellationToken = default); /// @@ -377,182 +525,52 @@ Models.GetRecipientResponse CreateRecipient( CancellationToken cancellationToken = default); /// - /// GetDefaultRecipient EndPoint. + /// Retrieves recipient information. /// + /// Required parameter: Recipient code. /// Returns the Models.GetRecipientResponse response from the API call. - Models.GetRecipientResponse GetDefaultRecipient(); + Models.GetRecipientResponse GetRecipientByCode( + string code); /// - /// GetDefaultRecipient EndPoint. + /// Retrieves recipient information. /// + /// Required parameter: Recipient code. /// cancellationToken. /// Returns the Models.GetRecipientResponse response from the API call. - Task GetDefaultRecipientAsync(CancellationToken cancellationToken = default); - - /// - /// Creates an anticipation. - /// - /// Required parameter: Recipient id. - /// Required parameter: Anticipation data. - /// Optional parameter: Example: . - /// Returns the Models.GetAnticipationResponse response from the API call. - Models.GetAnticipationResponse CreateAnticipation( - string recipientId, - Models.CreateAnticipationRequest request, - string idempotencyKey = null); - - /// - /// Creates an anticipation. - /// - /// Required parameter: Recipient id. - /// Required parameter: Anticipation data. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetAnticipationResponse response from the API call. - Task CreateAnticipationAsync( - string recipientId, - Models.CreateAnticipationRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Gets the anticipation limits for a recipient. - /// - /// Required parameter: Recipient id. - /// Required parameter: Timeframe. - /// Required parameter: Anticipation payment date. - /// Returns the Models.GetAnticipationLimitResponse response from the API call. - Models.GetAnticipationLimitResponse GetAnticipationLimits( - string recipientId, - string timeframe, - DateTime paymentDate); - - /// - /// Gets the anticipation limits for a recipient. - /// - /// Required parameter: Recipient id. - /// Required parameter: Timeframe. - /// Required parameter: Anticipation payment date. - /// cancellationToken. - /// Returns the Models.GetAnticipationLimitResponse response from the API call. - Task GetAnticipationLimitsAsync( - string recipientId, - string timeframe, - DateTime paymentDate, + Task GetRecipientByCodeAsync( + string code, CancellationToken cancellationToken = default); /// - /// Updates recipient metadata. + /// GetDefaultRecipient EndPoint. /// - /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . /// Returns the Models.GetRecipientResponse response from the API call. - Models.GetRecipientResponse UpdateRecipientMetadata( - string recipientId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null); + Models.GetRecipientResponse GetDefaultRecipient(); /// - /// Updates recipient metadata. + /// GetDefaultRecipient EndPoint. /// - /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetRecipientResponse response from the API call. - Task UpdateRecipientMetadataAsync( - string recipientId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Retrieves a paginated list of anticipations from a recipient. - /// - /// Required parameter: Recipient id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for anticipation status. - /// Optional parameter: Filter for anticipation timeframe. - /// Optional parameter: Filter for start range for anticipation payment date. - /// Optional parameter: Filter for end range for anticipation payment date. - /// Optional parameter: Filter for start range for anticipation creation date. - /// Optional parameter: Filter for end range for anticipation creation date. - /// Returns the Models.ListAnticipationResponse response from the API call. - Models.ListAnticipationResponse GetAnticipations( - string recipientId, - int? page = null, - int? size = null, - string status = null, - string timeframe = null, - DateTime? paymentDateSince = null, - DateTime? paymentDateUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null); - - /// - /// Retrieves a paginated list of anticipations from a recipient. - /// - /// Required parameter: Recipient id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for anticipation status. - /// Optional parameter: Filter for anticipation timeframe. - /// Optional parameter: Filter for start range for anticipation payment date. - /// Optional parameter: Filter for end range for anticipation payment date. - /// Optional parameter: Filter for start range for anticipation creation date. - /// Optional parameter: Filter for end range for anticipation creation date. - /// cancellationToken. - /// Returns the Models.ListAnticipationResponse response from the API call. - Task GetAnticipationsAsync( - string recipientId, - int? page = null, - int? size = null, - string status = null, - string timeframe = null, - DateTime? paymentDateSince = null, - DateTime? paymentDateUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - CancellationToken cancellationToken = default); + Task GetDefaultRecipientAsync(CancellationToken cancellationToken = default); /// - /// Gets a paginated list of transfers for the recipient. + /// Create a KYC link. /// /// Required parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Returns the Models.ListWithdrawals response from the API call. - Models.ListWithdrawals GetWithdrawals( - string recipientId, - int? page = null, - int? size = null, - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null); + /// Returns the Models.CreateKYCLinkResponse response from the API call. + Models.CreateKYCLinkResponse CreateKYCLink( + string recipientId); /// - /// Gets a paginated list of transfers for the recipient. + /// Create a KYC link. /// /// Required parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListWithdrawals response from the API call. - Task GetWithdrawalsAsync( + /// Returns the Models.CreateKYCLinkResponse response from the API call. + Task CreateKYCLinkAsync( string recipientId, - int? page = null, - int? size = null, - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/ISubscriptionsController.cs b/PagarmeApiSDK.Standard/Controllers/ISubscriptionsController.cs index 748c3b2..3435330 100644 --- a/PagarmeApiSDK.Standard/Controllers/ISubscriptionsController.cs +++ b/PagarmeApiSDK.Standard/Controllers/ISubscriptionsController.cs @@ -22,6 +22,28 @@ namespace PagarmeApiSDK.Standard.Controllers /// public interface ISubscriptionsController { + /// + /// RenewSubscription EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.GetPeriodResponse response from the API call. + Models.GetPeriodResponse RenewSubscription( + string subscriptionId, + string idempotencyKey = null); + + /// + /// RenewSubscription EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetPeriodResponse response from the API call. + Task RenewSubscriptionAsync( + string subscriptionId, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Updates the credit card from a subscription. /// @@ -48,6 +70,36 @@ Models.GetSubscriptionResponse UpdateSubscriptionCard( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Deletes a usage. + /// + /// Required parameter: The subscription id. + /// Required parameter: The subscription item id. + /// Required parameter: The usage id. + /// Optional parameter: Example: . + /// Returns the Models.GetUsageResponse response from the API call. + Models.GetUsageResponse DeleteUsage( + string subscriptionId, + string itemId, + string usageId, + string idempotencyKey = null); + + /// + /// Deletes a usage. + /// + /// Required parameter: The subscription id. + /// Required parameter: The subscription item id. + /// Required parameter: The usage id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetUsageResponse response from the API call. + Task DeleteUsageAsync( + string subscriptionId, + string itemId, + string usageId, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Creates a discount. /// @@ -75,171 +127,130 @@ Models.GetDiscountResponse CreateDiscount( CancellationToken cancellationToken = default); /// - /// Updates the billing date from a subscription. + /// Create Usage. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription billing date. + /// Required parameter: Subscription id. + /// Required parameter: Item id. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateSubscriptionBillingDate( + /// Returns the Models.GetUsageResponse response from the API call. + Models.GetUsageResponse CreateAnUsage( string subscriptionId, - Models.UpdateSubscriptionBillingDateRequest request, + string itemId, string idempotencyKey = null); /// - /// Updates the billing date from a subscription. + /// Create Usage. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription billing date. + /// Required parameter: Subscription id. + /// Required parameter: Item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateSubscriptionBillingDateAsync( + /// Returns the Models.GetUsageResponse response from the API call. + Task CreateAnUsageAsync( string subscriptionId, - Models.UpdateSubscriptionBillingDateRequest request, + string itemId, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Updates the start at date from a subscription. + /// UpdateCurrentCycleStatus EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription start date. + /// Required parameter: Subscription Id. + /// Required parameter: Request for updating the end date of the subscription current status. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateSubscriptionStartAt( + void UpdateCurrentCycleStatus( string subscriptionId, - Models.UpdateSubscriptionStartAtRequest request, + Models.UpdateCurrentCycleStatusRequest request, string idempotencyKey = null); /// - /// Updates the start at date from a subscription. + /// UpdateCurrentCycleStatus EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription start date. + /// Required parameter: Subscription Id. + /// Required parameter: Request for updating the end date of the subscription current status. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateSubscriptionStartAtAsync( + /// Returns the void response from the API call. + Task UpdateCurrentCycleStatusAsync( string subscriptionId, - Models.UpdateSubscriptionStartAtRequest request, + Models.UpdateCurrentCycleStatusRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Gets a subscription. + /// Deletes a discount. /// /// Required parameter: Subscription id. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse GetSubscription( - string subscriptionId); + /// Required parameter: Discount Id. + /// Optional parameter: Example: . + /// Returns the Models.GetDiscountResponse response from the API call. + Models.GetDiscountResponse DeleteDiscount( + string subscriptionId, + string discountId, + string idempotencyKey = null); /// - /// Gets a subscription. + /// Deletes a discount. /// /// Required parameter: Subscription id. + /// Required parameter: Discount Id. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task GetSubscriptionAsync( + /// Returns the Models.GetDiscountResponse response from the API call. + Task DeleteDiscountAsync( string subscriptionId, + string discountId, + string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Lists all usages from a subscription item. + /// Get Subscription Items. /// /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. /// Optional parameter: Page number. /// Optional parameter: Page size. + /// Optional parameter: The item name. /// Optional parameter: Identification code in the client system. - /// Optional parameter: Identification group in the client system. - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Returns the Models.ListUsagesResponse response from the API call. - Models.ListUsagesResponse GetUsages( + /// Optional parameter: The item statis. + /// Optional parameter: The item description. + /// Optional parameter: Filter for item's creation date start range. + /// Optional parameter: Filter for item's creation date end range. + /// Returns the Models.ListSubscriptionItemsResponse response from the API call. + Models.ListSubscriptionItemsResponse GetSubscriptionItems( string subscriptionId, - string itemId, int? page = null, int? size = null, + string name = null, string code = null, - string mGroup = null, - DateTime? usedSince = null, - DateTime? usedUntil = null); + string status = null, + string description = null, + string createdSince = null, + string createdUntil = null); /// - /// Lists all usages from a subscription item. + /// Get Subscription Items. /// /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. /// Optional parameter: Page number. /// Optional parameter: Page size. + /// Optional parameter: The item name. /// Optional parameter: Identification code in the client system. - /// Optional parameter: Identification group in the client system. - /// Optional parameter: Example: . - /// Optional parameter: Example: . + /// Optional parameter: The item statis. + /// Optional parameter: The item description. + /// Optional parameter: Filter for item's creation date start range. + /// Optional parameter: Filter for item's creation date end range. /// cancellationToken. - /// Returns the Models.ListUsagesResponse response from the API call. - Task GetUsagesAsync( + /// Returns the Models.ListSubscriptionItemsResponse response from the API call. + Task GetSubscriptionItemsAsync( string subscriptionId, - string itemId, int? page = null, int? size = null, + string name = null, string code = null, - string mGroup = null, - DateTime? usedSince = null, - DateTime? usedUntil = null, - CancellationToken cancellationToken = default); - - /// - /// UpdateLatestPeriodEndAt EndPoint. - /// - /// Required parameter: Example: . - /// Required parameter: Request for updating the end date of the current signature cycle. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateLatestPeriodEndAt( - string subscriptionId, - Models.UpdateCurrentCycleEndDateRequest request, - string idempotencyKey = null); - - /// - /// UpdateLatestPeriodEndAt EndPoint. - /// - /// Required parameter: Example: . - /// Required parameter: Request for updating the end date of the current signature cycle. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateLatestPeriodEndAtAsync( - string subscriptionId, - Models.UpdateCurrentCycleEndDateRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// Deletes a discount. - /// - /// Required parameter: Subscription id. - /// Required parameter: Discount Id. - /// Optional parameter: Example: . - /// Returns the Models.GetDiscountResponse response from the API call. - Models.GetDiscountResponse DeleteDiscount( - string subscriptionId, - string discountId, - string idempotencyKey = null); - - /// - /// Deletes a discount. - /// - /// Required parameter: Subscription id. - /// Required parameter: Discount Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetDiscountResponse response from the API call. - Task DeleteDiscountAsync( - string subscriptionId, - string discountId, - string idempotencyKey = null, + string status = null, + string description = null, + string createdSince = null, + string createdUntil = null, CancellationToken cancellationToken = default); /// @@ -269,346 +280,443 @@ Models.GetSubscriptionResponse UpdateSubscriptionPaymentMethod( CancellationToken cancellationToken = default); /// - /// Cancels a subscription. + /// Get Subscription Item. /// - /// Required parameter: Subscription id. - /// Optional parameter: Request for cancelling a subscription. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse CancelSubscription( + /// Required parameter: Subscription Id. + /// Required parameter: Item id. + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + Models.GetSubscriptionItemResponse GetSubscriptionItem( string subscriptionId, - Models.CreateCancelSubscriptionRequest request = null, - string idempotencyKey = null); + string itemId); /// - /// Cancels a subscription. + /// Get Subscription Item. /// - /// Required parameter: Subscription id. - /// Optional parameter: Request for cancelling a subscription. - /// Optional parameter: Example: . + /// Required parameter: Subscription Id. + /// Required parameter: Item id. /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task CancelSubscriptionAsync( + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + Task GetSubscriptionItemAsync( string subscriptionId, - Models.CreateCancelSubscriptionRequest request = null, - string idempotencyKey = null, + string itemId, CancellationToken cancellationToken = default); /// - /// Creates a new subscription. + /// Gets all subscriptions. /// - /// Required parameter: Request for creating a subscription. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse CreateSubscription( - Models.CreateSubscriptionRequest body, + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for subscription's code. + /// Optional parameter: Filter for subscription's billing type. + /// Optional parameter: Filter for subscription's customer id. + /// Optional parameter: Filter for subscription's plan id. + /// Optional parameter: Filter for subscription's card id. + /// Optional parameter: Filter for subscription's status. + /// Optional parameter: Filter for subscription's next billing date start range. + /// Optional parameter: Filter for subscription's next billing date end range. + /// Optional parameter: Filter for subscription's creation date start range. + /// Optional parameter: Filter for subscriptions creation date end range. + /// Returns the Models.ListSubscriptionsResponse response from the API call. + Models.ListSubscriptionsResponse GetSubscriptions( + int? page = null, + int? size = null, + string code = null, + string billingType = null, + string customerId = null, + string planId = null, + string cardId = null, + string status = null, + DateTime? nextBillingSince = null, + DateTime? nextBillingUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null); + + /// + /// Gets all subscriptions. + /// + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for subscription's code. + /// Optional parameter: Filter for subscription's billing type. + /// Optional parameter: Filter for subscription's customer id. + /// Optional parameter: Filter for subscription's plan id. + /// Optional parameter: Filter for subscription's card id. + /// Optional parameter: Filter for subscription's status. + /// Optional parameter: Filter for subscription's next billing date start range. + /// Optional parameter: Filter for subscription's next billing date end range. + /// Optional parameter: Filter for subscription's creation date start range. + /// Optional parameter: Filter for subscriptions creation date end range. + /// cancellationToken. + /// Returns the Models.ListSubscriptionsResponse response from the API call. + Task GetSubscriptionsAsync( + int? page = null, + int? size = null, + string code = null, + string billingType = null, + string customerId = null, + string planId = null, + string cardId = null, + string status = null, + DateTime? nextBillingSince = null, + DateTime? nextBillingUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + CancellationToken cancellationToken = default); + + /// + /// Cancels a subscription. + /// + /// Required parameter: Subscription id. + /// Optional parameter: Request for cancelling a subscription. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse CancelSubscription( + string subscriptionId, + Models.CreateCancelSubscriptionRequest request = null, string idempotencyKey = null); /// - /// Creates a new subscription. + /// Cancels a subscription. /// - /// Required parameter: Request for creating a subscription. + /// Required parameter: Subscription id. + /// Optional parameter: Request for cancelling a subscription. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetSubscriptionResponse response from the API call. - Task CreateSubscriptionAsync( - Models.CreateSubscriptionRequest body, + Task CancelSubscriptionAsync( + string subscriptionId, + Models.CreateCancelSubscriptionRequest request = null, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// UpdateSubscriptionAffiliationId EndPoint. + /// Creates a increment. /// - /// Required parameter: Example: . - /// Required parameter: Request for updating a subscription affiliation id. + /// Required parameter: Subscription id. + /// Required parameter: Request for creating a increment. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateSubscriptionAffiliationId( + /// Returns the Models.GetIncrementResponse response from the API call. + Models.GetIncrementResponse CreateIncrement( string subscriptionId, - Models.UpdateSubscriptionAffiliationIdRequest request, + Models.CreateIncrementRequest request, string idempotencyKey = null); /// - /// UpdateSubscriptionAffiliationId EndPoint. + /// Creates a increment. /// - /// Required parameter: Example: . - /// Required parameter: Request for updating a subscription affiliation id. + /// Required parameter: Subscription id. + /// Required parameter: Request for creating a increment. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateSubscriptionAffiliationIdAsync( + /// Returns the Models.GetIncrementResponse response from the API call. + Task CreateIncrementAsync( string subscriptionId, - Models.UpdateSubscriptionAffiliationIdRequest request, + Models.CreateIncrementRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Atualização do valor mínimo da assinatura. + /// Creates a usage. /// /// Required parameter: Subscription Id. - /// Required parameter: Request da requisição com o valor mínimo que será configurado. + /// Required parameter: Item id. + /// Required parameter: Request for creating a usage. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateSubscriptionMiniumPrice( + /// Returns the Models.GetUsageResponse response from the API call. + Models.GetUsageResponse CreateUsage( string subscriptionId, - Models.UpdateSubscriptionMinimumPriceRequest request, + string itemId, + Models.CreateUsageRequest body, string idempotencyKey = null); /// - /// Atualização do valor mínimo da assinatura. + /// Creates a usage. /// /// Required parameter: Subscription Id. - /// Required parameter: Request da requisição com o valor mínimo que será configurado. + /// Required parameter: Item id. + /// Required parameter: Request for creating a usage. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateSubscriptionMiniumPriceAsync( + /// Returns the Models.GetUsageResponse response from the API call. + Task CreateUsageAsync( string subscriptionId, - Models.UpdateSubscriptionMinimumPriceRequest request, + string itemId, + Models.CreateUsageRequest body, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// GetSubscriptionCycleById EndPoint. + /// GetDiscountById EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Example: . - /// Returns the Models.GetPeriodResponse response from the API call. - Models.GetPeriodResponse GetSubscriptionCycleById( + /// Required parameter: Example: . + /// Returns the Models.GetDiscountResponse response from the API call. + Models.GetDiscountResponse GetDiscountById( string subscriptionId, - string cycleId); + string discountId); /// - /// GetSubscriptionCycleById EndPoint. + /// GetDiscountById EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Example: . + /// Required parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPeriodResponse response from the API call. - Task GetSubscriptionCycleByIdAsync( + /// Returns the Models.GetDiscountResponse response from the API call. + Task GetDiscountByIdAsync( string subscriptionId, - string cycleId, + string discountId, CancellationToken cancellationToken = default); /// - /// GetUsageReport EndPoint. + /// Creates a new subscription. + /// + /// Required parameter: Request for creating a subscription. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse CreateSubscription( + Models.CreateSubscriptionRequest body, + string idempotencyKey = null); + + /// + /// Creates a new subscription. + /// + /// Required parameter: Request for creating a subscription. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task CreateSubscriptionAsync( + Models.CreateSubscriptionRequest body, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// GetIncrementById EndPoint. /// /// Required parameter: The subscription Id. - /// Required parameter: The period Id. - /// Returns the Models.GetUsageReportResponse response from the API call. - Models.GetUsageReportResponse GetUsageReport( + /// Required parameter: The increment Id. + /// Returns the Models.GetIncrementResponse response from the API call. + Models.GetIncrementResponse GetIncrementById( string subscriptionId, - string periodId); + string incrementId); /// - /// GetUsageReport EndPoint. + /// GetIncrementById EndPoint. /// /// Required parameter: The subscription Id. - /// Required parameter: The period Id. + /// Required parameter: The increment Id. /// cancellationToken. - /// Returns the Models.GetUsageReportResponse response from the API call. - Task GetUsageReportAsync( + /// Returns the Models.GetIncrementResponse response from the API call. + Task GetIncrementByIdAsync( string subscriptionId, - string periodId, + string incrementId, CancellationToken cancellationToken = default); /// - /// RenewSubscription EndPoint. + /// UpdateSubscriptionAffiliationId EndPoint. /// /// Required parameter: Example: . + /// Required parameter: Request for updating a subscription affiliation id. /// Optional parameter: Example: . - /// Returns the Models.GetPeriodResponse response from the API call. - Models.GetPeriodResponse RenewSubscription( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateSubscriptionAffiliationId( string subscriptionId, + Models.UpdateSubscriptionAffiliationIdRequest request, string idempotencyKey = null); /// - /// RenewSubscription EndPoint. + /// UpdateSubscriptionAffiliationId EndPoint. /// /// Required parameter: Example: . + /// Required parameter: Request for updating a subscription affiliation id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPeriodResponse response from the API call. - Task RenewSubscriptionAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateSubscriptionAffiliationIdAsync( string subscriptionId, + Models.UpdateSubscriptionAffiliationIdRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Deletes a usage. + /// Updates the metadata from a subscription. /// /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. - /// Required parameter: The usage id. + /// Required parameter: Request for updating the subscrption metadata. /// Optional parameter: Example: . - /// Returns the Models.GetUsageResponse response from the API call. - Models.GetUsageResponse DeleteUsage( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateSubscriptionMetadata( string subscriptionId, - string itemId, - string usageId, + Models.UpdateMetadataRequest request, string idempotencyKey = null); /// - /// Deletes a usage. + /// Updates the metadata from a subscription. /// /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. - /// Required parameter: The usage id. + /// Required parameter: Request for updating the subscrption metadata. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetUsageResponse response from the API call. - Task DeleteUsageAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateSubscriptionMetadataAsync( string subscriptionId, - string itemId, - string usageId, + Models.UpdateMetadataRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Create Usage. + /// Deletes a increment. /// /// Required parameter: Subscription id. - /// Required parameter: Item id. + /// Required parameter: Increment id. /// Optional parameter: Example: . - /// Returns the Models.GetUsageResponse response from the API call. - Models.GetUsageResponse CreateAnUsage( + /// Returns the Models.GetIncrementResponse response from the API call. + Models.GetIncrementResponse DeleteIncrement( string subscriptionId, - string itemId, + string incrementId, string idempotencyKey = null); /// - /// Create Usage. + /// Deletes a increment. /// /// Required parameter: Subscription id. - /// Required parameter: Item id. + /// Required parameter: Increment id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetUsageResponse response from the API call. - Task CreateAnUsageAsync( + /// Returns the Models.GetIncrementResponse response from the API call. + Task DeleteIncrementAsync( string subscriptionId, - string itemId, + string incrementId, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// UpdateCurrentCycleStatus EndPoint. + /// GetSubscriptionCycles EndPoint. /// /// Required parameter: Subscription Id. - /// Required parameter: Request for updating the end date of the subscription current status. - /// Optional parameter: Example: . - void UpdateCurrentCycleStatus( - string subscriptionId, - Models.UpdateCurrentCycleStatusRequest request, - string idempotencyKey = null); + /// Required parameter: Page number. + /// Required parameter: Page size. + /// Returns the Models.ListCyclesResponse response from the API call. + Models.ListCyclesResponse GetSubscriptionCycles( + string subscriptionId, + string page, + string size); /// - /// UpdateCurrentCycleStatus EndPoint. + /// GetSubscriptionCycles EndPoint. /// /// Required parameter: Subscription Id. - /// Required parameter: Request for updating the end date of the subscription current status. - /// Optional parameter: Example: . + /// Required parameter: Page number. + /// Required parameter: Page size. /// cancellationToken. - /// Returns the void response from the API call. - Task UpdateCurrentCycleStatusAsync( + /// Returns the Models.ListCyclesResponse response from the API call. + Task GetSubscriptionCyclesAsync( string subscriptionId, - Models.UpdateCurrentCycleStatusRequest request, - string idempotencyKey = null, + string page, + string size, CancellationToken cancellationToken = default); /// - /// Get Subscription Item. + /// GetDiscounts EndPoint. /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - Models.GetSubscriptionItemResponse GetSubscriptionItem( + /// Required parameter: The subscription id. + /// Required parameter: Page number. + /// Required parameter: Page size. + /// Returns the Models.ListDiscountsResponse response from the API call. + Models.ListDiscountsResponse GetDiscounts( string subscriptionId, - string itemId); + int page, + int size); /// - /// Get Subscription Item. + /// GetDiscounts EndPoint. /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. + /// Required parameter: The subscription id. + /// Required parameter: Page number. + /// Required parameter: Page size. /// cancellationToken. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - Task GetSubscriptionItemAsync( + /// Returns the Models.ListDiscountsResponse response from the API call. + Task GetDiscountsAsync( string subscriptionId, - string itemId, + int page, + int size, CancellationToken cancellationToken = default); /// - /// GetIncrementById EndPoint. + /// Updates the billing date from a subscription. /// - /// Required parameter: The subscription Id. - /// Required parameter: The increment Id. - /// Returns the Models.GetIncrementResponse response from the API call. - Models.GetIncrementResponse GetIncrementById( + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription billing date. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateSubscriptionBillingDate( string subscriptionId, - string incrementId); + Models.UpdateSubscriptionBillingDateRequest request, + string idempotencyKey = null); /// - /// GetIncrementById EndPoint. + /// Updates the billing date from a subscription. /// - /// Required parameter: The subscription Id. - /// Required parameter: The increment Id. + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription billing date. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetIncrementResponse response from the API call. - Task GetIncrementByIdAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateSubscriptionBillingDateAsync( string subscriptionId, - string incrementId, + Models.UpdateSubscriptionBillingDateRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Deletes a increment. + /// Deletes a subscription item. /// /// Required parameter: Subscription id. - /// Required parameter: Increment id. + /// Required parameter: Subscription item id. /// Optional parameter: Example: . - /// Returns the Models.GetIncrementResponse response from the API call. - Models.GetIncrementResponse DeleteIncrement( + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + Models.GetSubscriptionItemResponse DeleteSubscriptionItem( string subscriptionId, - string incrementId, + string subscriptionItemId, string idempotencyKey = null); /// - /// Deletes a increment. + /// Deletes a subscription item. /// /// Required parameter: Subscription id. - /// Required parameter: Increment id. + /// Required parameter: Subscription item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetIncrementResponse response from the API call. - Task DeleteIncrementAsync( + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + Task DeleteSubscriptionItemAsync( string subscriptionId, - string incrementId, + string subscriptionItemId, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// GetDiscounts EndPoint. + /// GetIncrements EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Page number. - /// Required parameter: Page size. - /// Returns the Models.ListDiscountsResponse response from the API call. - Models.ListDiscountsResponse GetDiscounts( + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Returns the Models.ListIncrementsResponse response from the API call. + Models.ListIncrementsResponse GetIncrements( string subscriptionId, - int page, - int size); + int? page = null, + int? size = null); /// - /// GetDiscounts EndPoint. + /// GetIncrements EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Page number. - /// Required parameter: Page size. + /// Optional parameter: Page number. + /// Optional parameter: Page size. /// cancellationToken. - /// Returns the Models.ListDiscountsResponse response from the API call. - Task GetDiscountsAsync( + /// Returns the Models.ListIncrementsResponse response from the API call. + Task GetIncrementsAsync( string subscriptionId, - int page, - int size, + int? page = null, + int? size = null, CancellationToken cancellationToken = default); /// @@ -637,6 +745,62 @@ Models.GetSubscriptionResponse UpdateSubscriptionDueDays( string idempotencyKey = null, CancellationToken cancellationToken = default); + /// + /// Updates the start at date from a subscription. + /// + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription start date. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateSubscriptionStartAt( + string subscriptionId, + Models.UpdateSubscriptionStartAtRequest request, + string idempotencyKey = null); + + /// + /// Updates the start at date from a subscription. + /// + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription start date. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateSubscriptionStartAtAsync( + string subscriptionId, + Models.UpdateSubscriptionStartAtRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + + /// + /// Updates a subscription item. + /// + /// Required parameter: Subscription Id. + /// Required parameter: Item id. + /// Required parameter: Request for updating a subscription item. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + Models.GetSubscriptionItemResponse UpdateSubscriptionItem( + string subscriptionId, + string itemId, + Models.UpdateSubscriptionItemRequest body, + string idempotencyKey = null); + + /// + /// Updates a subscription item. + /// + /// Required parameter: Subscription Id. + /// Required parameter: Item id. + /// Required parameter: Request for updating a subscription item. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + Task UpdateSubscriptionItemAsync( + string subscriptionId, + string itemId, + Models.UpdateSubscriptionItemRequest body, + string idempotencyKey = null, + CancellationToken cancellationToken = default); + /// /// Creates a new Subscription item. /// @@ -664,349 +828,185 @@ Models.GetSubscriptionItemResponse CreateSubscriptionItem( CancellationToken cancellationToken = default); /// - /// UpdateSplitSubscription EndPoint. + /// Gets a subscription. /// - /// Required parameter: Subscription's id. - /// Required parameter: Example: . + /// Required parameter: Subscription id. /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateSplitSubscription( - string id, - Models.UpdateSubscriptionSplitRequest request); + Models.GetSubscriptionResponse GetSubscription( + string subscriptionId); /// - /// UpdateSplitSubscription EndPoint. + /// Gets a subscription. /// - /// Required parameter: Subscription's id. - /// Required parameter: Example: . + /// Required parameter: Subscription id. /// cancellationToken. /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateSplitSubscriptionAsync( - string id, - Models.UpdateSubscriptionSplitRequest request, + Task GetSubscriptionAsync( + string subscriptionId, CancellationToken cancellationToken = default); /// - /// Get Subscription Items. + /// Lists all usages from a subscription item. /// /// Required parameter: The subscription id. + /// Required parameter: The subscription item id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Optional parameter: The item name. /// Optional parameter: Identification code in the client system. - /// Optional parameter: The item statis. - /// Optional parameter: The item description. - /// Optional parameter: Filter for item's creation date start range. - /// Optional parameter: Filter for item's creation date end range. - /// Returns the Models.ListSubscriptionItemsResponse response from the API call. - Models.ListSubscriptionItemsResponse GetSubscriptionItems( + /// Optional parameter: Identification group in the client system. + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.ListUsagesResponse response from the API call. + Models.ListUsagesResponse GetUsages( string subscriptionId, + string itemId, int? page = null, int? size = null, - string name = null, string code = null, - string status = null, - string description = null, - string createdSince = null, - string createdUntil = null); + string mGroup = null, + DateTime? usedSince = null, + DateTime? usedUntil = null); /// - /// Get Subscription Items. + /// Lists all usages from a subscription item. /// /// Required parameter: The subscription id. + /// Required parameter: The subscription item id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Optional parameter: The item name. /// Optional parameter: Identification code in the client system. - /// Optional parameter: The item statis. - /// Optional parameter: The item description. - /// Optional parameter: Filter for item's creation date start range. - /// Optional parameter: Filter for item's creation date end range. + /// Optional parameter: Identification group in the client system. + /// Optional parameter: Example: . + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListSubscriptionItemsResponse response from the API call. - Task GetSubscriptionItemsAsync( + /// Returns the Models.ListUsagesResponse response from the API call. + Task GetUsagesAsync( string subscriptionId, + string itemId, int? page = null, int? size = null, - string name = null, string code = null, - string status = null, - string description = null, - string createdSince = null, - string createdUntil = null, + string mGroup = null, + DateTime? usedSince = null, + DateTime? usedUntil = null, CancellationToken cancellationToken = default); /// - /// Gets all subscriptions. + /// UpdateLatestPeriodEndAt EndPoint. /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for subscription's code. - /// Optional parameter: Filter for subscription's billing type. - /// Optional parameter: Filter for subscription's customer id. - /// Optional parameter: Filter for subscription's plan id. - /// Optional parameter: Filter for subscription's card id. - /// Optional parameter: Filter for subscription's status. - /// Optional parameter: Filter for subscription's next billing date start range. - /// Optional parameter: Filter for subscription's next billing date end range. - /// Optional parameter: Filter for subscription's creation date start range. - /// Optional parameter: Filter for subscriptions creation date end range. - /// Returns the Models.ListSubscriptionsResponse response from the API call. - Models.ListSubscriptionsResponse GetSubscriptions( - int? page = null, - int? size = null, - string code = null, - string billingType = null, - string customerId = null, - string planId = null, - string cardId = null, - string status = null, - DateTime? nextBillingSince = null, - DateTime? nextBillingUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null); - - /// - /// Gets all subscriptions. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for subscription's code. - /// Optional parameter: Filter for subscription's billing type. - /// Optional parameter: Filter for subscription's customer id. - /// Optional parameter: Filter for subscription's plan id. - /// Optional parameter: Filter for subscription's card id. - /// Optional parameter: Filter for subscription's status. - /// Optional parameter: Filter for subscription's next billing date start range. - /// Optional parameter: Filter for subscription's next billing date end range. - /// Optional parameter: Filter for subscription's creation date start range. - /// Optional parameter: Filter for subscriptions creation date end range. - /// cancellationToken. - /// Returns the Models.ListSubscriptionsResponse response from the API call. - Task GetSubscriptionsAsync( - int? page = null, - int? size = null, - string code = null, - string billingType = null, - string customerId = null, - string planId = null, - string cardId = null, - string status = null, - DateTime? nextBillingSince = null, - DateTime? nextBillingUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - CancellationToken cancellationToken = default); - - /// - /// Creates a increment. - /// - /// Required parameter: Subscription id. - /// Required parameter: Request for creating a increment. + /// Required parameter: Example: . + /// Required parameter: Request for updating the end date of the current signature cycle. /// Optional parameter: Example: . - /// Returns the Models.GetIncrementResponse response from the API call. - Models.GetIncrementResponse CreateIncrement( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateLatestPeriodEndAt( string subscriptionId, - Models.CreateIncrementRequest request, + Models.UpdateCurrentCycleEndDateRequest request, string idempotencyKey = null); /// - /// Creates a increment. + /// UpdateLatestPeriodEndAt EndPoint. /// - /// Required parameter: Subscription id. - /// Required parameter: Request for creating a increment. + /// Required parameter: Example: . + /// Required parameter: Request for updating the end date of the current signature cycle. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetIncrementResponse response from the API call. - Task CreateIncrementAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateLatestPeriodEndAtAsync( string subscriptionId, - Models.CreateIncrementRequest request, + Models.UpdateCurrentCycleEndDateRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// Creates a usage. + /// Atualização do valor mínimo da assinatura. /// /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Required parameter: Request for creating a usage. + /// Required parameter: Request da requisição com o valor mínimo que será configurado. /// Optional parameter: Example: . - /// Returns the Models.GetUsageResponse response from the API call. - Models.GetUsageResponse CreateUsage( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateSubscriptionMiniumPrice( string subscriptionId, - string itemId, - Models.CreateUsageRequest body, + Models.UpdateSubscriptionMinimumPriceRequest request, string idempotencyKey = null); /// - /// Creates a usage. + /// Atualização do valor mínimo da assinatura. /// /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Required parameter: Request for creating a usage. + /// Required parameter: Request da requisição com o valor mínimo que será configurado. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetUsageResponse response from the API call. - Task CreateUsageAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateSubscriptionMiniumPriceAsync( string subscriptionId, - string itemId, - Models.CreateUsageRequest body, + Models.UpdateSubscriptionMinimumPriceRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); /// - /// GetDiscountById EndPoint. - /// - /// Required parameter: The subscription id. - /// Required parameter: Example: . - /// Returns the Models.GetDiscountResponse response from the API call. - Models.GetDiscountResponse GetDiscountById( - string subscriptionId, - string discountId); - - /// - /// GetDiscountById EndPoint. - /// - /// Required parameter: The subscription id. - /// Required parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetDiscountResponse response from the API call. - Task GetDiscountByIdAsync( - string subscriptionId, - string discountId, - CancellationToken cancellationToken = default); - - /// - /// Updates the metadata from a subscription. + /// GetSubscriptionCycleById EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscrption metadata. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - Models.GetSubscriptionResponse UpdateSubscriptionMetadata( + /// Required parameter: Example: . + /// Returns the Models.GetPeriodResponse response from the API call. + Models.GetPeriodResponse GetSubscriptionCycleById( string subscriptionId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null); + string cycleId); /// - /// Updates the metadata from a subscription. + /// GetSubscriptionCycleById EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscrption metadata. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - Task UpdateSubscriptionMetadataAsync( - string subscriptionId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default); - - /// - /// GetSubscriptionCycles EndPoint. - /// - /// Required parameter: Subscription Id. - /// Required parameter: Page number. - /// Required parameter: Page size. - /// Returns the Models.ListCyclesResponse response from the API call. - Models.ListCyclesResponse GetSubscriptionCycles( - string subscriptionId, - string page, - string size); - - /// - /// GetSubscriptionCycles EndPoint. - /// - /// Required parameter: Subscription Id. - /// Required parameter: Page number. - /// Required parameter: Page size. - /// cancellationToken. - /// Returns the Models.ListCyclesResponse response from the API call. - Task GetSubscriptionCyclesAsync( - string subscriptionId, - string page, - string size, - CancellationToken cancellationToken = default); - - /// - /// Deletes a subscription item. - /// - /// Required parameter: Subscription id. - /// Required parameter: Subscription item id. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - Models.GetSubscriptionItemResponse DeleteSubscriptionItem( - string subscriptionId, - string subscriptionItemId, - string idempotencyKey = null); - - /// - /// Deletes a subscription item. - /// - /// Required parameter: Subscription id. - /// Required parameter: Subscription item id. - /// Optional parameter: Example: . + /// Required parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - Task DeleteSubscriptionItemAsync( + /// Returns the Models.GetPeriodResponse response from the API call. + Task GetSubscriptionCycleByIdAsync( string subscriptionId, - string subscriptionItemId, - string idempotencyKey = null, + string cycleId, CancellationToken cancellationToken = default); /// - /// GetIncrements EndPoint. + /// GetUsageReport EndPoint. /// - /// Required parameter: The subscription id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Returns the Models.ListIncrementsResponse response from the API call. - Models.ListIncrementsResponse GetIncrements( + /// Required parameter: The subscription Id. + /// Required parameter: The period Id. + /// Returns the Models.GetUsageReportResponse response from the API call. + Models.GetUsageReportResponse GetUsageReport( string subscriptionId, - int? page = null, - int? size = null); + string periodId); /// - /// GetIncrements EndPoint. + /// GetUsageReport EndPoint. /// - /// Required parameter: The subscription id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. + /// Required parameter: The subscription Id. + /// Required parameter: The period Id. /// cancellationToken. - /// Returns the Models.ListIncrementsResponse response from the API call. - Task GetIncrementsAsync( + /// Returns the Models.GetUsageReportResponse response from the API call. + Task GetUsageReportAsync( string subscriptionId, - int? page = null, - int? size = null, + string periodId, CancellationToken cancellationToken = default); /// - /// Updates a subscription item. + /// UpdateSplitSubscription EndPoint. /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Required parameter: Request for updating a subscription item. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - Models.GetSubscriptionItemResponse UpdateSubscriptionItem( - string subscriptionId, - string itemId, - Models.UpdateSubscriptionItemRequest body, - string idempotencyKey = null); + /// Required parameter: Subscription's id. + /// Required parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + Models.GetSubscriptionResponse UpdateSplitSubscription( + string id, + Models.UpdateSubscriptionSplitRequest request); /// - /// Updates a subscription item. + /// UpdateSplitSubscription EndPoint. /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Required parameter: Request for updating a subscription item. - /// Optional parameter: Example: . + /// Required parameter: Subscription's id. + /// Required parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - Task UpdateSubscriptionItemAsync( - string subscriptionId, - string itemId, - Models.UpdateSubscriptionItemRequest body, - string idempotencyKey = null, + /// Returns the Models.GetSubscriptionResponse response from the API call. + Task UpdateSplitSubscriptionAsync( + string id, + Models.UpdateSubscriptionSplitRequest request, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/ITokensController.cs b/PagarmeApiSDK.Standard/Controllers/ITokensController.cs index 1be42e5..052b165 100644 --- a/PagarmeApiSDK.Standard/Controllers/ITokensController.cs +++ b/PagarmeApiSDK.Standard/Controllers/ITokensController.cs @@ -22,28 +22,6 @@ namespace PagarmeApiSDK.Standard.Controllers /// public interface ITokensController { - /// - /// Gets a token from its id. - /// - /// Required parameter: Token id. - /// Required parameter: Public key. - /// Returns the Models.GetTokenResponse response from the API call. - Models.GetTokenResponse GetToken( - string id, - string publicKey); - - /// - /// Gets a token from its id. - /// - /// Required parameter: Token id. - /// Required parameter: Public key. - /// cancellationToken. - /// Returns the Models.GetTokenResponse response from the API call. - Task GetTokenAsync( - string id, - string publicKey, - CancellationToken cancellationToken = default); - /// /// CreateToken EndPoint. /// @@ -69,5 +47,27 @@ Models.GetTokenResponse CreateToken( Models.CreateTokenRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default); + + /// + /// Gets a token from its id. + /// + /// Required parameter: Token id. + /// Required parameter: Public key. + /// Returns the Models.GetTokenResponse response from the API call. + Models.GetTokenResponse GetToken( + string id, + string publicKey); + + /// + /// Gets a token from its id. + /// + /// Required parameter: Token id. + /// Required parameter: Public key. + /// cancellationToken. + /// Returns the Models.GetTokenResponse response from the API call. + Task GetTokenAsync( + string id, + string publicKey, + CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/ITransfersController.cs b/PagarmeApiSDK.Standard/Controllers/ITransfersController.cs index 78eab1a..3c6516f 100644 --- a/PagarmeApiSDK.Standard/Controllers/ITransfersController.cs +++ b/PagarmeApiSDK.Standard/Controllers/ITransfersController.cs @@ -40,19 +40,6 @@ Models.GetTransfer GetTransferById( string transferId, CancellationToken cancellationToken = default); - /// - /// Gets all transfers. - /// - /// Returns the Models.ListTransfers response from the API call. - Models.ListTransfers GetTransfers(); - - /// - /// Gets all transfers. - /// - /// cancellationToken. - /// Returns the Models.ListTransfers response from the API call. - Task GetTransfersAsync(CancellationToken cancellationToken = default); - /// /// CreateTransfer EndPoint. /// @@ -70,5 +57,18 @@ Models.GetTransfer CreateTransfer( Task CreateTransferAsync( Models.CreateTransfer request, CancellationToken cancellationToken = default); + + /// + /// Gets all transfers. + /// + /// Returns the Models.ListTransfers response from the API call. + Models.ListTransfers GetTransfers(); + + /// + /// Gets all transfers. + /// + /// cancellationToken. + /// Returns the Models.ListTransfers response from the API call. + Task GetTransfersAsync(CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/InvoicesController.cs b/PagarmeApiSDK.Standard/Controllers/InvoicesController.cs index 7935688..477d372 100644 --- a/PagarmeApiSDK.Standard/Controllers/InvoicesController.cs +++ b/PagarmeApiSDK.Standard/Controllers/InvoicesController.cs @@ -32,149 +32,6 @@ internal class InvoicesController : BaseController, IInvoicesController /// internal InvoicesController(GlobalConfiguration globalConfiguration) : base(globalConfiguration) { } - /// - /// Gets all invoices. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for Invoice's code. - /// Optional parameter: Filter for Invoice's customer id. - /// Optional parameter: Filter for Invoice's subscription id. - /// Optional parameter: Filter for Invoice's creation date start range. - /// Optional parameter: Filter for Invoices creation date end range. - /// Optional parameter: Filter for Invoice's status. - /// Optional parameter: Filter for Invoice's due date start range. - /// Optional parameter: Filter for Invoice's due date end range. - /// Optional parameter: Example: . - /// Returns the Models.ListInvoicesResponse response from the API call. - public Models.ListInvoicesResponse GetInvoices( - int? page = null, - int? size = null, - string code = null, - string customerId = null, - string subscriptionId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - string status = null, - DateTime? dueSince = null, - DateTime? dueUntil = null, - string customerDocument = null) - => CoreHelper.RunTask(GetInvoicesAsync(page, size, code, customerId, subscriptionId, createdSince, createdUntil, status, dueSince, dueUntil, customerDocument)); - - /// - /// Gets all invoices. - /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for Invoice's code. - /// Optional parameter: Filter for Invoice's customer id. - /// Optional parameter: Filter for Invoice's subscription id. - /// Optional parameter: Filter for Invoice's creation date start range. - /// Optional parameter: Filter for Invoices creation date end range. - /// Optional parameter: Filter for Invoice's status. - /// Optional parameter: Filter for Invoice's due date start range. - /// Optional parameter: Filter for Invoice's due date end range. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.ListInvoicesResponse response from the API call. - public async Task GetInvoicesAsync( - int? page = null, - int? size = null, - string code = null, - string customerId = null, - string subscriptionId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - string status = null, - DateTime? dueSince = null, - DateTime? dueUntil = null, - string customerDocument = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/invoices") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)) - .Query(_query => _query.Setup("code", code)) - .Query(_query => _query.Setup("customer_id", customerId)) - .Query(_query => _query.Setup("subscription_id", subscriptionId)) - .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("due_since", dueSince.HasValue ? dueSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("due_until", dueUntil.HasValue ? dueUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("customer_document", customerDocument)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Cancels an invoice. - /// - /// Required parameter: Invoice id. - /// Optional parameter: Example: . - /// Returns the Models.GetInvoiceResponse response from the API call. - public Models.GetInvoiceResponse CancelInvoice( - string invoiceId, - string idempotencyKey = null) - => CoreHelper.RunTask(CancelInvoiceAsync(invoiceId, idempotencyKey)); - - /// - /// Cancels an invoice. - /// - /// Required parameter: Invoice id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetInvoiceResponse response from the API call. - public async Task CancelInvoiceAsync( - string invoiceId, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/invoices/{invoice_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("invoice_id", invoiceId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Updates the status from an invoice. - /// - /// Required parameter: Invoice Id. - /// Required parameter: Request for updating an invoice's status. - /// Optional parameter: Example: . - /// Returns the Models.GetInvoiceResponse response from the API call. - public Models.GetInvoiceResponse UpdateInvoiceStatus( - string invoiceId, - Models.UpdateInvoiceStatusRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateInvoiceStatusAsync(invoiceId, request, idempotencyKey)); - - /// - /// Updates the status from an invoice. - /// - /// Required parameter: Invoice Id. - /// Required parameter: Request for updating an invoice's status. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetInvoiceResponse response from the API call. - public async Task UpdateInvoiceStatusAsync( - string invoiceId, - Models.UpdateInvoiceStatusRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/invoices/{invoice_id}/status") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("invoice_id", invoiceId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// Updates the metadata from an invoice. /// @@ -237,6 +94,37 @@ public Models.GetInvoiceResponse GetPartialInvoice( .Template(_template => _template.Setup("subscription_id", subscriptionId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Cancels an invoice. + /// + /// Required parameter: Invoice id. + /// Optional parameter: Example: . + /// Returns the Models.GetInvoiceResponse response from the API call. + public Models.GetInvoiceResponse CancelInvoice( + string invoiceId, + string idempotencyKey = null) + => CoreHelper.RunTask(CancelInvoiceAsync(invoiceId, idempotencyKey)); + + /// + /// Cancels an invoice. + /// + /// Required parameter: Invoice id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetInvoiceResponse response from the API call. + public async Task CancelInvoiceAsync( + string invoiceId, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Delete, "/invoices/{invoice_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("invoice_id", invoiceId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Create an Invoice. /// @@ -278,6 +166,82 @@ public Models.GetInvoiceResponse CreateInvoice( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Gets all invoices. + /// + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for Invoice's code. + /// Optional parameter: Filter for Invoice's customer id. + /// Optional parameter: Filter for Invoice's subscription id. + /// Optional parameter: Filter for Invoice's creation date start range. + /// Optional parameter: Filter for Invoices creation date end range. + /// Optional parameter: Filter for Invoice's status. + /// Optional parameter: Filter for Invoice's due date start range. + /// Optional parameter: Filter for Invoice's due date end range. + /// Optional parameter: Example: . + /// Returns the Models.ListInvoicesResponse response from the API call. + public Models.ListInvoicesResponse GetInvoices( + int? page = null, + int? size = null, + string code = null, + string customerId = null, + string subscriptionId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + string status = null, + DateTime? dueSince = null, + DateTime? dueUntil = null, + string customerDocument = null) + => CoreHelper.RunTask(GetInvoicesAsync(page, size, code, customerId, subscriptionId, createdSince, createdUntil, status, dueSince, dueUntil, customerDocument)); + + /// + /// Gets all invoices. + /// + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for Invoice's code. + /// Optional parameter: Filter for Invoice's customer id. + /// Optional parameter: Filter for Invoice's subscription id. + /// Optional parameter: Filter for Invoice's creation date start range. + /// Optional parameter: Filter for Invoices creation date end range. + /// Optional parameter: Filter for Invoice's status. + /// Optional parameter: Filter for Invoice's due date start range. + /// Optional parameter: Filter for Invoice's due date end range. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.ListInvoicesResponse response from the API call. + public async Task GetInvoicesAsync( + int? page = null, + int? size = null, + string code = null, + string customerId = null, + string subscriptionId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + string status = null, + DateTime? dueSince = null, + DateTime? dueUntil = null, + string customerDocument = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/invoices") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("code", code)) + .Query(_query => _query.Setup("customer_id", customerId)) + .Query(_query => _query.Setup("subscription_id", subscriptionId)) + .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("status", status)) + .Query(_query => _query.Setup("due_since", dueSince.HasValue ? dueSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("due_until", dueUntil.HasValue ? dueUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("customer_document", customerDocument)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Gets an invoice. /// @@ -303,5 +267,41 @@ public Models.GetInvoiceResponse GetInvoice( .Parameters(_parameters => _parameters .Template(_template => _template.Setup("invoice_id", invoiceId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Updates the status from an invoice. + /// + /// Required parameter: Invoice Id. + /// Required parameter: Request for updating an invoice's status. + /// Optional parameter: Example: . + /// Returns the Models.GetInvoiceResponse response from the API call. + public Models.GetInvoiceResponse UpdateInvoiceStatus( + string invoiceId, + Models.UpdateInvoiceStatusRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateInvoiceStatusAsync(invoiceId, request, idempotencyKey)); + + /// + /// Updates the status from an invoice. + /// + /// Required parameter: Invoice Id. + /// Required parameter: Request for updating an invoice's status. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetInvoiceResponse response from the API call. + public async Task UpdateInvoiceStatusAsync( + string invoiceId, + Models.UpdateInvoiceStatusRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(new HttpMethod("PATCH"), "/invoices/{invoice_id}/status") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("invoice_id", invoiceId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/OrdersController.cs b/PagarmeApiSDK.Standard/Controllers/OrdersController.cs index 92b6f8b..13d5017 100644 --- a/PagarmeApiSDK.Standard/Controllers/OrdersController.cs +++ b/PagarmeApiSDK.Standard/Controllers/OrdersController.cs @@ -32,166 +32,6 @@ internal class OrdersController : BaseController, IOrdersController /// internal OrdersController(GlobalConfiguration globalConfiguration) : base(globalConfiguration) { } - /// - /// DeleteAllOrderItems EndPoint. - /// - /// Required parameter: Order Id. - /// Optional parameter: Example: . - /// Returns the Models.GetOrderResponse response from the API call. - public Models.GetOrderResponse DeleteAllOrderItems( - string orderId, - string idempotencyKey = null) - => CoreHelper.RunTask(DeleteAllOrderItemsAsync(orderId, idempotencyKey)); - - /// - /// DeleteAllOrderItems EndPoint. - /// - /// Required parameter: Order Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetOrderResponse response from the API call. - public async Task DeleteAllOrderItemsAsync( - string orderId, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/orders/{orderId}/items") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("orderId", orderId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// GetOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// Returns the Models.GetOrderItemResponse response from the API call. - public Models.GetOrderItemResponse GetOrderItem( - string orderId, - string itemId) - => CoreHelper.RunTask(GetOrderItemAsync(orderId, itemId)); - - /// - /// GetOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// cancellationToken. - /// Returns the Models.GetOrderItemResponse response from the API call. - public async Task GetOrderItemAsync( - string orderId, - string itemId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/orders/{orderId}/items/{itemId}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("orderId", orderId)) - .Template(_template => _template.Setup("itemId", itemId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Updates the metadata from an order. - /// - /// Required parameter: The order id. - /// Required parameter: Request for updating the order metadata. - /// Optional parameter: Example: . - /// Returns the Models.GetOrderResponse response from the API call. - public Models.GetOrderResponse UpdateOrderMetadata( - string orderId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateOrderMetadataAsync(orderId, request, idempotencyKey)); - - /// - /// Updates the metadata from an order. - /// - /// Required parameter: The order id. - /// Required parameter: Request for updating the order metadata. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetOrderResponse response from the API call. - public async Task UpdateOrderMetadataAsync( - string orderId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/Orders/{order_id}/metadata") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("order_id", orderId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// DeleteOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// Optional parameter: Example: . - /// Returns the Models.GetOrderItemResponse response from the API call. - public Models.GetOrderItemResponse DeleteOrderItem( - string orderId, - string itemId, - string idempotencyKey = null) - => CoreHelper.RunTask(DeleteOrderItemAsync(orderId, itemId, idempotencyKey)); - - /// - /// DeleteOrderItem EndPoint. - /// - /// Required parameter: Order Id. - /// Required parameter: Item Id. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetOrderItemResponse response from the API call. - public async Task DeleteOrderItemAsync( - string orderId, - string itemId, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/orders/{orderId}/items/{itemId}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("orderId", orderId)) - .Template(_template => _template.Setup("itemId", itemId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Gets an order. - /// - /// Required parameter: Order id. - /// Returns the Models.GetOrderResponse response from the API call. - public Models.GetOrderResponse GetOrder( - string orderId) - => CoreHelper.RunTask(GetOrderAsync(orderId)); - - /// - /// Gets an order. - /// - /// Required parameter: Order id. - /// cancellationToken. - /// Returns the Models.GetOrderResponse response from the API call. - public async Task GetOrderAsync( - string orderId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/orders/{order_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("order_id", orderId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// Gets all orders. /// @@ -289,6 +129,73 @@ public Models.GetOrderItemResponse UpdateOrderItem( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// DeleteAllOrderItems EndPoint. + /// + /// Required parameter: Order Id. + /// Optional parameter: Example: . + /// Returns the Models.GetOrderResponse response from the API call. + public Models.GetOrderResponse DeleteAllOrderItems( + string orderId, + string idempotencyKey = null) + => CoreHelper.RunTask(DeleteAllOrderItemsAsync(orderId, idempotencyKey)); + + /// + /// DeleteAllOrderItems EndPoint. + /// + /// Required parameter: Order Id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetOrderResponse response from the API call. + public async Task DeleteAllOrderItemsAsync( + string orderId, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Delete, "/orders/{orderId}/items") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("orderId", orderId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// DeleteOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// Optional parameter: Example: . + /// Returns the Models.GetOrderItemResponse response from the API call. + public Models.GetOrderItemResponse DeleteOrderItem( + string orderId, + string itemId, + string idempotencyKey = null) + => CoreHelper.RunTask(DeleteOrderItemAsync(orderId, itemId, idempotencyKey)); + + /// + /// DeleteOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetOrderItemResponse response from the API call. + public async Task DeleteOrderItemAsync( + string orderId, + string itemId, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Delete, "/orders/{orderId}/items/{itemId}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("orderId", orderId)) + .Template(_template => _template.Setup("itemId", itemId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// CloseOrder EndPoint. /// @@ -391,5 +298,98 @@ public Models.GetOrderItemResponse CreateOrderItem( .Template(_template => _template.Setup("orderId", orderId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// GetOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// Returns the Models.GetOrderItemResponse response from the API call. + public Models.GetOrderItemResponse GetOrderItem( + string orderId, + string itemId) + => CoreHelper.RunTask(GetOrderItemAsync(orderId, itemId)); + + /// + /// GetOrderItem EndPoint. + /// + /// Required parameter: Order Id. + /// Required parameter: Item Id. + /// cancellationToken. + /// Returns the Models.GetOrderItemResponse response from the API call. + public async Task GetOrderItemAsync( + string orderId, + string itemId, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/orders/{orderId}/items/{itemId}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("orderId", orderId)) + .Template(_template => _template.Setup("itemId", itemId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Updates the metadata from an order. + /// + /// Required parameter: The order id. + /// Required parameter: Request for updating the order metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetOrderResponse response from the API call. + public Models.GetOrderResponse UpdateOrderMetadata( + string orderId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateOrderMetadataAsync(orderId, request, idempotencyKey)); + + /// + /// Updates the metadata from an order. + /// + /// Required parameter: The order id. + /// Required parameter: Request for updating the order metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetOrderResponse response from the API call. + public async Task UpdateOrderMetadataAsync( + string orderId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(new HttpMethod("PATCH"), "/Orders/{order_id}/metadata") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("order_id", orderId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Gets an order. + /// + /// Required parameter: Order id. + /// Returns the Models.GetOrderResponse response from the API call. + public Models.GetOrderResponse GetOrder( + string orderId) + => CoreHelper.RunTask(GetOrderAsync(orderId)); + + /// + /// Gets an order. + /// + /// Required parameter: Order id. + /// cancellationToken. + /// Returns the Models.GetOrderResponse response from the API call. + public async Task GetOrderAsync( + string orderId, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/orders/{order_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("order_id", orderId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/PlansController.cs b/PagarmeApiSDK.Standard/Controllers/PlansController.cs index 154d70a..8e47dcb 100644 --- a/PagarmeApiSDK.Standard/Controllers/PlansController.cs +++ b/PagarmeApiSDK.Standard/Controllers/PlansController.cs @@ -59,38 +59,33 @@ public Models.GetPlanResponse GetPlan( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Removes an item from a plan. + /// Deletes a plan. /// /// Required parameter: Plan id. - /// Required parameter: Plan item id. /// Optional parameter: Example: . - /// Returns the Models.GetPlanItemResponse response from the API call. - public Models.GetPlanItemResponse DeletePlanItem( + /// Returns the Models.GetPlanResponse response from the API call. + public Models.GetPlanResponse DeletePlan( string planId, - string planItemId, string idempotencyKey = null) - => CoreHelper.RunTask(DeletePlanItemAsync(planId, planItemId, idempotencyKey)); + => CoreHelper.RunTask(DeletePlanAsync(planId, idempotencyKey)); /// - /// Removes an item from a plan. + /// Deletes a plan. /// /// Required parameter: Plan id. - /// Required parameter: Plan item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - public async Task DeletePlanItemAsync( + /// Returns the Models.GetPlanResponse response from the API call. + public async Task DeletePlanAsync( string planId, - string planItemId, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/plans/{plan_id}/items/{plan_item_id}") + .Setup(HttpMethod.Delete, "/plans/{plan_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("plan_id", planId)) - .Template(_template => _template.Setup("plan_item_id", planItemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); @@ -131,65 +126,75 @@ public Models.GetPlanResponse UpdatePlanMetadata( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a new plan. + /// Updates a plan item. /// - /// Required parameter: Request for creating a plan. + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Required parameter: Request for updating the plan item. /// Optional parameter: Example: . - /// Returns the Models.GetPlanResponse response from the API call. - public Models.GetPlanResponse CreatePlan( - Models.CreatePlanRequest body, + /// Returns the Models.GetPlanItemResponse response from the API call. + public Models.GetPlanItemResponse UpdatePlanItem( + string planId, + string planItemId, + Models.UpdatePlanItemRequest body, string idempotencyKey = null) - => CoreHelper.RunTask(CreatePlanAsync(body, idempotencyKey)); + => CoreHelper.RunTask(UpdatePlanItemAsync(planId, planItemId, body, idempotencyKey)); /// - /// Creates a new plan. + /// Updates a plan item. /// - /// Required parameter: Request for creating a plan. + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Required parameter: Request for updating the plan item. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanResponse response from the API call. - public async Task CreatePlanAsync( - Models.CreatePlanRequest body, + /// Returns the Models.GetPlanItemResponse response from the API call. + public async Task UpdatePlanItemAsync( + string planId, + string planItemId, + Models.UpdatePlanItemRequest body, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/plans") + .Setup(HttpMethod.Put, "/plans/{plan_id}/items/{plan_item_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(body)) + .Template(_template => _template.Setup("plan_id", planId)) + .Template(_template => _template.Setup("plan_item_id", planItemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates a plan. + /// Adds a new item to a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for updating a plan. + /// Required parameter: Request for creating a plan item. /// Optional parameter: Example: . - /// Returns the Models.GetPlanResponse response from the API call. - public Models.GetPlanResponse UpdatePlan( + /// Returns the Models.GetPlanItemResponse response from the API call. + public Models.GetPlanItemResponse CreatePlanItem( string planId, - Models.UpdatePlanRequest request, + Models.CreatePlanItemRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdatePlanAsync(planId, request, idempotencyKey)); + => CoreHelper.RunTask(CreatePlanItemAsync(planId, request, idempotencyKey)); /// - /// Updates a plan. + /// Adds a new item to a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for updating a plan. + /// Required parameter: Request for creating a plan item. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanResponse response from the API call. - public async Task UpdatePlanAsync( + /// Returns the Models.GetPlanItemResponse response from the API call. + public async Task CreatePlanItemAsync( string planId, - Models.UpdatePlanRequest request, + Models.CreatePlanItemRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Put, "/plans/{plan_id}") + .Setup(HttpMethod.Post, "/plans/{plan_id}/items") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -198,33 +203,100 @@ public Models.GetPlanResponse UpdatePlan( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Deletes a plan. + /// Gets a plan item. + /// + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Returns the Models.GetPlanItemResponse response from the API call. + public Models.GetPlanItemResponse GetPlanItem( + string planId, + string planItemId) + => CoreHelper.RunTask(GetPlanItemAsync(planId, planItemId)); + + /// + /// Gets a plan item. /// /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// cancellationToken. + /// Returns the Models.GetPlanItemResponse response from the API call. + public async Task GetPlanItemAsync( + string planId, + string planItemId, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/plans/{plan_id}/items/{plan_item_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("plan_id", planId)) + .Template(_template => _template.Setup("plan_item_id", planItemId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Creates a new plan. + /// + /// Required parameter: Request for creating a plan. /// Optional parameter: Example: . /// Returns the Models.GetPlanResponse response from the API call. - public Models.GetPlanResponse DeletePlan( + public Models.GetPlanResponse CreatePlan( + Models.CreatePlanRequest body, + string idempotencyKey = null) + => CoreHelper.RunTask(CreatePlanAsync(body, idempotencyKey)); + + /// + /// Creates a new plan. + /// + /// Required parameter: Request for creating a plan. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetPlanResponse response from the API call. + public async Task CreatePlanAsync( + Models.CreatePlanRequest body, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/plans") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(body)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Removes an item from a plan. + /// + /// Required parameter: Plan id. + /// Required parameter: Plan item id. + /// Optional parameter: Example: . + /// Returns the Models.GetPlanItemResponse response from the API call. + public Models.GetPlanItemResponse DeletePlanItem( string planId, + string planItemId, string idempotencyKey = null) - => CoreHelper.RunTask(DeletePlanAsync(planId, idempotencyKey)); + => CoreHelper.RunTask(DeletePlanItemAsync(planId, planItemId, idempotencyKey)); /// - /// Deletes a plan. + /// Removes an item from a plan. /// /// Required parameter: Plan id. + /// Required parameter: Plan item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanResponse response from the API call. - public async Task DeletePlanAsync( + /// Returns the Models.GetPlanItemResponse response from the API call. + public async Task DeletePlanItemAsync( string planId, + string planItemId, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/plans/{plan_id}") + .Setup(HttpMethod.Delete, "/plans/{plan_id}/items/{plan_item_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("plan_id", planId)) + .Template(_template => _template.Setup("plan_item_id", planItemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); @@ -285,111 +357,39 @@ public Models.ListPlansResponse GetPlans( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// Required parameter: Request for updating the plan item. - /// Optional parameter: Example: . - /// Returns the Models.GetPlanItemResponse response from the API call. - public Models.GetPlanItemResponse UpdatePlanItem( - string planId, - string planItemId, - Models.UpdatePlanItemRequest body, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdatePlanItemAsync(planId, planItemId, body, idempotencyKey)); - - /// - /// Updates a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// Required parameter: Request for updating the plan item. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - public async Task UpdatePlanItemAsync( - string planId, - string planItemId, - Models.UpdatePlanItemRequest body, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Put, "/plans/{plan_id}/items/{plan_item_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(body)) - .Template(_template => _template.Setup("plan_id", planId)) - .Template(_template => _template.Setup("plan_item_id", planItemId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Adds a new item to a plan. + /// Updates a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for creating a plan item. + /// Required parameter: Request for updating a plan. /// Optional parameter: Example: . - /// Returns the Models.GetPlanItemResponse response from the API call. - public Models.GetPlanItemResponse CreatePlanItem( + /// Returns the Models.GetPlanResponse response from the API call. + public Models.GetPlanResponse UpdatePlan( string planId, - Models.CreatePlanItemRequest request, + Models.UpdatePlanRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(CreatePlanItemAsync(planId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdatePlanAsync(planId, request, idempotencyKey)); /// - /// Adds a new item to a plan. + /// Updates a plan. /// /// Required parameter: Plan id. - /// Required parameter: Request for creating a plan item. + /// Required parameter: Request for updating a plan. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - public async Task CreatePlanItemAsync( + /// Returns the Models.GetPlanResponse response from the API call. + public async Task UpdatePlanAsync( string planId, - Models.CreatePlanItemRequest request, + Models.UpdatePlanRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/plans/{plan_id}/items") + .Setup(HttpMethod.Put, "/plans/{plan_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("plan_id", planId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Gets a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// Returns the Models.GetPlanItemResponse response from the API call. - public Models.GetPlanItemResponse GetPlanItem( - string planId, - string planItemId) - => CoreHelper.RunTask(GetPlanItemAsync(planId, planItemId)); - - /// - /// Gets a plan item. - /// - /// Required parameter: Plan id. - /// Required parameter: Plan item id. - /// cancellationToken. - /// Returns the Models.GetPlanItemResponse response from the API call. - public async Task GetPlanItemAsync( - string planId, - string planItemId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/plans/{plan_id}/items/{plan_item_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("plan_id", planId)) - .Template(_template => _template.Setup("plan_item_id", planItemId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/RecipientsController.cs b/PagarmeApiSDK.Standard/Controllers/RecipientsController.cs index 372f2e9..fdd36ab 100644 --- a/PagarmeApiSDK.Standard/Controllers/RecipientsController.cs +++ b/PagarmeApiSDK.Standard/Controllers/RecipientsController.cs @@ -69,86 +69,75 @@ public Models.GetRecipientResponse UpdateRecipient( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetWithdrawById EndPoint. + /// Creates an anticipation. /// - /// Required parameter: Example: . - /// Required parameter: Example: . - /// Returns the Models.GetWithdrawResponse response from the API call. - public Models.GetWithdrawResponse GetWithdrawById( + /// Required parameter: Recipient id. + /// Required parameter: Anticipation data. + /// Optional parameter: Example: . + /// Returns the Models.GetAnticipationResponse response from the API call. + public Models.GetAnticipationResponse CreateAnticipation( string recipientId, - string withdrawalId) - => CoreHelper.RunTask(GetWithdrawByIdAsync(recipientId, withdrawalId)); + Models.CreateAnticipationRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(CreateAnticipationAsync(recipientId, request, idempotencyKey)); /// - /// GetWithdrawById EndPoint. + /// Creates an anticipation. /// - /// Required parameter: Example: . - /// Required parameter: Example: . + /// Required parameter: Recipient id. + /// Required parameter: Anticipation data. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetWithdrawResponse response from the API call. - public async Task GetWithdrawByIdAsync( + /// Returns the Models.GetAnticipationResponse response from the API call. + public async Task CreateAnticipationAsync( string recipientId, - string withdrawalId, + Models.CreateAnticipationRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{recipient_id}/withdrawals/{withdrawal_id}") + .Setup(HttpMethod.Post, "/recipients/{recipient_id}/anticipations") .WithAuth("httpBasic") .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("recipient_id", recipientId)) - .Template(_template => _template.Setup("withdrawal_id", withdrawalId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Retrieves recipient information. - /// - /// Required parameter: Recipiend id. - /// Returns the Models.GetRecipientResponse response from the API call. - public Models.GetRecipientResponse GetRecipient( - string recipientId) - => CoreHelper.RunTask(GetRecipientAsync(recipientId)); - - /// - /// Retrieves recipient information. - /// - /// Required parameter: Recipiend id. - /// cancellationToken. - /// Returns the Models.GetRecipientResponse response from the API call. - public async Task GetRecipientAsync( - string recipientId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{recipient_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("recipient_id", recipientId)))) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Get balance information for a recipient. + /// Gets the anticipation limits for a recipient. /// /// Required parameter: Recipient id. - /// Returns the Models.GetBalanceResponse response from the API call. - public Models.GetBalanceResponse GetBalance( - string recipientId) - => CoreHelper.RunTask(GetBalanceAsync(recipientId)); + /// Required parameter: Timeframe. + /// Required parameter: Anticipation payment date. + /// Returns the Models.GetAnticipationLimitResponse response from the API call. + public Models.GetAnticipationLimitResponse GetAnticipationLimits( + string recipientId, + string timeframe, + DateTime paymentDate) + => CoreHelper.RunTask(GetAnticipationLimitsAsync(recipientId, timeframe, paymentDate)); /// - /// Get balance information for a recipient. + /// Gets the anticipation limits for a recipient. /// /// Required parameter: Recipient id. + /// Required parameter: Timeframe. + /// Required parameter: Anticipation payment date. /// cancellationToken. - /// Returns the Models.GetBalanceResponse response from the API call. - public async Task GetBalanceAsync( + /// Returns the Models.GetAnticipationLimitResponse response from the API call. + public async Task GetAnticipationLimitsAsync( string recipientId, + string timeframe, + DateTime paymentDate, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{recipient_id}/balance") + .Setup(HttpMethod.Get, "/recipients/{recipient_id}/anticipation_limits") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("recipient_id", recipientId)))) + .Template(_template => _template.Setup("recipient_id", recipientId)) + .Query(_query => _query.Setup("timeframe", timeframe)) + .Query(_query => _query.Setup("payment_date", paymentDate.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"))))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// @@ -182,6 +171,37 @@ public Models.ListRecipientResponse GetRecipients( .Query(_query => _query.Setup("size", size)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// GetWithdrawById EndPoint. + /// + /// Required parameter: Example: . + /// Required parameter: Example: . + /// Returns the Models.GetWithdrawResponse response from the API call. + public Models.GetWithdrawResponse GetWithdrawById( + string recipientId, + string withdrawalId) + => CoreHelper.RunTask(GetWithdrawByIdAsync(recipientId, withdrawalId)); + + /// + /// GetWithdrawById EndPoint. + /// + /// Required parameter: Example: . + /// Required parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetWithdrawResponse response from the API call. + public async Task GetWithdrawByIdAsync( + string recipientId, + string withdrawalId, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/recipients/{recipient_id}/withdrawals/{withdrawal_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("recipient_id", recipientId)) + .Template(_template => _template.Setup("withdrawal_id", withdrawalId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Updates the default bank account from a recipient. /// @@ -218,6 +238,42 @@ public Models.GetRecipientResponse UpdateRecipientDefaultBankAccount( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetRecipientResponse response from the API call. + public Models.GetRecipientResponse UpdateRecipientMetadata( + string recipientId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateRecipientMetadataAsync(recipientId, request, idempotencyKey)); + + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetRecipientResponse response from the API call. + public async Task UpdateRecipientMetadataAsync( + string recipientId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(new HttpMethod("PATCH"), "/recipients/{recipient_id}/metadata") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("recipient_id", recipientId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Gets a paginated list of transfers for the recipient. /// @@ -331,6 +387,42 @@ public Models.GetWithdrawResponse CreateWithdraw( .Template(_template => _template.Setup("recipient_id", recipientId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// Returns the Models.GetRecipientResponse response from the API call. + public Models.GetRecipientResponse UpdateAutomaticAnticipationSettings( + string recipientId, + Models.UpdateAutomaticAnticipationSettingsRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateAutomaticAnticipationSettingsAsync(recipientId, request, idempotencyKey)); + + /// + /// Updates recipient metadata. + /// + /// Required parameter: Recipient id. + /// Required parameter: Metadata. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetRecipientResponse response from the API call. + public async Task UpdateAutomaticAnticipationSettingsAsync( + string recipientId, + Models.UpdateAutomaticAnticipationSettingsRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(new HttpMethod("PATCH"), "/recipients/{recipient_id}/automatic-anticipation-settings") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("recipient_id", recipientId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Gets an anticipation. /// @@ -399,65 +491,172 @@ public Models.GetRecipientResponse UpdateRecipientTransferSettings( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Retrieves recipient information. + /// Retrieves a paginated list of anticipations from a recipient. /// - /// Required parameter: Recipient code. - /// Returns the Models.GetRecipientResponse response from the API call. - public Models.GetRecipientResponse GetRecipientByCode( - string code) - => CoreHelper.RunTask(GetRecipientByCodeAsync(code)); + /// Required parameter: Recipient id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for anticipation status. + /// Optional parameter: Filter for anticipation timeframe. + /// Optional parameter: Filter for start range for anticipation payment date. + /// Optional parameter: Filter for end range for anticipation payment date. + /// Optional parameter: Filter for start range for anticipation creation date. + /// Optional parameter: Filter for end range for anticipation creation date. + /// Returns the Models.ListAnticipationResponse response from the API call. + public Models.ListAnticipationResponse GetAnticipations( + string recipientId, + int? page = null, + int? size = null, + string status = null, + string timeframe = null, + DateTime? paymentDateSince = null, + DateTime? paymentDateUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) + => CoreHelper.RunTask(GetAnticipationsAsync(recipientId, page, size, status, timeframe, paymentDateSince, paymentDateUntil, createdSince, createdUntil)); /// - /// Retrieves recipient information. + /// Retrieves a paginated list of anticipations from a recipient. /// - /// Required parameter: Recipient code. + /// Required parameter: Recipient id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for anticipation status. + /// Optional parameter: Filter for anticipation timeframe. + /// Optional parameter: Filter for start range for anticipation payment date. + /// Optional parameter: Filter for end range for anticipation payment date. + /// Optional parameter: Filter for start range for anticipation creation date. + /// Optional parameter: Filter for end range for anticipation creation date. /// cancellationToken. - /// Returns the Models.GetRecipientResponse response from the API call. - public async Task GetRecipientByCodeAsync( - string code, + /// Returns the Models.ListAnticipationResponse response from the API call. + public async Task GetAnticipationsAsync( + string recipientId, + int? page = null, + int? size = null, + string status = null, + string timeframe = null, + DateTime? paymentDateSince = null, + DateTime? paymentDateUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{code}") + .Setup(HttpMethod.Get, "/recipients/{recipient_id}/anticipations") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("code", code)))) + .Template(_template => _template.Setup("recipient_id", recipientId)) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("status", status)) + .Query(_query => _query.Setup("timeframe", timeframe)) + .Query(_query => _query.Setup("payment_date_since", paymentDateSince.HasValue ? paymentDateSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("payment_date_until", paymentDateUntil.HasValue ? paymentDateUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates recipient metadata. + /// Retrieves recipient information. /// - /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . + /// Required parameter: Recipiend id. /// Returns the Models.GetRecipientResponse response from the API call. - public Models.GetRecipientResponse UpdateAutomaticAnticipationSettings( - string recipientId, - Models.UpdateAutomaticAnticipationSettingsRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateAutomaticAnticipationSettingsAsync(recipientId, request, idempotencyKey)); + public Models.GetRecipientResponse GetRecipient( + string recipientId) + => CoreHelper.RunTask(GetRecipientAsync(recipientId)); /// - /// Updates recipient metadata. + /// Retrieves recipient information. /// - /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . + /// Required parameter: Recipiend id. /// cancellationToken. /// Returns the Models.GetRecipientResponse response from the API call. - public async Task UpdateAutomaticAnticipationSettingsAsync( + public async Task GetRecipientAsync( string recipientId, - Models.UpdateAutomaticAnticipationSettingsRequest request, - string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/recipients/{recipient_id}/automatic-anticipation-settings") + .Setup(HttpMethod.Get, "/recipients/{recipient_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("recipient_id", recipientId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Get balance information for a recipient. + /// + /// Required parameter: Recipient id. + /// Returns the Models.GetBalanceResponse response from the API call. + public Models.GetBalanceResponse GetBalance( + string recipientId) + => CoreHelper.RunTask(GetBalanceAsync(recipientId)); + + /// + /// Get balance information for a recipient. + /// + /// Required parameter: Recipient id. + /// cancellationToken. + /// Returns the Models.GetBalanceResponse response from the API call. + public async Task GetBalanceAsync( + string recipientId, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/recipients/{recipient_id}/balance") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("recipient_id", recipientId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Gets a paginated list of transfers for the recipient. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.ListWithdrawals response from the API call. + public Models.ListWithdrawals GetWithdrawals( + string recipientId, + int? page = null, + int? size = null, + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) + => CoreHelper.RunTask(GetWithdrawalsAsync(recipientId, page, size, status, createdSince, createdUntil)); + + /// + /// Gets a paginated list of transfers for the recipient. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.ListWithdrawals response from the API call. + public async Task GetWithdrawalsAsync( + string recipientId, + int? page = null, + int? size = null, + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/recipients/{recipient_id}/withdrawals") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("recipient_id", recipientId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("status", status)) + .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// @@ -528,247 +727,74 @@ public Models.GetRecipientResponse CreateRecipient( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetDefaultRecipient EndPoint. + /// Retrieves recipient information. /// + /// Required parameter: Recipient code. /// Returns the Models.GetRecipientResponse response from the API call. - public Models.GetRecipientResponse GetDefaultRecipient() - => CoreHelper.RunTask(GetDefaultRecipientAsync()); + public Models.GetRecipientResponse GetRecipientByCode( + string code) + => CoreHelper.RunTask(GetRecipientByCodeAsync(code)); /// - /// GetDefaultRecipient EndPoint. + /// Retrieves recipient information. /// + /// Required parameter: Recipient code. /// cancellationToken. /// Returns the Models.GetRecipientResponse response from the API call. - public async Task GetDefaultRecipientAsync(CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/default") - .WithAuth("httpBasic")) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Creates an anticipation. - /// - /// Required parameter: Recipient id. - /// Required parameter: Anticipation data. - /// Optional parameter: Example: . - /// Returns the Models.GetAnticipationResponse response from the API call. - public Models.GetAnticipationResponse CreateAnticipation( - string recipientId, - Models.CreateAnticipationRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(CreateAnticipationAsync(recipientId, request, idempotencyKey)); - - /// - /// Creates an anticipation. - /// - /// Required parameter: Recipient id. - /// Required parameter: Anticipation data. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetAnticipationResponse response from the API call. - public async Task CreateAnticipationAsync( - string recipientId, - Models.CreateAnticipationRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/recipients/{recipient_id}/anticipations") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("recipient_id", recipientId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Gets the anticipation limits for a recipient. - /// - /// Required parameter: Recipient id. - /// Required parameter: Timeframe. - /// Required parameter: Anticipation payment date. - /// Returns the Models.GetAnticipationLimitResponse response from the API call. - public Models.GetAnticipationLimitResponse GetAnticipationLimits( - string recipientId, - string timeframe, - DateTime paymentDate) - => CoreHelper.RunTask(GetAnticipationLimitsAsync(recipientId, timeframe, paymentDate)); - - /// - /// Gets the anticipation limits for a recipient. - /// - /// Required parameter: Recipient id. - /// Required parameter: Timeframe. - /// Required parameter: Anticipation payment date. - /// cancellationToken. - /// Returns the Models.GetAnticipationLimitResponse response from the API call. - public async Task GetAnticipationLimitsAsync( - string recipientId, - string timeframe, - DateTime paymentDate, + public async Task GetRecipientByCodeAsync( + string code, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{recipient_id}/anticipation_limits") + .Setup(HttpMethod.Get, "/recipients/{code}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("recipient_id", recipientId)) - .Query(_query => _query.Setup("timeframe", timeframe)) - .Query(_query => _query.Setup("payment_date", paymentDate.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"))))) + .Template(_template => _template.Setup("code", code)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates recipient metadata. + /// GetDefaultRecipient EndPoint. /// - /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . /// Returns the Models.GetRecipientResponse response from the API call. - public Models.GetRecipientResponse UpdateRecipientMetadata( - string recipientId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateRecipientMetadataAsync(recipientId, request, idempotencyKey)); + public Models.GetRecipientResponse GetDefaultRecipient() + => CoreHelper.RunTask(GetDefaultRecipientAsync()); /// - /// Updates recipient metadata. + /// GetDefaultRecipient EndPoint. /// - /// Required parameter: Recipient id. - /// Required parameter: Metadata. - /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetRecipientResponse response from the API call. - public async Task UpdateRecipientMetadataAsync( - string recipientId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null, - CancellationToken cancellationToken = default) + public async Task GetDefaultRecipientAsync(CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/recipients/{recipient_id}/metadata") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("recipient_id", recipientId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Retrieves a paginated list of anticipations from a recipient. - /// - /// Required parameter: Recipient id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for anticipation status. - /// Optional parameter: Filter for anticipation timeframe. - /// Optional parameter: Filter for start range for anticipation payment date. - /// Optional parameter: Filter for end range for anticipation payment date. - /// Optional parameter: Filter for start range for anticipation creation date. - /// Optional parameter: Filter for end range for anticipation creation date. - /// Returns the Models.ListAnticipationResponse response from the API call. - public Models.ListAnticipationResponse GetAnticipations( - string recipientId, - int? page = null, - int? size = null, - string status = null, - string timeframe = null, - DateTime? paymentDateSince = null, - DateTime? paymentDateUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) - => CoreHelper.RunTask(GetAnticipationsAsync(recipientId, page, size, status, timeframe, paymentDateSince, paymentDateUntil, createdSince, createdUntil)); - - /// - /// Retrieves a paginated list of anticipations from a recipient. - /// - /// Required parameter: Recipient id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for anticipation status. - /// Optional parameter: Filter for anticipation timeframe. - /// Optional parameter: Filter for start range for anticipation payment date. - /// Optional parameter: Filter for end range for anticipation payment date. - /// Optional parameter: Filter for start range for anticipation creation date. - /// Optional parameter: Filter for end range for anticipation creation date. - /// cancellationToken. - /// Returns the Models.ListAnticipationResponse response from the API call. - public async Task GetAnticipationsAsync( - string recipientId, - int? page = null, - int? size = null, - string status = null, - string timeframe = null, - DateTime? paymentDateSince = null, - DateTime? paymentDateUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{recipient_id}/anticipations") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("recipient_id", recipientId)) - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("timeframe", timeframe)) - .Query(_query => _query.Setup("payment_date_since", paymentDateSince.HasValue ? paymentDateSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("payment_date_until", paymentDateUntil.HasValue ? paymentDateUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) + .Setup(HttpMethod.Get, "/recipients/default") + .WithAuth("httpBasic")) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Gets a paginated list of transfers for the recipient. + /// Create a KYC link. /// /// Required parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Returns the Models.ListWithdrawals response from the API call. - public Models.ListWithdrawals GetWithdrawals( - string recipientId, - int? page = null, - int? size = null, - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) - => CoreHelper.RunTask(GetWithdrawalsAsync(recipientId, page, size, status, createdSince, createdUntil)); + /// Returns the Models.CreateKYCLinkResponse response from the API call. + public Models.CreateKYCLinkResponse CreateKYCLink( + string recipientId) + => CoreHelper.RunTask(CreateKYCLinkAsync(recipientId)); /// - /// Gets a paginated list of transfers for the recipient. + /// Create a KYC link. /// /// Required parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListWithdrawals response from the API call. - public async Task GetWithdrawalsAsync( + /// Returns the Models.CreateKYCLinkResponse response from the API call. + public async Task CreateKYCLinkAsync( string recipientId, - int? page = null, - int? size = null, - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/recipients/{recipient_id}/withdrawals") + .Setup(HttpMethod.Post, "/recipients/{recipient_id}/kyc_link") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("recipient_id", recipientId)) - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) + .Template(_template => _template.Setup("recipient_id", recipientId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/SubscriptionsController.cs b/PagarmeApiSDK.Standard/Controllers/SubscriptionsController.cs index 136893e..112e184 100644 --- a/PagarmeApiSDK.Standard/Controllers/SubscriptionsController.cs +++ b/PagarmeApiSDK.Standard/Controllers/SubscriptionsController.cs @@ -32,6 +32,37 @@ internal class SubscriptionsController : BaseController, ISubscriptionsControlle /// internal SubscriptionsController(GlobalConfiguration globalConfiguration) : base(globalConfiguration) { } + /// + /// RenewSubscription EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.GetPeriodResponse response from the API call. + public Models.GetPeriodResponse RenewSubscription( + string subscriptionId, + string idempotencyKey = null) + => CoreHelper.RunTask(RenewSubscriptionAsync(subscriptionId, idempotencyKey)); + + /// + /// RenewSubscription EndPoint. + /// + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetPeriodResponse response from the API call. + public async Task RenewSubscriptionAsync( + string subscriptionId, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/cycles") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Updates the credit card from a subscription. /// @@ -68,6 +99,47 @@ public Models.GetSubscriptionResponse UpdateSubscriptionCard( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Deletes a usage. + /// + /// Required parameter: The subscription id. + /// Required parameter: The subscription item id. + /// Required parameter: The usage id. + /// Optional parameter: Example: . + /// Returns the Models.GetUsageResponse response from the API call. + public Models.GetUsageResponse DeleteUsage( + string subscriptionId, + string itemId, + string usageId, + string idempotencyKey = null) + => CoreHelper.RunTask(DeleteUsageAsync(subscriptionId, itemId, usageId, idempotencyKey)); + + /// + /// Deletes a usage. + /// + /// Required parameter: The subscription id. + /// Required parameter: The subscription item id. + /// Required parameter: The usage id. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetUsageResponse response from the API call. + public async Task DeleteUsageAsync( + string subscriptionId, + string itemId, + string usageId, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Delete, "/subscriptions/{subscription_id}/items/{item_id}/usages/{usage_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Template(_template => _template.Setup("item_id", itemId)) + .Template(_template => _template.Setup("usage_id", usageId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Creates a discount. /// @@ -105,70 +177,69 @@ public Models.GetDiscountResponse CreateDiscount( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the billing date from a subscription. + /// Create Usage. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription billing date. + /// Required parameter: Subscription id. + /// Required parameter: Item id. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionBillingDate( + /// Returns the Models.GetUsageResponse response from the API call. + public Models.GetUsageResponse CreateAnUsage( string subscriptionId, - Models.UpdateSubscriptionBillingDateRequest request, + string itemId, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionBillingDateAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(CreateAnUsageAsync(subscriptionId, itemId, idempotencyKey)); /// - /// Updates the billing date from a subscription. + /// Create Usage. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription billing date. + /// Required parameter: Subscription id. + /// Required parameter: Item id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionBillingDateAsync( + /// Returns the Models.GetUsageResponse response from the API call. + public async Task CreateAnUsageAsync( string subscriptionId, - Models.UpdateSubscriptionBillingDateRequest request, + string itemId, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/billing-date") + .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/items/{item_id}/usages") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Template(_template => _template.Setup("item_id", itemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the start at date from a subscription. + /// UpdateCurrentCycleStatus EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription start date. + /// Required parameter: Subscription Id. + /// Required parameter: Request for updating the end date of the subscription current status. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionStartAt( + public void UpdateCurrentCycleStatus( string subscriptionId, - Models.UpdateSubscriptionStartAtRequest request, + Models.UpdateCurrentCycleStatusRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionStartAtAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunVoidTask(UpdateCurrentCycleStatusAsync(subscriptionId, request, idempotencyKey)); /// - /// Updates the start at date from a subscription. + /// UpdateCurrentCycleStatus EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscription start date. + /// Required parameter: Subscription Id. + /// Required parameter: Request for updating the end date of the subscription current status. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionStartAtAsync( + /// Returns the void response from the API call. + public async Task UpdateCurrentCycleStatusAsync( string subscriptionId, - Models.UpdateSubscriptionStartAtRequest request, + Models.UpdateCurrentCycleStatusRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/start-at") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/cycle-status") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -177,121 +248,136 @@ public Models.GetSubscriptionResponse UpdateSubscriptionStartAt( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Gets a subscription. + /// Deletes a discount. /// /// Required parameter: Subscription id. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse GetSubscription( - string subscriptionId) - => CoreHelper.RunTask(GetSubscriptionAsync(subscriptionId)); + /// Required parameter: Discount Id. + /// Optional parameter: Example: . + /// Returns the Models.GetDiscountResponse response from the API call. + public Models.GetDiscountResponse DeleteDiscount( + string subscriptionId, + string discountId, + string idempotencyKey = null) + => CoreHelper.RunTask(DeleteDiscountAsync(subscriptionId, discountId, idempotencyKey)); /// - /// Gets a subscription. + /// Deletes a discount. /// /// Required parameter: Subscription id. + /// Required parameter: Discount Id. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task GetSubscriptionAsync( + /// Returns the Models.GetDiscountResponse response from the API call. + public async Task DeleteDiscountAsync( string subscriptionId, + string discountId, + string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}") + .Setup(HttpMethod.Delete, "/subscriptions/{subscription_id}/discounts/{discount_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("subscription_id", subscriptionId)))) + .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Template(_template => _template.Setup("discount_id", discountId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Lists all usages from a subscription item. + /// Get Subscription Items. /// /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. /// Optional parameter: Page number. /// Optional parameter: Page size. + /// Optional parameter: The item name. /// Optional parameter: Identification code in the client system. - /// Optional parameter: Identification group in the client system. - /// Optional parameter: Example: . - /// Optional parameter: Example: . - /// Returns the Models.ListUsagesResponse response from the API call. - public Models.ListUsagesResponse GetUsages( + /// Optional parameter: The item statis. + /// Optional parameter: The item description. + /// Optional parameter: Filter for item's creation date start range. + /// Optional parameter: Filter for item's creation date end range. + /// Returns the Models.ListSubscriptionItemsResponse response from the API call. + public Models.ListSubscriptionItemsResponse GetSubscriptionItems( string subscriptionId, - string itemId, int? page = null, int? size = null, + string name = null, string code = null, - string mGroup = null, - DateTime? usedSince = null, - DateTime? usedUntil = null) - => CoreHelper.RunTask(GetUsagesAsync(subscriptionId, itemId, page, size, code, mGroup, usedSince, usedUntil)); + string status = null, + string description = null, + string createdSince = null, + string createdUntil = null) + => CoreHelper.RunTask(GetSubscriptionItemsAsync(subscriptionId, page, size, name, code, status, description, createdSince, createdUntil)); /// - /// Lists all usages from a subscription item. + /// Get Subscription Items. /// /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. /// Optional parameter: Page number. /// Optional parameter: Page size. + /// Optional parameter: The item name. /// Optional parameter: Identification code in the client system. - /// Optional parameter: Identification group in the client system. - /// Optional parameter: Example: . - /// Optional parameter: Example: . + /// Optional parameter: The item statis. + /// Optional parameter: The item description. + /// Optional parameter: Filter for item's creation date start range. + /// Optional parameter: Filter for item's creation date end range. /// cancellationToken. - /// Returns the Models.ListUsagesResponse response from the API call. - public async Task GetUsagesAsync( + /// Returns the Models.ListSubscriptionItemsResponse response from the API call. + public async Task GetSubscriptionItemsAsync( string subscriptionId, - string itemId, int? page = null, int? size = null, + string name = null, string code = null, - string mGroup = null, - DateTime? usedSince = null, - DateTime? usedUntil = null, + string status = null, + string description = null, + string createdSince = null, + string createdUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/items/{item_id}/usages") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/items") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("item_id", itemId)) .Query(_query => _query.Setup("page", page)) .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("name", name)) .Query(_query => _query.Setup("code", code)) - .Query(_query => _query.Setup("group", mGroup)) - .Query(_query => _query.Setup("used_since", usedSince.HasValue ? usedSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("used_until", usedUntil.HasValue ? usedUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) + .Query(_query => _query.Setup("status", status)) + .Query(_query => _query.Setup("description", description)) + .Query(_query => _query.Setup("created_since", createdSince)) + .Query(_query => _query.Setup("created_until", createdUntil)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// UpdateLatestPeriodEndAt EndPoint. + /// Updates the payment method from a subscription. /// - /// Required parameter: Example: . - /// Required parameter: Request for updating the end date of the current signature cycle. + /// Required parameter: Subscription id. + /// Required parameter: Request for updating the paymentmethod from a subscription. /// Optional parameter: Example: . /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateLatestPeriodEndAt( + public Models.GetSubscriptionResponse UpdateSubscriptionPaymentMethod( string subscriptionId, - Models.UpdateCurrentCycleEndDateRequest request, + Models.UpdateSubscriptionPaymentMethodRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateLatestPeriodEndAtAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateSubscriptionPaymentMethodAsync(subscriptionId, request, idempotencyKey)); /// - /// UpdateLatestPeriodEndAt EndPoint. + /// Updates the payment method from a subscription. /// - /// Required parameter: Example: . - /// Required parameter: Request for updating the end date of the current signature cycle. + /// Required parameter: Subscription id. + /// Required parameter: Request for updating the paymentmethod from a subscription. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateLatestPeriodEndAtAsync( + public async Task UpdateSubscriptionPaymentMethodAsync( string subscriptionId, - Models.UpdateCurrentCycleEndDateRequest request, + Models.UpdateSubscriptionPaymentMethodRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/periods/latest/end-at") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/payment-method") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -300,75 +386,115 @@ public Models.GetSubscriptionResponse UpdateLatestPeriodEndAt( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Deletes a discount. + /// Get Subscription Item. /// - /// Required parameter: Subscription id. - /// Required parameter: Discount Id. - /// Optional parameter: Example: . - /// Returns the Models.GetDiscountResponse response from the API call. - public Models.GetDiscountResponse DeleteDiscount( + /// Required parameter: Subscription Id. + /// Required parameter: Item id. + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + public Models.GetSubscriptionItemResponse GetSubscriptionItem( string subscriptionId, - string discountId, - string idempotencyKey = null) - => CoreHelper.RunTask(DeleteDiscountAsync(subscriptionId, discountId, idempotencyKey)); + string itemId) + => CoreHelper.RunTask(GetSubscriptionItemAsync(subscriptionId, itemId)); /// - /// Deletes a discount. + /// Get Subscription Item. /// - /// Required parameter: Subscription id. - /// Required parameter: Discount Id. - /// Optional parameter: Example: . + /// Required parameter: Subscription Id. + /// Required parameter: Item id. /// cancellationToken. - /// Returns the Models.GetDiscountResponse response from the API call. - public async Task DeleteDiscountAsync( + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + public async Task GetSubscriptionItemAsync( string subscriptionId, - string discountId, - string idempotencyKey = null, + string itemId, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/subscriptions/{subscription_id}/discounts/{discount_id}") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/items/{item_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("discount_id", discountId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Template(_template => _template.Setup("item_id", itemId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the payment method from a subscription. + /// Gets all subscriptions. /// - /// Required parameter: Subscription id. - /// Required parameter: Request for updating the paymentmethod from a subscription. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionPaymentMethod( - string subscriptionId, - Models.UpdateSubscriptionPaymentMethodRequest request, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionPaymentMethodAsync(subscriptionId, request, idempotencyKey)); + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for subscription's code. + /// Optional parameter: Filter for subscription's billing type. + /// Optional parameter: Filter for subscription's customer id. + /// Optional parameter: Filter for subscription's plan id. + /// Optional parameter: Filter for subscription's card id. + /// Optional parameter: Filter for subscription's status. + /// Optional parameter: Filter for subscription's next billing date start range. + /// Optional parameter: Filter for subscription's next billing date end range. + /// Optional parameter: Filter for subscription's creation date start range. + /// Optional parameter: Filter for subscriptions creation date end range. + /// Returns the Models.ListSubscriptionsResponse response from the API call. + public Models.ListSubscriptionsResponse GetSubscriptions( + int? page = null, + int? size = null, + string code = null, + string billingType = null, + string customerId = null, + string planId = null, + string cardId = null, + string status = null, + DateTime? nextBillingSince = null, + DateTime? nextBillingUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) + => CoreHelper.RunTask(GetSubscriptionsAsync(page, size, code, billingType, customerId, planId, cardId, status, nextBillingSince, nextBillingUntil, createdSince, createdUntil)); /// - /// Updates the payment method from a subscription. + /// Gets all subscriptions. /// - /// Required parameter: Subscription id. - /// Required parameter: Request for updating the paymentmethod from a subscription. - /// Optional parameter: Example: . + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Filter for subscription's code. + /// Optional parameter: Filter for subscription's billing type. + /// Optional parameter: Filter for subscription's customer id. + /// Optional parameter: Filter for subscription's plan id. + /// Optional parameter: Filter for subscription's card id. + /// Optional parameter: Filter for subscription's status. + /// Optional parameter: Filter for subscription's next billing date start range. + /// Optional parameter: Filter for subscription's next billing date end range. + /// Optional parameter: Filter for subscription's creation date start range. + /// Optional parameter: Filter for subscriptions creation date end range. /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionPaymentMethodAsync( - string subscriptionId, - Models.UpdateSubscriptionPaymentMethodRequest request, - string idempotencyKey = null, + /// Returns the Models.ListSubscriptionsResponse response from the API call. + public async Task GetSubscriptionsAsync( + int? page = null, + int? size = null, + string code = null, + string billingType = null, + string customerId = null, + string planId = null, + string cardId = null, + string status = null, + DateTime? nextBillingSince = null, + DateTime? nextBillingUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/payment-method") + .Setup(HttpMethod.Get, "/subscriptions") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("code", code)) + .Query(_query => _query.Setup("billing_type", billingType)) + .Query(_query => _query.Setup("customer_id", customerId)) + .Query(_query => _query.Setup("plan_id", planId)) + .Query(_query => _query.Setup("card_id", cardId)) + .Query(_query => _query.Setup("status", status)) + .Query(_query => _query.Setup("next_billing_since", nextBillingSince.HasValue ? nextBillingSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("next_billing_until", nextBillingUntil.HasValue ? nextBillingUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// @@ -408,65 +534,34 @@ public Models.GetSubscriptionResponse CancelSubscription( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a new subscription. - /// - /// Required parameter: Request for creating a subscription. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse CreateSubscription( - Models.CreateSubscriptionRequest body, - string idempotencyKey = null) - => CoreHelper.RunTask(CreateSubscriptionAsync(body, idempotencyKey)); - - /// - /// Creates a new subscription. - /// - /// Required parameter: Request for creating a subscription. - /// Optional parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task CreateSubscriptionAsync( - Models.CreateSubscriptionRequest body, - string idempotencyKey = null, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/subscriptions") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(body)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// UpdateSubscriptionAffiliationId EndPoint. + /// Creates a increment. /// - /// Required parameter: Example: . - /// Required parameter: Request for updating a subscription affiliation id. + /// Required parameter: Subscription id. + /// Required parameter: Request for creating a increment. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionAffiliationId( + /// Returns the Models.GetIncrementResponse response from the API call. + public Models.GetIncrementResponse CreateIncrement( string subscriptionId, - Models.UpdateSubscriptionAffiliationIdRequest request, + Models.CreateIncrementRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionAffiliationIdAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(CreateIncrementAsync(subscriptionId, request, idempotencyKey)); /// - /// UpdateSubscriptionAffiliationId EndPoint. + /// Creates a increment. /// - /// Required parameter: Example: . - /// Required parameter: Request for updating a subscription affiliation id. + /// Required parameter: Subscription id. + /// Required parameter: Request for creating a increment. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionAffiliationIdAsync( + /// Returns the Models.GetIncrementResponse response from the API call. + public async Task CreateIncrementAsync( string subscriptionId, - Models.UpdateSubscriptionAffiliationIdRequest request, + Models.CreateIncrementRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/gateway-affiliation-id") + .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/increments") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -475,239 +570,204 @@ public Models.GetSubscriptionResponse UpdateSubscriptionAffiliationId( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Atualização do valor mínimo da assinatura. + /// Creates a usage. /// /// Required parameter: Subscription Id. - /// Required parameter: Request da requisição com o valor mínimo que será configurado. + /// Required parameter: Item id. + /// Required parameter: Request for creating a usage. /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionMiniumPrice( + /// Returns the Models.GetUsageResponse response from the API call. + public Models.GetUsageResponse CreateUsage( string subscriptionId, - Models.UpdateSubscriptionMinimumPriceRequest request, + string itemId, + Models.CreateUsageRequest body, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionMiniumPriceAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(CreateUsageAsync(subscriptionId, itemId, body, idempotencyKey)); /// - /// Atualização do valor mínimo da assinatura. + /// Creates a usage. /// /// Required parameter: Subscription Id. - /// Required parameter: Request da requisição com o valor mínimo que será configurado. + /// Required parameter: Item id. + /// Required parameter: Request for creating a usage. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionMiniumPriceAsync( + /// Returns the Models.GetUsageResponse response from the API call. + public async Task CreateUsageAsync( string subscriptionId, - Models.UpdateSubscriptionMinimumPriceRequest request, + string itemId, + Models.CreateUsageRequest body, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/minimum_price") + .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/items/{item_id}/usages") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Body(_bodyParameter => _bodyParameter.Setup(body)) .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Template(_template => _template.Setup("item_id", itemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetSubscriptionCycleById EndPoint. + /// GetDiscountById EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Example: . - /// Returns the Models.GetPeriodResponse response from the API call. - public Models.GetPeriodResponse GetSubscriptionCycleById( + /// Required parameter: Example: . + /// Returns the Models.GetDiscountResponse response from the API call. + public Models.GetDiscountResponse GetDiscountById( string subscriptionId, - string cycleId) - => CoreHelper.RunTask(GetSubscriptionCycleByIdAsync(subscriptionId, cycleId)); + string discountId) + => CoreHelper.RunTask(GetDiscountByIdAsync(subscriptionId, discountId)); /// - /// GetSubscriptionCycleById EndPoint. + /// GetDiscountById EndPoint. /// /// Required parameter: The subscription id. - /// Required parameter: Example: . + /// Required parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPeriodResponse response from the API call. - public async Task GetSubscriptionCycleByIdAsync( + /// Returns the Models.GetDiscountResponse response from the API call. + public async Task GetDiscountByIdAsync( string subscriptionId, - string cycleId, + string discountId, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/cycles/{cycleId}") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/discounts/{discountId}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("cycleId", cycleId)))) + .Template(_template => _template.Setup("discountId", discountId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetUsageReport EndPoint. + /// Creates a new subscription. /// - /// Required parameter: The subscription Id. - /// Required parameter: The period Id. - /// Returns the Models.GetUsageReportResponse response from the API call. - public Models.GetUsageReportResponse GetUsageReport( - string subscriptionId, - string periodId) - => CoreHelper.RunTask(GetUsageReportAsync(subscriptionId, periodId)); - - /// - /// GetUsageReport EndPoint. - /// - /// Required parameter: The subscription Id. - /// Required parameter: The period Id. - /// cancellationToken. - /// Returns the Models.GetUsageReportResponse response from the API call. - public async Task GetUsageReportAsync( - string subscriptionId, - string periodId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/periods/{period_id}/usages/report") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("period_id", periodId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// RenewSubscription EndPoint. - /// - /// Required parameter: Example: . + /// Required parameter: Request for creating a subscription. /// Optional parameter: Example: . - /// Returns the Models.GetPeriodResponse response from the API call. - public Models.GetPeriodResponse RenewSubscription( - string subscriptionId, + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse CreateSubscription( + Models.CreateSubscriptionRequest body, string idempotencyKey = null) - => CoreHelper.RunTask(RenewSubscriptionAsync(subscriptionId, idempotencyKey)); + => CoreHelper.RunTask(CreateSubscriptionAsync(body, idempotencyKey)); /// - /// RenewSubscription EndPoint. + /// Creates a new subscription. /// - /// Required parameter: Example: . + /// Required parameter: Request for creating a subscription. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetPeriodResponse response from the API call. - public async Task RenewSubscriptionAsync( - string subscriptionId, + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task CreateSubscriptionAsync( + Models.CreateSubscriptionRequest body, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/cycles") + .Setup(HttpMethod.Post, "/subscriptions") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Body(_bodyParameter => _bodyParameter.Setup(body)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Deletes a usage. + /// GetIncrementById EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. - /// Required parameter: The usage id. - /// Optional parameter: Example: . - /// Returns the Models.GetUsageResponse response from the API call. - public Models.GetUsageResponse DeleteUsage( + /// Required parameter: The subscription Id. + /// Required parameter: The increment Id. + /// Returns the Models.GetIncrementResponse response from the API call. + public Models.GetIncrementResponse GetIncrementById( string subscriptionId, - string itemId, - string usageId, - string idempotencyKey = null) - => CoreHelper.RunTask(DeleteUsageAsync(subscriptionId, itemId, usageId, idempotencyKey)); + string incrementId) + => CoreHelper.RunTask(GetIncrementByIdAsync(subscriptionId, incrementId)); /// - /// Deletes a usage. + /// GetIncrementById EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: The subscription item id. - /// Required parameter: The usage id. - /// Optional parameter: Example: . + /// Required parameter: The subscription Id. + /// Required parameter: The increment Id. /// cancellationToken. - /// Returns the Models.GetUsageResponse response from the API call. - public async Task DeleteUsageAsync( + /// Returns the Models.GetIncrementResponse response from the API call. + public async Task GetIncrementByIdAsync( string subscriptionId, - string itemId, - string usageId, - string idempotencyKey = null, + string incrementId, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/subscriptions/{subscription_id}/items/{item_id}/usages/{usage_id}") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/increments/{increment_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("item_id", itemId)) - .Template(_template => _template.Setup("usage_id", usageId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Template(_template => _template.Setup("increment_id", incrementId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Create Usage. + /// UpdateSubscriptionAffiliationId EndPoint. /// - /// Required parameter: Subscription id. - /// Required parameter: Item id. + /// Required parameter: Example: . + /// Required parameter: Request for updating a subscription affiliation id. /// Optional parameter: Example: . - /// Returns the Models.GetUsageResponse response from the API call. - public Models.GetUsageResponse CreateAnUsage( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse UpdateSubscriptionAffiliationId( string subscriptionId, - string itemId, + Models.UpdateSubscriptionAffiliationIdRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(CreateAnUsageAsync(subscriptionId, itemId, idempotencyKey)); + => CoreHelper.RunTask(UpdateSubscriptionAffiliationIdAsync(subscriptionId, request, idempotencyKey)); /// - /// Create Usage. + /// UpdateSubscriptionAffiliationId EndPoint. /// - /// Required parameter: Subscription id. - /// Required parameter: Item id. + /// Required parameter: Example: . + /// Required parameter: Request for updating a subscription affiliation id. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetUsageResponse response from the API call. - public async Task CreateAnUsageAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task UpdateSubscriptionAffiliationIdAsync( string subscriptionId, - string itemId, + Models.UpdateSubscriptionAffiliationIdRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/items/{item_id}/usages") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/gateway-affiliation-id") .WithAuth("httpBasic") .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("item_id", itemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// UpdateCurrentCycleStatus EndPoint. + /// Updates the metadata from a subscription. /// - /// Required parameter: Subscription Id. - /// Required parameter: Request for updating the end date of the subscription current status. + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscrption metadata. /// Optional parameter: Example: . - public void UpdateCurrentCycleStatus( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse UpdateSubscriptionMetadata( string subscriptionId, - Models.UpdateCurrentCycleStatusRequest request, + Models.UpdateMetadataRequest request, string idempotencyKey = null) - => CoreHelper.RunVoidTask(UpdateCurrentCycleStatusAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateSubscriptionMetadataAsync(subscriptionId, request, idempotencyKey)); /// - /// UpdateCurrentCycleStatus EndPoint. + /// Updates the metadata from a subscription. /// - /// Required parameter: Subscription Id. - /// Required parameter: Request for updating the end date of the subscription current status. + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscrption metadata. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the void response from the API call. - public async Task UpdateCurrentCycleStatusAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task UpdateSubscriptionMetadataAsync( string subscriptionId, - Models.UpdateCurrentCycleStatusRequest request, + Models.UpdateMetadataRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/cycle-status") + .Setup(new HttpMethod("PATCH"), "/Subscriptions/{subscription_id}/metadata") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -715,68 +775,6 @@ public async Task UpdateCurrentCycleStatusAsync( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// - /// Get Subscription Item. - /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public Models.GetSubscriptionItemResponse GetSubscriptionItem( - string subscriptionId, - string itemId) - => CoreHelper.RunTask(GetSubscriptionItemAsync(subscriptionId, itemId)); - - /// - /// Get Subscription Item. - /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// cancellationToken. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public async Task GetSubscriptionItemAsync( - string subscriptionId, - string itemId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/items/{item_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("item_id", itemId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// GetIncrementById EndPoint. - /// - /// Required parameter: The subscription Id. - /// Required parameter: The increment Id. - /// Returns the Models.GetIncrementResponse response from the API call. - public Models.GetIncrementResponse GetIncrementById( - string subscriptionId, - string incrementId) - => CoreHelper.RunTask(GetIncrementByIdAsync(subscriptionId, incrementId)); - - /// - /// GetIncrementById EndPoint. - /// - /// Required parameter: The subscription Id. - /// Required parameter: The increment Id. - /// cancellationToken. - /// Returns the Models.GetIncrementResponse response from the API call. - public async Task GetIncrementByIdAsync( - string subscriptionId, - string incrementId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/increments/{increment_id}") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("increment_id", incrementId)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// Deletes a increment. /// @@ -813,6 +811,42 @@ public Models.GetIncrementResponse DeleteIncrement( .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// GetSubscriptionCycles EndPoint. + /// + /// Required parameter: Subscription Id. + /// Required parameter: Page number. + /// Required parameter: Page size. + /// Returns the Models.ListCyclesResponse response from the API call. + public Models.ListCyclesResponse GetSubscriptionCycles( + string subscriptionId, + string page, + string size) + => CoreHelper.RunTask(GetSubscriptionCyclesAsync(subscriptionId, page, size)); + + /// + /// GetSubscriptionCycles EndPoint. + /// + /// Required parameter: Subscription Id. + /// Required parameter: Page number. + /// Required parameter: Page size. + /// cancellationToken. + /// Returns the Models.ListCyclesResponse response from the API call. + public async Task GetSubscriptionCyclesAsync( + string subscriptionId, + string page, + string size, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/cycles") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// GetDiscounts EndPoint. /// @@ -850,34 +884,34 @@ public Models.ListDiscountsResponse GetDiscounts( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the boleto due days from a subscription. + /// Updates the billing date from a subscription. /// - /// Required parameter: Subscription Id. - /// Required parameter: Example: . + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription billing date. /// Optional parameter: Example: . /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionDueDays( + public Models.GetSubscriptionResponse UpdateSubscriptionBillingDate( string subscriptionId, - Models.UpdateSubscriptionDueDaysRequest request, + Models.UpdateSubscriptionBillingDateRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionDueDaysAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateSubscriptionBillingDateAsync(subscriptionId, request, idempotencyKey)); /// - /// Updates the boleto due days from a subscription. + /// Updates the billing date from a subscription. /// - /// Required parameter: Subscription Id. - /// Required parameter: Example: . + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription billing date. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionDueDaysAsync( + public async Task UpdateSubscriptionBillingDateAsync( string subscriptionId, - Models.UpdateSubscriptionDueDaysRequest request, + Models.UpdateSubscriptionBillingDateRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/boleto-due-days") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/billing-date") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -886,248 +920,142 @@ public Models.GetSubscriptionResponse UpdateSubscriptionDueDays( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a new Subscription item. + /// Deletes a subscription item. /// /// Required parameter: Subscription id. - /// Required parameter: Request for creating a subscription item. + /// Required parameter: Subscription item id. /// Optional parameter: Example: . /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public Models.GetSubscriptionItemResponse CreateSubscriptionItem( + public Models.GetSubscriptionItemResponse DeleteSubscriptionItem( string subscriptionId, - Models.CreateSubscriptionItemRequest request, + string subscriptionItemId, string idempotencyKey = null) - => CoreHelper.RunTask(CreateSubscriptionItemAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(DeleteSubscriptionItemAsync(subscriptionId, subscriptionItemId, idempotencyKey)); /// - /// Creates a new Subscription item. + /// Deletes a subscription item. /// /// Required parameter: Subscription id. - /// Required parameter: Request for creating a subscription item. + /// Required parameter: Subscription item id. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public async Task CreateSubscriptionItemAsync( + public async Task DeleteSubscriptionItemAsync( string subscriptionId, - Models.CreateSubscriptionItemRequest request, + string subscriptionItemId, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/items") + .Setup(HttpMethod.Delete, "/subscriptions/{subscription_id}/items/{subscription_item_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Template(_template => _template.Setup("subscription_item_id", subscriptionItemId)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// UpdateSplitSubscription EndPoint. - /// - /// Required parameter: Subscription's id. - /// Required parameter: Example: . - /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSplitSubscription( - string id, - Models.UpdateSubscriptionSplitRequest request) - => CoreHelper.RunTask(UpdateSplitSubscriptionAsync(id, request)); - - /// - /// UpdateSplitSubscription EndPoint. - /// - /// Required parameter: Subscription's id. - /// Required parameter: Example: . - /// cancellationToken. - /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSplitSubscriptionAsync( - string id, - Models.UpdateSubscriptionSplitRequest request, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/subscriptions/{id}/split") - .WithAuth("httpBasic") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(request)) - .Template(_template => _template.Setup("id", id)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Get Subscription Items. + /// GetIncrements EndPoint. /// /// Required parameter: The subscription id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Optional parameter: The item name. - /// Optional parameter: Identification code in the client system. - /// Optional parameter: The item statis. - /// Optional parameter: The item description. - /// Optional parameter: Filter for item's creation date start range. - /// Optional parameter: Filter for item's creation date end range. - /// Returns the Models.ListSubscriptionItemsResponse response from the API call. - public Models.ListSubscriptionItemsResponse GetSubscriptionItems( + /// Returns the Models.ListIncrementsResponse response from the API call. + public Models.ListIncrementsResponse GetIncrements( string subscriptionId, int? page = null, - int? size = null, - string name = null, - string code = null, - string status = null, - string description = null, - string createdSince = null, - string createdUntil = null) - => CoreHelper.RunTask(GetSubscriptionItemsAsync(subscriptionId, page, size, name, code, status, description, createdSince, createdUntil)); + int? size = null) + => CoreHelper.RunTask(GetIncrementsAsync(subscriptionId, page, size)); /// - /// Get Subscription Items. + /// GetIncrements EndPoint. /// /// Required parameter: The subscription id. /// Optional parameter: Page number. /// Optional parameter: Page size. - /// Optional parameter: The item name. - /// Optional parameter: Identification code in the client system. - /// Optional parameter: The item statis. - /// Optional parameter: The item description. - /// Optional parameter: Filter for item's creation date start range. - /// Optional parameter: Filter for item's creation date end range. /// cancellationToken. - /// Returns the Models.ListSubscriptionItemsResponse response from the API call. - public async Task GetSubscriptionItemsAsync( + /// Returns the Models.ListIncrementsResponse response from the API call. + public async Task GetIncrementsAsync( string subscriptionId, int? page = null, int? size = null, - string name = null, - string code = null, - string status = null, - string description = null, - string createdSince = null, - string createdUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/items") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/increments/") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)) - .Query(_query => _query.Setup("name", name)) - .Query(_query => _query.Setup("code", code)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("description", description)) - .Query(_query => _query.Setup("created_since", createdSince)) - .Query(_query => _query.Setup("created_until", createdUntil)))) + .Query(_query => _query.Setup("size", size)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Gets all subscriptions. + /// Updates the boleto due days from a subscription. /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for subscription's code. - /// Optional parameter: Filter for subscription's billing type. - /// Optional parameter: Filter for subscription's customer id. - /// Optional parameter: Filter for subscription's plan id. - /// Optional parameter: Filter for subscription's card id. - /// Optional parameter: Filter for subscription's status. - /// Optional parameter: Filter for subscription's next billing date start range. - /// Optional parameter: Filter for subscription's next billing date end range. - /// Optional parameter: Filter for subscription's creation date start range. - /// Optional parameter: Filter for subscriptions creation date end range. - /// Returns the Models.ListSubscriptionsResponse response from the API call. - public Models.ListSubscriptionsResponse GetSubscriptions( - int? page = null, - int? size = null, - string code = null, - string billingType = null, - string customerId = null, - string planId = null, - string cardId = null, - string status = null, - DateTime? nextBillingSince = null, - DateTime? nextBillingUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) - => CoreHelper.RunTask(GetSubscriptionsAsync(page, size, code, billingType, customerId, planId, cardId, status, nextBillingSince, nextBillingUntil, createdSince, createdUntil)); + /// Required parameter: Subscription Id. + /// Required parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse UpdateSubscriptionDueDays( + string subscriptionId, + Models.UpdateSubscriptionDueDaysRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateSubscriptionDueDaysAsync(subscriptionId, request, idempotencyKey)); /// - /// Gets all subscriptions. + /// Updates the boleto due days from a subscription. /// - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Optional parameter: Filter for subscription's code. - /// Optional parameter: Filter for subscription's billing type. - /// Optional parameter: Filter for subscription's customer id. - /// Optional parameter: Filter for subscription's plan id. - /// Optional parameter: Filter for subscription's card id. - /// Optional parameter: Filter for subscription's status. - /// Optional parameter: Filter for subscription's next billing date start range. - /// Optional parameter: Filter for subscription's next billing date end range. - /// Optional parameter: Filter for subscription's creation date start range. - /// Optional parameter: Filter for subscriptions creation date end range. + /// Required parameter: Subscription Id. + /// Required parameter: Example: . + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListSubscriptionsResponse response from the API call. - public async Task GetSubscriptionsAsync( - int? page = null, - int? size = null, - string code = null, - string billingType = null, - string customerId = null, - string planId = null, - string cardId = null, - string status = null, - DateTime? nextBillingSince = null, - DateTime? nextBillingUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task UpdateSubscriptionDueDaysAsync( + string subscriptionId, + Models.UpdateSubscriptionDueDaysRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/boleto-due-days") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)) - .Query(_query => _query.Setup("code", code)) - .Query(_query => _query.Setup("billing_type", billingType)) - .Query(_query => _query.Setup("customer_id", customerId)) - .Query(_query => _query.Setup("plan_id", planId)) - .Query(_query => _query.Setup("card_id", cardId)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("next_billing_since", nextBillingSince.HasValue ? nextBillingSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("next_billing_until", nextBillingUntil.HasValue ? nextBillingUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_since", createdSince.HasValue ? createdSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) - .Query(_query => _query.Setup("created_until", createdUntil.HasValue ? createdUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a increment. + /// Updates the start at date from a subscription. /// - /// Required parameter: Subscription id. - /// Required parameter: Request for creating a increment. + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription start date. /// Optional parameter: Example: . - /// Returns the Models.GetIncrementResponse response from the API call. - public Models.GetIncrementResponse CreateIncrement( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse UpdateSubscriptionStartAt( string subscriptionId, - Models.CreateIncrementRequest request, + Models.UpdateSubscriptionStartAtRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(CreateIncrementAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateSubscriptionStartAtAsync(subscriptionId, request, idempotencyKey)); /// - /// Creates a increment. + /// Updates the start at date from a subscription. /// - /// Required parameter: Subscription id. - /// Required parameter: Request for creating a increment. + /// Required parameter: The subscription id. + /// Required parameter: Request for updating the subscription start date. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetIncrementResponse response from the API call. - public async Task CreateIncrementAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task UpdateSubscriptionStartAtAsync( string subscriptionId, - Models.CreateIncrementRequest request, + Models.UpdateSubscriptionStartAtRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/increments") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/start-at") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -1136,38 +1064,38 @@ public Models.GetIncrementResponse CreateIncrement( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Creates a usage. + /// Updates a subscription item. /// /// Required parameter: Subscription Id. /// Required parameter: Item id. - /// Required parameter: Request for creating a usage. + /// Required parameter: Request for updating a subscription item. /// Optional parameter: Example: . - /// Returns the Models.GetUsageResponse response from the API call. - public Models.GetUsageResponse CreateUsage( + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + public Models.GetSubscriptionItemResponse UpdateSubscriptionItem( string subscriptionId, string itemId, - Models.CreateUsageRequest body, + Models.UpdateSubscriptionItemRequest body, string idempotencyKey = null) - => CoreHelper.RunTask(CreateUsageAsync(subscriptionId, itemId, body, idempotencyKey)); + => CoreHelper.RunTask(UpdateSubscriptionItemAsync(subscriptionId, itemId, body, idempotencyKey)); /// - /// Creates a usage. + /// Updates a subscription item. /// /// Required parameter: Subscription Id. /// Required parameter: Item id. - /// Required parameter: Request for creating a usage. + /// Required parameter: Request for updating a subscription item. /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetUsageResponse response from the API call. - public async Task CreateUsageAsync( + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + public async Task UpdateSubscriptionItemAsync( string subscriptionId, string itemId, - Models.CreateUsageRequest body, + Models.UpdateSubscriptionItemRequest body, string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/items/{item_id}/usages") + .Setup(HttpMethod.Put, "/subscriptions/{subscription_id}/items/{item_id}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(body)) @@ -1177,65 +1105,157 @@ public Models.GetUsageResponse CreateUsage( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetDiscountById EndPoint. + /// Creates a new Subscription item. + /// + /// Required parameter: Subscription id. + /// Required parameter: Request for creating a subscription item. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + public Models.GetSubscriptionItemResponse CreateSubscriptionItem( + string subscriptionId, + Models.CreateSubscriptionItemRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(CreateSubscriptionItemAsync(subscriptionId, request, idempotencyKey)); + + /// + /// Creates a new Subscription item. + /// + /// Required parameter: Subscription id. + /// Required parameter: Request for creating a subscription item. + /// Optional parameter: Example: . + /// cancellationToken. + /// Returns the Models.GetSubscriptionItemResponse response from the API call. + public async Task CreateSubscriptionItemAsync( + string subscriptionId, + Models.CreateSubscriptionItemRequest request, + string idempotencyKey = null, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/subscriptions/{subscription_id}/items") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("subscription_id", subscriptionId)) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Gets a subscription. + /// + /// Required parameter: Subscription id. + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse GetSubscription( + string subscriptionId) + => CoreHelper.RunTask(GetSubscriptionAsync(subscriptionId)); + + /// + /// Gets a subscription. + /// + /// Required parameter: Subscription id. + /// cancellationToken. + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task GetSubscriptionAsync( + string subscriptionId, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}") + .WithAuth("httpBasic") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("subscription_id", subscriptionId)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Lists all usages from a subscription item. /// /// Required parameter: The subscription id. - /// Required parameter: Example: . - /// Returns the Models.GetDiscountResponse response from the API call. - public Models.GetDiscountResponse GetDiscountById( + /// Required parameter: The subscription item id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Identification code in the client system. + /// Optional parameter: Identification group in the client system. + /// Optional parameter: Example: . + /// Optional parameter: Example: . + /// Returns the Models.ListUsagesResponse response from the API call. + public Models.ListUsagesResponse GetUsages( string subscriptionId, - string discountId) - => CoreHelper.RunTask(GetDiscountByIdAsync(subscriptionId, discountId)); + string itemId, + int? page = null, + int? size = null, + string code = null, + string mGroup = null, + DateTime? usedSince = null, + DateTime? usedUntil = null) + => CoreHelper.RunTask(GetUsagesAsync(subscriptionId, itemId, page, size, code, mGroup, usedSince, usedUntil)); /// - /// GetDiscountById EndPoint. + /// Lists all usages from a subscription item. /// /// Required parameter: The subscription id. - /// Required parameter: Example: . + /// Required parameter: The subscription item id. + /// Optional parameter: Page number. + /// Optional parameter: Page size. + /// Optional parameter: Identification code in the client system. + /// Optional parameter: Identification group in the client system. + /// Optional parameter: Example: . + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.GetDiscountResponse response from the API call. - public async Task GetDiscountByIdAsync( + /// Returns the Models.ListUsagesResponse response from the API call. + public async Task GetUsagesAsync( string subscriptionId, - string discountId, + string itemId, + int? page = null, + int? size = null, + string code = null, + string mGroup = null, + DateTime? usedSince = null, + DateTime? usedUntil = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/discounts/{discountId}") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/items/{item_id}/usages") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("discountId", discountId)))) + .Template(_template => _template.Setup("item_id", itemId)) + .Query(_query => _query.Setup("page", page)) + .Query(_query => _query.Setup("size", size)) + .Query(_query => _query.Setup("code", code)) + .Query(_query => _query.Setup("group", mGroup)) + .Query(_query => _query.Setup("used_since", usedSince.HasValue ? usedSince.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)) + .Query(_query => _query.Setup("used_until", usedUntil.HasValue ? usedUntil.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK") : null)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates the metadata from a subscription. + /// UpdateLatestPeriodEndAt EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscrption metadata. + /// Required parameter: Example: . + /// Required parameter: Request for updating the end date of the current signature cycle. /// Optional parameter: Example: . /// Returns the Models.GetSubscriptionResponse response from the API call. - public Models.GetSubscriptionResponse UpdateSubscriptionMetadata( + public Models.GetSubscriptionResponse UpdateLatestPeriodEndAt( string subscriptionId, - Models.UpdateMetadataRequest request, + Models.UpdateCurrentCycleEndDateRequest request, string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionMetadataAsync(subscriptionId, request, idempotencyKey)); + => CoreHelper.RunTask(UpdateLatestPeriodEndAtAsync(subscriptionId, request, idempotencyKey)); /// - /// Updates the metadata from a subscription. + /// UpdateLatestPeriodEndAt EndPoint. /// - /// Required parameter: The subscription id. - /// Required parameter: Request for updating the subscrption metadata. + /// Required parameter: Example: . + /// Required parameter: Request for updating the end date of the current signature cycle. /// Optional parameter: Example: . /// cancellationToken. /// Returns the Models.GetSubscriptionResponse response from the API call. - public async Task UpdateSubscriptionMetadataAsync( + public async Task UpdateLatestPeriodEndAtAsync( string subscriptionId, - Models.UpdateMetadataRequest request, + Models.UpdateCurrentCycleEndDateRequest request, string idempotencyKey = null, CancellationToken cancellationToken = default) => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(new HttpMethod("PATCH"), "/Subscriptions/{subscription_id}/metadata") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/periods/latest/end-at") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)) @@ -1244,152 +1264,132 @@ public Models.GetSubscriptionResponse UpdateSubscriptionMetadata( .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetSubscriptionCycles EndPoint. + /// Atualização do valor mínimo da assinatura. /// /// Required parameter: Subscription Id. - /// Required parameter: Page number. - /// Required parameter: Page size. - /// Returns the Models.ListCyclesResponse response from the API call. - public Models.ListCyclesResponse GetSubscriptionCycles( + /// Required parameter: Request da requisição com o valor mínimo que será configurado. + /// Optional parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse UpdateSubscriptionMiniumPrice( string subscriptionId, - string page, - string size) - => CoreHelper.RunTask(GetSubscriptionCyclesAsync(subscriptionId, page, size)); + Models.UpdateSubscriptionMinimumPriceRequest request, + string idempotencyKey = null) + => CoreHelper.RunTask(UpdateSubscriptionMiniumPriceAsync(subscriptionId, request, idempotencyKey)); /// - /// GetSubscriptionCycles EndPoint. + /// Atualização do valor mínimo da assinatura. /// /// Required parameter: Subscription Id. - /// Required parameter: Page number. - /// Required parameter: Page size. + /// Required parameter: Request da requisição com o valor mínimo que será configurado. + /// Optional parameter: Example: . /// cancellationToken. - /// Returns the Models.ListCyclesResponse response from the API call. - public async Task GetSubscriptionCyclesAsync( + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task UpdateSubscriptionMiniumPriceAsync( string subscriptionId, - string page, - string size, + Models.UpdateSubscriptionMinimumPriceRequest request, + string idempotencyKey = null, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/cycles") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{subscription_id}/minimum_price") .WithAuth("httpBasic") .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(request)) .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)))) + .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Deletes a subscription item. + /// GetSubscriptionCycleById EndPoint. /// - /// Required parameter: Subscription id. - /// Required parameter: Subscription item id. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public Models.GetSubscriptionItemResponse DeleteSubscriptionItem( + /// Required parameter: The subscription id. + /// Required parameter: Example: . + /// Returns the Models.GetPeriodResponse response from the API call. + public Models.GetPeriodResponse GetSubscriptionCycleById( string subscriptionId, - string subscriptionItemId, - string idempotencyKey = null) - => CoreHelper.RunTask(DeleteSubscriptionItemAsync(subscriptionId, subscriptionItemId, idempotencyKey)); + string cycleId) + => CoreHelper.RunTask(GetSubscriptionCycleByIdAsync(subscriptionId, cycleId)); /// - /// Deletes a subscription item. + /// GetSubscriptionCycleById EndPoint. /// - /// Required parameter: Subscription id. - /// Required parameter: Subscription item id. - /// Optional parameter: Example: . + /// Required parameter: The subscription id. + /// Required parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public async Task DeleteSubscriptionItemAsync( + /// Returns the Models.GetPeriodResponse response from the API call. + public async Task GetSubscriptionCycleByIdAsync( string subscriptionId, - string subscriptionItemId, - string idempotencyKey = null, + string cycleId, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Delete, "/subscriptions/{subscription_id}/items/{subscription_item_id}") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/cycles/{cycleId}") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("subscription_item_id", subscriptionItemId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Template(_template => _template.Setup("cycleId", cycleId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// GetIncrements EndPoint. + /// GetUsageReport EndPoint. /// - /// Required parameter: The subscription id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. - /// Returns the Models.ListIncrementsResponse response from the API call. - public Models.ListIncrementsResponse GetIncrements( + /// Required parameter: The subscription Id. + /// Required parameter: The period Id. + /// Returns the Models.GetUsageReportResponse response from the API call. + public Models.GetUsageReportResponse GetUsageReport( string subscriptionId, - int? page = null, - int? size = null) - => CoreHelper.RunTask(GetIncrementsAsync(subscriptionId, page, size)); + string periodId) + => CoreHelper.RunTask(GetUsageReportAsync(subscriptionId, periodId)); /// - /// GetIncrements EndPoint. + /// GetUsageReport EndPoint. /// - /// Required parameter: The subscription id. - /// Optional parameter: Page number. - /// Optional parameter: Page size. + /// Required parameter: The subscription Id. + /// Required parameter: The period Id. /// cancellationToken. - /// Returns the Models.ListIncrementsResponse response from the API call. - public async Task GetIncrementsAsync( + /// Returns the Models.GetUsageReportResponse response from the API call. + public async Task GetUsageReportAsync( string subscriptionId, - int? page = null, - int? size = null, + string periodId, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/increments/") + .Setup(HttpMethod.Get, "/subscriptions/{subscription_id}/periods/{period_id}/usages/report") .WithAuth("httpBasic") .Parameters(_parameters => _parameters .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Query(_query => _query.Setup("page", page)) - .Query(_query => _query.Setup("size", size)))) + .Template(_template => _template.Setup("period_id", periodId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); /// - /// Updates a subscription item. + /// UpdateSplitSubscription EndPoint. /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Required parameter: Request for updating a subscription item. - /// Optional parameter: Example: . - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public Models.GetSubscriptionItemResponse UpdateSubscriptionItem( - string subscriptionId, - string itemId, - Models.UpdateSubscriptionItemRequest body, - string idempotencyKey = null) - => CoreHelper.RunTask(UpdateSubscriptionItemAsync(subscriptionId, itemId, body, idempotencyKey)); + /// Required parameter: Subscription's id. + /// Required parameter: Example: . + /// Returns the Models.GetSubscriptionResponse response from the API call. + public Models.GetSubscriptionResponse UpdateSplitSubscription( + string id, + Models.UpdateSubscriptionSplitRequest request) + => CoreHelper.RunTask(UpdateSplitSubscriptionAsync(id, request)); /// - /// Updates a subscription item. + /// UpdateSplitSubscription EndPoint. /// - /// Required parameter: Subscription Id. - /// Required parameter: Item id. - /// Required parameter: Request for updating a subscription item. - /// Optional parameter: Example: . + /// Required parameter: Subscription's id. + /// Required parameter: Example: . /// cancellationToken. - /// Returns the Models.GetSubscriptionItemResponse response from the API call. - public async Task UpdateSubscriptionItemAsync( - string subscriptionId, - string itemId, - Models.UpdateSubscriptionItemRequest body, - string idempotencyKey = null, + /// Returns the Models.GetSubscriptionResponse response from the API call. + public async Task UpdateSplitSubscriptionAsync( + string id, + Models.UpdateSubscriptionSplitRequest request, CancellationToken cancellationToken = default) - => await CreateApiCall() + => await CreateApiCall() .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Put, "/subscriptions/{subscription_id}/items/{item_id}") + .Setup(new HttpMethod("PATCH"), "/subscriptions/{id}/split") .WithAuth("httpBasic") .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(body)) - .Template(_template => _template.Setup("subscription_id", subscriptionId)) - .Template(_template => _template.Setup("item_id", itemId)) - .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) + .Body(_bodyParameter => _bodyParameter.Setup(request)) + .Template(_template => _template.Setup("id", id)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/TokensController.cs b/PagarmeApiSDK.Standard/Controllers/TokensController.cs index 7b7dc1d..664a65b 100644 --- a/PagarmeApiSDK.Standard/Controllers/TokensController.cs +++ b/PagarmeApiSDK.Standard/Controllers/TokensController.cs @@ -32,36 +32,6 @@ internal class TokensController : BaseController, ITokensController /// internal TokensController(GlobalConfiguration globalConfiguration) : base(globalConfiguration) { } - /// - /// Gets a token from its id. - /// - /// Required parameter: Token id. - /// Required parameter: Public key. - /// Returns the Models.GetTokenResponse response from the API call. - public Models.GetTokenResponse GetToken( - string id, - string publicKey) - => CoreHelper.RunTask(GetTokenAsync(id, publicKey)); - - /// - /// Gets a token from its id. - /// - /// Required parameter: Token id. - /// Required parameter: Public key. - /// cancellationToken. - /// Returns the Models.GetTokenResponse response from the API call. - public async Task GetTokenAsync( - string id, - string publicKey, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/tokens/{id}?appId={public_key}") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("id", id)) - .Template(_template => _template.Setup("public_key", publicKey)))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// CreateToken EndPoint. /// @@ -96,5 +66,35 @@ public Models.GetTokenResponse CreateToken( .Template(_template => _template.Setup("public_key", publicKey)) .Header(_header => _header.Setup("idempotency-key", idempotencyKey)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Gets a token from its id. + /// + /// Required parameter: Token id. + /// Required parameter: Public key. + /// Returns the Models.GetTokenResponse response from the API call. + public Models.GetTokenResponse GetToken( + string id, + string publicKey) + => CoreHelper.RunTask(GetTokenAsync(id, publicKey)); + + /// + /// Gets a token from its id. + /// + /// Required parameter: Token id. + /// Required parameter: Public key. + /// cancellationToken. + /// Returns the Models.GetTokenResponse response from the API call. + public async Task GetTokenAsync( + string id, + string publicKey, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/tokens/{id}?appId={public_key}") + .Parameters(_parameters => _parameters + .Template(_template => _template.Setup("id", id)) + .Template(_template => _template.Setup("public_key", publicKey)))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Controllers/TransfersController.cs b/PagarmeApiSDK.Standard/Controllers/TransfersController.cs index 139f498..0feb8fd 100644 --- a/PagarmeApiSDK.Standard/Controllers/TransfersController.cs +++ b/PagarmeApiSDK.Standard/Controllers/TransfersController.cs @@ -58,25 +58,6 @@ public Models.GetTransfer GetTransferById( .Template(_template => _template.Setup("transfer_id", transferId)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// - /// Gets all transfers. - /// - /// Returns the Models.ListTransfers response from the API call. - public Models.ListTransfers GetTransfers() - => CoreHelper.RunTask(GetTransfersAsync()); - - /// - /// Gets all transfers. - /// - /// cancellationToken. - /// Returns the Models.ListTransfers response from the API call. - public async Task GetTransfersAsync(CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/transfers") - .WithAuth("httpBasic")) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - /// /// CreateTransfer EndPoint. /// @@ -102,5 +83,24 @@ public Models.GetTransfer CreateTransfer( .Parameters(_parameters => _parameters .Body(_bodyParameter => _bodyParameter.Setup(request)))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Gets all transfers. + /// + /// Returns the Models.ListTransfers response from the API call. + public Models.ListTransfers GetTransfers() + => CoreHelper.RunTask(GetTransfersAsync()); + + /// + /// Gets all transfers. + /// + /// cancellationToken. + /// Returns the Models.ListTransfers response from the API call. + public async Task GetTransfersAsync(CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Get, "/transfers") + .WithAuth("httpBasic")) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Models/CreateKYCLinkResponse.cs b/PagarmeApiSDK.Standard/Models/CreateKYCLinkResponse.cs new file mode 100644 index 0000000..2f6fafd --- /dev/null +++ b/PagarmeApiSDK.Standard/Models/CreateKYCLinkResponse.cs @@ -0,0 +1,213 @@ +// +// Copyright (c) APIMatic. All rights reserved. +// +namespace PagarmeApiSDK.Standard.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using JsonSubTypes; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using PagarmeApiSDK.Standard; + using PagarmeApiSDK.Standard.Utilities; + + /// + /// CreateKYCLinkResponse. + /// + public class CreateKYCLinkResponse + { + private string base64; + private string url; + private string expirationDate; + private Dictionary shouldSerialize = new Dictionary + { + { "base64", false }, + { "url", false }, + { "expiration_date", false }, + }; + + /// + /// Initializes a new instance of the class. + /// + public CreateKYCLinkResponse() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// base64. + /// url. + /// expiration_date. + public CreateKYCLinkResponse( + string base64 = null, + string url = null, + string expirationDate = null) + { + if (base64 != null) + { + this.Base64 = base64; + } + + if (url != null) + { + this.Url = url; + } + + if (expirationDate != null) + { + this.ExpirationDate = expirationDate; + } + + } + + /// + /// Base64 + /// + [JsonProperty("base64")] + public string Base64 + { + get + { + return this.base64; + } + + set + { + this.shouldSerialize["base64"] = true; + this.base64 = value; + } + } + + /// + /// URL + /// + [JsonProperty("url")] + public string Url + { + get + { + return this.url; + } + + set + { + this.shouldSerialize["url"] = true; + this.url = value; + } + } + + /// + /// Expiration Date + /// + [JsonProperty("expiration_date")] + public string ExpirationDate + { + get + { + return this.expirationDate; + } + + set + { + this.shouldSerialize["expiration_date"] = true; + this.expirationDate = value; + } + } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"CreateKYCLinkResponse : ({string.Join(", ", toStringOutput)})"; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetBase64() + { + this.shouldSerialize["base64"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetUrl() + { + this.shouldSerialize["url"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetExpirationDate() + { + this.shouldSerialize["expiration_date"] = false; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeBase64() + { + return this.shouldSerialize["base64"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeUrl() + { + return this.shouldSerialize["url"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeExpirationDate() + { + return this.shouldSerialize["expiration_date"]; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is CreateKYCLinkResponse other && ((this.Base64 == null && other.Base64 == null) || (this.Base64?.Equals(other.Base64) == true)) && + ((this.Url == null && other.Url == null) || (this.Url?.Equals(other.Url) == true)) && + ((this.ExpirationDate == null && other.ExpirationDate == null) || (this.ExpirationDate?.Equals(other.ExpirationDate) == true)); + } + + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"this.Base64 = {(this.Base64 == null ? "null" : this.Base64)}"); + toStringOutput.Add($"this.Url = {(this.Url == null ? "null" : this.Url)}"); + toStringOutput.Add($"this.ExpirationDate = {(this.ExpirationDate == null ? "null" : this.ExpirationDate)}"); + } + } +} \ No newline at end of file diff --git a/PagarmeApiSDK.Standard/Models/GetMovementObjectBaseResponse.cs b/PagarmeApiSDK.Standard/Models/GetMovementObjectBaseResponse.cs index f2d9842..d3a5476 100644 --- a/PagarmeApiSDK.Standard/Models/GetMovementObjectBaseResponse.cs +++ b/PagarmeApiSDK.Standard/Models/GetMovementObjectBaseResponse.cs @@ -21,9 +21,9 @@ namespace PagarmeApiSDK.Standard.Models /// GetMovementObjectBaseResponse. /// [JsonConverter(typeof(JsonSubtypes), "object")] + [JsonSubtypes.KnownSubType(typeof(GetMovementObjectRefundResponse), "refund")] [JsonSubtypes.KnownSubType(typeof(GetMovementObjectFeeCollectionResponse), "feeCollection")] [JsonSubtypes.KnownSubType(typeof(GetMovementObjectPayableResponse), "payable")] - [JsonSubtypes.KnownSubType(typeof(GetMovementObjectRefundResponse), "refund")] [JsonSubtypes.KnownSubType(typeof(GetMovementObjectTransferResponse), "transfer")] [JsonSubtypes.KnownSubType(typeof(GetMovementObjectSettlementResponse), "settlement")] public class GetMovementObjectBaseResponse diff --git a/PagarmeApiSDK.Standard/Models/GetTransactionResponse.cs b/PagarmeApiSDK.Standard/Models/GetTransactionResponse.cs index 0fe7fca..65fd834 100644 --- a/PagarmeApiSDK.Standard/Models/GetTransactionResponse.cs +++ b/PagarmeApiSDK.Standard/Models/GetTransactionResponse.cs @@ -21,13 +21,13 @@ namespace PagarmeApiSDK.Standard.Models /// GetTransactionResponse. /// [JsonConverter(typeof(JsonSubtypes), "transaction_type")] + [JsonSubtypes.KnownSubType(typeof(GetBankTransferTransactionResponse), "bank_transfer")] [JsonSubtypes.KnownSubType(typeof(GetSafetyPayTransactionResponse), "safetypay")] [JsonSubtypes.KnownSubType(typeof(GetVoucherTransactionResponse), "voucher")] - [JsonSubtypes.KnownSubType(typeof(GetBankTransferTransactionResponse), "bank_transfer")] [JsonSubtypes.KnownSubType(typeof(GetBoletoTransactionResponse), "boleto")] [JsonSubtypes.KnownSubType(typeof(GetDebitCardTransactionResponse), "debit_card")] - [JsonSubtypes.KnownSubType(typeof(GetCashTransactionResponse), "cash")] [JsonSubtypes.KnownSubType(typeof(GetPrivateLabelTransactionResponse), "private_label")] + [JsonSubtypes.KnownSubType(typeof(GetCashTransactionResponse), "cash")] [JsonSubtypes.KnownSubType(typeof(GetCreditCardTransactionResponse), "credit_card")] [JsonSubtypes.KnownSubType(typeof(GetPixTransactionResponse), "pix")] public class GetTransactionResponse diff --git a/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.csproj b/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.csproj index c3c397d..e7dffc1 100644 --- a/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.csproj +++ b/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.csproj @@ -9,13 +9,13 @@ netstandard2.0 PagarmeApiSDKStandard - 6.8.7.0 + 6.8.8.0 Pagar.me Pagamentos S/A Pagar.me Pagamentos S/A PagarmeApiSDK.Standard Copyright © 2019 - 6.8.7.0 - 6.8.7.0 + 6.8.8.0 + 6.8.8.0 .NET client library for the PagarmeApiSDK 7.3 true diff --git a/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.nuspec b/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.nuspec deleted file mode 100644 index a6a6dbc..0000000 --- a/PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - PagarmeApiSDK.Standard - 6.8.7 - PagarmeApiSDK.Standard - APIMATIC SDK Generator - https://nuget.org/Content/Images/packageDefaultIcon-50x50.png - false - Pagarme API - - - Copyright 2016 - en-US - - - - - - - diff --git a/PagarmeApiSDK.Standard/PagarmeApiSDKClient.cs b/PagarmeApiSDK.Standard/PagarmeApiSDKClient.cs index f3f0743..95147f6 100644 --- a/PagarmeApiSDK.Standard/PagarmeApiSDKClient.cs +++ b/PagarmeApiSDK.Standard/PagarmeApiSDKClient.cs @@ -33,7 +33,7 @@ public sealed class PagarmeApiSDKClient : IPagarmeApiSDKClient }; private readonly GlobalConfiguration globalConfiguration; - private const string userAgent = "PagarmeApiSDK - DotNet 6.8.7"; + private const string userAgent = "PagarmeApiSDK - DotNet 6.8.8"; private readonly Lazy subscriptions; private readonly Lazy orders; private readonly Lazy plans; diff --git a/PagarmeApiSDK.sln b/PagarmeApiSDK.sln index ecb5893..6ae4f9c 100644 --- a/PagarmeApiSDK.sln +++ b/PagarmeApiSDK.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PagarmeApiSDK.Standard", "PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.csproj", "{699a3b8e-9a11-4ab0-a4df-fbde13ceebb3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PagarmeApiSDK.Standard", "PagarmeApiSDK.Standard/PagarmeApiSDK.Standard.csproj", "{abaf6051-a672-4527-9a1b-dfab19d70e8c}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {699a3b8e-9a11-4ab0-a4df-fbde13ceebb3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {699a3b8e-9a11-4ab0-a4df-fbde13ceebb3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {699a3b8e-9a11-4ab0-a4df-fbde13ceebb3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {699a3b8e-9a11-4ab0-a4df-fbde13ceebb3}.Release|Any CPU.Build.0 = Release|Any CPU + {abaf6051-a672-4527-9a1b-dfab19d70e8c}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {abaf6051-a672-4527-9a1b-dfab19d70e8c}.Debug|Any CPU.Build.0 = Debug|Any CPU + {abaf6051-a672-4527-9a1b-dfab19d70e8c}.Release|Any CPU.ActiveCfg = Release|Any CPU + {abaf6051-a672-4527-9a1b-dfab19d70e8c}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index 806d132..1e9aa37 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Once the `TestConsoleProject` is created, a file named `Program.cs` will be visi ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/client.md) The following parameters are configurable for the API Client: @@ -63,7 +63,7 @@ The following parameters are configurable for the API Client: | --- | --- | --- | | `ServiceRefererName` | `string` | | | `Timeout` | `TimeSpan` | Http client timeout.
*Default*: `TimeSpan.FromSeconds(100)` | -| `BasicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/$a/https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/basic-authentication.md) | The Credentials Setter for Basic Authentication | +| `BasicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/$a/https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: @@ -83,7 +83,7 @@ PagarmeApiSDK.Standard.PagarmeApiSDKClient client = new PagarmeApiSDK.Standard.P This API uses the following authentication schemes. -* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/$a/https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/basic-authentication.md) +* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/$a/https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/basic-authentication.md) ## API Errors @@ -91,37 +91,37 @@ Here is the list of errors that the API might throw. | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/models/error-exception.md) | -| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/models/error-exception.md) | -| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/models/error-exception.md) | -| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/models/error-exception.md) | -| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/models/error-exception.md) | -| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/models/error-exception.md) | +| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/models/error-exception.md) | +| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/models/error-exception.md) | +| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/models/error-exception.md) | +| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/models/error-exception.md) | +| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/models/error-exception.md) | +| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/models/error-exception.md) | ## List of APIs -* [Subscriptions](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/subscriptions.md) -* [Orders](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/orders.md) -* [Plans](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/plans.md) -* [Invoices](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/invoices.md) -* [Customers](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/customers.md) -* [Charges](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/charges.md) -* [Recipients](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/recipients.md) -* [Tokens](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/tokens.md) -* [Transactions](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/transactions.md) -* [Transfers](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/transfers.md) -* [Payables](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/payables.md) -* [Balance Operations](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/controllers/balance-operations.md) +* [Subscriptions](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/subscriptions.md) +* [Orders](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/orders.md) +* [Plans](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/plans.md) +* [Invoices](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/invoices.md) +* [Customers](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/customers.md) +* [Charges](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/charges.md) +* [Recipients](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/recipients.md) +* [Tokens](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/tokens.md) +* [Transactions](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/transactions.md) +* [Transfers](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/transfers.md) +* [Payables](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/payables.md) +* [Balance Operations](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/controllers/balance-operations.md) ## Classes Documentation -* [Utility Classes](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/utility-classes.md) -* [HttpRequest](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/http-request.md) -* [HttpResponse](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/http-response.md) -* [HttpStringResponse](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/http-string-response.md) -* [HttpContext](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/http-context.md) -* [HttpClientConfiguration](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/http-client-configuration.md) -* [HttpClientConfiguration Builder](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/http-client-configuration-builder.md) -* [IAuthManager](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/i-auth-manager.md) -* [ApiException](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.7/doc/api-exception.md) +* [Utility Classes](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/utility-classes.md) +* [HttpRequest](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/http-request.md) +* [HttpResponse](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/http-response.md) +* [HttpStringResponse](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/http-string-response.md) +* [HttpContext](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/http-context.md) +* [HttpClientConfiguration](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/http-client-configuration.md) +* [HttpClientConfiguration Builder](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/http-client-configuration-builder.md) +* [IAuthManager](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/i-auth-manager.md) +* [ApiException](https://www.github.com/pagarme/pagarme-net-standard-sdk/tree/6.8.8/doc/api-exception.md) diff --git a/doc/controllers/balance-operations.md b/doc/controllers/balance-operations.md index 01b0ad3..c051d56 100644 --- a/doc/controllers/balance-operations.md +++ b/doc/controllers/balance-operations.md @@ -10,34 +10,39 @@ IBalanceOperationsController balanceOperationsController = client.BalanceOperati ## Methods -* [Get Balance Operation by Id](../../doc/controllers/balance-operations.md#get-balance-operation-by-id) * [Get Balance Operations](../../doc/controllers/balance-operations.md#get-balance-operations) +* [Get Balance Operation by Id](../../doc/controllers/balance-operations.md#get-balance-operation-by-id) -# Get Balance Operation by Id +# Get Balance Operations ```csharp -GetBalanceOperationByIdAsync( - long id) +GetBalanceOperationsAsync( + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + string recipientId = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `long` | Template, Required | - | +| `status` | `string` | Query, Optional | - | +| `createdSince` | `DateTime?` | Query, Optional | - | +| `createdUntil` | `DateTime?` | Query, Optional | - | +| `recipientId` | `string` | Query, Optional | - | ## Response Type -[`Task`](../../doc/models/get-balance-operation-response.md) +[`Task`](../../doc/models/list-balance-operation-response.md) ## Example Usage ```csharp -long id = 112L; try { - GetBalanceOperationResponse result = await balanceOperationsController.GetBalanceOperationByIdAsync(id); + ListBalanceOperationResponse result = await balanceOperationsController.GetBalanceOperationsAsync(); } catch (ApiException e) { @@ -47,35 +52,30 @@ catch (ApiException e) ``` -# Get Balance Operations +# Get Balance Operation by Id ```csharp -GetBalanceOperationsAsync( - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - string recipientId = null) +GetBalanceOperationByIdAsync( + long id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `status` | `string` | Query, Optional | - | -| `createdSince` | `DateTime?` | Query, Optional | - | -| `createdUntil` | `DateTime?` | Query, Optional | - | -| `recipientId` | `string` | Query, Optional | - | +| `id` | `long` | Template, Required | - | ## Response Type -[`Task`](../../doc/models/list-balance-operation-response.md) +[`Task`](../../doc/models/get-balance-operation-response.md) ## Example Usage ```csharp +long id = 112L; try { - ListBalanceOperationResponse result = await balanceOperationsController.GetBalanceOperationsAsync(); + GetBalanceOperationResponse result = await balanceOperationsController.GetBalanceOperationByIdAsync(id); } catch (ApiException e) { diff --git a/doc/controllers/charges.md b/doc/controllers/charges.md index 32bde23..274539e 100644 --- a/doc/controllers/charges.md +++ b/doc/controllers/charges.md @@ -11,18 +11,18 @@ IChargesController chargesController = client.ChargesController; ## Methods * [Update Charge Metadata](../../doc/controllers/charges.md#update-charge-metadata) -* [Capture Charge](../../doc/controllers/charges.md#capture-charge) -* [Get Charge](../../doc/controllers/charges.md#get-charge) -* [Confirm Payment](../../doc/controllers/charges.md#confirm-payment) -* [Get Charge Transactions](../../doc/controllers/charges.md#get-charge-transactions) -* [Update Charge Card](../../doc/controllers/charges.md#update-charge-card) -* [Create Charge](../../doc/controllers/charges.md#create-charge) * [Update Charge Payment Method](../../doc/controllers/charges.md#update-charge-payment-method) +* [Get Charge Transactions](../../doc/controllers/charges.md#get-charge-transactions) * [Update Charge Due Date](../../doc/controllers/charges.md#update-charge-due-date) +* [Get Charges](../../doc/controllers/charges.md#get-charges) +* [Capture Charge](../../doc/controllers/charges.md#capture-charge) +* [Update Charge Card](../../doc/controllers/charges.md#update-charge-card) +* [Get Charge](../../doc/controllers/charges.md#get-charge) * [Get Charges Summary](../../doc/controllers/charges.md#get-charges-summary) * [Retry Charge](../../doc/controllers/charges.md#retry-charge) -* [Get Charges](../../doc/controllers/charges.md#get-charges) * [Cancel Charge](../../doc/controllers/charges.md#cancel-charge) +* [Create Charge](../../doc/controllers/charges.md#create-charge) +* [Confirm Payment](../../doc/controllers/charges.md#confirm-payment) # Update Charge Metadata @@ -75,14 +75,14 @@ catch (ApiException e) ``` -# Capture Charge +# Update Charge Payment Method -Captures a charge +Updates a charge's payment method ```csharp -CaptureChargeAsync( +UpdateChargePaymentMethodAsync( string chargeId, - Models.CreateCaptureChargeRequest request = null, + Models.UpdateChargePaymentMethodRequest request, string idempotencyKey = null) ``` @@ -91,7 +91,7 @@ CaptureChargeAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`CreateCaptureChargeRequest`](../../doc/models/create-capture-charge-request.md) | Body, Optional | Request for capturing a charge | +| `request` | [`UpdateChargePaymentMethodRequest`](../../doc/models/update-charge-payment-method-request.md) | Body, Required | Request for updating the payment method from a charge | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -102,9 +102,67 @@ CaptureChargeAsync( ```csharp string chargeId = "charge_id8"; +UpdateChargePaymentMethodRequest request = new UpdateChargePaymentMethodRequest +{ + UpdateSubscription = false, + PaymentMethod = "payment_method4", + CreditCard = new CreateCreditCardPaymentRequest + { + Installments = 1, + Capture = true, + RecurrencyCycle = "\"first\" or \"subsequent\"", + }, + DebitCard = new CreateDebitCardPaymentRequest + { + }, + Boleto = new CreateBoletoPaymentRequest + { + Retries = 226, + Instructions = "instructions2", + BillingAddress = new CreateAddressRequest + { + Street = "street8", + Number = "number4", + ZipCode = "zip_code2", + Neighborhood = "neighborhood4", + City = "city2", + State = "state6", + Country = "country2", + Complement = "complement6", + Line1 = "line_18", + Line2 = "line_26", + }, + DocumentNumber = "document_number6", + StatementDescriptor = "statement_descriptor0", + }, + Voucher = new CreateVoucherPaymentRequest + { + RecurrencyCycle = "\"first\" or \"subsequent\"", + }, + Cash = new CreateCashPaymentRequest + { + Description = "description0", + Confirm = false, + }, + BankTransfer = new CreateBankTransferPaymentRequest + { + Bank = "bank0", + Retries = 236, + }, + PrivateLabel = new CreatePrivateLabelPaymentRequest + { + Installments = 1, + Capture = true, + RecurrencyCycle = "\"first\" or \"subsequent\"", + }, +}; + try { - GetChargeResponse result = await chargesController.CaptureChargeAsync(chargeId); + GetChargeResponse result = await chargesController.UpdateChargePaymentMethodAsync( + chargeId, + request + ); } catch (ApiException e) { @@ -114,24 +172,26 @@ catch (ApiException e) ``` -# Get Charge - -Get a charge from its id +# Get Charge Transactions ```csharp -GetChargeAsync( - string chargeId) +GetChargeTransactionsAsync( + string chargeId, + int? page = null, + int? size = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge id | +| `chargeId` | `string` | Template, Required | Charge Id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | ## Response Type -[`Task`](../../doc/models/get-charge-response.md) +[`Task`](../../doc/models/list-charge-transactions-response.md) ## Example Usage @@ -139,7 +199,7 @@ GetChargeAsync( string chargeId = "charge_id8"; try { - GetChargeResponse result = await chargesController.GetChargeAsync(chargeId); + ListChargeTransactionsResponse result = await chargesController.GetChargeTransactionsAsync(chargeId); } catch (ApiException e) { @@ -149,12 +209,14 @@ catch (ApiException e) ``` -# Confirm Payment +# Update Charge Due Date + +Updates the due date from a charge ```csharp -ConfirmPaymentAsync( +UpdateChargeDueDateAsync( string chargeId, - Models.CreateConfirmPaymentRequest request = null, + Models.UpdateChargeDueDateRequest request, string idempotencyKey = null) ``` @@ -162,8 +224,8 @@ ConfirmPaymentAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | - | -| `request` | [`CreateConfirmPaymentRequest`](../../doc/models/create-confirm-payment-request.md) | Body, Optional | Request for confirm payment | +| `chargeId` | `string` | Template, Required | Charge Id | +| `request` | [`UpdateChargeDueDateRequest`](../../doc/models/update-charge-due-date-request.md) | Body, Required | Request for updating the due date | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -174,9 +236,16 @@ ConfirmPaymentAsync( ```csharp string chargeId = "charge_id8"; +UpdateChargeDueDateRequest request = new UpdateChargeDueDateRequest +{ +}; + try { - GetChargeResponse result = await chargesController.ConfirmPaymentAsync(chargeId); + GetChargeResponse result = await chargesController.UpdateChargeDueDateAsync( + chargeId, + request + ); } catch (ApiException e) { @@ -186,34 +255,47 @@ catch (ApiException e) ``` -# Get Charge Transactions +# Get Charges + +Lists all charges ```csharp -GetChargeTransactionsAsync( - string chargeId, +GetChargesAsync( int? page = null, - int? size = null) + int? size = null, + string code = null, + string status = null, + string paymentMethod = null, + string customerId = null, + string orderId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge Id | | `page` | `int?` | Query, Optional | Page number | | `size` | `int?` | Query, Optional | Page size | +| `code` | `string` | Query, Optional | Filter for charge's code | +| `status` | `string` | Query, Optional | Filter for charge's status | +| `paymentMethod` | `string` | Query, Optional | Filter for charge's payment method | +| `customerId` | `string` | Query, Optional | Filter for charge's customer id | +| `orderId` | `string` | Query, Optional | Filter for charge's order id | +| `createdSince` | `DateTime?` | Query, Optional | Filter for the beginning of the range for charge's creation | +| `createdUntil` | `DateTime?` | Query, Optional | Filter for the end of the range for charge's creation | ## Response Type -[`Task`](../../doc/models/list-charge-transactions-response.md) +[`Task`](../../doc/models/list-charges-response.md) ## Example Usage ```csharp -string chargeId = "charge_id8"; try { - ListChargeTransactionsResponse result = await chargesController.GetChargeTransactionsAsync(chargeId); + ListChargesResponse result = await chargesController.GetChargesAsync(); } catch (ApiException e) { @@ -223,14 +305,14 @@ catch (ApiException e) ``` -# Update Charge Card +# Capture Charge -Updates the card from a charge +Captures a charge ```csharp -UpdateChargeCardAsync( +CaptureChargeAsync( string chargeId, - Models.UpdateChargeCardRequest request, + Models.CreateCaptureChargeRequest request = null, string idempotencyKey = null) ``` @@ -239,7 +321,7 @@ UpdateChargeCardAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`UpdateChargeCardRequest`](../../doc/models/update-charge-card-request.md) | Body, Required | Request for updating a charge's card | +| `request` | [`CreateCaptureChargeRequest`](../../doc/models/create-capture-charge-request.md) | Body, Optional | Request for capturing a charge | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -250,23 +332,9 @@ UpdateChargeCardAsync( ```csharp string chargeId = "charge_id8"; -UpdateChargeCardRequest request = new UpdateChargeCardRequest -{ - UpdateSubscription = false, - CardId = "card_id2", - Card = new CreateCardRequest - { - Type = "credit", - }, - Recurrence = false, -}; - try { - GetChargeResponse result = await chargesController.UpdateChargeCardAsync( - chargeId, - request - ); + GetChargeResponse result = await chargesController.CaptureChargeAsync(chargeId); } catch (ApiException e) { @@ -276,13 +344,14 @@ catch (ApiException e) ``` -# Create Charge +# Update Charge Card -Creates a new charge +Updates the card from a charge ```csharp -CreateChargeAsync( - Models.CreateChargeRequest request, +UpdateChargeCardAsync( + string chargeId, + Models.UpdateChargeCardRequest request, string idempotencyKey = null) ``` @@ -290,7 +359,8 @@ CreateChargeAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `request` | [`CreateChargeRequest`](../../doc/models/create-charge-request.md) | Body, Required | Request for creating a charge | +| `chargeId` | `string` | Template, Required | Charge id | +| `request` | [`UpdateChargeCardRequest`](../../doc/models/update-charge-card-request.md) | Body, Required | Request for updating a charge's card | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -300,19 +370,24 @@ CreateChargeAsync( ## Example Usage ```csharp -CreateChargeRequest request = new CreateChargeRequest +string chargeId = "charge_id8"; +UpdateChargeCardRequest request = new UpdateChargeCardRequest { - Amount = 242, - Payment = new CreatePaymentRequest + UpdateSubscription = false, + CardId = "card_id2", + Card = new CreateCardRequest { - PaymentMethod = "payment_method4", + Type = "credit", }, - OrderId = "order_id0", + Recurrence = false, }; try { - GetChargeResponse result = await chargesController.CreateChargeAsync(request); + GetChargeResponse result = await chargesController.UpdateChargeCardAsync( + chargeId, + request + ); } catch (ApiException e) { @@ -322,15 +397,13 @@ catch (ApiException e) ``` -# Update Charge Payment Method +# Get Charge -Updates a charge's payment method +Get a charge from its id ```csharp -UpdateChargePaymentMethodAsync( - string chargeId, - Models.UpdateChargePaymentMethodRequest request, - string idempotencyKey = null) +GetChargeAsync( + string chargeId) ``` ## Parameters @@ -338,8 +411,6 @@ UpdateChargePaymentMethodAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`UpdateChargePaymentMethodRequest`](../../doc/models/update-charge-payment-method-request.md) | Body, Required | Request for updating the payment method from a charge | -| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -349,67 +420,9 @@ UpdateChargePaymentMethodAsync( ```csharp string chargeId = "charge_id8"; -UpdateChargePaymentMethodRequest request = new UpdateChargePaymentMethodRequest -{ - UpdateSubscription = false, - PaymentMethod = "payment_method4", - CreditCard = new CreateCreditCardPaymentRequest - { - Installments = 1, - Capture = true, - RecurrencyCycle = "\"first\" or \"subsequent\"", - }, - DebitCard = new CreateDebitCardPaymentRequest - { - }, - Boleto = new CreateBoletoPaymentRequest - { - Retries = 226, - Instructions = "instructions2", - BillingAddress = new CreateAddressRequest - { - Street = "street8", - Number = "number4", - ZipCode = "zip_code2", - Neighborhood = "neighborhood4", - City = "city2", - State = "state6", - Country = "country2", - Complement = "complement6", - Line1 = "line_18", - Line2 = "line_26", - }, - DocumentNumber = "document_number6", - StatementDescriptor = "statement_descriptor0", - }, - Voucher = new CreateVoucherPaymentRequest - { - RecurrencyCycle = "\"first\" or \"subsequent\"", - }, - Cash = new CreateCashPaymentRequest - { - Description = "description0", - Confirm = false, - }, - BankTransfer = new CreateBankTransferPaymentRequest - { - Bank = "bank0", - Retries = 236, - }, - PrivateLabel = new CreatePrivateLabelPaymentRequest - { - Installments = 1, - Capture = true, - RecurrencyCycle = "\"first\" or \"subsequent\"", - }, -}; - try { - GetChargeResponse result = await chargesController.UpdateChargePaymentMethodAsync( - chargeId, - request - ); + GetChargeResponse result = await chargesController.GetChargeAsync(chargeId); } catch (ApiException e) { @@ -419,43 +432,34 @@ catch (ApiException e) ``` -# Update Charge Due Date - -Updates the due date from a charge +# Get Charges Summary ```csharp -UpdateChargeDueDateAsync( - string chargeId, - Models.UpdateChargeDueDateRequest request, - string idempotencyKey = null) +GetChargesSummaryAsync( + string status, + DateTime? createdSince = null, + DateTime? createdUntil = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge Id | -| `request` | [`UpdateChargeDueDateRequest`](../../doc/models/update-charge-due-date-request.md) | Body, Required | Request for updating the due date | -| `idempotencyKey` | `string` | Header, Optional | - | +| `status` | `string` | Query, Required | - | +| `createdSince` | `DateTime?` | Query, Optional | - | +| `createdUntil` | `DateTime?` | Query, Optional | - | ## Response Type -[`Task`](../../doc/models/get-charge-response.md) +[`Task`](../../doc/models/get-charges-summary-response.md) ## Example Usage ```csharp -string chargeId = "charge_id8"; -UpdateChargeDueDateRequest request = new UpdateChargeDueDateRequest -{ -}; - +string status = "status8"; try { - GetChargeResponse result = await chargesController.UpdateChargeDueDateAsync( - chargeId, - request - ); + GetChargesSummaryResponse result = await chargesController.GetChargesSummaryAsync(status); } catch (ApiException e) { @@ -465,34 +469,34 @@ catch (ApiException e) ``` -# Get Charges Summary +# Retry Charge + +Retries a charge ```csharp -GetChargesSummaryAsync( - string status, - DateTime? createdSince = null, - DateTime? createdUntil = null) +RetryChargeAsync( + string chargeId, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `status` | `string` | Query, Required | - | -| `createdSince` | `DateTime?` | Query, Optional | - | -| `createdUntil` | `DateTime?` | Query, Optional | - | +| `chargeId` | `string` | Template, Required | Charge id | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-charges-summary-response.md) +[`Task`](../../doc/models/get-charge-response.md) ## Example Usage ```csharp -string status = "status8"; +string chargeId = "charge_id8"; try { - GetChargesSummaryResponse result = await chargesController.GetChargesSummaryAsync(status); + GetChargeResponse result = await chargesController.RetryChargeAsync(chargeId); } catch (ApiException e) { @@ -502,13 +506,14 @@ catch (ApiException e) ``` -# Retry Charge +# Cancel Charge -Retries a charge +Cancel a charge ```csharp -RetryChargeAsync( +CancelChargeAsync( string chargeId, + Models.CreateCancelChargeRequest request = null, string idempotencyKey = null) ``` @@ -517,6 +522,7 @@ RetryChargeAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `chargeId` | `string` | Template, Required | Charge id | +| `request` | [`CreateCancelChargeRequest`](../../doc/models/create-cancel-charge-request.md) | Body, Optional | Request for cancelling a charge | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -529,7 +535,7 @@ RetryChargeAsync( string chargeId = "charge_id8"; try { - GetChargeResponse result = await chargesController.RetryChargeAsync(chargeId); + GetChargeResponse result = await chargesController.CancelChargeAsync(chargeId); } catch (ApiException e) { @@ -539,47 +545,43 @@ catch (ApiException e) ``` -# Get Charges +# Create Charge -Lists all charges +Creates a new charge ```csharp -GetChargesAsync( - int? page = null, - int? size = null, - string code = null, - string status = null, - string paymentMethod = null, - string customerId = null, - string orderId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) +CreateChargeAsync( + Models.CreateChargeRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | -| `code` | `string` | Query, Optional | Filter for charge's code | -| `status` | `string` | Query, Optional | Filter for charge's status | -| `paymentMethod` | `string` | Query, Optional | Filter for charge's payment method | -| `customerId` | `string` | Query, Optional | Filter for charge's customer id | -| `orderId` | `string` | Query, Optional | Filter for charge's order id | -| `createdSince` | `DateTime?` | Query, Optional | Filter for the beginning of the range for charge's creation | -| `createdUntil` | `DateTime?` | Query, Optional | Filter for the end of the range for charge's creation | +| `request` | [`CreateChargeRequest`](../../doc/models/create-charge-request.md) | Body, Required | Request for creating a charge | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-charges-response.md) +[`Task`](../../doc/models/get-charge-response.md) ## Example Usage ```csharp +CreateChargeRequest request = new CreateChargeRequest +{ + Amount = 242, + Payment = new CreatePaymentRequest + { + PaymentMethod = "payment_method4", + }, + OrderId = "order_id0", +}; + try { - ListChargesResponse result = await chargesController.GetChargesAsync(); + GetChargeResponse result = await chargesController.CreateChargeAsync(request); } catch (ApiException e) { @@ -589,14 +591,12 @@ catch (ApiException e) ``` -# Cancel Charge - -Cancel a charge +# Confirm Payment ```csharp -CancelChargeAsync( +ConfirmPaymentAsync( string chargeId, - Models.CreateCancelChargeRequest request = null, + Models.CreateConfirmPaymentRequest request = null, string idempotencyKey = null) ``` @@ -604,8 +604,8 @@ CancelChargeAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`CreateCancelChargeRequest`](../../doc/models/create-cancel-charge-request.md) | Body, Optional | Request for cancelling a charge | +| `chargeId` | `string` | Template, Required | - | +| `request` | [`CreateConfirmPaymentRequest`](../../doc/models/create-confirm-payment-request.md) | Body, Optional | Request for confirm payment | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -618,7 +618,7 @@ CancelChargeAsync( string chargeId = "charge_id8"; try { - GetChargeResponse result = await chargesController.CancelChargeAsync(chargeId); + GetChargeResponse result = await chargesController.ConfirmPaymentAsync(chargeId); } catch (ApiException e) { diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 834ad28..5cf419a 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -10,37 +10,38 @@ ICustomersController customersController = client.CustomersController; ## Methods -* [Create Address](../../doc/controllers/customers.md#create-address) * [Update Card](../../doc/controllers/customers.md#update-card) +* [Update Address](../../doc/controllers/customers.md#update-address) * [Delete Access Token](../../doc/controllers/customers.md#delete-access-token) * [Create Customer](../../doc/controllers/customers.md#create-customer) +* [Create Address](../../doc/controllers/customers.md#create-address) * [Delete Access Tokens](../../doc/controllers/customers.md#delete-access-tokens) -* [Update Address](../../doc/controllers/customers.md#update-address) * [Get Address](../../doc/controllers/customers.md#get-address) * [Delete Address](../../doc/controllers/customers.md#delete-address) -* [Get Customers](../../doc/controllers/customers.md#get-customers) -* [Get Access Tokens](../../doc/controllers/customers.md#get-access-tokens) -* [Delete Card](../../doc/controllers/customers.md#delete-card) -* [Get Card](../../doc/controllers/customers.md#get-card) * [Create Card](../../doc/controllers/customers.md#create-card) -* [Get Access Token](../../doc/controllers/customers.md#get-access-token) -* [Get Addresses](../../doc/controllers/customers.md#get-addresses) +* [Get Customers](../../doc/controllers/customers.md#get-customers) * [Update Customer](../../doc/controllers/customers.md#update-customer) * [Create Access Token](../../doc/controllers/customers.md#create-access-token) +* [Get Access Tokens](../../doc/controllers/customers.md#get-access-tokens) * [Get Cards](../../doc/controllers/customers.md#get-cards) * [Renew Card](../../doc/controllers/customers.md#renew-card) +* [Get Access Token](../../doc/controllers/customers.md#get-access-token) * [Update Customer Metadata](../../doc/controllers/customers.md#update-customer-metadata) +* [Delete Card](../../doc/controllers/customers.md#delete-card) +* [Get Addresses](../../doc/controllers/customers.md#get-addresses) * [Get Customer](../../doc/controllers/customers.md#get-customer) +* [Get Card](../../doc/controllers/customers.md#get-card) -# Create Address +# Update Card -Creates a new address for a customer +Updates a card ```csharp -CreateAddressAsync( +UpdateCardAsync( string customerId, - Models.CreateAddressRequest request, + string cardId, + Models.UpdateCardRequest request, string idempotencyKey = null) ``` @@ -49,35 +50,49 @@ CreateAddressAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `request` | [`CreateAddressRequest`](../../doc/models/create-address-request.md) | Body, Required | Request for creating an address | +| `cardId` | `string` | Template, Required | Card id | +| `request` | [`UpdateCardRequest`](../../doc/models/update-card-request.md) | Body, Required | Request for updating a card | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-address-response.md) +[`Task`](../../doc/models/get-card-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -CreateAddressRequest request = new CreateAddressRequest +string cardId = "card_id4"; +UpdateCardRequest request = new UpdateCardRequest { - Street = "street6", - Number = "number4", - ZipCode = "zip_code0", - Neighborhood = "neighborhood2", - City = "city6", - State = "state2", - Country = "country0", - Complement = "complement2", - Line1 = "line_10", - Line2 = "line_24", + HolderName = "holder_name2", + ExpMonth = 10, + ExpYear = 30, + BillingAddress = new CreateAddressRequest + { + Street = "street8", + Number = "number4", + ZipCode = "zip_code2", + Neighborhood = "neighborhood4", + City = "city2", + State = "state6", + Country = "country2", + Complement = "complement6", + Line1 = "line_18", + Line2 = "line_26", + }, + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, + Label = "label6", }; try { - GetAddressResponse result = await customersController.CreateAddressAsync( + GetCardResponse result = await customersController.UpdateCardAsync( customerId, + cardId, request ); } @@ -89,15 +104,15 @@ catch (ApiException e) ``` -# Update Card +# Update Address -Updates a card +Updates an address ```csharp -UpdateCardAsync( +UpdateAddressAsync( string customerId, - string cardId, - Models.UpdateCardRequest request, + string addressId, + Models.UpdateAddressRequest request, string idempotencyKey = null) ``` @@ -106,49 +121,35 @@ UpdateCardAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `cardId` | `string` | Template, Required | Card id | -| `request` | [`UpdateCardRequest`](../../doc/models/update-card-request.md) | Body, Required | Request for updating a card | +| `addressId` | `string` | Template, Required | Address Id | +| `request` | [`UpdateAddressRequest`](../../doc/models/update-address-request.md) | Body, Required | Request for updating an address | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-card-response.md) +[`Task`](../../doc/models/get-address-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -string cardId = "card_id4"; -UpdateCardRequest request = new UpdateCardRequest +string addressId = "address_id0"; +UpdateAddressRequest request = new UpdateAddressRequest { - HolderName = "holder_name2", - ExpMonth = 10, - ExpYear = 30, - BillingAddress = new CreateAddressRequest - { - Street = "street8", - Number = "number4", - ZipCode = "zip_code2", - Neighborhood = "neighborhood4", - City = "city2", - State = "state6", - Country = "country2", - Complement = "complement6", - Line1 = "line_18", - Line2 = "line_26", - }, + Number = "number4", + Complement = "complement2", Metadata = new Dictionary { ["key0"] = "metadata3", }, - Label = "label6", + Line2 = "line_24", }; try { - GetCardResponse result = await customersController.UpdateCardAsync( + GetAddressResponse result = await customersController.UpdateAddressAsync( customerId, - cardId, + addressId, request ); } @@ -229,7 +230,7 @@ CreateCustomerAsync( ```csharp CreateCustomerRequest request = new CreateCustomerRequest { - Name = "{\n \"name\": \"Tony Stark\"\n}", + Name = "Tony Stark", Email = "email0", Document = "document0", Type = "type4", @@ -268,13 +269,15 @@ catch (ApiException e) ``` -# Delete Access Tokens +# Create Address -Delete a Customer's access tokens +Creates a new address for a customer ```csharp -DeleteAccessTokensAsync( - string customerId) +CreateAddressAsync( + string customerId, + Models.CreateAddressRequest request, + string idempotencyKey = null) ``` ## Parameters @@ -282,18 +285,37 @@ DeleteAccessTokensAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | +| `request` | [`CreateAddressRequest`](../../doc/models/create-address-request.md) | Body, Required | Request for creating an address | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-access-tokens-response.md) +[`Task`](../../doc/models/get-address-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; +CreateAddressRequest request = new CreateAddressRequest +{ + Street = "street6", + Number = "number4", + ZipCode = "zip_code0", + Neighborhood = "neighborhood2", + City = "city6", + State = "state2", + Country = "country0", + Complement = "complement2", + Line1 = "line_10", + Line2 = "line_24", +}; + try { - ListAccessTokensResponse result = await customersController.DeleteAccessTokensAsync(customerId); + GetAddressResponse result = await customersController.CreateAddressAsync( + customerId, + request + ); } catch (ApiException e) { @@ -303,16 +325,13 @@ catch (ApiException e) ``` -# Update Address +# Delete Access Tokens -Updates an address +Delete a Customer's access tokens ```csharp -UpdateAddressAsync( - string customerId, - string addressId, - Models.UpdateAddressRequest request, - string idempotencyKey = null) +DeleteAccessTokensAsync( + string customerId) ``` ## Parameters @@ -320,37 +339,18 @@ UpdateAddressAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `addressId` | `string` | Template, Required | Address Id | -| `request` | [`UpdateAddressRequest`](../../doc/models/update-address-request.md) | Body, Required | Request for updating an address | -| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-address-response.md) +[`Task`](../../doc/models/list-access-tokens-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -string addressId = "address_id0"; -UpdateAddressRequest request = new UpdateAddressRequest -{ - Number = "number4", - Complement = "complement2", - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, - Line2 = "line_24", -}; - try { - GetAddressResponse result = await customersController.UpdateAddressAsync( - customerId, - addressId, - request - ); + ListAccessTokensResponse result = await customersController.DeleteAccessTokensAsync(customerId); } catch (ApiException e) { @@ -444,6 +444,53 @@ catch (ApiException e) ``` +# Create Card + +Creates a new card for a customer + +```csharp +CreateCardAsync( + string customerId, + Models.CreateCardRequest request, + string idempotencyKey = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | Customer id | +| `request` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | Request for creating a card | +| `idempotencyKey` | `string` | Header, Optional | - | + +## Response Type + +[`Task`](../../doc/models/get-card-response.md) + +## Example Usage + +```csharp +string customerId = "customer_id8"; +CreateCardRequest request = new CreateCardRequest +{ + Type = "credit", +}; + +try +{ + GetCardResponse result = await customersController.CreateCardAsync( + customerId, + request + ); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + # Get Customers Get all Customers @@ -495,36 +542,43 @@ catch (ApiException e) ``` -# Get Access Tokens +# Update Customer -Get all access tokens from a customer +Updates a customer ```csharp -GetAccessTokensAsync( +UpdateCustomerAsync( string customerId, - int? page = null, - int? size = null) + Models.UpdateCustomerRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | +| `customerId` | `string` | Template, Required | Customer id | +| `request` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | Request for updating a customer | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-access-tokens-response.md) +[`Task`](../../doc/models/get-customer-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; +UpdateCustomerRequest request = new UpdateCustomerRequest +{ +}; + try { - ListAccessTokensResponse result = await customersController.GetAccessTokensAsync(customerId); + GetCustomerResponse result = await customersController.UpdateCustomerAsync( + customerId, + request + ); } catch (ApiException e) { @@ -534,14 +588,14 @@ catch (ApiException e) ``` -# Delete Card +# Create Access Token -Delete a customer's card +Creates a access token for a customer ```csharp -DeleteCardAsync( +CreateAccessTokenAsync( string customerId, - string cardId, + Models.CreateAccessTokenRequest request, string idempotencyKey = null) ``` @@ -550,23 +604,26 @@ DeleteCardAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `cardId` | `string` | Template, Required | Card Id | +| `request` | [`CreateAccessTokenRequest`](../../doc/models/create-access-token-request.md) | Body, Required | Request for creating a access token | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-card-response.md) +[`Task`](../../doc/models/get-access-token-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -string cardId = "card_id4"; +CreateAccessTokenRequest request = new CreateAccessTokenRequest +{ +}; + try { - GetCardResponse result = await customersController.DeleteCardAsync( + GetAccessTokenResponse result = await customersController.CreateAccessTokenAsync( customerId, - cardId + request ); } catch (ApiException e) @@ -577,38 +634,36 @@ catch (ApiException e) ``` -# Get Card +# Get Access Tokens -Get a customer's card +Get all access tokens from a customer ```csharp -GetCardAsync( +GetAccessTokensAsync( string customerId, - string cardId) + int? page = null, + int? size = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `cardId` | `string` | Template, Required | Card id | +| `customerId` | `string` | Template, Required | Customer Id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | ## Response Type -[`Task`](../../doc/models/get-card-response.md) +[`Task`](../../doc/models/list-access-tokens-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -string cardId = "card_id4"; try { - GetCardResponse result = await customersController.GetCardAsync( - customerId, - cardId - ); + ListAccessTokensResponse result = await customersController.GetAccessTokensAsync(customerId); } catch (ApiException e) { @@ -618,44 +673,36 @@ catch (ApiException e) ``` -# Create Card +# Get Cards -Creates a new card for a customer +Get all cards from a customer ```csharp -CreateCardAsync( +GetCardsAsync( string customerId, - Models.CreateCardRequest request, - string idempotencyKey = null) + int? page = null, + int? size = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `request` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | Request for creating a card | -| `idempotencyKey` | `string` | Header, Optional | - | +| `customerId` | `string` | Template, Required | Customer Id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | ## Response Type -[`Task`](../../doc/models/get-card-response.md) +[`Task`](../../doc/models/list-cards-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -CreateCardRequest request = new CreateCardRequest -{ - Type = "credit", -}; - try { - GetCardResponse result = await customersController.CreateCardAsync( - customerId, - request - ); + ListCardsResponse result = await customersController.GetCardsAsync(customerId); } catch (ApiException e) { @@ -665,37 +712,39 @@ catch (ApiException e) ``` -# Get Access Token +# Renew Card -Get a Customer's access token +Renew a card ```csharp -GetAccessTokenAsync( +RenewCardAsync( string customerId, - string tokenId) + string cardId, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | -| `tokenId` | `string` | Template, Required | Token Id | +| `customerId` | `string` | Template, Required | Customer id | +| `cardId` | `string` | Template, Required | Card Id | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-access-token-response.md) +[`Task`](../../doc/models/get-card-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -string tokenId = "token_id6"; +string cardId = "card_id4"; try { - GetAccessTokenResponse result = await customersController.GetAccessTokenAsync( + GetCardResponse result = await customersController.RenewCardAsync( customerId, - tokenId + cardId ); } catch (ApiException e) @@ -706,36 +755,38 @@ catch (ApiException e) ``` -# Get Addresses +# Get Access Token -Gets all adressess from a customer +Get a Customer's access token ```csharp -GetAddressesAsync( +GetAccessTokenAsync( string customerId, - int? page = null, - int? size = null) + string tokenId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | +| `customerId` | `string` | Template, Required | Customer Id | +| `tokenId` | `string` | Template, Required | Token Id | ## Response Type -[`Task`](../../doc/models/list-addresses-response.md) +[`Task`](../../doc/models/get-access-token-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; +string tokenId = "token_id6"; try { - ListAddressesResponse result = await customersController.GetAddressesAsync(customerId); + GetAccessTokenResponse result = await customersController.GetAccessTokenAsync( + customerId, + tokenId + ); } catch (ApiException e) { @@ -745,14 +796,14 @@ catch (ApiException e) ``` -# Update Customer +# Update Customer Metadata -Updates a customer +Updates the metadata a customer ```csharp -UpdateCustomerAsync( +UpdateCustomerMetadataAsync( string customerId, - Models.UpdateCustomerRequest request, + Models.UpdateMetadataRequest request, string idempotencyKey = null) ``` @@ -760,8 +811,8 @@ UpdateCustomerAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `request` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | Request for updating a customer | +| `customerId` | `string` | Template, Required | The customer id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the customer metadata | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -772,13 +823,17 @@ UpdateCustomerAsync( ```csharp string customerId = "customer_id8"; -UpdateCustomerRequest request = new UpdateCustomerRequest +UpdateMetadataRequest request = new UpdateMetadataRequest { + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, }; try { - GetCustomerResponse result = await customersController.UpdateCustomerAsync( + GetCustomerResponse result = await customersController.UpdateCustomerMetadataAsync( customerId, request ); @@ -791,14 +846,14 @@ catch (ApiException e) ``` -# Create Access Token +# Delete Card -Creates a access token for a customer +Delete a customer's card ```csharp -CreateAccessTokenAsync( +DeleteCardAsync( string customerId, - Models.CreateAccessTokenRequest request, + string cardId, string idempotencyKey = null) ``` @@ -807,26 +862,23 @@ CreateAccessTokenAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `request` | [`CreateAccessTokenRequest`](../../doc/models/create-access-token-request.md) | Body, Required | Request for creating a access token | +| `cardId` | `string` | Template, Required | Card Id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-access-token-response.md) +[`Task`](../../doc/models/get-card-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -CreateAccessTokenRequest request = new CreateAccessTokenRequest -{ -}; - +string cardId = "card_id4"; try { - GetAccessTokenResponse result = await customersController.CreateAccessTokenAsync( + GetCardResponse result = await customersController.DeleteCardAsync( customerId, - request + cardId ); } catch (ApiException e) @@ -837,12 +889,12 @@ catch (ApiException e) ``` -# Get Cards +# Get Addresses -Get all cards from a customer +Gets all adressess from a customer ```csharp -GetCardsAsync( +GetAddressesAsync( string customerId, int? page = null, int? size = null) @@ -852,13 +904,13 @@ GetCardsAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | +| `customerId` | `string` | Template, Required | Customer id | | `page` | `int?` | Query, Optional | Page number | | `size` | `int?` | Query, Optional | Page size | ## Response Type -[`Task`](../../doc/models/list-cards-response.md) +[`Task`](../../doc/models/list-addresses-response.md) ## Example Usage @@ -866,7 +918,7 @@ GetCardsAsync( string customerId = "customer_id8"; try { - ListCardsResponse result = await customersController.GetCardsAsync(customerId); + ListAddressesResponse result = await customersController.GetAddressesAsync(customerId); } catch (ApiException e) { @@ -876,40 +928,32 @@ catch (ApiException e) ``` -# Renew Card +# Get Customer -Renew a card +Get a customer ```csharp -RenewCardAsync( - string customerId, - string cardId, - string idempotencyKey = null) +GetCustomerAsync( + string customerId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `cardId` | `string` | Template, Required | Card Id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `customerId` | `string` | Template, Required | Customer Id | ## Response Type -[`Task`](../../doc/models/get-card-response.md) +[`Task`](../../doc/models/get-customer-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -string cardId = "card_id4"; try { - GetCardResponse result = await customersController.RenewCardAsync( - customerId, - cardId - ); + GetCustomerResponse result = await customersController.GetCustomerAsync(customerId); } catch (ApiException e) { @@ -919,46 +963,37 @@ catch (ApiException e) ``` -# Update Customer Metadata +# Get Card -Updates the metadata a customer +Get a customer's card ```csharp -UpdateCustomerMetadataAsync( +GetCardAsync( string customerId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null) + string cardId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The customer id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the customer metadata | -| `idempotencyKey` | `string` | Header, Optional | - | +| `customerId` | `string` | Template, Required | Customer id | +| `cardId` | `string` | Template, Required | Card id | ## Response Type -[`Task`](../../doc/models/get-customer-response.md) +[`Task`](../../doc/models/get-card-response.md) ## Example Usage ```csharp string customerId = "customer_id8"; -UpdateMetadataRequest request = new UpdateMetadataRequest -{ - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, -}; - +string cardId = "card_id4"; try { - GetCustomerResponse result = await customersController.UpdateCustomerMetadataAsync( + GetCardResponse result = await customersController.GetCardAsync( customerId, - request + cardId ); } catch (ApiException e) @@ -968,38 +1003,3 @@ catch (ApiException e) } ``` - -# Get Customer - -Get a customer - -```csharp -GetCustomerAsync( - string customerId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | - -## Response Type - -[`Task`](../../doc/models/get-customer-response.md) - -## Example Usage - -```csharp -string customerId = "customer_id8"; -try -{ - GetCustomerResponse result = await customersController.GetCustomerAsync(customerId); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 115259f..d502f37 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -10,60 +10,56 @@ IInvoicesController invoicesController = client.InvoicesController; ## Methods -* [Get Invoices](../../doc/controllers/invoices.md#get-invoices) -* [Cancel Invoice](../../doc/controllers/invoices.md#cancel-invoice) -* [Update Invoice Status](../../doc/controllers/invoices.md#update-invoice-status) * [Update Invoice Metadata](../../doc/controllers/invoices.md#update-invoice-metadata) * [Get Partial Invoice](../../doc/controllers/invoices.md#get-partial-invoice) +* [Cancel Invoice](../../doc/controllers/invoices.md#cancel-invoice) * [Create Invoice](../../doc/controllers/invoices.md#create-invoice) +* [Get Invoices](../../doc/controllers/invoices.md#get-invoices) * [Get Invoice](../../doc/controllers/invoices.md#get-invoice) +* [Update Invoice Status](../../doc/controllers/invoices.md#update-invoice-status) -# Get Invoices +# Update Invoice Metadata -Gets all invoices +Updates the metadata from an invoice ```csharp -GetInvoicesAsync( - int? page = null, - int? size = null, - string code = null, - string customerId = null, - string subscriptionId = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - string status = null, - DateTime? dueSince = null, - DateTime? dueUntil = null, - string customerDocument = null) +UpdateInvoiceMetadataAsync( + string invoiceId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | -| `code` | `string` | Query, Optional | Filter for Invoice's code | -| `customerId` | `string` | Query, Optional | Filter for Invoice's customer id | -| `subscriptionId` | `string` | Query, Optional | Filter for Invoice's subscription id | -| `createdSince` | `DateTime?` | Query, Optional | Filter for Invoice's creation date start range | -| `createdUntil` | `DateTime?` | Query, Optional | Filter for Invoices creation date end range | -| `status` | `string` | Query, Optional | Filter for Invoice's status | -| `dueSince` | `DateTime?` | Query, Optional | Filter for Invoice's due date start range | -| `dueUntil` | `DateTime?` | Query, Optional | Filter for Invoice's due date end range | -| `customerDocument` | `string` | Query, Optional | - | +| `invoiceId` | `string` | Template, Required | The invoice id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the invoice metadata | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-invoices-response.md) +[`Task`](../../doc/models/get-invoice-response.md) ## Example Usage ```csharp +string invoiceId = "invoice_id0"; +UpdateMetadataRequest request = new UpdateMetadataRequest +{ + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, +}; + try { - ListInvoicesResponse result = await invoicesController.GetInvoicesAsync(); + GetInvoiceResponse result = await invoicesController.UpdateInvoiceMetadataAsync( + invoiceId, + request + ); } catch (ApiException e) { @@ -73,22 +69,18 @@ catch (ApiException e) ``` -# Cancel Invoice - -Cancels an invoice +# Get Partial Invoice ```csharp -CancelInvoiceAsync( - string invoiceId, - string idempotencyKey = null) +GetPartialInvoiceAsync( + string subscriptionId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | Invoice id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | Subscription Id | ## Response Type @@ -97,10 +89,10 @@ CancelInvoiceAsync( ## Example Usage ```csharp -string invoiceId = "invoice_id0"; +string subscriptionId = "subscription_id0"; try { - GetInvoiceResponse result = await invoicesController.CancelInvoiceAsync(invoiceId); + GetInvoiceResponse result = await invoicesController.GetPartialInvoiceAsync(subscriptionId); } catch (ApiException e) { @@ -110,14 +102,13 @@ catch (ApiException e) ``` -# Update Invoice Status +# Cancel Invoice -Updates the status from an invoice +Cancels an invoice ```csharp -UpdateInvoiceStatusAsync( +CancelInvoiceAsync( string invoiceId, - Models.UpdateInvoiceStatusRequest request, string idempotencyKey = null) ``` @@ -125,8 +116,7 @@ UpdateInvoiceStatusAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | Invoice Id | -| `request` | [`UpdateInvoiceStatusRequest`](../../doc/models/update-invoice-status-request.md) | Body, Required | Request for updating an invoice's status | +| `invoiceId` | `string` | Template, Required | Invoice id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -137,17 +127,9 @@ UpdateInvoiceStatusAsync( ```csharp string invoiceId = "invoice_id0"; -UpdateInvoiceStatusRequest request = new UpdateInvoiceStatusRequest -{ - Status = "status8", -}; - try { - GetInvoiceResponse result = await invoicesController.UpdateInvoiceStatusAsync( - invoiceId, - request - ); + GetInvoiceResponse result = await invoicesController.CancelInvoiceAsync(invoiceId); } catch (ApiException e) { @@ -157,14 +139,15 @@ catch (ApiException e) ``` -# Update Invoice Metadata +# Create Invoice -Updates the metadata from an invoice +Create an Invoice ```csharp -UpdateInvoiceMetadataAsync( - string invoiceId, - Models.UpdateMetadataRequest request, +CreateInvoiceAsync( + string subscriptionId, + string cycleId, + Models.CreateInvoiceRequest request = null, string idempotencyKey = null) ``` @@ -172,8 +155,9 @@ UpdateInvoiceMetadataAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The invoice id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the invoice metadata | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `cycleId` | `string` | Template, Required | Cycle Id | +| `request` | [`CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -183,20 +167,13 @@ UpdateInvoiceMetadataAsync( ## Example Usage ```csharp -string invoiceId = "invoice_id0"; -UpdateMetadataRequest request = new UpdateMetadataRequest -{ - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, -}; - +string subscriptionId = "subscription_id0"; +string cycleId = "cycle_id6"; try { - GetInvoiceResponse result = await invoicesController.UpdateInvoiceMetadataAsync( - invoiceId, - request + GetInvoiceResponse result = await invoicesController.CreateInvoiceAsync( + subscriptionId, + cycleId ); } catch (ApiException e) @@ -207,30 +184,51 @@ catch (ApiException e) ``` -# Get Partial Invoice +# Get Invoices + +Gets all invoices ```csharp -GetPartialInvoiceAsync( - string subscriptionId) +GetInvoicesAsync( + int? page = null, + int? size = null, + string code = null, + string customerId = null, + string subscriptionId = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + string status = null, + DateTime? dueSince = null, + DateTime? dueUntil = null, + string customerDocument = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | +| `code` | `string` | Query, Optional | Filter for Invoice's code | +| `customerId` | `string` | Query, Optional | Filter for Invoice's customer id | +| `subscriptionId` | `string` | Query, Optional | Filter for Invoice's subscription id | +| `createdSince` | `DateTime?` | Query, Optional | Filter for Invoice's creation date start range | +| `createdUntil` | `DateTime?` | Query, Optional | Filter for Invoices creation date end range | +| `status` | `string` | Query, Optional | Filter for Invoice's status | +| `dueSince` | `DateTime?` | Query, Optional | Filter for Invoice's due date start range | +| `dueUntil` | `DateTime?` | Query, Optional | Filter for Invoice's due date end range | +| `customerDocument` | `string` | Query, Optional | - | ## Response Type -[`Task`](../../doc/models/get-invoice-response.md) +[`Task`](../../doc/models/list-invoices-response.md) ## Example Usage ```csharp -string subscriptionId = "subscription_id0"; try { - GetInvoiceResponse result = await invoicesController.GetPartialInvoiceAsync(subscriptionId); + ListInvoicesResponse result = await invoicesController.GetInvoicesAsync(); } catch (ApiException e) { @@ -240,26 +238,20 @@ catch (ApiException e) ``` -# Create Invoice +# Get Invoice -Create an Invoice +Gets an invoice ```csharp -CreateInvoiceAsync( - string subscriptionId, - string cycleId, - Models.CreateInvoiceRequest request = null, - string idempotencyKey = null) +GetInvoiceAsync( + string invoiceId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `cycleId` | `string` | Template, Required | Cycle Id | -| `request` | [`CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | -| `idempotencyKey` | `string` | Header, Optional | - | +| `invoiceId` | `string` | Template, Required | Invoice Id | ## Response Type @@ -268,14 +260,10 @@ CreateInvoiceAsync( ## Example Usage ```csharp -string subscriptionId = "subscription_id0"; -string cycleId = "cycle_id6"; +string invoiceId = "invoice_id0"; try { - GetInvoiceResponse result = await invoicesController.CreateInvoiceAsync( - subscriptionId, - cycleId - ); + GetInvoiceResponse result = await invoicesController.GetInvoiceAsync(invoiceId); } catch (ApiException e) { @@ -285,13 +273,15 @@ catch (ApiException e) ``` -# Get Invoice +# Update Invoice Status -Gets an invoice +Updates the status from an invoice ```csharp -GetInvoiceAsync( - string invoiceId) +UpdateInvoiceStatusAsync( + string invoiceId, + Models.UpdateInvoiceStatusRequest request, + string idempotencyKey = null) ``` ## Parameters @@ -299,6 +289,8 @@ GetInvoiceAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoiceId` | `string` | Template, Required | Invoice Id | +| `request` | [`UpdateInvoiceStatusRequest`](../../doc/models/update-invoice-status-request.md) | Body, Required | Request for updating an invoice's status | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -308,9 +300,17 @@ GetInvoiceAsync( ```csharp string invoiceId = "invoice_id0"; +UpdateInvoiceStatusRequest request = new UpdateInvoiceStatusRequest +{ + Status = "status8", +}; + try { - GetInvoiceResponse result = await invoicesController.GetInvoiceAsync(invoiceId); + GetInvoiceResponse result = await invoicesController.UpdateInvoiceStatusAsync( + invoiceId, + request + ); } catch (ApiException e) { diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md index d0862e2..fe4b00d 100644 --- a/doc/controllers/orders.md +++ b/doc/controllers/orders.md @@ -10,44 +10,55 @@ IOrdersController ordersController = client.OrdersController; ## Methods -* [Delete All Order Items](../../doc/controllers/orders.md#delete-all-order-items) -* [Get Order Item](../../doc/controllers/orders.md#get-order-item) -* [Update Order Metadata](../../doc/controllers/orders.md#update-order-metadata) -* [Delete Order Item](../../doc/controllers/orders.md#delete-order-item) -* [Get Order](../../doc/controllers/orders.md#get-order) * [Get Orders](../../doc/controllers/orders.md#get-orders) * [Update Order Item](../../doc/controllers/orders.md#update-order-item) +* [Delete All Order Items](../../doc/controllers/orders.md#delete-all-order-items) +* [Delete Order Item](../../doc/controllers/orders.md#delete-order-item) * [Close Order](../../doc/controllers/orders.md#close-order) * [Create Order](../../doc/controllers/orders.md#create-order) * [Create Order Item](../../doc/controllers/orders.md#create-order-item) +* [Get Order Item](../../doc/controllers/orders.md#get-order-item) +* [Update Order Metadata](../../doc/controllers/orders.md#update-order-metadata) +* [Get Order](../../doc/controllers/orders.md#get-order) -# Delete All Order Items +# Get Orders + +Gets all orders ```csharp -DeleteAllOrderItemsAsync( - string orderId, - string idempotencyKey = null) +GetOrdersAsync( + int? page = null, + int? size = null, + string code = null, + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null, + string customerId = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | Order Id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | +| `code` | `string` | Query, Optional | Filter for order's code | +| `status` | `string` | Query, Optional | Filter for order's status | +| `createdSince` | `DateTime?` | Query, Optional | Filter for order's creation date start range | +| `createdUntil` | `DateTime?` | Query, Optional | Filter for order's creation date end range | +| `customerId` | `string` | Query, Optional | Filter for order's customer id | ## Response Type -[`Task`](../../doc/models/get-order-response.md) +[`Task`](../../doc/models/list-order-response.md) ## Example Usage ```csharp -string orderId = "orderId2"; try { - GetOrderResponse result = await ordersController.DeleteAllOrderItemsAsync(orderId); + ListOrderResponse result = await ordersController.GetOrdersAsync(); } catch (ApiException e) { @@ -57,12 +68,14 @@ catch (ApiException e) ``` -# Get Order Item +# Update Order Item ```csharp -GetOrderItemAsync( +UpdateOrderItemAsync( string orderId, - string itemId) + string itemId, + Models.UpdateOrderItemRequest request, + string idempotencyKey = null) ``` ## Parameters @@ -71,6 +84,8 @@ GetOrderItemAsync( | --- | --- | --- | --- | | `orderId` | `string` | Template, Required | Order Id | | `itemId` | `string` | Template, Required | Item Id | +| `request` | [`UpdateOrderItemRequest`](../../doc/models/update-order-item-request.md) | Body, Required | Item Model | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -81,11 +96,20 @@ GetOrderItemAsync( ```csharp string orderId = "orderId2"; string itemId = "itemId8"; +UpdateOrderItemRequest request = new UpdateOrderItemRequest +{ + Amount = 242, + Description = "description6", + Quantity = 100, + Category = "category4", +}; + try { - GetOrderItemResponse result = await ordersController.GetOrderItemAsync( + GetOrderItemResponse result = await ordersController.UpdateOrderItemAsync( orderId, - itemId + itemId, + request ); } catch (ApiException e) @@ -96,14 +120,11 @@ catch (ApiException e) ``` -# Update Order Metadata - -Updates the metadata from an order +# Delete All Order Items ```csharp -UpdateOrderMetadataAsync( +DeleteAllOrderItemsAsync( string orderId, - Models.UpdateMetadataRequest request, string idempotencyKey = null) ``` @@ -111,8 +132,7 @@ UpdateOrderMetadataAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The order id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the order metadata | +| `orderId` | `string` | Template, Required | Order Id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -122,21 +142,10 @@ UpdateOrderMetadataAsync( ## Example Usage ```csharp -string orderId = "order_id6"; -UpdateMetadataRequest request = new UpdateMetadataRequest -{ - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, -}; - +string orderId = "orderId2"; try { - GetOrderResponse result = await ordersController.UpdateOrderMetadataAsync( - orderId, - request - ); + GetOrderResponse result = await ordersController.DeleteAllOrderItemsAsync(orderId); } catch (ApiException e) { @@ -187,20 +196,22 @@ catch (ApiException e) ``` -# Get Order - -Gets an order +# Close Order ```csharp -GetOrderAsync( - string orderId) +CloseOrderAsync( + string id, + Models.UpdateOrderStatusRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | Order id | +| `id` | `string` | Template, Required | Order Id | +| `request` | [`UpdateOrderStatusRequest`](../../doc/models/update-order-status-request.md) | Body, Required | Update Order Model | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -209,10 +220,18 @@ GetOrderAsync( ## Example Usage ```csharp -string orderId = "order_id6"; +string id = "id0"; +UpdateOrderStatusRequest request = new UpdateOrderStatusRequest +{ + Status = "status8", +}; + try { - GetOrderResponse result = await ordersController.GetOrderAsync(orderId); + GetOrderResponse result = await ordersController.CloseOrderAsync( + id, + request + ); } catch (ApiException e) { @@ -222,43 +241,84 @@ catch (ApiException e) ``` -# Get Orders +# Create Order -Gets all orders +Creates a new Order ```csharp -GetOrdersAsync( - int? page = null, - int? size = null, - string code = null, - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null, - string customerId = null) +CreateOrderAsync( + Models.CreateOrderRequest body, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | -| `code` | `string` | Query, Optional | Filter for order's code | -| `status` | `string` | Query, Optional | Filter for order's status | -| `createdSince` | `DateTime?` | Query, Optional | Filter for order's creation date start range | -| `createdUntil` | `DateTime?` | Query, Optional | Filter for order's creation date end range | -| `customerId` | `string` | Query, Optional | Filter for order's customer id | +| `body` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Body, Required | Request for creating an order | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-order-response.md) +[`Task`](../../doc/models/get-order-response.md) ## Example Usage ```csharp +CreateOrderRequest body = new CreateOrderRequest +{ + Items = new List + { + new CreateOrderItemRequest + { + Amount = 164, + Description = "description2", + Quantity = 22, + Category = "category6", + }, + }, + Customer = new CreateCustomerRequest + { + Name = "Tony Stark", + Email = "email6", + Document = "document6", + Type = "type0", + Address = new CreateAddressRequest + { + Street = "street6", + Number = "number4", + ZipCode = "zip_code0", + Neighborhood = "neighborhood2", + City = "city6", + State = "state2", + Country = "country0", + Complement = "complement2", + Line1 = "line_10", + Line2 = "line_24", + }, + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, + Phones = new CreatePhonesRequest + { + }, + Code = "code8", + }, + Payments = new List + { + new CreatePaymentRequest + { + PaymentMethod = "payment_method8", + }, + }, + Code = "code4", + Closed = true, +}; + try { - ListOrderResponse result = await ordersController.GetOrdersAsync(); + GetOrderResponse result = await ordersController.CreateOrderAsync(body); } catch (ApiException e) { @@ -268,13 +328,12 @@ catch (ApiException e) ``` -# Update Order Item +# Create Order Item ```csharp -UpdateOrderItemAsync( +CreateOrderItemAsync( string orderId, - string itemId, - Models.UpdateOrderItemRequest request, + Models.CreateOrderItemRequest request, string idempotencyKey = null) ``` @@ -283,8 +342,7 @@ UpdateOrderItemAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `orderId` | `string` | Template, Required | Order Id | -| `itemId` | `string` | Template, Required | Item Id | -| `request` | [`UpdateOrderItemRequest`](../../doc/models/update-order-item-request.md) | Body, Required | Item Model | +| `request` | [`CreateOrderItemRequest`](../../doc/models/create-order-item-request.md) | Body, Required | Order Item Model | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -295,8 +353,7 @@ UpdateOrderItemAsync( ```csharp string orderId = "orderId2"; -string itemId = "itemId8"; -UpdateOrderItemRequest request = new UpdateOrderItemRequest +CreateOrderItemRequest request = new CreateOrderItemRequest { Amount = 242, Description = "description6", @@ -306,9 +363,8 @@ UpdateOrderItemRequest request = new UpdateOrderItemRequest try { - GetOrderItemResponse result = await ordersController.UpdateOrderItemAsync( + GetOrderItemResponse result = await ordersController.CreateOrderItemAsync( orderId, - itemId, request ); } @@ -320,41 +376,35 @@ catch (ApiException e) ``` -# Close Order +# Get Order Item ```csharp -CloseOrderAsync( - string id, - Models.UpdateOrderStatusRequest request, - string idempotencyKey = null) +GetOrderItemAsync( + string orderId, + string itemId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `string` | Template, Required | Order Id | -| `request` | [`UpdateOrderStatusRequest`](../../doc/models/update-order-status-request.md) | Body, Required | Update Order Model | -| `idempotencyKey` | `string` | Header, Optional | - | +| `orderId` | `string` | Template, Required | Order Id | +| `itemId` | `string` | Template, Required | Item Id | ## Response Type -[`Task`](../../doc/models/get-order-response.md) +[`Task`](../../doc/models/get-order-item-response.md) ## Example Usage ```csharp -string id = "id0"; -UpdateOrderStatusRequest request = new UpdateOrderStatusRequest -{ - Status = "status8", -}; - +string orderId = "orderId2"; +string itemId = "itemId8"; try { - GetOrderResponse result = await ordersController.CloseOrderAsync( - id, - request + GetOrderItemResponse result = await ordersController.GetOrderItemAsync( + orderId, + itemId ); } catch (ApiException e) @@ -365,13 +415,14 @@ catch (ApiException e) ``` -# Create Order +# Update Order Metadata -Creates a new Order +Updates the metadata from an order ```csharp -CreateOrderAsync( - Models.CreateOrderRequest body, +UpdateOrderMetadataAsync( + string orderId, + Models.UpdateMetadataRequest request, string idempotencyKey = null) ``` @@ -379,7 +430,8 @@ CreateOrderAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Body, Required | Request for creating an order | +| `orderId` | `string` | Template, Required | The order id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the order metadata | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -389,60 +441,21 @@ CreateOrderAsync( ## Example Usage ```csharp -CreateOrderRequest body = new CreateOrderRequest +string orderId = "order_id6"; +UpdateMetadataRequest request = new UpdateMetadataRequest { - Items = new List - { - new CreateOrderItemRequest - { - Amount = 164, - Description = "description2", - Quantity = 22, - Category = "category6", - }, - }, - Customer = new CreateCustomerRequest - { - Name = "{\n \"name\": \"Tony Stark\"\n}", - Email = "email6", - Document = "document6", - Type = "type0", - Address = new CreateAddressRequest - { - Street = "street6", - Number = "number4", - ZipCode = "zip_code0", - Neighborhood = "neighborhood2", - City = "city6", - State = "state2", - Country = "country0", - Complement = "complement2", - Line1 = "line_10", - Line2 = "line_24", - }, - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, - Phones = new CreatePhonesRequest - { - }, - Code = "code8", - }, - Payments = new List + Metadata = new Dictionary { - new CreatePaymentRequest - { - PaymentMethod = "payment_method8", - }, + ["key0"] = "metadata3", }, - Code = "code4", - Closed = true, }; try { - GetOrderResponse result = await ordersController.CreateOrderAsync(body); + GetOrderResponse result = await ordersController.UpdateOrderMetadataAsync( + orderId, + request + ); } catch (ApiException e) { @@ -452,45 +465,32 @@ catch (ApiException e) ``` -# Create Order Item +# Get Order + +Gets an order ```csharp -CreateOrderItemAsync( - string orderId, - Models.CreateOrderItemRequest request, - string idempotencyKey = null) +GetOrderAsync( + string orderId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | Order Id | -| `request` | [`CreateOrderItemRequest`](../../doc/models/create-order-item-request.md) | Body, Required | Order Item Model | -| `idempotencyKey` | `string` | Header, Optional | - | +| `orderId` | `string` | Template, Required | Order id | ## Response Type -[`Task`](../../doc/models/get-order-item-response.md) +[`Task`](../../doc/models/get-order-response.md) ## Example Usage ```csharp -string orderId = "orderId2"; -CreateOrderItemRequest request = new CreateOrderItemRequest -{ - Amount = 242, - Description = "description6", - Quantity = 100, - Category = "category4", -}; - +string orderId = "order_id6"; try { - GetOrderItemResponse result = await ordersController.CreateOrderItemAsync( - orderId, - request - ); + GetOrderResponse result = await ordersController.GetOrderAsync(orderId); } catch (ApiException e) { diff --git a/doc/controllers/plans.md b/doc/controllers/plans.md index 66c7ad6..e47fc11 100644 --- a/doc/controllers/plans.md +++ b/doc/controllers/plans.md @@ -11,15 +11,15 @@ IPlansController plansController = client.PlansController; ## Methods * [Get Plan](../../doc/controllers/plans.md#get-plan) -* [Delete Plan Item](../../doc/controllers/plans.md#delete-plan-item) -* [Update Plan Metadata](../../doc/controllers/plans.md#update-plan-metadata) -* [Create Plan](../../doc/controllers/plans.md#create-plan) -* [Update Plan](../../doc/controllers/plans.md#update-plan) * [Delete Plan](../../doc/controllers/plans.md#delete-plan) -* [Get Plans](../../doc/controllers/plans.md#get-plans) +* [Update Plan Metadata](../../doc/controllers/plans.md#update-plan-metadata) * [Update Plan Item](../../doc/controllers/plans.md#update-plan-item) * [Create Plan Item](../../doc/controllers/plans.md#create-plan-item) * [Get Plan Item](../../doc/controllers/plans.md#get-plan-item) +* [Create Plan](../../doc/controllers/plans.md#create-plan) +* [Delete Plan Item](../../doc/controllers/plans.md#delete-plan-item) +* [Get Plans](../../doc/controllers/plans.md#get-plans) +* [Update Plan](../../doc/controllers/plans.md#update-plan) # Get Plan @@ -57,14 +57,13 @@ catch (ApiException e) ``` -# Delete Plan Item +# Delete Plan -Removes an item from a plan +Deletes a plan ```csharp -DeletePlanItemAsync( +DeletePlanAsync( string planId, - string planItemId, string idempotencyKey = null) ``` @@ -73,24 +72,19 @@ DeletePlanItemAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | -| `planItemId` | `string` | Template, Required | Plan item id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-plan-item-response.md) +[`Task`](../../doc/models/get-plan-response.md) ## Example Usage ```csharp string planId = "plan_id8"; -string planItemId = "plan_item_id0"; try { - GetPlanItemResponse result = await plansController.DeletePlanItemAsync( - planId, - planItemId - ); + GetPlanResponse result = await plansController.DeletePlanAsync(planId); } catch (ApiException e) { @@ -150,13 +144,15 @@ catch (ApiException e) ``` -# Create Plan +# Update Plan Item -Creates a new plan +Updates a plan item ```csharp -CreatePlanAsync( - Models.CreatePlanRequest body, +UpdatePlanItemAsync( + string planId, + string planItemId, + Models.UpdatePlanItemRequest body, string idempotencyKey = null) ``` @@ -164,66 +160,46 @@ CreatePlanAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreatePlanRequest`](../../doc/models/create-plan-request.md) | Body, Required | Request for creating a plan | +| `planId` | `string` | Template, Required | Plan id | +| `planItemId` | `string` | Template, Required | Plan item id | +| `body` | [`UpdatePlanItemRequest`](../../doc/models/update-plan-item-request.md) | Body, Required | Request for updating the plan item | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-plan-response.md) +[`Task`](../../doc/models/get-plan-item-response.md) ## Example Usage ```csharp -CreatePlanRequest body = new CreatePlanRequest +string planId = "plan_id8"; +string planItemId = "plan_item_id0"; +UpdatePlanItemRequest body = new UpdatePlanItemRequest { Name = "name6", Description = "description4", - StatementDescriptor = "statement_descriptor6", - Items = new List + Status = "status2", + PricingScheme = new UpdatePricingSchemeRequest { - new CreatePlanItemRequest + SchemeType = "scheme_type8", + PriceBrackets = new List { - Name = "name8", - PricingScheme = new CreatePricingSchemeRequest + new UpdatePriceBracketRequest { - SchemeType = "scheme_type8", + StartQuantity = 144, + Price = 174, }, - Id = "id8", - Description = "description2", }, }, - Shippable = false, - PaymentMethods = new List - { - "payment_methods9", - }, - Installments = new List - { - 207, - }, - Currency = "currency6", - Interval = "interval6", - IntervalCount = 170, - BillingDays = new List - { - 201, - 200, - }, - BillingType = "billing_type0", - PricingScheme = new CreatePricingSchemeRequest - { - SchemeType = "scheme_type8", - }, - Metadata = new Dictionary - { - ["key0"] = "metadata7", - ["key1"] = "metadata8", - }, }; try { - GetPlanResponse result = await plansController.CreatePlanAsync(body); + GetPlanItemResponse result = await plansController.UpdatePlanItemAsync( + planId, + planItemId, + body + ); } catch (ApiException e) { @@ -233,14 +209,14 @@ catch (ApiException e) ``` -# Update Plan +# Create Plan Item -Updates a plan +Adds a new item to a plan ```csharp -UpdatePlanAsync( +CreatePlanItemAsync( string planId, - Models.UpdatePlanRequest request, + Models.CreatePlanItemRequest request, string idempotencyKey = null) ``` @@ -249,52 +225,31 @@ UpdatePlanAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | -| `request` | [`UpdatePlanRequest`](../../doc/models/update-plan-request.md) | Body, Required | Request for updating a plan | +| `request` | [`CreatePlanItemRequest`](../../doc/models/create-plan-item-request.md) | Body, Required | Request for creating a plan item | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-plan-response.md) +[`Task`](../../doc/models/get-plan-item-response.md) ## Example Usage ```csharp string planId = "plan_id8"; -UpdatePlanRequest request = new UpdatePlanRequest +CreatePlanItemRequest request = new CreatePlanItemRequest { Name = "name6", - Description = "description6", - Installments = new List - { - 151, - 152, - }, - StatementDescriptor = "statement_descriptor6", - Currency = "currency6", - Interval = "interval4", - IntervalCount = 114, - PaymentMethods = new List - { - "payment_methods1", - "payment_methods0", - "payment_methods9", - }, - BillingType = "billing_type0", - Status = "status8", - Shippable = false, - BillingDays = new List - { - 115, - }, - Metadata = new Dictionary + PricingScheme = new CreatePricingSchemeRequest { - ["key0"] = "metadata3", + SchemeType = "scheme_type8", }, + Id = "id6", + Description = "description6", }; try { - GetPlanResponse result = await plansController.UpdatePlanAsync( + GetPlanItemResponse result = await plansController.CreatePlanItemAsync( planId, request ); @@ -307,14 +262,14 @@ catch (ApiException e) ``` -# Delete Plan +# Get Plan Item -Deletes a plan +Gets a plan item ```csharp -DeletePlanAsync( +GetPlanItemAsync( string planId, - string idempotencyKey = null) + string planItemId) ``` ## Parameters @@ -322,19 +277,23 @@ DeletePlanAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `planItemId` | `string` | Template, Required | Plan item id | ## Response Type -[`Task`](../../doc/models/get-plan-response.md) +[`Task`](../../doc/models/get-plan-item-response.md) ## Example Usage ```csharp string planId = "plan_id8"; +string planItemId = "plan_item_id0"; try { - GetPlanResponse result = await plansController.DeletePlanAsync(planId); + GetPlanItemResponse result = await plansController.GetPlanItemAsync( + planId, + planItemId + ); } catch (ApiException e) { @@ -344,43 +303,80 @@ catch (ApiException e) ``` -# Get Plans +# Create Plan -Gets all plans +Creates a new plan ```csharp -GetPlansAsync( - int? page = null, - int? size = null, - string name = null, - string status = null, - string billingType = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) +CreatePlanAsync( + Models.CreatePlanRequest body, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | -| `name` | `string` | Query, Optional | Filter for Plan's name | -| `status` | `string` | Query, Optional | Filter for Plan's status | -| `billingType` | `string` | Query, Optional | Filter for plan's billing type | -| `createdSince` | `DateTime?` | Query, Optional | Filter for plan's creation date start range | -| `createdUntil` | `DateTime?` | Query, Optional | Filter for plan's creation date end range | +| `body` | [`CreatePlanRequest`](../../doc/models/create-plan-request.md) | Body, Required | Request for creating a plan | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-plans-response.md) +[`Task`](../../doc/models/get-plan-response.md) ## Example Usage ```csharp +CreatePlanRequest body = new CreatePlanRequest +{ + Name = "name6", + Description = "description4", + StatementDescriptor = "statement_descriptor6", + Items = new List + { + new CreatePlanItemRequest + { + Name = "name8", + PricingScheme = new CreatePricingSchemeRequest + { + SchemeType = "scheme_type8", + }, + Id = "id8", + Description = "description2", + }, + }, + Shippable = false, + PaymentMethods = new List + { + "payment_methods9", + }, + Installments = new List + { + 207, + }, + Currency = "currency6", + Interval = "interval6", + IntervalCount = 170, + BillingDays = new List + { + 201, + 200, + }, + BillingType = "billing_type0", + PricingScheme = new CreatePricingSchemeRequest + { + SchemeType = "scheme_type8", + }, + Metadata = new Dictionary + { + ["key0"] = "metadata7", + ["key1"] = "metadata8", + }, +}; + try { - ListPlansResponse result = await plansController.GetPlansAsync(); + GetPlanResponse result = await plansController.CreatePlanAsync(body); } catch (ApiException e) { @@ -390,15 +386,14 @@ catch (ApiException e) ``` -# Update Plan Item +# Delete Plan Item -Updates a plan item +Removes an item from a plan ```csharp -UpdatePlanItemAsync( +DeletePlanItemAsync( string planId, string planItemId, - Models.UpdatePlanItemRequest body, string idempotencyKey = null) ``` @@ -408,7 +403,6 @@ UpdatePlanItemAsync( | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | | `planItemId` | `string` | Template, Required | Plan item id | -| `body` | [`UpdatePlanItemRequest`](../../doc/models/update-plan-item-request.md) | Body, Required | Request for updating the plan item | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -420,31 +414,11 @@ UpdatePlanItemAsync( ```csharp string planId = "plan_id8"; string planItemId = "plan_item_id0"; -UpdatePlanItemRequest body = new UpdatePlanItemRequest -{ - Name = "name6", - Description = "description4", - Status = "status2", - PricingScheme = new UpdatePricingSchemeRequest - { - SchemeType = "scheme_type8", - PriceBrackets = new List - { - new UpdatePriceBracketRequest - { - StartQuantity = 144, - Price = 174, - }, - }, - }, -}; - try { - GetPlanItemResponse result = await plansController.UpdatePlanItemAsync( + GetPlanItemResponse result = await plansController.DeletePlanItemAsync( planId, - planItemId, - body + planItemId ); } catch (ApiException e) @@ -455,50 +429,43 @@ catch (ApiException e) ``` -# Create Plan Item +# Get Plans -Adds a new item to a plan +Gets all plans ```csharp -CreatePlanItemAsync( - string planId, - Models.CreatePlanItemRequest request, - string idempotencyKey = null) +GetPlansAsync( + int? page = null, + int? size = null, + string name = null, + string status = null, + string billingType = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `planId` | `string` | Template, Required | Plan id | -| `request` | [`CreatePlanItemRequest`](../../doc/models/create-plan-item-request.md) | Body, Required | Request for creating a plan item | -| `idempotencyKey` | `string` | Header, Optional | - | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | +| `name` | `string` | Query, Optional | Filter for Plan's name | +| `status` | `string` | Query, Optional | Filter for Plan's status | +| `billingType` | `string` | Query, Optional | Filter for plan's billing type | +| `createdSince` | `DateTime?` | Query, Optional | Filter for plan's creation date start range | +| `createdUntil` | `DateTime?` | Query, Optional | Filter for plan's creation date end range | ## Response Type -[`Task`](../../doc/models/get-plan-item-response.md) +[`Task`](../../doc/models/list-plans-response.md) ## Example Usage ```csharp -string planId = "plan_id8"; -CreatePlanItemRequest request = new CreatePlanItemRequest -{ - Name = "name6", - PricingScheme = new CreatePricingSchemeRequest - { - SchemeType = "scheme_type8", - }, - Id = "id6", - Description = "description6", -}; - try { - GetPlanItemResponse result = await plansController.CreatePlanItemAsync( - planId, - request - ); + ListPlansResponse result = await plansController.GetPlansAsync(); } catch (ApiException e) { @@ -508,14 +475,15 @@ catch (ApiException e) ``` -# Get Plan Item +# Update Plan -Gets a plan item +Updates a plan ```csharp -GetPlanItemAsync( +UpdatePlanAsync( string planId, - string planItemId) + Models.UpdatePlanRequest request, + string idempotencyKey = null) ``` ## Parameters @@ -523,22 +491,54 @@ GetPlanItemAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | -| `planItemId` | `string` | Template, Required | Plan item id | +| `request` | [`UpdatePlanRequest`](../../doc/models/update-plan-request.md) | Body, Required | Request for updating a plan | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-plan-item-response.md) +[`Task`](../../doc/models/get-plan-response.md) ## Example Usage ```csharp string planId = "plan_id8"; -string planItemId = "plan_item_id0"; +UpdatePlanRequest request = new UpdatePlanRequest +{ + Name = "name6", + Description = "description6", + Installments = new List + { + 151, + 152, + }, + StatementDescriptor = "statement_descriptor6", + Currency = "currency6", + Interval = "interval4", + IntervalCount = 114, + PaymentMethods = new List + { + "payment_methods1", + "payment_methods0", + "payment_methods9", + }, + BillingType = "billing_type0", + Status = "status8", + Shippable = false, + BillingDays = new List + { + 115, + }, + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, +}; + try { - GetPlanItemResponse result = await plansController.GetPlanItemAsync( + GetPlanResponse result = await plansController.UpdatePlanAsync( planId, - planItemId + request ); } catch (ApiException e) diff --git a/doc/controllers/recipients.md b/doc/controllers/recipients.md index 5a05c61..ef95a95 100644 --- a/doc/controllers/recipients.md +++ b/doc/controllers/recipients.md @@ -11,26 +11,27 @@ IRecipientsController recipientsController = client.RecipientsController; ## Methods * [Update Recipient](../../doc/controllers/recipients.md#update-recipient) -* [Get Withdraw by Id](../../doc/controllers/recipients.md#get-withdraw-by-id) -* [Get Recipient](../../doc/controllers/recipients.md#get-recipient) -* [Get Balance](../../doc/controllers/recipients.md#get-balance) +* [Create Anticipation](../../doc/controllers/recipients.md#create-anticipation) +* [Get Anticipation Limits](../../doc/controllers/recipients.md#get-anticipation-limits) * [Get Recipients](../../doc/controllers/recipients.md#get-recipients) +* [Get Withdraw by Id](../../doc/controllers/recipients.md#get-withdraw-by-id) * [Update Recipient Default Bank Account](../../doc/controllers/recipients.md#update-recipient-default-bank-account) +* [Update Recipient Metadata](../../doc/controllers/recipients.md#update-recipient-metadata) * [Get Transfers](../../doc/controllers/recipients.md#get-transfers) * [Get Transfer](../../doc/controllers/recipients.md#get-transfer) * [Create Withdraw](../../doc/controllers/recipients.md#create-withdraw) +* [Update Automatic Anticipation Settings](../../doc/controllers/recipients.md#update-automatic-anticipation-settings) * [Get Anticipation](../../doc/controllers/recipients.md#get-anticipation) * [Update Recipient Transfer Settings](../../doc/controllers/recipients.md#update-recipient-transfer-settings) -* [Get Recipient by Code](../../doc/controllers/recipients.md#get-recipient-by-code) -* [Update Automatic Anticipation Settings](../../doc/controllers/recipients.md#update-automatic-anticipation-settings) +* [Get Anticipations](../../doc/controllers/recipients.md#get-anticipations) +* [Get Recipient](../../doc/controllers/recipients.md#get-recipient) +* [Get Balance](../../doc/controllers/recipients.md#get-balance) +* [Get Withdrawals](../../doc/controllers/recipients.md#get-withdrawals) * [Create Transfer](../../doc/controllers/recipients.md#create-transfer) * [Create Recipient](../../doc/controllers/recipients.md#create-recipient) +* [Get Recipient by Code](../../doc/controllers/recipients.md#get-recipient-by-code) * [Get Default Recipient](../../doc/controllers/recipients.md#get-default-recipient) -* [Create Anticipation](../../doc/controllers/recipients.md#create-anticipation) -* [Get Anticipation Limits](../../doc/controllers/recipients.md#get-anticipation-limits) -* [Update Recipient Metadata](../../doc/controllers/recipients.md#update-recipient-metadata) -* [Get Anticipations](../../doc/controllers/recipients.md#get-anticipations) -* [Get Withdrawals](../../doc/controllers/recipients.md#get-withdrawals) +* [Create KYC Link](../../doc/controllers/recipients.md#create-kyc-link) # Update Recipient @@ -88,35 +89,47 @@ catch (ApiException e) ``` -# Get Withdraw by Id +# Create Anticipation + +Creates an anticipation ```csharp -GetWithdrawByIdAsync( +CreateAnticipationAsync( string recipientId, - string withdrawalId) + Models.CreateAnticipationRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | - | -| `withdrawalId` | `string` | Template, Required | - | +| `recipientId` | `string` | Template, Required | Recipient id | +| `request` | [`CreateAnticipationRequest`](../../doc/models/create-anticipation-request.md) | Body, Required | Anticipation data | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-withdraw-response.md) +[`Task`](../../doc/models/get-anticipation-response.md) ## Example Usage ```csharp string recipientId = "recipient_id0"; -string withdrawalId = "withdrawal_id2"; +CreateAnticipationRequest request = new CreateAnticipationRequest +{ + Amount = 242, + Timeframe = "timeframe8", + PaymentDate = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", + provider: CultureInfo.InvariantCulture, + DateTimeStyles.RoundtripKind), +}; + try { - GetWithdrawResponse result = await recipientsController.GetWithdrawByIdAsync( + GetAnticipationResponse result = await recipientsController.CreateAnticipationAsync( recipientId, - withdrawalId + request ); } catch (ApiException e) @@ -127,32 +140,44 @@ catch (ApiException e) ``` -# Get Recipient +# Get Anticipation Limits -Retrieves recipient information +Gets the anticipation limits for a recipient ```csharp -GetRecipientAsync( - string recipientId) +GetAnticipationLimitsAsync( + string recipientId, + string timeframe, + DateTime paymentDate) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipiend id | +| `recipientId` | `string` | Template, Required | Recipient id | +| `timeframe` | `string` | Query, Required | Timeframe | +| `paymentDate` | `DateTime` | Query, Required | Anticipation payment date | ## Response Type -[`Task`](../../doc/models/get-recipient-response.md) +[`Task`](../../doc/models/get-anticipation-limit-response.md) ## Example Usage ```csharp string recipientId = "recipient_id0"; +string timeframe = "timeframe2"; +DateTime paymentDate = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", + provider: CultureInfo.InvariantCulture, + DateTimeStyles.RoundtripKind); try { - GetRecipientResponse result = await recipientsController.GetRecipientAsync(recipientId); + GetAnticipationLimitResponse result = await recipientsController.GetAnticipationLimitsAsync( + recipientId, + timeframe, + paymentDate + ); } catch (ApiException e) { @@ -162,32 +187,33 @@ catch (ApiException e) ``` -# Get Balance +# Get Recipients -Get balance information for a recipient +Retrieves paginated recipients information ```csharp -GetBalanceAsync( - string recipientId) +GetRecipientsAsync( + int? page = null, + int? size = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | ## Response Type -[`Task`](../../doc/models/get-balance-response.md) +[`Task`](../../doc/models/list-recipient-response.md) ## Example Usage ```csharp -string recipientId = "recipient_id0"; try { - GetBalanceResponse result = await recipientsController.GetBalanceAsync(recipientId); + ListRecipientResponse result = await recipientsController.GetRecipientsAsync(); } catch (ApiException e) { @@ -197,33 +223,36 @@ catch (ApiException e) ``` -# Get Recipients - -Retrieves paginated recipients information +# Get Withdraw by Id ```csharp -GetRecipientsAsync( - int? page = null, - int? size = null) +GetWithdrawByIdAsync( + string recipientId, + string withdrawalId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | +| `recipientId` | `string` | Template, Required | - | +| `withdrawalId` | `string` | Template, Required | - | ## Response Type -[`Task`](../../doc/models/list-recipient-response.md) +[`Task`](../../doc/models/get-withdraw-response.md) ## Example Usage ```csharp +string recipientId = "recipient_id0"; +string withdrawalId = "withdrawal_id2"; try { - ListRecipientResponse result = await recipientsController.GetRecipientsAsync(); + GetWithdrawResponse result = await recipientsController.GetWithdrawByIdAsync( + recipientId, + withdrawalId + ); } catch (ApiException e) { @@ -296,6 +325,56 @@ catch (ApiException e) ``` +# Update Recipient Metadata + +Updates recipient metadata + +```csharp +UpdateRecipientMetadataAsync( + string recipientId, + Models.UpdateMetadataRequest request, + string idempotencyKey = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipientId` | `string` | Template, Required | Recipient id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Metadata | +| `idempotencyKey` | `string` | Header, Optional | - | + +## Response Type + +[`Task`](../../doc/models/get-recipient-response.md) + +## Example Usage + +```csharp +string recipientId = "recipient_id0"; +UpdateMetadataRequest request = new UpdateMetadataRequest +{ + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, +}; + +try +{ + GetRecipientResponse result = await recipientsController.UpdateRecipientMetadataAsync( + recipientId, + request + ); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + # Get Transfers Gets a paginated list of transfers for the recipient @@ -425,6 +504,52 @@ catch (ApiException e) ``` +# Update Automatic Anticipation Settings + +Updates recipient metadata + +```csharp +UpdateAutomaticAnticipationSettingsAsync( + string recipientId, + Models.UpdateAutomaticAnticipationSettingsRequest request, + string idempotencyKey = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipientId` | `string` | Template, Required | Recipient id | +| `request` | [`UpdateAutomaticAnticipationSettingsRequest`](../../doc/models/update-automatic-anticipation-settings-request.md) | Body, Required | Metadata | +| `idempotencyKey` | `string` | Header, Optional | - | + +## Response Type + +[`Task`](../../doc/models/get-recipient-response.md) + +## Example Usage + +```csharp +string recipientId = "recipient_id0"; +UpdateAutomaticAnticipationSettingsRequest request = new UpdateAutomaticAnticipationSettingsRequest +{ +}; + +try +{ + GetRecipientResponse result = await recipientsController.UpdateAutomaticAnticipationSettingsAsync( + recipientId, + request + ); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + # Get Anticipation Gets an anticipation @@ -513,32 +638,48 @@ catch (ApiException e) ``` -# Get Recipient by Code +# Get Anticipations -Retrieves recipient information +Retrieves a paginated list of anticipations from a recipient ```csharp -GetRecipientByCodeAsync( - string code) +GetAnticipationsAsync( + string recipientId, + int? page = null, + int? size = null, + string status = null, + string timeframe = null, + DateTime? paymentDateSince = null, + DateTime? paymentDateUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `code` | `string` | Template, Required | Recipient code | +| `recipientId` | `string` | Template, Required | Recipient id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | +| `status` | `string` | Query, Optional | Filter for anticipation status | +| `timeframe` | `string` | Query, Optional | Filter for anticipation timeframe | +| `paymentDateSince` | `DateTime?` | Query, Optional | Filter for start range for anticipation payment date | +| `paymentDateUntil` | `DateTime?` | Query, Optional | Filter for end range for anticipation payment date | +| `createdSince` | `DateTime?` | Query, Optional | Filter for start range for anticipation creation date | +| `createdUntil` | `DateTime?` | Query, Optional | Filter for end range for anticipation creation date | ## Response Type -[`Task`](../../doc/models/get-recipient-response.md) +[`Task`](../../doc/models/list-anticipation-response.md) ## Example Usage ```csharp -string code = "code8"; +string recipientId = "recipient_id0"; try { - GetRecipientResponse result = await recipientsController.GetRecipientByCodeAsync(code); + ListAnticipationResponse result = await recipientsController.GetAnticipationsAsync(recipientId); } catch (ApiException e) { @@ -548,24 +689,20 @@ catch (ApiException e) ``` -# Update Automatic Anticipation Settings +# Get Recipient -Updates recipient metadata +Retrieves recipient information ```csharp -UpdateAutomaticAnticipationSettingsAsync( - string recipientId, - Models.UpdateAutomaticAnticipationSettingsRequest request, - string idempotencyKey = null) +GetRecipientAsync( + string recipientId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `request` | [`UpdateAutomaticAnticipationSettingsRequest`](../../doc/models/update-automatic-anticipation-settings-request.md) | Body, Required | Metadata | -| `idempotencyKey` | `string` | Header, Optional | - | +| `recipientId` | `string` | Template, Required | Recipiend id | ## Response Type @@ -575,16 +712,9 @@ UpdateAutomaticAnticipationSettingsAsync( ```csharp string recipientId = "recipient_id0"; -UpdateAutomaticAnticipationSettingsRequest request = new UpdateAutomaticAnticipationSettingsRequest -{ -}; - try { - GetRecipientResponse result = await recipientsController.UpdateAutomaticAnticipationSettingsAsync( - recipientId, - request - ); + GetRecipientResponse result = await recipientsController.GetRecipientAsync(recipientId); } catch (ApiException e) { @@ -594,48 +724,32 @@ catch (ApiException e) ``` -# Create Transfer +# Get Balance -Creates a transfer for a recipient +Get balance information for a recipient ```csharp -CreateTransferAsync( - string recipientId, - Models.CreateTransferRequest request, - string idempotencyKey = null) +GetBalanceAsync( + string recipientId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient Id | -| `request` | [`CreateTransferRequest`](../../doc/models/create-transfer-request.md) | Body, Required | Transfer data | -| `idempotencyKey` | `string` | Header, Optional | - | +| `recipientId` | `string` | Template, Required | Recipient id | ## Response Type -[`Task`](../../doc/models/get-transfer-response.md) +[`Task`](../../doc/models/get-balance-response.md) ## Example Usage ```csharp string recipientId = "recipient_id0"; -CreateTransferRequest request = new CreateTransferRequest -{ - Amount = 242, - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, -}; - try { - GetTransferResponse result = await recipientsController.CreateTransferAsync( - recipientId, - request - ); + GetBalanceResponse result = await recipientsController.GetBalanceAsync(recipientId); } catch (ApiException e) { @@ -645,85 +759,42 @@ catch (ApiException e) ``` -# Create Recipient +# Get Withdrawals -Creates a new recipient +Gets a paginated list of transfers for the recipient ```csharp -CreateRecipientAsync( - Models.CreateRecipientRequest request, - string idempotencyKey = null) +GetWithdrawalsAsync( + string recipientId, + int? page = null, + int? size = null, + string status = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `request` | [`CreateRecipientRequest`](../../doc/models/create-recipient-request.md) | Body, Required | Recipient data | -| `idempotencyKey` | `string` | Header, Optional | - | - -## Response Type - -[`Task`](../../doc/models/get-recipient-response.md) - -## Example Usage - -```csharp -CreateRecipientRequest request = new CreateRecipientRequest -{ - DefaultBankAccount = new CreateBankAccountRequest - { - HolderName = "holder_name4", - HolderType = "holder_type0", - HolderDocument = "holder_document2", - Bank = "bank6", - BranchNumber = "branch_number4", - AccountNumber = "account_number8", - AccountCheckDigit = "account_check_digit4", - Type = "type2", - Metadata = new Dictionary - { - ["key0"] = "metadata5", - ["key1"] = "metadata4", - ["key2"] = "metadata3", - }, - }, - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, - Code = "code4", - PaymentMode = "bank_transfer", -}; - -try -{ - GetRecipientResponse result = await recipientsController.CreateRecipientAsync(request); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# Get Default Recipient - -```csharp -GetDefaultRecipientAsync() -``` +| `recipientId` | `string` | Template, Required | - | +| `page` | `int?` | Query, Optional | - | +| `size` | `int?` | Query, Optional | - | +| `status` | `string` | Query, Optional | - | +| `createdSince` | `DateTime?` | Query, Optional | - | +| `createdUntil` | `DateTime?` | Query, Optional | - | ## Response Type -[`Task`](../../doc/models/get-recipient-response.md) +[`Task`](../../doc/models/list-withdrawals.md) ## Example Usage ```csharp +string recipientId = "recipient_id0"; try { - GetRecipientResponse result = await recipientsController.GetDefaultRecipientAsync(); + ListWithdrawals result = await recipientsController.GetWithdrawalsAsync(recipientId); } catch (ApiException e) { @@ -733,14 +804,14 @@ catch (ApiException e) ``` -# Create Anticipation +# Create Transfer -Creates an anticipation +Creates a transfer for a recipient ```csharp -CreateAnticipationAsync( +CreateTransferAsync( string recipientId, - Models.CreateAnticipationRequest request, + Models.CreateTransferRequest request, string idempotencyKey = null) ``` @@ -748,30 +819,30 @@ CreateAnticipationAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `request` | [`CreateAnticipationRequest`](../../doc/models/create-anticipation-request.md) | Body, Required | Anticipation data | +| `recipientId` | `string` | Template, Required | Recipient Id | +| `request` | [`CreateTransferRequest`](../../doc/models/create-transfer-request.md) | Body, Required | Transfer data | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-anticipation-response.md) +[`Task`](../../doc/models/get-transfer-response.md) ## Example Usage ```csharp string recipientId = "recipient_id0"; -CreateAnticipationRequest request = new CreateAnticipationRequest +CreateTransferRequest request = new CreateTransferRequest { Amount = 242, - Timeframe = "timeframe8", - PaymentDate = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", - provider: CultureInfo.InvariantCulture, - DateTimeStyles.RoundtripKind), + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, }; try { - GetAnticipationResponse result = await recipientsController.CreateAnticipationAsync( + GetTransferResponse result = await recipientsController.CreateTransferAsync( recipientId, request ); @@ -784,44 +855,60 @@ catch (ApiException e) ``` -# Get Anticipation Limits +# Create Recipient -Gets the anticipation limits for a recipient +Creates a new recipient ```csharp -GetAnticipationLimitsAsync( - string recipientId, - string timeframe, - DateTime paymentDate) +CreateRecipientAsync( + Models.CreateRecipientRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `timeframe` | `string` | Query, Required | Timeframe | -| `paymentDate` | `DateTime` | Query, Required | Anticipation payment date | +| `request` | [`CreateRecipientRequest`](../../doc/models/create-recipient-request.md) | Body, Required | Recipient data | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-anticipation-limit-response.md) +[`Task`](../../doc/models/get-recipient-response.md) ## Example Usage ```csharp -string recipientId = "recipient_id0"; -string timeframe = "timeframe2"; -DateTime paymentDate = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", - provider: CultureInfo.InvariantCulture, - DateTimeStyles.RoundtripKind); +CreateRecipientRequest request = new CreateRecipientRequest +{ + DefaultBankAccount = new CreateBankAccountRequest + { + HolderName = "holder_name4", + HolderType = "holder_type0", + HolderDocument = "holder_document2", + Bank = "bank6", + BranchNumber = "branch_number4", + AccountNumber = "account_number8", + AccountCheckDigit = "account_check_digit4", + Type = "type2", + Metadata = new Dictionary + { + ["key0"] = "metadata5", + ["key1"] = "metadata4", + ["key2"] = "metadata3", + }, + }, + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, + Code = "code4", + PaymentMode = "bank_transfer", +}; + try { - GetAnticipationLimitResponse result = await recipientsController.GetAnticipationLimitsAsync( - recipientId, - timeframe, - paymentDate - ); + GetRecipientResponse result = await recipientsController.CreateRecipientAsync(request); } catch (ApiException e) { @@ -831,24 +918,20 @@ catch (ApiException e) ``` -# Update Recipient Metadata +# Get Recipient by Code -Updates recipient metadata +Retrieves recipient information ```csharp -UpdateRecipientMetadataAsync( - string recipientId, - Models.UpdateMetadataRequest request, - string idempotencyKey = null) +GetRecipientByCodeAsync( + string code) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Metadata | -| `idempotencyKey` | `string` | Header, Optional | - | +| `code` | `string` | Template, Required | Recipient code | ## Response Type @@ -857,21 +940,10 @@ UpdateRecipientMetadataAsync( ## Example Usage ```csharp -string recipientId = "recipient_id0"; -UpdateMetadataRequest request = new UpdateMetadataRequest -{ - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, -}; - +string code = "code8"; try { - GetRecipientResponse result = await recipientsController.UpdateRecipientMetadataAsync( - recipientId, - request - ); + GetRecipientResponse result = await recipientsController.GetRecipientByCodeAsync(code); } catch (ApiException e) { @@ -881,48 +953,22 @@ catch (ApiException e) ``` -# Get Anticipations - -Retrieves a paginated list of anticipations from a recipient +# Get Default Recipient ```csharp -GetAnticipationsAsync( - string recipientId, - int? page = null, - int? size = null, - string status = null, - string timeframe = null, - DateTime? paymentDateSince = null, - DateTime? paymentDateUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) +GetDefaultRecipientAsync() ``` -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | -| `status` | `string` | Query, Optional | Filter for anticipation status | -| `timeframe` | `string` | Query, Optional | Filter for anticipation timeframe | -| `paymentDateSince` | `DateTime?` | Query, Optional | Filter for start range for anticipation payment date | -| `paymentDateUntil` | `DateTime?` | Query, Optional | Filter for end range for anticipation payment date | -| `createdSince` | `DateTime?` | Query, Optional | Filter for start range for anticipation creation date | -| `createdUntil` | `DateTime?` | Query, Optional | Filter for end range for anticipation creation date | - ## Response Type -[`Task`](../../doc/models/list-anticipation-response.md) +[`Task`](../../doc/models/get-recipient-response.md) ## Example Usage ```csharp -string recipientId = "recipient_id0"; try { - ListAnticipationResponse result = await recipientsController.GetAnticipationsAsync(recipientId); + GetRecipientResponse result = await recipientsController.GetDefaultRecipientAsync(); } catch (ApiException e) { @@ -932,18 +978,13 @@ catch (ApiException e) ``` -# Get Withdrawals +# Create KYC Link -Gets a paginated list of transfers for the recipient +Create a KYC link ```csharp -GetWithdrawalsAsync( - string recipientId, - int? page = null, - int? size = null, - string status = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) +CreateKYCLinkAsync( + string recipientId) ``` ## Parameters @@ -951,15 +992,10 @@ GetWithdrawalsAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `recipientId` | `string` | Template, Required | - | -| `page` | `int?` | Query, Optional | - | -| `size` | `int?` | Query, Optional | - | -| `status` | `string` | Query, Optional | - | -| `createdSince` | `DateTime?` | Query, Optional | - | -| `createdUntil` | `DateTime?` | Query, Optional | - | ## Response Type -[`Task`](../../doc/models/list-withdrawals.md) +[`Task`](../../doc/models/create-kyc-link-response.md) ## Example Usage @@ -967,7 +1003,7 @@ GetWithdrawalsAsync( string recipientId = "recipient_id0"; try { - ListWithdrawals result = await recipientsController.GetWithdrawalsAsync(recipientId); + CreateKYCLinkResponse result = await recipientsController.CreateKYCLinkAsync(recipientId); } catch (ApiException e) { diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 828f3e7..2a62ff5 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -10,42 +10,77 @@ ISubscriptionsController subscriptionsController = client.SubscriptionsControlle ## Methods -* [Update Subscription Card](../../doc/controllers/subscriptions.md#update-subscription-card) -* [Create Discount](../../doc/controllers/subscriptions.md#create-discount) -* [Update Subscription Billing Date](../../doc/controllers/subscriptions.md#update-subscription-billing-date) -* [Update Subscription Start At](../../doc/controllers/subscriptions.md#update-subscription-start-at) -* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) -* [Get Usages](../../doc/controllers/subscriptions.md#get-usages) -* [Update Latest Period End At](../../doc/controllers/subscriptions.md#update-latest-period-end-at) -* [Delete Discount](../../doc/controllers/subscriptions.md#delete-discount) -* [Update Subscription Payment Method](../../doc/controllers/subscriptions.md#update-subscription-payment-method) -* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) -* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) -* [Update Subscription Affiliation Id](../../doc/controllers/subscriptions.md#update-subscription-affiliation-id) -* [Update Subscription Minium Price](../../doc/controllers/subscriptions.md#update-subscription-minium-price) -* [Get Subscription Cycle by Id](../../doc/controllers/subscriptions.md#get-subscription-cycle-by-id) -* [Get Usage Report](../../doc/controllers/subscriptions.md#get-usage-report) * [Renew Subscription](../../doc/controllers/subscriptions.md#renew-subscription) +* [Update Subscription Card](../../doc/controllers/subscriptions.md#update-subscription-card) * [Delete Usage](../../doc/controllers/subscriptions.md#delete-usage) +* [Create Discount](../../doc/controllers/subscriptions.md#create-discount) * [Create an Usage](../../doc/controllers/subscriptions.md#create-an-usage) * [Update Current Cycle Status](../../doc/controllers/subscriptions.md#update-current-cycle-status) -* [Get Subscription Item](../../doc/controllers/subscriptions.md#get-subscription-item) -* [Get Increment by Id](../../doc/controllers/subscriptions.md#get-increment-by-id) -* [Delete Increment](../../doc/controllers/subscriptions.md#delete-increment) -* [Get Discounts](../../doc/controllers/subscriptions.md#get-discounts) -* [Update Subscription Due Days](../../doc/controllers/subscriptions.md#update-subscription-due-days) -* [Create Subscription Item](../../doc/controllers/subscriptions.md#create-subscription-item) -* [Update Split Subscription](../../doc/controllers/subscriptions.md#update-split-subscription) +* [Delete Discount](../../doc/controllers/subscriptions.md#delete-discount) * [Get Subscription Items](../../doc/controllers/subscriptions.md#get-subscription-items) +* [Update Subscription Payment Method](../../doc/controllers/subscriptions.md#update-subscription-payment-method) +* [Get Subscription Item](../../doc/controllers/subscriptions.md#get-subscription-item) * [Get Subscriptions](../../doc/controllers/subscriptions.md#get-subscriptions) +* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) * [Create Increment](../../doc/controllers/subscriptions.md#create-increment) * [Create Usage](../../doc/controllers/subscriptions.md#create-usage) * [Get Discount by Id](../../doc/controllers/subscriptions.md#get-discount-by-id) +* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) +* [Get Increment by Id](../../doc/controllers/subscriptions.md#get-increment-by-id) +* [Update Subscription Affiliation Id](../../doc/controllers/subscriptions.md#update-subscription-affiliation-id) * [Update Subscription Metadata](../../doc/controllers/subscriptions.md#update-subscription-metadata) +* [Delete Increment](../../doc/controllers/subscriptions.md#delete-increment) * [Get Subscription Cycles](../../doc/controllers/subscriptions.md#get-subscription-cycles) +* [Get Discounts](../../doc/controllers/subscriptions.md#get-discounts) +* [Update Subscription Billing Date](../../doc/controllers/subscriptions.md#update-subscription-billing-date) * [Delete Subscription Item](../../doc/controllers/subscriptions.md#delete-subscription-item) * [Get Increments](../../doc/controllers/subscriptions.md#get-increments) +* [Update Subscription Due Days](../../doc/controllers/subscriptions.md#update-subscription-due-days) +* [Update Subscription Start At](../../doc/controllers/subscriptions.md#update-subscription-start-at) * [Update Subscription Item](../../doc/controllers/subscriptions.md#update-subscription-item) +* [Create Subscription Item](../../doc/controllers/subscriptions.md#create-subscription-item) +* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) +* [Get Usages](../../doc/controllers/subscriptions.md#get-usages) +* [Update Latest Period End At](../../doc/controllers/subscriptions.md#update-latest-period-end-at) +* [Update Subscription Minium Price](../../doc/controllers/subscriptions.md#update-subscription-minium-price) +* [Get Subscription Cycle by Id](../../doc/controllers/subscriptions.md#get-subscription-cycle-by-id) +* [Get Usage Report](../../doc/controllers/subscriptions.md#get-usage-report) +* [Update Split Subscription](../../doc/controllers/subscriptions.md#update-split-subscription) + + +# Renew Subscription + +```csharp +RenewSubscriptionAsync( + string subscriptionId, + string idempotencyKey = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | - | +| `idempotencyKey` | `string` | Header, Optional | - | + +## Response Type + +[`Task`](../../doc/models/get-period-response.md) + +## Example Usage + +```csharp +string subscriptionId = "subscription_id0"; +try +{ + GetPeriodResponse result = await subscriptionsController.RenewSubscriptionAsync(subscriptionId); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` # Update Subscription Card @@ -99,6 +134,53 @@ catch (ApiException e) ``` +# Delete Usage + +Deletes a usage + +```csharp +DeleteUsageAsync( + string subscriptionId, + string itemId, + string usageId, + string idempotencyKey = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `itemId` | `string` | Template, Required | The subscription item id | +| `usageId` | `string` | Template, Required | The usage id | +| `idempotencyKey` | `string` | Header, Optional | - | + +## Response Type + +[`Task`](../../doc/models/get-usage-response.md) + +## Example Usage + +```csharp +string subscriptionId = "subscription_id0"; +string itemId = "item_id0"; +string usageId = "usage_id0"; +try +{ + GetUsageResponse result = await subscriptionsController.DeleteUsageAsync( + subscriptionId, + itemId, + usageId + ); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + # Create Discount Creates a discount @@ -148,14 +230,14 @@ catch (ApiException e) ``` -# Update Subscription Billing Date +# Create an Usage -Updates the billing date from a subscription +Create Usage ```csharp -UpdateSubscriptionBillingDateAsync( +CreateAnUsageAsync( string subscriptionId, - Models.UpdateSubscriptionBillingDateRequest request, + string itemId, string idempotencyKey = null) ``` @@ -163,30 +245,24 @@ UpdateSubscriptionBillingDateAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `request` | [`UpdateSubscriptionBillingDateRequest`](../../doc/models/update-subscription-billing-date-request.md) | Body, Required | Request for updating the subscription billing date | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `itemId` | `string` | Template, Required | Item id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-subscription-response.md) +[`Task`](../../doc/models/get-usage-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -UpdateSubscriptionBillingDateRequest request = new UpdateSubscriptionBillingDateRequest -{ - NextBillingAt = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", - provider: CultureInfo.InvariantCulture, - DateTimeStyles.RoundtripKind), -}; - +string itemId = "item_id0"; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionBillingDateAsync( + GetUsageResponse result = await subscriptionsController.CreateAnUsageAsync( subscriptionId, - request + itemId ); } catch (ApiException e) @@ -197,14 +273,12 @@ catch (ApiException e) ``` -# Update Subscription Start At - -Updates the start at date from a subscription +# Update Current Cycle Status ```csharp -UpdateSubscriptionStartAtAsync( +UpdateCurrentCycleStatusAsync( string subscriptionId, - Models.UpdateSubscriptionStartAtRequest request, + Models.UpdateCurrentCycleStatusRequest request, string idempotencyKey = null) ``` @@ -212,28 +286,26 @@ UpdateSubscriptionStartAtAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `request` | [`UpdateSubscriptionStartAtRequest`](../../doc/models/update-subscription-start-at-request.md) | Body, Required | Request for updating the subscription start date | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `request` | [`UpdateCurrentCycleStatusRequest`](../../doc/models/update-current-cycle-status-request.md) | Body, Required | Request for updating the end date of the subscription current status | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-subscription-response.md) +`Task` ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -UpdateSubscriptionStartAtRequest request = new UpdateSubscriptionStartAtRequest +UpdateCurrentCycleStatusRequest request = new UpdateCurrentCycleStatusRequest { - StartAt = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", - provider: CultureInfo.InvariantCulture, - DateTimeStyles.RoundtripKind), + Status = "status8", }; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionStartAtAsync( + await subscriptionsController.UpdateCurrentCycleStatusAsync( subscriptionId, request ); @@ -246,13 +318,15 @@ catch (ApiException e) ``` -# Get Subscription +# Delete Discount -Gets a subscription +Deletes a discount ```csharp -GetSubscriptionAsync( - string subscriptionId) +DeleteDiscountAsync( + string subscriptionId, + string discountId, + string idempotencyKey = null) ``` ## Parameters @@ -260,18 +334,24 @@ GetSubscriptionAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | +| `discountId` | `string` | Template, Required | Discount Id | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-subscription-response.md) +[`Task`](../../doc/models/get-discount-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; +string discountId = "discount_id8"; try { - GetSubscriptionResponse result = await subscriptionsController.GetSubscriptionAsync(subscriptionId); + GetDiscountResponse result = await subscriptionsController.DeleteDiscountAsync( + subscriptionId, + discountId + ); } catch (ApiException e) { @@ -281,20 +361,21 @@ catch (ApiException e) ``` -# Get Usages +# Get Subscription Items -Lists all usages from a subscription item +Get Subscription Items ```csharp -GetUsagesAsync( +GetSubscriptionItemsAsync( string subscriptionId, - string itemId, int? page = null, int? size = null, + string name = null, string code = null, - string mGroup = null, - DateTime? usedSince = null, - DateTime? usedUntil = null) + string status = null, + string description = null, + string createdSince = null, + string createdUntil = null) ``` ## Parameters @@ -302,29 +383,26 @@ GetUsagesAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | -| `itemId` | `string` | Template, Required | The subscription item id | | `page` | `int?` | Query, Optional | Page number | | `size` | `int?` | Query, Optional | Page size | +| `name` | `string` | Query, Optional | The item name | | `code` | `string` | Query, Optional | Identification code in the client system | -| `mGroup` | `string` | Query, Optional | Identification group in the client system | -| `usedSince` | `DateTime?` | Query, Optional | - | -| `usedUntil` | `DateTime?` | Query, Optional | - | +| `status` | `string` | Query, Optional | The item statis | +| `description` | `string` | Query, Optional | The item description | +| `createdSince` | `string` | Query, Optional | Filter for item's creation date start range | +| `createdUntil` | `string` | Query, Optional | Filter for item's creation date end range | ## Response Type -[`Task`](../../doc/models/list-usages-response.md) +[`Task`](../../doc/models/list-subscription-items-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string itemId = "item_id0"; try { - ListUsagesResponse result = await subscriptionsController.GetUsagesAsync( - subscriptionId, - itemId - ); + ListSubscriptionItemsResponse result = await subscriptionsController.GetSubscriptionItemsAsync(subscriptionId); } catch (ApiException e) { @@ -334,12 +412,14 @@ catch (ApiException e) ``` -# Update Latest Period End At +# Update Subscription Payment Method + +Updates the payment method from a subscription ```csharp -UpdateLatestPeriodEndAtAsync( +UpdateSubscriptionPaymentMethodAsync( string subscriptionId, - Models.UpdateCurrentCycleEndDateRequest request, + Models.UpdateSubscriptionPaymentMethodRequest request, string idempotencyKey = null) ``` @@ -347,8 +427,8 @@ UpdateLatestPeriodEndAtAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | - | -| `request` | [`UpdateCurrentCycleEndDateRequest`](../../doc/models/update-current-cycle-end-date-request.md) | Body, Required | Request for updating the end date of the current signature cycle | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `request` | [`UpdateSubscriptionPaymentMethodRequest`](../../doc/models/update-subscription-payment-method-request.md) | Body, Required | Request for updating the paymentmethod from a subscription | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -359,13 +439,19 @@ UpdateLatestPeriodEndAtAsync( ```csharp string subscriptionId = "subscription_id0"; -UpdateCurrentCycleEndDateRequest request = new UpdateCurrentCycleEndDateRequest +UpdateSubscriptionPaymentMethodRequest request = new UpdateSubscriptionPaymentMethodRequest { + PaymentMethod = "payment_method4", + CardId = "card_id2", + Card = new CreateCardRequest + { + Type = "credit", + }, }; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateLatestPeriodEndAtAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionPaymentMethodAsync( subscriptionId, request ); @@ -378,39 +464,37 @@ catch (ApiException e) ``` -# Delete Discount +# Get Subscription Item -Deletes a discount +Get Subscription Item ```csharp -DeleteDiscountAsync( +GetSubscriptionItemAsync( string subscriptionId, - string discountId, - string idempotencyKey = null) + string itemId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `discountId` | `string` | Template, Required | Discount Id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `itemId` | `string` | Template, Required | Item id | ## Response Type -[`Task`](../../doc/models/get-discount-response.md) +[`Task`](../../doc/models/get-subscription-item-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string discountId = "discount_id8"; +string itemId = "item_id0"; try { - GetDiscountResponse result = await subscriptionsController.DeleteDiscountAsync( + GetSubscriptionItemResponse result = await subscriptionsController.GetSubscriptionItemAsync( subscriptionId, - discountId + itemId ); } catch (ApiException e) @@ -421,14 +505,70 @@ catch (ApiException e) ``` -# Update Subscription Payment Method +# Get Subscriptions -Updates the payment method from a subscription +Gets all subscriptions ```csharp -UpdateSubscriptionPaymentMethodAsync( +GetSubscriptionsAsync( + int? page = null, + int? size = null, + string code = null, + string billingType = null, + string customerId = null, + string planId = null, + string cardId = null, + string status = null, + DateTime? nextBillingSince = null, + DateTime? nextBillingUntil = null, + DateTime? createdSince = null, + DateTime? createdUntil = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | +| `code` | `string` | Query, Optional | Filter for subscription's code | +| `billingType` | `string` | Query, Optional | Filter for subscription's billing type | +| `customerId` | `string` | Query, Optional | Filter for subscription's customer id | +| `planId` | `string` | Query, Optional | Filter for subscription's plan id | +| `cardId` | `string` | Query, Optional | Filter for subscription's card id | +| `status` | `string` | Query, Optional | Filter for subscription's status | +| `nextBillingSince` | `DateTime?` | Query, Optional | Filter for subscription's next billing date start range | +| `nextBillingUntil` | `DateTime?` | Query, Optional | Filter for subscription's next billing date end range | +| `createdSince` | `DateTime?` | Query, Optional | Filter for subscription's creation date start range | +| `createdUntil` | `DateTime?` | Query, Optional | Filter for subscriptions creation date end range | + +## Response Type + +[`Task`](../../doc/models/list-subscriptions-response.md) + +## Example Usage + +```csharp +try +{ + ListSubscriptionsResponse result = await subscriptionsController.GetSubscriptionsAsync(); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + +# Cancel Subscription + +Cancels a subscription + +```csharp +CancelSubscriptionAsync( string subscriptionId, - Models.UpdateSubscriptionPaymentMethodRequest request, + Models.CreateCancelSubscriptionRequest request = null, string idempotencyKey = null) ``` @@ -437,7 +577,7 @@ UpdateSubscriptionPaymentMethodAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`UpdateSubscriptionPaymentMethodRequest`](../../doc/models/update-subscription-payment-method-request.md) | Body, Required | Request for updating the paymentmethod from a subscription | +| `request` | [`CreateCancelSubscriptionRequest`](../../doc/models/create-cancel-subscription-request.md) | Body, Optional | Request for cancelling a subscription | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -448,19 +588,14 @@ UpdateSubscriptionPaymentMethodAsync( ```csharp string subscriptionId = "subscription_id0"; -UpdateSubscriptionPaymentMethodRequest request = new UpdateSubscriptionPaymentMethodRequest +CreateCancelSubscriptionRequest request = new CreateCancelSubscriptionRequest { - PaymentMethod = "payment_method4", - CardId = "card_id2", - Card = new CreateCardRequest - { - Type = "credit", - }, + CancelPendingInvoices = true, }; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionPaymentMethodAsync( + GetSubscriptionResponse result = await subscriptionsController.CancelSubscriptionAsync( subscriptionId, request ); @@ -473,14 +608,14 @@ catch (ApiException e) ``` -# Cancel Subscription +# Create Increment -Cancels a subscription +Creates a increment ```csharp -CancelSubscriptionAsync( +CreateIncrementAsync( string subscriptionId, - Models.CreateCancelSubscriptionRequest request = null, + Models.CreateIncrementRequest request, string idempotencyKey = null) ``` @@ -489,25 +624,27 @@ CancelSubscriptionAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`CreateCancelSubscriptionRequest`](../../doc/models/create-cancel-subscription-request.md) | Body, Optional | Request for cancelling a subscription | +| `request` | [`CreateIncrementRequest`](../../doc/models/create-increment-request.md) | Body, Required | Request for creating a increment | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-subscription-response.md) +[`Task`](../../doc/models/get-increment-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -CreateCancelSubscriptionRequest request = new CreateCancelSubscriptionRequest +CreateIncrementRequest request = new CreateIncrementRequest { - CancelPendingInvoices = true, + MValue = 185.28, + IncrementType = "increment_type8", + ItemId = "item_id6", }; try { - GetSubscriptionResponse result = await subscriptionsController.CancelSubscriptionAsync( + GetIncrementResponse result = await subscriptionsController.CreateIncrementAsync( subscriptionId, request ); @@ -520,6 +657,100 @@ catch (ApiException e) ``` +# Create Usage + +Creates a usage + +```csharp +CreateUsageAsync( + string subscriptionId, + string itemId, + Models.CreateUsageRequest body, + string idempotencyKey = null) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `itemId` | `string` | Template, Required | Item id | +| `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Required | Request for creating a usage | +| `idempotencyKey` | `string` | Header, Optional | - | + +## Response Type + +[`Task`](../../doc/models/get-usage-response.md) + +## Example Usage + +```csharp +string subscriptionId = "subscription_id0"; +string itemId = "item_id0"; +CreateUsageRequest body = new CreateUsageRequest +{ + Quantity = 156, + Description = "description4", + UsedAt = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", + provider: CultureInfo.InvariantCulture, + DateTimeStyles.RoundtripKind), +}; + +try +{ + GetUsageResponse result = await subscriptionsController.CreateUsageAsync( + subscriptionId, + itemId, + body + ); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + +# Get Discount by Id + +```csharp +GetDiscountByIdAsync( + string subscriptionId, + string discountId) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `discountId` | `string` | Template, Required | - | + +## Response Type + +[`Task`](../../doc/models/get-discount-response.md) + +## Example Usage + +```csharp +string subscriptionId = "subscription_id0"; +string discountId = "discountId0"; +try +{ + GetDiscountResponse result = await subscriptionsController.GetDiscountByIdAsync( + subscriptionId, + discountId + ); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + # Create Subscription Creates a new subscription @@ -548,7 +779,7 @@ CreateSubscriptionRequest body = new CreateSubscriptionRequest { Customer = new CreateCustomerRequest { - Name = "{\n \"name\": \"Tony Stark\"\n}", + Name = "Tony Stark", Email = "email6", Document = "document6", Type = "type0", @@ -672,41 +903,35 @@ catch (ApiException e) ``` -# Update Subscription Affiliation Id +# Get Increment by Id ```csharp -UpdateSubscriptionAffiliationIdAsync( +GetIncrementByIdAsync( string subscriptionId, - Models.UpdateSubscriptionAffiliationIdRequest request, - string idempotencyKey = null) + string incrementId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | - | -| `request` | [`UpdateSubscriptionAffiliationIdRequest`](../../doc/models/update-subscription-affiliation-id-request.md) | Body, Required | Request for updating a subscription affiliation id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription Id | +| `incrementId` | `string` | Template, Required | The increment Id | ## Response Type -[`Task`](../../doc/models/get-subscription-response.md) +[`Task`](../../doc/models/get-increment-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -UpdateSubscriptionAffiliationIdRequest request = new UpdateSubscriptionAffiliationIdRequest -{ - GatewayAffiliationId = "gateway_affiliation_id2", -}; - +string incrementId = "increment_id8"; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionAffiliationIdAsync( + GetIncrementResponse result = await subscriptionsController.GetIncrementByIdAsync( subscriptionId, - request + incrementId ); } catch (ApiException e) @@ -717,14 +942,12 @@ catch (ApiException e) ``` -# Update Subscription Minium Price - -Atualização do valor mínimo da assinatura +# Update Subscription Affiliation Id ```csharp -UpdateSubscriptionMiniumPriceAsync( +UpdateSubscriptionAffiliationIdAsync( string subscriptionId, - Models.UpdateSubscriptionMinimumPriceRequest request, + Models.UpdateSubscriptionAffiliationIdRequest request, string idempotencyKey = null) ``` @@ -732,8 +955,8 @@ UpdateSubscriptionMiniumPriceAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `request` | [`UpdateSubscriptionMinimumPriceRequest`](../../doc/models/update-subscription-minimum-price-request.md) | Body, Required | Request da requisição com o valor mínimo que será configurado | +| `subscriptionId` | `string` | Template, Required | - | +| `request` | [`UpdateSubscriptionAffiliationIdRequest`](../../doc/models/update-subscription-affiliation-id-request.md) | Body, Required | Request for updating a subscription affiliation id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -744,13 +967,14 @@ UpdateSubscriptionMiniumPriceAsync( ```csharp string subscriptionId = "subscription_id0"; -UpdateSubscriptionMinimumPriceRequest request = new UpdateSubscriptionMinimumPriceRequest +UpdateSubscriptionAffiliationIdRequest request = new UpdateSubscriptionAffiliationIdRequest { + GatewayAffiliationId = "gateway_affiliation_id2", }; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionMiniumPriceAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionAffiliationIdAsync( subscriptionId, request ); @@ -763,12 +987,15 @@ catch (ApiException e) ``` -# Get Subscription Cycle by Id +# Update Subscription Metadata + +Updates the metadata from a subscription ```csharp -GetSubscriptionCycleByIdAsync( +UpdateSubscriptionMetadataAsync( string subscriptionId, - string cycleId) + Models.UpdateMetadataRequest request, + string idempotencyKey = null) ``` ## Parameters @@ -776,61 +1003,30 @@ GetSubscriptionCycleByIdAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | -| `cycleId` | `string` | Template, Required | - | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the subscrption metadata | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-period-response.md) +[`Task`](../../doc/models/get-subscription-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string cycleId = "cycleId0"; -try -{ - GetPeriodResponse result = await subscriptionsController.GetSubscriptionCycleByIdAsync( - subscriptionId, - cycleId - ); -} -catch (ApiException e) +UpdateMetadataRequest request = new UpdateMetadataRequest { - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# Get Usage Report - -```csharp -GetUsageReportAsync( - string subscriptionId, - string periodId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription Id | -| `periodId` | `string` | Template, Required | The period Id | - -## Response Type - -[`Task`](../../doc/models/get-usage-report-response.md) - -## Example Usage + Metadata = new Dictionary + { + ["key0"] = "metadata3", + }, +}; -```csharp -string subscriptionId = "subscription_id0"; -string periodId = "period_id0"; try { - GetUsageReportResponse result = await subscriptionsController.GetUsageReportAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionMetadataAsync( subscriptionId, - periodId + request ); } catch (ApiException e) @@ -841,11 +1037,14 @@ catch (ApiException e) ``` -# Renew Subscription +# Delete Increment + +Deletes a increment ```csharp -RenewSubscriptionAsync( +DeleteIncrementAsync( string subscriptionId, + string incrementId, string idempotencyKey = null) ``` @@ -853,20 +1052,25 @@ RenewSubscriptionAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | - | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `incrementId` | `string` | Template, Required | Increment id | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-period-response.md) +[`Task`](../../doc/models/get-increment-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; +string incrementId = "increment_id8"; try { - GetPeriodResponse result = await subscriptionsController.RenewSubscriptionAsync(subscriptionId); + GetIncrementResponse result = await subscriptionsController.DeleteIncrementAsync( + subscriptionId, + incrementId + ); } catch (ApiException e) { @@ -876,43 +1080,39 @@ catch (ApiException e) ``` -# Delete Usage - -Deletes a usage +# Get Subscription Cycles ```csharp -DeleteUsageAsync( +GetSubscriptionCyclesAsync( string subscriptionId, - string itemId, - string usageId, - string idempotencyKey = null) + string page, + string size) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `itemId` | `string` | Template, Required | The subscription item id | -| `usageId` | `string` | Template, Required | The usage id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `page` | `string` | Query, Required | Page number | +| `size` | `string` | Query, Required | Page size | ## Response Type -[`Task`](../../doc/models/get-usage-response.md) +[`Task`](../../doc/models/list-cycles-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string itemId = "item_id0"; -string usageId = "usage_id0"; +string page = "page8"; +string size = "size0"; try { - GetUsageResponse result = await subscriptionsController.DeleteUsageAsync( + ListCyclesResponse result = await subscriptionsController.GetSubscriptionCyclesAsync( subscriptionId, - itemId, - usageId + page, + size ); } catch (ApiException e) @@ -923,39 +1123,39 @@ catch (ApiException e) ``` -# Create an Usage - -Create Usage +# Get Discounts ```csharp -CreateAnUsageAsync( +GetDiscountsAsync( string subscriptionId, - string itemId, - string idempotencyKey = null) + int page, + int size) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `itemId` | `string` | Template, Required | Item id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `page` | `int` | Query, Required | Page number | +| `size` | `int` | Query, Required | Page size | ## Response Type -[`Task`](../../doc/models/get-usage-response.md) +[`Task`](../../doc/models/list-discounts-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string itemId = "item_id0"; +int page = 30; +int size = 18; try { - GetUsageResponse result = await subscriptionsController.CreateAnUsageAsync( + ListDiscountsResponse result = await subscriptionsController.GetDiscountsAsync( subscriptionId, - itemId + page, + size ); } catch (ApiException e) @@ -966,12 +1166,14 @@ catch (ApiException e) ``` -# Update Current Cycle Status +# Update Subscription Billing Date + +Updates the billing date from a subscription ```csharp -UpdateCurrentCycleStatusAsync( +UpdateSubscriptionBillingDateAsync( string subscriptionId, - Models.UpdateCurrentCycleStatusRequest request, + Models.UpdateSubscriptionBillingDateRequest request, string idempotencyKey = null) ``` @@ -979,26 +1181,28 @@ UpdateCurrentCycleStatusAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `request` | [`UpdateCurrentCycleStatusRequest`](../../doc/models/update-current-cycle-status-request.md) | Body, Required | Request for updating the end date of the subscription current status | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `request` | [`UpdateSubscriptionBillingDateRequest`](../../doc/models/update-subscription-billing-date-request.md) | Body, Required | Request for updating the subscription billing date | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -`Task` +[`Task`](../../doc/models/get-subscription-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -UpdateCurrentCycleStatusRequest request = new UpdateCurrentCycleStatusRequest +UpdateSubscriptionBillingDateRequest request = new UpdateSubscriptionBillingDateRequest { - Status = "status8", + NextBillingAt = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", + provider: CultureInfo.InvariantCulture, + DateTimeStyles.RoundtripKind), }; try { - await subscriptionsController.UpdateCurrentCycleStatusAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionBillingDateAsync( subscriptionId, request ); @@ -1011,22 +1215,24 @@ catch (ApiException e) ``` -# Get Subscription Item +# Delete Subscription Item -Get Subscription Item +Deletes a subscription item ```csharp -GetSubscriptionItemAsync( +DeleteSubscriptionItemAsync( string subscriptionId, - string itemId) + string subscriptionItemId, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `itemId` | `string` | Template, Required | Item id | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `subscriptionItemId` | `string` | Template, Required | Subscription item id | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -1036,12 +1242,12 @@ GetSubscriptionItemAsync( ```csharp string subscriptionId = "subscription_id0"; -string itemId = "item_id0"; +string subscriptionItemId = "subscription_item_id4"; try { - GetSubscriptionItemResponse result = await subscriptionsController.GetSubscriptionItemAsync( + GetSubscriptionItemResponse result = await subscriptionsController.DeleteSubscriptionItemAsync( subscriptionId, - itemId + subscriptionItemId ); } catch (ApiException e) @@ -1052,36 +1258,34 @@ catch (ApiException e) ``` -# Get Increment by Id +# Get Increments ```csharp -GetIncrementByIdAsync( +GetIncrementsAsync( string subscriptionId, - string incrementId) + int? page = null, + int? size = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription Id | -| `incrementId` | `string` | Template, Required | The increment Id | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `page` | `int?` | Query, Optional | Page number | +| `size` | `int?` | Query, Optional | Page size | ## Response Type -[`Task`](../../doc/models/get-increment-response.md) +[`Task`](../../doc/models/list-increments-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string incrementId = "increment_id8"; try { - GetIncrementResponse result = await subscriptionsController.GetIncrementByIdAsync( - subscriptionId, - incrementId - ); + ListIncrementsResponse result = await subscriptionsController.GetIncrementsAsync(subscriptionId); } catch (ApiException e) { @@ -1091,14 +1295,14 @@ catch (ApiException e) ``` -# Delete Increment +# Update Subscription Due Days -Deletes a increment +Updates the boleto due days from a subscription ```csharp -DeleteIncrementAsync( +UpdateSubscriptionDueDaysAsync( string subscriptionId, - string incrementId, + Models.UpdateSubscriptionDueDaysRequest request, string idempotencyKey = null) ``` @@ -1106,24 +1310,28 @@ DeleteIncrementAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `incrementId` | `string` | Template, Required | Increment id | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `request` | [`UpdateSubscriptionDueDaysRequest`](../../doc/models/update-subscription-due-days-request.md) | Body, Required | - | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-increment-response.md) +[`Task`](../../doc/models/get-subscription-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string incrementId = "increment_id8"; +UpdateSubscriptionDueDaysRequest request = new UpdateSubscriptionDueDaysRequest +{ + BoletoDueDays = 226, +}; + try { - GetIncrementResponse result = await subscriptionsController.DeleteIncrementAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionDueDaysAsync( subscriptionId, - incrementId + request ); } catch (ApiException e) @@ -1134,13 +1342,15 @@ catch (ApiException e) ``` -# Get Discounts +# Update Subscription Start At + +Updates the start at date from a subscription ```csharp -GetDiscountsAsync( +UpdateSubscriptionStartAtAsync( string subscriptionId, - int page, - int size) + Models.UpdateSubscriptionStartAtRequest request, + string idempotencyKey = null) ``` ## Parameters @@ -1148,25 +1358,29 @@ GetDiscountsAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | -| `page` | `int` | Query, Required | Page number | -| `size` | `int` | Query, Required | Page size | +| `request` | [`UpdateSubscriptionStartAtRequest`](../../doc/models/update-subscription-start-at-request.md) | Body, Required | Request for updating the subscription start date | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/list-discounts-response.md) +[`Task`](../../doc/models/get-subscription-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -int page = 30; -int size = 18; +UpdateSubscriptionStartAtRequest request = new UpdateSubscriptionStartAtRequest +{ + StartAt = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", + provider: CultureInfo.InvariantCulture, + DateTimeStyles.RoundtripKind), +}; + try { - ListDiscountsResponse result = await subscriptionsController.GetDiscountsAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionStartAtAsync( subscriptionId, - page, - size + request ); } catch (ApiException e) @@ -1177,14 +1391,15 @@ catch (ApiException e) ``` -# Update Subscription Due Days +# Update Subscription Item -Updates the boleto due days from a subscription +Updates a subscription item ```csharp -UpdateSubscriptionDueDaysAsync( +UpdateSubscriptionItemAsync( string subscriptionId, - Models.UpdateSubscriptionDueDaysRequest request, + string itemId, + Models.UpdateSubscriptionItemRequest body, string idempotencyKey = null) ``` @@ -1193,27 +1408,44 @@ UpdateSubscriptionDueDaysAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription Id | -| `request` | [`UpdateSubscriptionDueDaysRequest`](../../doc/models/update-subscription-due-days-request.md) | Body, Required | - | +| `itemId` | `string` | Template, Required | Item id | +| `body` | [`UpdateSubscriptionItemRequest`](../../doc/models/update-subscription-item-request.md) | Body, Required | Request for updating a subscription item | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-subscription-response.md) +[`Task`](../../doc/models/get-subscription-item-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -UpdateSubscriptionDueDaysRequest request = new UpdateSubscriptionDueDaysRequest +string itemId = "item_id0"; +UpdateSubscriptionItemRequest body = new UpdateSubscriptionItemRequest { - BoletoDueDays = 226, + Description = "description4", + Status = "status2", + PricingScheme = new UpdatePricingSchemeRequest + { + SchemeType = "scheme_type8", + PriceBrackets = new List + { + new UpdatePriceBracketRequest + { + StartQuantity = 144, + Price = 174, + }, + }, + }, + Name = "name6", }; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionDueDaysAsync( + GetSubscriptionItemResponse result = await subscriptionsController.UpdateSubscriptionItemAsync( subscriptionId, - request + itemId, + body ); } catch (ApiException e) @@ -1287,20 +1519,20 @@ catch (ApiException e) ``` -# Update Split Subscription +# Get Subscription + +Gets a subscription ```csharp -UpdateSplitSubscriptionAsync( - string id, - Models.UpdateSubscriptionSplitRequest request) +GetSubscriptionAsync( + string subscriptionId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `string` | Template, Required | Subscription's id | -| `request` | [`UpdateSubscriptionSplitRequest`](../../doc/models/update-subscription-split-request.md) | Body, Required | - | +| `subscriptionId` | `string` | Template, Required | Subscription id | ## Response Type @@ -1309,27 +1541,10 @@ UpdateSplitSubscriptionAsync( ## Example Usage ```csharp -string id = "id0"; -UpdateSubscriptionSplitRequest request = new UpdateSubscriptionSplitRequest -{ - Enabled = false, - Rules = new List - { - new CreateSplitRequest - { - Type = "type2", - Amount = 118, - RecipientId = "recipient_id2", - }, - }, -}; - +string subscriptionId = "subscription_id0"; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSplitSubscriptionAsync( - id, - request - ); + GetSubscriptionResponse result = await subscriptionsController.GetSubscriptionAsync(subscriptionId); } catch (ApiException e) { @@ -1339,21 +1554,20 @@ catch (ApiException e) ``` -# Get Subscription Items +# Get Usages -Get Subscription Items +Lists all usages from a subscription item ```csharp -GetSubscriptionItemsAsync( +GetUsagesAsync( string subscriptionId, + string itemId, int? page = null, int? size = null, - string name = null, string code = null, - string status = null, - string description = null, - string createdSince = null, - string createdUntil = null) + string mGroup = null, + DateTime? usedSince = null, + DateTime? usedUntil = null) ``` ## Parameters @@ -1361,130 +1575,28 @@ GetSubscriptionItemsAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | +| `itemId` | `string` | Template, Required | The subscription item id | | `page` | `int?` | Query, Optional | Page number | | `size` | `int?` | Query, Optional | Page size | -| `name` | `string` | Query, Optional | The item name | | `code` | `string` | Query, Optional | Identification code in the client system | -| `status` | `string` | Query, Optional | The item statis | -| `description` | `string` | Query, Optional | The item description | -| `createdSince` | `string` | Query, Optional | Filter for item's creation date start range | -| `createdUntil` | `string` | Query, Optional | Filter for item's creation date end range | - -## Response Type - -[`Task`](../../doc/models/list-subscription-items-response.md) - -## Example Usage - -```csharp -string subscriptionId = "subscription_id0"; -try -{ - ListSubscriptionItemsResponse result = await subscriptionsController.GetSubscriptionItemsAsync(subscriptionId); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# Get Subscriptions - -Gets all subscriptions - -```csharp -GetSubscriptionsAsync( - int? page = null, - int? size = null, - string code = null, - string billingType = null, - string customerId = null, - string planId = null, - string cardId = null, - string status = null, - DateTime? nextBillingSince = null, - DateTime? nextBillingUntil = null, - DateTime? createdSince = null, - DateTime? createdUntil = null) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | -| `code` | `string` | Query, Optional | Filter for subscription's code | -| `billingType` | `string` | Query, Optional | Filter for subscription's billing type | -| `customerId` | `string` | Query, Optional | Filter for subscription's customer id | -| `planId` | `string` | Query, Optional | Filter for subscription's plan id | -| `cardId` | `string` | Query, Optional | Filter for subscription's card id | -| `status` | `string` | Query, Optional | Filter for subscription's status | -| `nextBillingSince` | `DateTime?` | Query, Optional | Filter for subscription's next billing date start range | -| `nextBillingUntil` | `DateTime?` | Query, Optional | Filter for subscription's next billing date end range | -| `createdSince` | `DateTime?` | Query, Optional | Filter for subscription's creation date start range | -| `createdUntil` | `DateTime?` | Query, Optional | Filter for subscriptions creation date end range | - -## Response Type - -[`Task`](../../doc/models/list-subscriptions-response.md) - -## Example Usage - -```csharp -try -{ - ListSubscriptionsResponse result = await subscriptionsController.GetSubscriptionsAsync(); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# Create Increment - -Creates a increment - -```csharp -CreateIncrementAsync( - string subscriptionId, - Models.CreateIncrementRequest request, - string idempotencyKey = null) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`CreateIncrementRequest`](../../doc/models/create-increment-request.md) | Body, Required | Request for creating a increment | -| `idempotencyKey` | `string` | Header, Optional | - | +| `mGroup` | `string` | Query, Optional | Identification group in the client system | +| `usedSince` | `DateTime?` | Query, Optional | - | +| `usedUntil` | `DateTime?` | Query, Optional | - | ## Response Type -[`Task`](../../doc/models/get-increment-response.md) +[`Task`](../../doc/models/list-usages-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -CreateIncrementRequest request = new CreateIncrementRequest -{ - MValue = 185.28, - IncrementType = "increment_type8", - ItemId = "item_id6", -}; - +string itemId = "item_id0"; try { - GetIncrementResponse result = await subscriptionsController.CreateIncrementAsync( + ListUsagesResponse result = await subscriptionsController.GetUsagesAsync( subscriptionId, - request + itemId ); } catch (ApiException e) @@ -1495,15 +1607,12 @@ catch (ApiException e) ``` -# Create Usage - -Creates a usage +# Update Latest Period End At ```csharp -CreateUsageAsync( +UpdateLatestPeriodEndAtAsync( string subscriptionId, - string itemId, - Models.CreateUsageRequest body, + Models.UpdateCurrentCycleEndDateRequest request, string idempotencyKey = null) ``` @@ -1511,74 +1620,27 @@ CreateUsageAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `itemId` | `string` | Template, Required | Item id | -| `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Required | Request for creating a usage | +| `subscriptionId` | `string` | Template, Required | - | +| `request` | [`UpdateCurrentCycleEndDateRequest`](../../doc/models/update-current-cycle-end-date-request.md) | Body, Required | Request for updating the end date of the current signature cycle | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type -[`Task`](../../doc/models/get-usage-response.md) +[`Task`](../../doc/models/get-subscription-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string itemId = "item_id0"; -CreateUsageRequest body = new CreateUsageRequest +UpdateCurrentCycleEndDateRequest request = new UpdateCurrentCycleEndDateRequest { - Quantity = 156, - Description = "description4", - UsedAt = DateTime.ParseExact("2016-03-13T12:52:32.123Z", "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", - provider: CultureInfo.InvariantCulture, - DateTimeStyles.RoundtripKind), }; try { - GetUsageResponse result = await subscriptionsController.CreateUsageAsync( - subscriptionId, - itemId, - body - ); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# Get Discount by Id - -```csharp -GetDiscountByIdAsync( - string subscriptionId, - string discountId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `discountId` | `string` | Template, Required | - | - -## Response Type - -[`Task`](../../doc/models/get-discount-response.md) - -## Example Usage - -```csharp -string subscriptionId = "subscription_id0"; -string discountId = "discountId0"; -try -{ - GetDiscountResponse result = await subscriptionsController.GetDiscountByIdAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateLatestPeriodEndAtAsync( subscriptionId, - discountId + request ); } catch (ApiException e) @@ -1589,14 +1651,14 @@ catch (ApiException e) ``` -# Update Subscription Metadata +# Update Subscription Minium Price -Updates the metadata from a subscription +Atualização do valor mínimo da assinatura ```csharp -UpdateSubscriptionMetadataAsync( +UpdateSubscriptionMiniumPriceAsync( string subscriptionId, - Models.UpdateMetadataRequest request, + Models.UpdateSubscriptionMinimumPriceRequest request, string idempotencyKey = null) ``` @@ -1604,8 +1666,8 @@ UpdateSubscriptionMetadataAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the subscrption metadata | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `request` | [`UpdateSubscriptionMinimumPriceRequest`](../../doc/models/update-subscription-minimum-price-request.md) | Body, Required | Request da requisição com o valor mínimo que será configurado | | `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -1616,17 +1678,13 @@ UpdateSubscriptionMetadataAsync( ```csharp string subscriptionId = "subscription_id0"; -UpdateMetadataRequest request = new UpdateMetadataRequest +UpdateSubscriptionMinimumPriceRequest request = new UpdateSubscriptionMinimumPriceRequest { - Metadata = new Dictionary - { - ["key0"] = "metadata3", - }, }; try { - GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionMetadataAsync( + GetSubscriptionResponse result = await subscriptionsController.UpdateSubscriptionMiniumPriceAsync( subscriptionId, request ); @@ -1639,39 +1697,35 @@ catch (ApiException e) ``` -# Get Subscription Cycles +# Get Subscription Cycle by Id ```csharp -GetSubscriptionCyclesAsync( +GetSubscriptionCycleByIdAsync( string subscriptionId, - string page, - string size) + string cycleId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `page` | `string` | Query, Required | Page number | -| `size` | `string` | Query, Required | Page size | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `cycleId` | `string` | Template, Required | - | ## Response Type -[`Task`](../../doc/models/list-cycles-response.md) +[`Task`](../../doc/models/get-period-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string page = "page8"; -string size = "size0"; +string cycleId = "cycleId0"; try { - ListCyclesResponse result = await subscriptionsController.GetSubscriptionCyclesAsync( + GetPeriodResponse result = await subscriptionsController.GetSubscriptionCycleByIdAsync( subscriptionId, - page, - size + cycleId ); } catch (ApiException e) @@ -1682,39 +1736,35 @@ catch (ApiException e) ``` -# Delete Subscription Item - -Deletes a subscription item +# Get Usage Report ```csharp -DeleteSubscriptionItemAsync( +GetUsageReportAsync( string subscriptionId, - string subscriptionItemId, - string idempotencyKey = null) + string periodId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `subscriptionItemId` | `string` | Template, Required | Subscription item id | -| `idempotencyKey` | `string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription Id | +| `periodId` | `string` | Template, Required | The period Id | ## Response Type -[`Task`](../../doc/models/get-subscription-item-response.md) +[`Task`](../../doc/models/get-usage-report-response.md) ## Example Usage ```csharp string subscriptionId = "subscription_id0"; -string subscriptionItemId = "subscription_item_id4"; +string periodId = "period_id0"; try { - GetSubscriptionItemResponse result = await subscriptionsController.DeleteSubscriptionItemAsync( + GetUsageReportResponse result = await subscriptionsController.GetUsageReportAsync( subscriptionId, - subscriptionItemId + periodId ); } catch (ApiException e) @@ -1725,98 +1775,48 @@ catch (ApiException e) ``` -# Get Increments - -```csharp -GetIncrementsAsync( - string subscriptionId, - int? page = null, - int? size = null) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `page` | `int?` | Query, Optional | Page number | -| `size` | `int?` | Query, Optional | Page size | - -## Response Type - -[`Task`](../../doc/models/list-increments-response.md) - -## Example Usage - -```csharp -string subscriptionId = "subscription_id0"; -try -{ - ListIncrementsResponse result = await subscriptionsController.GetIncrementsAsync(subscriptionId); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# Update Subscription Item - -Updates a subscription item +# Update Split Subscription ```csharp -UpdateSubscriptionItemAsync( - string subscriptionId, - string itemId, - Models.UpdateSubscriptionItemRequest body, - string idempotencyKey = null) +UpdateSplitSubscriptionAsync( + string id, + Models.UpdateSubscriptionSplitRequest request) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `itemId` | `string` | Template, Required | Item id | -| `body` | [`UpdateSubscriptionItemRequest`](../../doc/models/update-subscription-item-request.md) | Body, Required | Request for updating a subscription item | -| `idempotencyKey` | `string` | Header, Optional | - | +| `id` | `string` | Template, Required | Subscription's id | +| `request` | [`UpdateSubscriptionSplitRequest`](../../doc/models/update-subscription-split-request.md) | Body, Required | - | ## Response Type -[`Task`](../../doc/models/get-subscription-item-response.md) +[`Task`](../../doc/models/get-subscription-response.md) ## Example Usage ```csharp -string subscriptionId = "subscription_id0"; -string itemId = "item_id0"; -UpdateSubscriptionItemRequest body = new UpdateSubscriptionItemRequest +string id = "id0"; +UpdateSubscriptionSplitRequest request = new UpdateSubscriptionSplitRequest { - Description = "description4", - Status = "status2", - PricingScheme = new UpdatePricingSchemeRequest + Enabled = false, + Rules = new List { - SchemeType = "scheme_type8", - PriceBrackets = new List + new CreateSplitRequest { - new UpdatePriceBracketRequest - { - StartQuantity = 144, - Price = 174, - }, + Type = "type2", + Amount = 118, + RecipientId = "recipient_id2", }, }, - Name = "name6", }; try { - GetSubscriptionItemResponse result = await subscriptionsController.UpdateSubscriptionItemAsync( - subscriptionId, - itemId, - body + GetSubscriptionResponse result = await subscriptionsController.UpdateSplitSubscriptionAsync( + id, + request ); } catch (ApiException e) diff --git a/doc/controllers/tokens.md b/doc/controllers/tokens.md index 962fcf6..08b8dec 100644 --- a/doc/controllers/tokens.md +++ b/doc/controllers/tokens.md @@ -10,28 +10,28 @@ ITokensController tokensController = client.TokensController; ## Methods -* [Get Token](../../doc/controllers/tokens.md#get-token) * [Create Token](../../doc/controllers/tokens.md#create-token) +* [Get Token](../../doc/controllers/tokens.md#get-token) -# Get Token - -Gets a token from its id +# Create Token :information_source: **Note** This endpoint does not require authentication. ```csharp -GetTokenAsync( - string id, - string publicKey) +CreateTokenAsync( + string publicKey, + Models.CreateTokenRequest request, + string idempotencyKey = null) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `string` | Template, Required | Token id | | `publicKey` | `string` | Template, Required | Public key | +| `request` | [`CreateTokenRequest`](../../doc/models/create-token-request.md) | Body, Required | Request for creating a token | +| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -40,13 +40,27 @@ GetTokenAsync( ## Example Usage ```csharp -string id = "id0"; string publicKey = "public_key6"; +CreateTokenRequest request = new CreateTokenRequest +{ + Type = "card", + Card = new CreateCardTokenRequest + { + Number = "number6", + HolderName = "holder_name2", + ExpMonth = 228, + ExpYear = 68, + Cvv = "cvv4", + Brand = "brand0", + Label = "label6", + }, +}; + try { - GetTokenResponse result = await tokensController.GetTokenAsync( - id, - publicKey + GetTokenResponse result = await tokensController.CreateTokenAsync( + publicKey, + request ); } catch (ApiException e) @@ -57,24 +71,24 @@ catch (ApiException e) ``` -# Create Token +# Get Token + +Gets a token from its id :information_source: **Note** This endpoint does not require authentication. ```csharp -CreateTokenAsync( - string publicKey, - Models.CreateTokenRequest request, - string idempotencyKey = null) +GetTokenAsync( + string id, + string publicKey) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | +| `id` | `string` | Template, Required | Token id | | `publicKey` | `string` | Template, Required | Public key | -| `request` | [`CreateTokenRequest`](../../doc/models/create-token-request.md) | Body, Required | Request for creating a token | -| `idempotencyKey` | `string` | Header, Optional | - | ## Response Type @@ -83,27 +97,13 @@ CreateTokenAsync( ## Example Usage ```csharp +string id = "id0"; string publicKey = "public_key6"; -CreateTokenRequest request = new CreateTokenRequest -{ - Type = "card", - Card = new CreateCardTokenRequest - { - Number = "number6", - HolderName = "holder_name2", - ExpMonth = 228, - ExpYear = 68, - Cvv = "cvv4", - Brand = "brand0", - Label = "label6", - }, -}; - try { - GetTokenResponse result = await tokensController.CreateTokenAsync( - publicKey, - request + GetTokenResponse result = await tokensController.GetTokenAsync( + id, + publicKey ); } catch (ApiException e) diff --git a/doc/controllers/transfers.md b/doc/controllers/transfers.md index 2bb90a3..9b60dce 100644 --- a/doc/controllers/transfers.md +++ b/doc/controllers/transfers.md @@ -11,8 +11,8 @@ ITransfersController transfersController = client.TransfersController; ## Methods * [Get Transfer by Id](../../doc/controllers/transfers.md#get-transfer-by-id) -* [Get Transfers](../../doc/controllers/transfers.md#get-transfers) * [Create Transfer](../../doc/controllers/transfers.md#create-transfer) +* [Get Transfers](../../doc/controllers/transfers.md#get-transfers) # Get Transfer by Id @@ -48,24 +48,36 @@ catch (ApiException e) ``` -# Get Transfers - -Gets all transfers +# Create Transfer ```csharp -GetTransfersAsync() +CreateTransferAsync( + Models.CreateTransfer request) ``` +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `request` | [`CreateTransfer`](../../doc/models/create-transfer.md) | Body, Required | - | + ## Response Type -[`Task`](../../doc/models/list-transfers.md) +[`Task`](../../doc/models/get-transfer.md) ## Example Usage ```csharp +CreateTransfer request = new CreateTransfer +{ + Amount = 242, + SourceId = "source_id0", + TargetId = "target_id6", +}; + try { - ListTransfers result = await transfersController.GetTransfersAsync(); + GetTransfer result = await transfersController.CreateTransferAsync(request); } catch (ApiException e) { @@ -75,36 +87,24 @@ catch (ApiException e) ``` -# Create Transfer +# Get Transfers + +Gets all transfers ```csharp -CreateTransferAsync( - Models.CreateTransfer request) +GetTransfersAsync() ``` -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `request` | [`CreateTransfer`](../../doc/models/create-transfer.md) | Body, Required | - | - ## Response Type -[`Task`](../../doc/models/get-transfer.md) +[`Task`](../../doc/models/list-transfers.md) ## Example Usage ```csharp -CreateTransfer request = new CreateTransfer -{ - Amount = 242, - SourceId = "source_id0", - TargetId = "target_id6", -}; - try { - GetTransfer result = await transfersController.CreateTransferAsync(request); + ListTransfers result = await transfersController.GetTransfersAsync(); } catch (ApiException e) { diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index c03e6d1..fb817f9 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -26,7 +26,7 @@ Request for creating a new customer ```json { - "name": "{\n \"name\": \"Tony Stark\"\n}", + "name": "Tony Stark", "email": "email8", "document": "document8", "type": "type2", diff --git a/doc/models/create-kyc-link-response.md b/doc/models/create-kyc-link-response.md new file mode 100644 index 0000000..c5942c0 --- /dev/null +++ b/doc/models/create-kyc-link-response.md @@ -0,0 +1,27 @@ + +# Create KYC Link Response + +KYC Link + +## Structure + +`CreateKYCLinkResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Base64` | `string` | Optional | Base64 | +| `Url` | `string` | Optional | URL | +| `ExpirationDate` | `string` | Optional | Expiration Date | + +## Example (as JSON) + +```json +{ + "base64": "base644", + "url": "url0", + "expiration_date": "expiration_date0" +} +``` + diff --git a/doc/models/create-order-request.md b/doc/models/create-order-request.md index b07b50f..f43d620 100644 --- a/doc/models/create-order-request.md +++ b/doc/models/create-order-request.md @@ -42,7 +42,7 @@ Request for creating an order } ], "customer": { - "name": "{\n \"name\": \"Tony Stark\"\n}", + "name": "Tony Stark", "email": "email6", "document": "document6", "type": "type0", diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 000c52d..78633b3 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -50,7 +50,7 @@ Request for creating a subcription ```json { "customer": { - "name": "{\n \"name\": \"Tony Stark\"\n}", + "name": "Tony Stark", "email": "email6", "document": "document6", "type": "type0",