Skip to content

Commit

Permalink
AI-123: Regenerate SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
nicocedron committed Dec 17, 2024
1 parent 795f9e7 commit 8f9b98b
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 34 deletions.
44 changes: 19 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,28 @@ Please follow the [installation procedure](#installation--usage) and then run th
<?php
require_once(__DIR__ . '/vendor/autoload.php');

use Conekta\Api\CustomersApi;
use Conekta\ApiException;
use Conekta\Configuration;
use Conekta\Model\Customer;

// Configure authorization
/**
* @var string $apiKey use private key for authentication
* @link https://developers.conekta.com/reference/autenticaci%C3%B3n for more information
*/
$apiKey = getenv("CONEKTA_API_KEY");
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken($apiKey);

$apiInstance = new CustomersApi(null, $config);
$rq = new Customer([
'name' => 'Franklin carrero',
'email'=> '[email protected]',
'phone' => '+5218181818181'
]);


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\AntifraudApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_risk_rules_data = new \Conekta\Model\CreateRiskRulesData(); // \Conekta\Model\CreateRiskRulesData | requested field for blacklist rule
$accept_language = es; // string | Use for knowing which language to use

try {
$result = $apiInstance->createCustomer($rq);
$json_string = json_encode($result, JSON_PRETTY_PRINT);
print_r($json_string);
} catch (ApiException $e) {
echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL;
$result = $apiInstance->createRuleBlacklist($create_risk_rules_data, $accept_language);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AntifraudApi->createRuleBlacklist: ', $e->getMessage(), PHP_EOL;
}


```

## API Endpoints
Expand Down
2 changes: 2 additions & 0 deletions docs/Model/Customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Name | Type | Description | Notes
**antifraud_info** | [**\Conekta\Model\CustomerAntifraudInfo**](CustomerAntifraudInfo.md) | | [optional]
**corporate** | **bool** | It is a value that allows identifying if the email is corporate or not. | [optional] [default to false]
**custom_reference** | **string** | It is an undefined value. | [optional]
**date_of_birth** | **string** | It is a parameter that allows to identify the date of birth of the client. | [optional]
**email** | **string** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). |
**default_payment_source_id** | **string** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional]
**default_shipping_contact_id** | **string** | It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact) | [optional]
**fiscal_entities** | [**\Conekta\Model\CustomerFiscalEntitiesRequest[]**](CustomerFiscalEntitiesRequest.md) | | [optional]
**metadata** | **array<string,mixed>** | | [optional]
**name** | **string** | Client&#39;s name |
**national_id** | **string** | It is a parameter that allows to identify the national identification number of the client. | [optional]
**payment_sources** | [**\Conekta\Model\CustomerPaymentMethodsRequest[]**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional]
**phone** | **string** | Is the customer&#39;s phone number |
**plan_id** | **string** | Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription | [optional]
Expand Down
2 changes: 2 additions & 0 deletions docs/Model/CustomerResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**corporate** | **bool** | true if the customer is a company | [optional]
**created_at** | **int** | Creation date of the object |
**custom_reference** | **string** | Custom reference | [optional]
**date_of_birth** | **string** | It is a parameter that allows to identify the date of birth of the client. | [optional]
**default_fiscal_entity_id** | **string** | | [optional]
**default_shipping_contact_id** | **string** | | [optional]
**default_payment_source_id** | **string** | | [optional]
Expand All @@ -16,6 +17,7 @@ Name | Type | Description | Notes
**id** | **string** | Customer&#39;s ID |
**livemode** | **bool** | true if the object exists in live mode or the value false if the object exists in test mode |
**name** | **string** | Customer&#39;s name |
**national_id** | **string** | It is a parameter that allows to identify the national identification number of the client. | [optional]
**metadata** | **array<string,mixed>** | | [optional]
**object** | **string** | |
**payment_sources** | [**\Conekta\Model\CustomerPaymentMethodsResponse**](CustomerPaymentMethodsResponse.md) | | [optional]
Expand Down
2 changes: 2 additions & 0 deletions docs/Model/UpdateCustomer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**antifraud_info** | [**\Conekta\Model\UpdateCustomerAntifraudInfo**](UpdateCustomerAntifraudInfo.md) | | [optional]
**date_of_birth** | **string** | It is a parameter that allows to identify the date of birth of the client. | [optional]
**default_payment_source_id** | **string** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional]
**email** | **string** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). | [optional]
**name** | **string** | Client&#39;s name | [optional]
Expand All @@ -15,6 +16,7 @@ Name | Type | Description | Notes
**custom_reference** | **string** | It is an undefined value. | [optional]
**fiscal_entities** | [**\Conekta\Model\CustomerFiscalEntitiesRequest[]**](CustomerFiscalEntitiesRequest.md) | | [optional]
**metadata** | **array<string,mixed>** | | [optional]
**national_id** | **string** | It is a parameter that allows to identify the national identification number of the client. | [optional]
**payment_sources** | [**\Conekta\Model\CustomerPaymentMethodsRequest[]**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional]
**shipping_contacts** | [**\Conekta\Model\CustomerShippingContacts[]**](CustomerShippingContacts.md) | Contains the detail of the shipping addresses that the client has active or has used in Conekta | [optional]
**subscription** | [**\Conekta\Model\SubscriptionRequest**](SubscriptionRequest.md) | | [optional]
Expand Down
68 changes: 68 additions & 0 deletions lib/Model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ class Customer implements ModelInterface, ArrayAccess, \JsonSerializable
'antifraud_info' => '\Conekta\Model\CustomerAntifraudInfo',
'corporate' => 'bool',
'custom_reference' => 'string',
'date_of_birth' => 'string',
'email' => 'string',
'default_payment_source_id' => 'string',
'default_shipping_contact_id' => 'string',
'fiscal_entities' => '\Conekta\Model\CustomerFiscalEntitiesRequest[]',
'metadata' => 'array<string,mixed>',
'name' => 'string',
'national_id' => 'string',
'payment_sources' => '\Conekta\Model\CustomerPaymentMethodsRequest[]',
'phone' => 'string',
'plan_id' => 'string',
Expand All @@ -86,12 +88,14 @@ class Customer implements ModelInterface, ArrayAccess, \JsonSerializable
'antifraud_info' => null,
'corporate' => null,
'custom_reference' => null,
'date_of_birth' => null,
'email' => 'email',
'default_payment_source_id' => null,
'default_shipping_contact_id' => null,
'fiscal_entities' => null,
'metadata' => null,
'name' => null,
'national_id' => null,
'payment_sources' => null,
'phone' => null,
'plan_id' => null,
Expand All @@ -108,12 +112,14 @@ class Customer implements ModelInterface, ArrayAccess, \JsonSerializable
'antifraud_info' => true,
'corporate' => false,
'custom_reference' => false,
'date_of_birth' => false,
'email' => false,
'default_payment_source_id' => false,
'default_shipping_contact_id' => false,
'fiscal_entities' => false,
'metadata' => false,
'name' => false,
'national_id' => false,
'payment_sources' => false,
'phone' => false,
'plan_id' => false,
Expand Down Expand Up @@ -210,12 +216,14 @@ public function isNullableSetToNull(string $property): bool
'antifraud_info' => 'antifraud_info',
'corporate' => 'corporate',
'custom_reference' => 'custom_reference',
'date_of_birth' => 'date_of_birth',
'email' => 'email',
'default_payment_source_id' => 'default_payment_source_id',
'default_shipping_contact_id' => 'default_shipping_contact_id',
'fiscal_entities' => 'fiscal_entities',
'metadata' => 'metadata',
'name' => 'name',
'national_id' => 'national_id',
'payment_sources' => 'payment_sources',
'phone' => 'phone',
'plan_id' => 'plan_id',
Expand All @@ -232,12 +240,14 @@ public function isNullableSetToNull(string $property): bool
'antifraud_info' => 'setAntifraudInfo',
'corporate' => 'setCorporate',
'custom_reference' => 'setCustomReference',
'date_of_birth' => 'setDateOfBirth',
'email' => 'setEmail',
'default_payment_source_id' => 'setDefaultPaymentSourceId',
'default_shipping_contact_id' => 'setDefaultShippingContactId',
'fiscal_entities' => 'setFiscalEntities',
'metadata' => 'setMetadata',
'name' => 'setName',
'national_id' => 'setNationalId',
'payment_sources' => 'setPaymentSources',
'phone' => 'setPhone',
'plan_id' => 'setPlanId',
Expand All @@ -254,12 +264,14 @@ public function isNullableSetToNull(string $property): bool
'antifraud_info' => 'getAntifraudInfo',
'corporate' => 'getCorporate',
'custom_reference' => 'getCustomReference',
'date_of_birth' => 'getDateOfBirth',
'email' => 'getEmail',
'default_payment_source_id' => 'getDefaultPaymentSourceId',
'default_shipping_contact_id' => 'getDefaultShippingContactId',
'fiscal_entities' => 'getFiscalEntities',
'metadata' => 'getMetadata',
'name' => 'getName',
'national_id' => 'getNationalId',
'payment_sources' => 'getPaymentSources',
'phone' => 'getPhone',
'plan_id' => 'getPlanId',
Expand Down Expand Up @@ -327,12 +339,14 @@ public function __construct(array $data = null)
$this->setIfExists('antifraud_info', $data ?? [], null);
$this->setIfExists('corporate', $data ?? [], false);
$this->setIfExists('custom_reference', $data ?? [], null);
$this->setIfExists('date_of_birth', $data ?? [], null);
$this->setIfExists('email', $data ?? [], null);
$this->setIfExists('default_payment_source_id', $data ?? [], null);
$this->setIfExists('default_shipping_contact_id', $data ?? [], null);
$this->setIfExists('fiscal_entities', $data ?? [], null);
$this->setIfExists('metadata', $data ?? [], null);
$this->setIfExists('name', $data ?? [], null);
$this->setIfExists('national_id', $data ?? [], null);
$this->setIfExists('payment_sources', $data ?? [], null);
$this->setIfExists('phone', $data ?? [], null);
$this->setIfExists('plan_id', $data ?? [], null);
Expand Down Expand Up @@ -483,6 +497,33 @@ public function setCustomReference($custom_reference)
return $this;
}

/**
* Gets date_of_birth
*
* @return string|null
*/
public function getDateOfBirth()
{
return $this->container['date_of_birth'];
}

/**
* Sets date_of_birth
*
* @param string|null $date_of_birth It is a parameter that allows to identify the date of birth of the client.
*
* @return self
*/
public function setDateOfBirth($date_of_birth)
{
if (is_null($date_of_birth)) {
throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null');
}
$this->container['date_of_birth'] = $date_of_birth;

return $this;
}

/**
* Gets email
*
Expand Down Expand Up @@ -649,6 +690,33 @@ public function setName($name)
return $this;
}

/**
* Gets national_id
*
* @return string|null
*/
public function getNationalId()
{
return $this->container['national_id'];
}

/**
* Sets national_id
*
* @param string|null $national_id It is a parameter that allows to identify the national identification number of the client.
*
* @return self
*/
public function setNationalId($national_id)
{
if (is_null($national_id)) {
throw new \InvalidArgumentException('non-nullable national_id cannot be null');
}
$this->container['national_id'] = $national_id;

return $this;
}

/**
* Gets payment_sources
*
Expand Down
Loading

0 comments on commit 8f9b98b

Please sign in to comment.