Skip to content

Commit

Permalink
Automated commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
andreals committed Mar 12, 2024
1 parent 3cf6df6 commit db6027a
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 32 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ To run the file within your test project, right click on your Python file inside

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -85,7 +85,7 @@ The following parameters are configurable for the API Client:
| `backoff_factor` | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
| `retry_statuses` | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
| `retry_methods` | `Array of string` | The http methods on which retry is to be done. <br> **Default: ['GET', 'PUT']** |
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/$a/https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/basic-authentication.md) | The credential object for Basic Authentication |
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/$a/https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/basic-authentication.md) | The credential object for Basic Authentication |

The API client can be initialized as follows:

Expand All @@ -104,39 +104,39 @@ client = PagarmeapisdkClient(

This API uses the following authentication schemes.

* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/$a/https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/basic-authentication.md)
* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/$a/https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/basic-authentication.md)

## API Errors

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-python-sdk/tree/6.8.6/doc/models/error-exception.md) |
| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/models/error-exception.md) |
| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/models/error-exception.md) |
| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/models/error-exception.md) |
| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/models/error-exception.md) |
| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/models/error-exception.md) |
| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/models/error-exception.md) |
| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/models/error-exception.md) |
| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/models/error-exception.md) |
| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/models/error-exception.md) |
| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/models/error-exception.md) |
| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/models/error-exception.md) |

## List of APIs

* [Subscriptions](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/subscriptions.md)
* [Orders](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/orders.md)
* [Plans](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/plans.md)
* [Invoices](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/invoices.md)
* [Customers](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/customers.md)
* [Charges](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/charges.md)
* [Recipients](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/recipients.md)
* [Tokens](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/tokens.md)
* [Transactions](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/transactions.md)
* [Transfers](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/transfers.md)
* [Payables](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/payables.md)
* [Balance Operations](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/controllers/balance-operations.md)
* [Subscriptions](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/subscriptions.md)
* [Orders](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/orders.md)
* [Plans](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/plans.md)
* [Invoices](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/invoices.md)
* [Customers](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/customers.md)
* [Charges](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/charges.md)
* [Recipients](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/recipients.md)
* [Tokens](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/tokens.md)
* [Transactions](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/transactions.md)
* [Transfers](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/transfers.md)
* [Payables](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/payables.md)
* [Balance Operations](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/controllers/balance-operations.md)

## Classes Documentation

* [Utility Classes](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/http-response.md)
* [HttpRequest](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.6/doc/http-request.md)
* [Utility Classes](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/http-response.md)
* [HttpRequest](https://www.github.com/pagarme/pagarme-python-sdk/tree/6.8.7/doc/http-request.md)

10 changes: 5 additions & 5 deletions doc/models/get-movement-object-base-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Generic response object for getting a MovementObjectBase.
"status": "status4",
"amount": "amount4",
"created_at": "created_at0",
"source_type": "source_type6",
"source_id": "source_id0",
"target_type": "target_type8",
"target_id": "target_id4",
"fee": "fee8"
"product": "product2",
"brand": "brand6",
"payment_date": "payment_date4",
"recipient_id": "recipient_id2",
"document_type": "document_type0"
}
```

43 changes: 43 additions & 0 deletions doc/models/get-movement-object-settlement-response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

# Get Movement Object Settlement Response

Generic response object for getting a MovementObjectSettlement.

## Structure

`GetMovementObjectSettlementResponse`

## Inherits From

[`GetMovementObjectBaseResponse`](../../doc/models/get-movement-object-base-response.md)

## Fields

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `product` | `str` | Optional | - |
| `brand` | `str` | Optional | - |
| `payment_date` | `str` | Optional | - |
| `recipient_id` | `str` | Optional | - |
| `document_type` | `str` | Optional | - |
| `document` | `str` | Optional | - |
| `contract_obligation_id` | `str` | Optional | - |
| `liquidation_arrangement_id` | `str` | Optional | - |
| `external_engine_payment_id` | `str` | Optional | - |

## Example (as JSON)

```json
{
"id": "id2",
"status": "status4",
"amount": "amount4",
"created_at": "created_at0",
"product": "product2",
"brand": "brand6",
"payment_date": "payment_date4",
"recipient_id": "recipient_id2",
"document_type": "document_type0"
}
```

2 changes: 1 addition & 1 deletion pagarmeapisdk/controllers/base_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BaseController(object):

@staticmethod
def user_agent():
return 'PagarmeApiSDK - Python 6.8.6'
return 'PagarmeApiSDK - Python 6.8.7'

@staticmethod
def user_agent_parameters():
Expand Down
175 changes: 174 additions & 1 deletion pagarmeapisdk/models/get_movement_object_base_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def from_dictionary(cls,
'refund': GetMovementObjectRefundResponse.from_dictionary,
'feeCollection': GetMovementObjectFeeCollectionResponse.from_dictionary,
'payable': GetMovementObjectPayableResponse.from_dictionary,
'transfer': GetMovementObjectTransferResponse.from_dictionary
'transfer': GetMovementObjectTransferResponse.from_dictionary,
'settlement': GetMovementObjectSettlementResponse.from_dictionary
}
unboxer = discriminators.get(dictionary.get('object'))

Expand Down Expand Up @@ -738,3 +739,175 @@ def from_dictionary(cls,
mtype,
charge_id,
gateway_id)

class GetMovementObjectSettlementResponse(GetMovementObjectBaseResponse):

"""Implementation of the 'GetMovementObjectSettlementResponse' model.
Generic response object for getting a MovementObjectSettlement.
NOTE: This class inherits from 'GetMovementObjectBaseResponse'.
Attributes:
product (str): TODO: type description here.
brand (str): TODO: type description here.
payment_date (str): TODO: type description here.
recipient_id (str): TODO: type description here.
document_type (str): TODO: type description here.
document (str): TODO: type description here.
contract_obligation_id (str): TODO: type description here.
liquidation_arrangement_id (str): TODO: type description here.
external_engine_payment_id (str): TODO: type description here.
"""

# Create a mapping from Model property names to API property names
_names = {
"product": 'product',
"brand": 'brand',
"payment_date": 'payment_date',
"recipient_id": 'recipient_id',
"document_type": 'document_type',
"document": 'document',
"contract_obligation_id": 'contract_obligation_id',
"liquidation_arrangement_id": 'liquidation_arrangement_id',
"external_engine_payment_id": 'external_engine_payment_id',
"object": 'object',
"id": 'id',
"status": 'status',
"amount": 'amount',
"created_at": 'created_at',
"mtype": 'type',
"charge_id": 'charge_id',
"gateway_id": 'gateway_id'
}

_optionals = [
'product',
'brand',
'payment_date',
'recipient_id',
'document_type',
'document',
'contract_obligation_id',
'liquidation_arrangement_id',
'external_engine_payment_id',
]
_optionals.extend(GetMovementObjectBaseResponse._optionals)

_nullables = [
'product',
'brand',
'payment_date',
'recipient_id',
'document_type',
'document',
'contract_obligation_id',
'liquidation_arrangement_id',
'external_engine_payment_id',
]
_nullables.extend(GetMovementObjectBaseResponse._nullables)

def __init__(self,
product=APIHelper.SKIP,
brand=APIHelper.SKIP,
payment_date=APIHelper.SKIP,
recipient_id=APIHelper.SKIP,
document_type=APIHelper.SKIP,
document=APIHelper.SKIP,
contract_obligation_id=APIHelper.SKIP,
liquidation_arrangement_id=APIHelper.SKIP,
external_engine_payment_id=APIHelper.SKIP,
object='settlement',
id=APIHelper.SKIP,
status=APIHelper.SKIP,
amount=APIHelper.SKIP,
created_at=APIHelper.SKIP,
mtype=APIHelper.SKIP,
charge_id=APIHelper.SKIP,
gateway_id=APIHelper.SKIP):
"""Constructor for the GetMovementObjectSettlementResponse class"""

# Initialize members of the class
if product is not APIHelper.SKIP:
self.product = product
if brand is not APIHelper.SKIP:
self.brand = brand
if payment_date is not APIHelper.SKIP:
self.payment_date = payment_date
if recipient_id is not APIHelper.SKIP:
self.recipient_id = recipient_id
if document_type is not APIHelper.SKIP:
self.document_type = document_type
if document is not APIHelper.SKIP:
self.document = document
if contract_obligation_id is not APIHelper.SKIP:
self.contract_obligation_id = contract_obligation_id
if liquidation_arrangement_id is not APIHelper.SKIP:
self.liquidation_arrangement_id = liquidation_arrangement_id
if external_engine_payment_id is not APIHelper.SKIP:
self.external_engine_payment_id = external_engine_payment_id

# Call the constructor for the base class
super(GetMovementObjectSettlementResponse, self).__init__(object,
id,
status,
amount,
created_at,
mtype,
charge_id,
gateway_id)

@classmethod
def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
object: An instance of this structure class.
"""

if dictionary is None:
return None

# Extract variables from the dictionary
product = dictionary.get("product") if "product" in dictionary.keys() else APIHelper.SKIP
brand = dictionary.get("brand") if "brand" in dictionary.keys() else APIHelper.SKIP
payment_date = dictionary.get("payment_date") if "payment_date" in dictionary.keys() else APIHelper.SKIP
recipient_id = dictionary.get("recipient_id") if "recipient_id" in dictionary.keys() else APIHelper.SKIP
document_type = dictionary.get("document_type") if "document_type" in dictionary.keys() else APIHelper.SKIP
document = dictionary.get("document") if "document" in dictionary.keys() else APIHelper.SKIP
contract_obligation_id = dictionary.get("contract_obligation_id") if "contract_obligation_id" in dictionary.keys() else APIHelper.SKIP
liquidation_arrangement_id = dictionary.get("liquidation_arrangement_id") if "liquidation_arrangement_id" in dictionary.keys() else APIHelper.SKIP
external_engine_payment_id = dictionary.get("external_engine_payment_id") if "external_engine_payment_id" in dictionary.keys() else APIHelper.SKIP
object = dictionary.get("object") if dictionary.get("object") else 'settlement'
id = dictionary.get("id") if "id" in dictionary.keys() else APIHelper.SKIP
status = dictionary.get("status") if "status" in dictionary.keys() else APIHelper.SKIP
amount = dictionary.get("amount") if "amount" in dictionary.keys() else APIHelper.SKIP
created_at = dictionary.get("created_at") if "created_at" in dictionary.keys() else APIHelper.SKIP
mtype = dictionary.get("type") if "type" in dictionary.keys() else APIHelper.SKIP
charge_id = dictionary.get("charge_id") if "charge_id" in dictionary.keys() else APIHelper.SKIP
gateway_id = dictionary.get("gateway_id") if "gateway_id" in dictionary.keys() else APIHelper.SKIP
# Return an object of this model
return cls(product,
brand,
payment_date,
recipient_id,
document_type,
document,
contract_obligation_id,
liquidation_arrangement_id,
external_engine_payment_id,
object,
id,
status,
amount,
created_at,
mtype,
charge_id,
gateway_id)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["setuptools>=61.0"]
[project]
name = "pagarmeapisdk"
description = "Pagarme API"
version = "6.8.6"
version = "6.8.7"
requires-python = ">=3.7"
authors = [{name = "Pagar.me Pagamentos S/A", email = "suporte@pagar.me"}]
dependencies = ["apimatic-core~=0.2.0", "apimatic-core-interfaces~=0.1.0", "apimatic-requests-client-adapter~=0.1.0", "python-dateutil~=2.8.1", "enum34~=1.1, >=1.1.10"]
Expand Down

0 comments on commit db6027a

Please sign in to comment.