1
0
Fork 0
forked from lthn/blockchain

Add generated PHP client SDK for blockchain API

Introduces a new PHP client SDK generated via OpenAPI for the Lethean blockchain, including source code, models, API classes, documentation, tests, and configuration files. Updates Makefile to support PHP SDK generation and modifies php.json package configuration.
This commit is contained in:
Snider 2025-10-19 15:09:11 +01:00
parent 884958b0c7
commit c67fda3cfb
109 changed files with 42212 additions and 3 deletions

View file

@ -21,7 +21,7 @@ go: POST_BUILD_HOOK = (cd $(BUILD_DIR)/go && go mod edit -module github.com/leth
# For the 'go' target, set the generator name correctly.
go: GENERATOR_NAME = go
php: GENERATOR_NAME = php-nextgen
# --- Main Targets ---
all: build
@ -34,6 +34,8 @@ build: $(SDK_TARGETS)
$(SDK_TARGETS): %: packages/%.json
# Default generator name is the target name itself.
$(eval GENERATOR_NAME = $@)
# Ensure the output directory exists, cross-platform.
@cmake -E make_directory "$(BUILD_DIR)/$@"
@echo "--> Creating .openapi-generator-ignore file"
@echo "git_push.sh" > "$(BUILD_DIR)/$@/.openapi-generator-ignore"
@echo ".travis.yml" >> "$(BUILD_DIR)/$@/.openapi-generator-ignore"
@ -45,7 +47,7 @@ $(SDK_TARGETS): %: packages/%.json
rm -rf "$(BUILD_DIR)/$@/*"
export TS_POST_PROCESS_FILE="/usr/local/bin/prettier --write" && \
openapi-generator generate --minimal-update --git-host "github.com" --git-repo-id "blockchain" --git-user-id "letheanVPN" \
-i "$(BASE_DIR)/spec/oas-3.0.0.json" \
-i "$(BASE_DIR)/spec/oas-3.0.0.json" --group-id "lthn" \
-g "$(GENERATOR_NAME)" \
-o "$(BUILD_DIR)/$@" \
-c "$<" \

19
utils/sdk/client/php/.gitignore generated vendored Normal file
View file

@ -0,0 +1,19 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
composer.phar
/vendor/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# makes sense since it's a library(client SDK) and not a project
composer.lock
# php-cs-fixer cache
.php_cs.cache
.php-cs-fixer.cache
# PHPUnit cache
.phpunit.result.cache
# PHPLint cache
build/phplint.cache

View file

@ -0,0 +1,3 @@
git_push.sh
.travis.yml
README.md

View file

@ -0,0 +1,57 @@
.gitignore
.php-cs-fixer.dist.php
.phplint.yml
composer.json
docs/Api/BlockApi.md
docs/Api/InfoApi.md
docs/Model/BlockDetailsModel.md
docs/Model/BlockProcessingPerformanceModel.md
docs/Model/BlockTemplateModel.md
docs/Model/BlockTemplateRequestModel.md
docs/Model/DbStatInfoModel.md
docs/Model/HeightModel.md
docs/Model/InfoModel.md
docs/Model/MaintainersInfoModel.md
docs/Model/PerformanceModel.md
docs/Model/PosEntryModel.md
docs/Model/SubmitBlockRequestModel.md
docs/Model/SubmitBlockResponseModel.md
docs/Model/TransactionAttachmentModel.md
docs/Model/TransactionDetailsModel.md
docs/Model/TransactionExtraModel.md
docs/Model/TransactionInputModel.md
docs/Model/TransactionOutputModel.md
docs/Model/TxGenerationContextModel.md
docs/Model/TxPoolPerformanceModel.md
docs/Model/TxProcessingPerformanceModel.md
docs/Model/VersionModel.md
phpunit.xml.dist
src/ApiException.php
src/BlockApi.php
src/BlockDetailsModel.php
src/BlockProcessingPerformanceModel.php
src/BlockTemplateModel.php
src/BlockTemplateRequestModel.php
src/Configuration.php
src/DbStatInfoModel.php
src/FormDataProcessor.php
src/HeaderSelector.php
src/HeightModel.php
src/InfoApi.php
src/InfoModel.php
src/MaintainersInfoModel.php
src/ModelInterface.php
src/ObjectSerializer.php
src/PerformanceModel.php
src/PosEntryModel.php
src/SubmitBlockRequestModel.php
src/SubmitBlockResponseModel.php
src/TransactionAttachmentModel.php
src/TransactionDetailsModel.php
src/TransactionExtraModel.php
src/TransactionInputModel.php
src/TransactionOutputModel.php
src/TxGenerationContextModel.php
src/TxPoolPerformanceModel.php
src/TxProcessingPerformanceModel.php
src/VersionModel.php

View file

@ -0,0 +1 @@
7.16.0

View file

@ -0,0 +1,29 @@
<?php
/**
* @generated
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
*/
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
->exclude('test')
->exclude('tests')
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'phpdoc_order' => true,
'array_syntax' => [ 'syntax' => 'short' ],
'strict_comparison' => true,
'strict_param' => true,
'no_trailing_whitespace' => false,
'no_trailing_whitespace_in_comment' => false,
'braces' => false,
'single_blank_line_at_eof' => false,
'blank_line_after_namespace' => false,
'no_leading_import_slash' => false,
])
->setFinder($finder)
;

11
utils/sdk/client/php/.phplint.yml generated Normal file
View file

@ -0,0 +1,11 @@
path:
- ./src
- ./tests
jobs: 10
extensions:
- php
exclude:
- vendor
warning: true
memory-limit: -1
no-cache: true

47
utils/sdk/client/php/composer.json generated Normal file
View file

@ -0,0 +1,47 @@
{
"name": "letheanvpn/blockchain",
"version": "6.0.1",
"description": "OpenAPI for Lethean Blockchain",
"keywords": [
"openapitools",
"openapi-generator",
"openapi",
"php",
"sdk",
"rest",
"api"
],
"homepage": "https://openapi-generator.tech",
"license": "unlicense",
"authors": [
{
"name": "OpenAPI-Generator contributors",
"homepage": "https://openapi-generator.tech"
}
],
"require": {
"php": "^8.1",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.5",
"overtrue/phplint": "^9.0",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": { "lthn\\" : "src/" }
},
"autoload-dev": {
"psr-4": { "lthn\\Test\\" : "tests/" }
},
"scripts": {
"test": [
"@phplint"
],
"phplint": "phplint"
}
}

276
utils/sdk/client/php/docs/Api/BlockApi.md generated Normal file
View file

@ -0,0 +1,276 @@
# lthn\BlockApi
All URIs are relative to http://127.0.0.1:36943, except if the operation defines another base path.
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**createBlockTemplate()**](BlockApi.md#createBlockTemplate) | **POST** /block/template | Create a block template for mining |
| [**getBlock()**](BlockApi.md#getBlock) | **GET** /block/{identifier} | Get a block by its hash or height (ID) |
| [**getBlocks()**](BlockApi.md#getBlocks) | **GET** /block | Get one or more blocks, with optional pagination. |
| [**getHeight()**](BlockApi.md#getHeight) | **GET** /block/height | Get the current blockchain height |
| [**submitBlock()**](BlockApi.md#submitBlock) | **POST** /block/submit | Submit a new block to the network |
## `createBlockTemplate()`
```php
createBlockTemplate($block_template_request_model): \lthn\lthn\BlockTemplateModel
```
Create a block template for mining
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\BlockApi(
// 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()
);
$block_template_request_model = new \lthn\lthn\BlockTemplateRequestModel(); // \lthn\lthn\BlockTemplateRequestModel
try {
$result = $apiInstance->createBlockTemplate($block_template_request_model);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BlockApi->createBlockTemplate: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **block_template_request_model** | [**\lthn\lthn\BlockTemplateRequestModel**](../Model/BlockTemplateRequestModel.md)| | |
### Return type
[**\lthn\lthn\BlockTemplateModel**](../Model/BlockTemplateModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `getBlock()`
```php
getBlock($identifier): \lthn\lthn\BlockDetailsModel
```
Get a block by its hash or height (ID)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\BlockApi(
// 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()
);
$identifier = 'identifier_example'; // string | The hash (hex string) or height (integer) of the block to retrieve.
try {
$result = $apiInstance->getBlock($identifier);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BlockApi->getBlock: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **identifier** | **string**| The hash (hex string) or height (integer) of the block to retrieve. | |
### Return type
[**\lthn\lthn\BlockDetailsModel**](../Model/BlockDetailsModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `getBlocks()`
```php
getBlocks(): \lthn\lthn\BlockDetailsModel[]
```
Get one or more blocks, with optional pagination.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\BlockApi(
// 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()
);
try {
$result = $apiInstance->getBlocks();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BlockApi->getBlocks: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**\lthn\lthn\BlockDetailsModel[]**](../Model/BlockDetailsModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `getHeight()`
```php
getHeight(): \lthn\lthn\HeightModel
```
Get the current blockchain height
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\BlockApi(
// 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()
);
try {
$result = $apiInstance->getHeight();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BlockApi->getHeight: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**\lthn\lthn\HeightModel**](../Model/HeightModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `submitBlock()`
```php
submitBlock($submit_block_request_model): \lthn\lthn\SubmitBlockResponseModel
```
Submit a new block to the network
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\BlockApi(
// 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()
);
$submit_block_request_model = new \lthn\lthn\SubmitBlockRequestModel(); // \lthn\lthn\SubmitBlockRequestModel
try {
$result = $apiInstance->submitBlock($submit_block_request_model);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BlockApi->submitBlock: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **submit_block_request_model** | [**\lthn\lthn\SubmitBlockRequestModel**](../Model/SubmitBlockRequestModel.md)| | |
### Return type
[**\lthn\lthn\SubmitBlockResponseModel**](../Model/SubmitBlockResponseModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

116
utils/sdk/client/php/docs/Api/InfoApi.md generated Normal file
View file

@ -0,0 +1,116 @@
# lthn\InfoApi
All URIs are relative to http://127.0.0.1:36943, except if the operation defines another base path.
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**getInfo()**](InfoApi.md#getInfo) | **GET** /info | Get detailed information about the blockchain and daemon state |
| [**version()**](InfoApi.md#version) | **GET** /info/version | Get API version |
## `getInfo()`
```php
getInfo($flags): \lthn\lthn\InfoModel
```
Get detailed information about the blockchain and daemon state
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\InfoApi(
// 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()
);
$flags = 'flags_example'; // string | Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median.
try {
$result = $apiInstance->getInfo($flags);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InfoApi->getInfo: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **flags** | **string**| Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. | [optional] |
### Return type
[**\lthn\lthn\InfoModel**](../Model/InfoModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `version()`
```php
version(): \lthn\lthn\VersionModel
```
Get API version
Returns the current version of the API.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new lthn\Api\InfoApi(
// 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()
);
try {
$result = $apiInstance->version();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InfoApi->version: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**\lthn\lthn\VersionModel**](../Model/VersionModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

View file

@ -0,0 +1,33 @@
# # BlockDetailsModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**actual_timestamp** | **int** | | [optional]
**already_generated_coins** | **string** | | [optional]
**base_reward** | **int** | | [optional]
**blob** | **string** | | [optional]
**block_cumulative_size** | **int** | | [optional]
**block_tself_size** | **int** | | [optional]
**cumulative_diff_adjusted** | **string** | | [optional]
**cumulative_diff_precise** | **string** | | [optional]
**difficulty** | **string** | | [optional]
**effective_fee_median** | **int** | | [optional]
**height** | **int** | | [optional]
**id** | **string** | | [optional]
**is_orphan** | **bool** | | [optional]
**miner_text_info** | **string** | | [optional]
**object_in_json** | **string** | | [optional]
**penalty** | **int** | | [optional]
**pow_seed** | **string** | | [optional]
**prev_id** | **string** | | [optional]
**summary_reward** | **int** | | [optional]
**this_block_fee_median** | **int** | | [optional]
**timestamp** | **int** | | [optional]
**total_fee** | **int** | | [optional]
**total_txs_size** | **int** | | [optional]
**transactions_details** | [**\lthn\lthn\TransactionDetailsModel[]**](TransactionDetailsModel.md) | | [optional]
**type** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,24 @@
# # BlockProcessingPerformanceModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**block_processing_time_0** | **int** | | [optional]
**block_processing_time_1** | **int** | | [optional]
**target_calculating_time_2** | **int** | | [optional]
**longhash_calculating_time_3** | **int** | | [optional]
**all_txs_insert_time_5** | **int** | | [optional]
**etc_stuff_6** | **int** | | [optional]
**insert_time_4** | **int** | | [optional]
**raise_block_core_event** | **int** | | [optional]
**validate_miner_transaction_time** | **int** | | [optional]
**collect_rangeproofs_data_from_tx_time** | **int** | | [optional]
**verify_multiple_zc_outs_range_proofs_time** | **int** | | [optional]
**target_calculating_enum_blocks** | **int** | | [optional]
**target_calculating_calc** | **int** | | [optional]
**pos_validate_ki_search** | **int** | | [optional]
**pos_validate_get_out_keys_for_inputs** | **int** | | [optional]
**pos_validate_zvp** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,17 @@
# # BlockTemplateModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**blocktemplate_blob** | **string** | | [optional]
**difficulty** | **string** | | [optional]
**height** | **int** | | [optional]
**miner_tx_tgc** | [**\lthn\lthn\TxGenerationContextModel**](TxGenerationContextModel.md) | | [optional]
**block_reward_without_fee** | **int** | | [optional]
**block_reward** | **int** | | [optional]
**txs_fee** | **int** | | [optional]
**prev_hash** | **string** | | [optional]
**seed** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,15 @@
# # BlockTemplateRequestModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**miner_address** | **string** | | [optional]
**stakeholder_address** | **string** | | [optional]
**ex_nonce** | **string** | | [optional]
**pos_block** | **bool** | | [optional]
**ignore_pow_ts_check** | **bool** | | [optional]
**pe** | [**\lthn\lthn\PosEntryModel**](PosEntryModel.md) | | [optional]
**explicit_txs** | **string[]** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,11 @@
# # DbStatInfoModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tx_count** | **int** | | [optional]
**write_tx_count** | **int** | | [optional]
**map_size** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,9 @@
# # HeightModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**height** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,54 @@
# # InfoModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**height** | **int** | | [optional]
**tx_count** | **int** | | [optional]
**tx_pool_size** | **int** | | [optional]
**alt_blocks_count** | **int** | | [optional]
**outgoing_connections_count** | **int** | | [optional]
**incoming_connections_count** | **int** | | [optional]
**synchronized_connections_count** | **int** | | [optional]
**white_peerlist_size** | **int** | | [optional]
**grey_peerlist_size** | **int** | | [optional]
**current_blocks_median** | **int** | | [optional]
**alias_count** | **int** | | [optional]
**current_max_allowed_block_size** | **int** | | [optional]
**daemon_network_state** | **string** | | [optional]
**synchronization_start_height** | **int** | | [optional]
**max_net_seen_height** | **int** | | [optional]
**mi** | [**\lthn\lthn\MaintainersInfoModel**](MaintainersInfoModel.md) | | [optional]
**pos_allowed** | **bool** | | [optional]
**pos_difficulty** | **string** | | [optional]
**pow_difficulty** | **int** | | [optional]
**default_fee** | **int** | | [optional]
**minimum_fee** | **int** | | [optional]
**is_hardfork_active** | **bool[]** | | [optional]
**net_time_delta_median** | **int** | | [optional]
**current_network_hashrate_50** | **int** | | [optional]
**current_network_hashrate_350** | **int** | | [optional]
**seconds_for_10_blocks** | **int** | | [optional]
**seconds_for_30_blocks** | **int** | | [optional]
**transactions_cnt_per_day** | **int[]** | | [optional]
**transactions_volume_per_day** | **int[]** | | [optional]
**last_pos_timestamp** | **int** | | [optional]
**last_pow_timestamp** | **int** | | [optional]
**total_coins** | **string** | | [optional]
**last_block_size** | **int** | | [optional]
**tx_count_in_last_block** | **int** | | [optional]
**pos_sequence_factor** | **float** | | [optional]
**pow_sequence_factor** | **float** | | [optional]
**block_reward** | **int** | | [optional]
**last_block_total_reward** | **int** | | [optional]
**pos_diff_total_coins_rate** | **int** | | [optional]
**last_block_timestamp** | **int** | | [optional]
**last_block_hash** | **string** | | [optional]
**pos_block_ts_shift_vs_actual** | **int** | | [optional]
**outs_stat** | **array<string,int>** | | [optional]
**performance_data** | [**\lthn\lthn\PerformanceModel**](PerformanceModel.md) | | [optional]
**offers_count** | **int** | | [optional]
**expiration_median_timestamp** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,13 @@
# # MaintainersInfoModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ver_major** | **int** | | [optional]
**ver_minor** | **int** | | [optional]
**ver_revision** | **int** | | [optional]
**build_no** | **int** | | [optional]
**mode** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,12 @@
# # PerformanceModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**block_processing** | [**\lthn\lthn\BlockProcessingPerformanceModel**](BlockProcessingPerformanceModel.md) | | [optional]
**tx_processing** | [**\lthn\lthn\TxProcessingPerformanceModel**](TxProcessingPerformanceModel.md) | | [optional]
**tx_pool** | [**\lthn\lthn\TxPoolPerformanceModel**](TxPoolPerformanceModel.md) | | [optional]
**db_stat_info** | [**\lthn\lthn\DbStatInfoModel**](DbStatInfoModel.md) | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,16 @@
# # PosEntryModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **int** | | [optional]
**g_index** | **int** | | [optional]
**keyimage** | **string** | | [optional]
**block_timestamp** | **int** | | [optional]
**stake_unlock_time** | **int** | | [optional]
**tx_id** | **string** | | [optional]
**tx_out_index** | **int** | | [optional]
**wallet_index** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,9 @@
# # SubmitBlockRequestModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**block_blob** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,9 @@
# # SubmitBlockResponseModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,11 @@
# # TransactionAttachmentModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | | [optional]
**short_view** | **string** | | [optional]
**details_view** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,21 @@
# # TransactionDetailsModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **int** | | [optional]
**attachments** | [**\lthn\lthn\TransactionAttachmentModel[]**](TransactionAttachmentModel.md) | | [optional]
**blob** | **string** | | [optional]
**blob_size** | **int** | | [optional]
**extra** | [**\lthn\lthn\TransactionExtraModel[]**](TransactionExtraModel.md) | | [optional]
**fee** | **int** | | [optional]
**id** | **string** | | [optional]
**ins** | [**\lthn\lthn\TransactionInputModel[]**](TransactionInputModel.md) | | [optional]
**keeper_block** | **int** | | [optional]
**object_in_json** | **string** | | [optional]
**outs** | [**\lthn\lthn\TransactionOutputModel[]**](TransactionOutputModel.md) | | [optional]
**pub_key** | **string** | | [optional]
**timestamp** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,11 @@
# # TransactionExtraModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | | [optional]
**short_view** | **string** | | [optional]
**details_view** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,13 @@
# # TransactionInputModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **int** | | [optional]
**global_indexes** | **int[]** | | [optional]
**htlc_origin** | **string** | | [optional]
**kimage_or_ms_id** | **string** | | [optional]
**multisig_count** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,13 @@
# # TransactionOutputModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **int** | | [optional]
**global_index** | **int** | | [optional]
**is_spent** | **bool** | | [optional]
**minimum_sigs** | **int** | | [optional]
**pub_keys** | **string[]** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,32 @@
# # TxGenerationContextModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asset_ids** | **string[]** | | [optional]
**blinded_asset_ids** | **string[]** | | [optional]
**amount_commitments** | **string[]** | | [optional]
**asset_id_blinding_masks** | **string[]** | | [optional]
**amounts** | **string[]** | | [optional]
**amount_blinding_masks** | **string[]** | | [optional]
**pseudo_outs_blinded_asset_ids** | **string[]** | | [optional]
**pseudo_outs_plus_real_out_blinding_masks** | **string[]** | | [optional]
**real_zc_ins_asset_ids** | **string[]** | | [optional]
**zc_input_amounts** | **int[]** | | [optional]
**pseudo_out_amount_commitments_sum** | **string** | | [optional]
**pseudo_out_amount_blinding_masks_sum** | **string** | | [optional]
**real_in_asset_id_blinding_mask_x_amount_sum** | **string** | | [optional]
**amount_commitments_sum** | **string** | | [optional]
**amount_blinding_masks_sum** | **string** | | [optional]
**asset_id_blinding_mask_x_amount_sum** | **string** | | [optional]
**ao_asset_id** | **string** | | [optional]
**ao_asset_id_pt** | **string** | | [optional]
**ao_amount_commitment** | **string** | | [optional]
**ao_amount_blinding_mask** | **string** | | [optional]
**ao_commitment_in_outputs** | **bool** | | [optional]
**tx_key_pub** | **string** | | [optional]
**tx_key_sec** | **string** | | [optional]
**tx_pub_key_p** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,19 @@
# # TxPoolPerformanceModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tx_processing_time** | **int** | | [optional]
**check_inputs_types_supported_time** | **int** | | [optional]
**expiration_validate_time** | **int** | | [optional]
**validate_amount_time** | **int** | | [optional]
**validate_alias_time** | **int** | | [optional]
**check_keyimages_ws_ms_time** | **int** | | [optional]
**check_inputs_time** | **int** | | [optional]
**begin_tx_time** | **int** | | [optional]
**update_db_time** | **int** | | [optional]
**db_commit_time** | **int** | | [optional]
**check_post_hf4_balance** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,33 @@
# # TxProcessingPerformanceModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tx_check_inputs** | **int** | | [optional]
**tx_add_one_tx** | **int** | | [optional]
**tx_process_extra** | **int** | | [optional]
**tx_process_attachment** | **int** | | [optional]
**tx_process_inputs** | **int** | | [optional]
**tx_push_global_index** | **int** | | [optional]
**tx_check_exist** | **int** | | [optional]
**tx_print_log** | **int** | | [optional]
**tx_prapare_append** | **int** | | [optional]
**tx_append** | **int** | | [optional]
**tx_append_rl_wait** | **int** | | [optional]
**tx_append_is_expired** | **int** | | [optional]
**tx_store_db** | **int** | | [optional]
**tx_check_inputs_prefix_hash** | **int** | | [optional]
**tx_check_inputs_attachment_check** | **int** | | [optional]
**tx_check_inputs_loop** | **int** | | [optional]
**tx_check_inputs_loop_kimage_check** | **int** | | [optional]
**tx_check_inputs_loop_ch_in_val_sig** | **int** | | [optional]
**tx_check_inputs_loop_scan_outputkeys_get_item_size** | **int** | | [optional]
**tx_check_inputs_loop_scan_outputkeys_relative_to_absolute** | **int** | | [optional]
**tx_check_inputs_loop_scan_outputkeys_loop** | **int** | | [optional]
**tx_check_inputs_loop_scan_outputkeys_loop_get_subitem** | **int** | | [optional]
**tx_check_inputs_loop_scan_outputkeys_loop_find_tx** | **int** | | [optional]
**tx_check_inputs_loop_scan_outputkeys_loop_handle_output** | **int** | | [optional]
**tx_mixin_count** | **int** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View file

@ -0,0 +1,13 @@
# # VersionModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **string** | | [optional]
**version_long** | **string** | | [optional]
**major** | **string** | | [optional]
**minor** | **string** | | [optional]
**revision** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

18
utils/sdk/client/php/phpunit.xml.dist generated Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="tests">
<directory>./tests/Api</directory>
<directory>./tests/Model</directory>
</testsuite>
</testsuites>
<php>
<ini name="error_reporting" value="E_ALL"/>
</php>
</phpunit>

118
utils/sdk/client/php/src/ApiException.php generated Normal file
View file

@ -0,0 +1,118 @@
<?php
/**
* ApiException
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn;
use Exception;
use stdClass;
/**
* ApiException Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ApiException extends Exception
{
/**
* The HTTP body of the server response either as Json or string.
*
* @var stdClass|string|null
*/
protected stdClass|string|null $responseBody;
/**
* The HTTP header of the server response.
*
* @var string[][]|null
*/
protected ?array $responseHeaders;
/**
* The deserialized response object
*
* @var mixed
*/
protected mixed $responseObject = null;
/**
* Constructor
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string[][]|null $responseHeaders HTTP response header
* @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string
*/
public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null)
{
parent::__construct($message, $code);
$this->responseHeaders = $responseHeaders;
$this->responseBody = $responseBody;
}
/**
* Gets the HTTP response header
*
* @return string[][]|null HTTP response header
*/
public function getResponseHeaders(): ?array
{
return $this->responseHeaders;
}
/**
* Gets the HTTP body of the server response either as Json or string
*
* @return stdClass|string|null HTTP body of the server response either as \stdClass or string
*/
public function getResponseBody(): stdClass|string|null
{
return $this->responseBody;
}
/**
* Sets the deserialized response object (during deserialization)
*
* @param mixed $obj Deserialized response object
*
* @return void
*/
public function setResponseObject(mixed $obj): void
{
$this->responseObject = $obj;
}
/**
* Gets the deserialized response object (during deserialization)
*
* @return mixed the deserialized response object
*/
public function getResponseObject(): mixed
{
return $this->responseObject;
}
}

1549
utils/sdk/client/php/src/BlockApi.php generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,917 @@
<?php
/**
* BlockProcessingPerformanceModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* BlockProcessingPerformanceModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class BlockProcessingPerformanceModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'BlockProcessingPerformanceModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'block_processing_time_0' => 'int',
'block_processing_time_1' => 'int',
'target_calculating_time_2' => 'int',
'longhash_calculating_time_3' => 'int',
'all_txs_insert_time_5' => 'int',
'etc_stuff_6' => 'int',
'insert_time_4' => 'int',
'raise_block_core_event' => 'int',
'validate_miner_transaction_time' => 'int',
'collect_rangeproofs_data_from_tx_time' => 'int',
'verify_multiple_zc_outs_range_proofs_time' => 'int',
'target_calculating_enum_blocks' => 'int',
'target_calculating_calc' => 'int',
'pos_validate_ki_search' => 'int',
'pos_validate_get_out_keys_for_inputs' => 'int',
'pos_validate_zvp' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'block_processing_time_0' => null,
'block_processing_time_1' => null,
'target_calculating_time_2' => null,
'longhash_calculating_time_3' => null,
'all_txs_insert_time_5' => null,
'etc_stuff_6' => null,
'insert_time_4' => null,
'raise_block_core_event' => null,
'validate_miner_transaction_time' => null,
'collect_rangeproofs_data_from_tx_time' => null,
'verify_multiple_zc_outs_range_proofs_time' => null,
'target_calculating_enum_blocks' => null,
'target_calculating_calc' => null,
'pos_validate_ki_search' => null,
'pos_validate_get_out_keys_for_inputs' => null,
'pos_validate_zvp' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'block_processing_time_0' => false,
'block_processing_time_1' => false,
'target_calculating_time_2' => false,
'longhash_calculating_time_3' => false,
'all_txs_insert_time_5' => false,
'etc_stuff_6' => false,
'insert_time_4' => false,
'raise_block_core_event' => false,
'validate_miner_transaction_time' => false,
'collect_rangeproofs_data_from_tx_time' => false,
'verify_multiple_zc_outs_range_proofs_time' => false,
'target_calculating_enum_blocks' => false,
'target_calculating_calc' => false,
'pos_validate_ki_search' => false,
'pos_validate_get_out_keys_for_inputs' => false,
'pos_validate_zvp' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'block_processing_time_0' => 'block_processing_time_0',
'block_processing_time_1' => 'block_processing_time_1',
'target_calculating_time_2' => 'target_calculating_time_2',
'longhash_calculating_time_3' => 'longhash_calculating_time_3',
'all_txs_insert_time_5' => 'all_txs_insert_time_5',
'etc_stuff_6' => 'etc_stuff_6',
'insert_time_4' => 'insert_time_4',
'raise_block_core_event' => 'raise_block_core_event',
'validate_miner_transaction_time' => 'validate_miner_transaction_time',
'collect_rangeproofs_data_from_tx_time' => 'collect_rangeproofs_data_from_tx_time',
'verify_multiple_zc_outs_range_proofs_time' => 'verify_multiple_zc_outs_range_proofs_time',
'target_calculating_enum_blocks' => 'target_calculating_enum_blocks',
'target_calculating_calc' => 'target_calculating_calc',
'pos_validate_ki_search' => 'pos_validate_ki_search',
'pos_validate_get_out_keys_for_inputs' => 'pos_validate_get_out_keys_for_inputs',
'pos_validate_zvp' => 'pos_validate_zvp'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'block_processing_time_0' => 'setBlockProcessingTime0',
'block_processing_time_1' => 'setBlockProcessingTime1',
'target_calculating_time_2' => 'setTargetCalculatingTime2',
'longhash_calculating_time_3' => 'setLonghashCalculatingTime3',
'all_txs_insert_time_5' => 'setAllTxsInsertTime5',
'etc_stuff_6' => 'setEtcStuff6',
'insert_time_4' => 'setInsertTime4',
'raise_block_core_event' => 'setRaiseBlockCoreEvent',
'validate_miner_transaction_time' => 'setValidateMinerTransactionTime',
'collect_rangeproofs_data_from_tx_time' => 'setCollectRangeproofsDataFromTxTime',
'verify_multiple_zc_outs_range_proofs_time' => 'setVerifyMultipleZcOutsRangeProofsTime',
'target_calculating_enum_blocks' => 'setTargetCalculatingEnumBlocks',
'target_calculating_calc' => 'setTargetCalculatingCalc',
'pos_validate_ki_search' => 'setPosValidateKiSearch',
'pos_validate_get_out_keys_for_inputs' => 'setPosValidateGetOutKeysForInputs',
'pos_validate_zvp' => 'setPosValidateZvp'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'block_processing_time_0' => 'getBlockProcessingTime0',
'block_processing_time_1' => 'getBlockProcessingTime1',
'target_calculating_time_2' => 'getTargetCalculatingTime2',
'longhash_calculating_time_3' => 'getLonghashCalculatingTime3',
'all_txs_insert_time_5' => 'getAllTxsInsertTime5',
'etc_stuff_6' => 'getEtcStuff6',
'insert_time_4' => 'getInsertTime4',
'raise_block_core_event' => 'getRaiseBlockCoreEvent',
'validate_miner_transaction_time' => 'getValidateMinerTransactionTime',
'collect_rangeproofs_data_from_tx_time' => 'getCollectRangeproofsDataFromTxTime',
'verify_multiple_zc_outs_range_proofs_time' => 'getVerifyMultipleZcOutsRangeProofsTime',
'target_calculating_enum_blocks' => 'getTargetCalculatingEnumBlocks',
'target_calculating_calc' => 'getTargetCalculatingCalc',
'pos_validate_ki_search' => 'getPosValidateKiSearch',
'pos_validate_get_out_keys_for_inputs' => 'getPosValidateGetOutKeysForInputs',
'pos_validate_zvp' => 'getPosValidateZvp'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('block_processing_time_0', $data ?? [], null);
$this->setIfExists('block_processing_time_1', $data ?? [], null);
$this->setIfExists('target_calculating_time_2', $data ?? [], null);
$this->setIfExists('longhash_calculating_time_3', $data ?? [], null);
$this->setIfExists('all_txs_insert_time_5', $data ?? [], null);
$this->setIfExists('etc_stuff_6', $data ?? [], null);
$this->setIfExists('insert_time_4', $data ?? [], null);
$this->setIfExists('raise_block_core_event', $data ?? [], null);
$this->setIfExists('validate_miner_transaction_time', $data ?? [], null);
$this->setIfExists('collect_rangeproofs_data_from_tx_time', $data ?? [], null);
$this->setIfExists('verify_multiple_zc_outs_range_proofs_time', $data ?? [], null);
$this->setIfExists('target_calculating_enum_blocks', $data ?? [], null);
$this->setIfExists('target_calculating_calc', $data ?? [], null);
$this->setIfExists('pos_validate_ki_search', $data ?? [], null);
$this->setIfExists('pos_validate_get_out_keys_for_inputs', $data ?? [], null);
$this->setIfExists('pos_validate_zvp', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets block_processing_time_0
*
* @return int|null
*/
public function getBlockProcessingTime0(): ?int
{
return $this->container['block_processing_time_0'];
}
/**
* Sets block_processing_time_0
*
* @param int|null $block_processing_time_0 block_processing_time_0
*
* @return $this
*/
public function setBlockProcessingTime0(?int $block_processing_time_0): static
{
if (is_null($block_processing_time_0)) {
throw new InvalidArgumentException('non-nullable block_processing_time_0 cannot be null');
}
$this->container['block_processing_time_0'] = $block_processing_time_0;
return $this;
}
/**
* Gets block_processing_time_1
*
* @return int|null
*/
public function getBlockProcessingTime1(): ?int
{
return $this->container['block_processing_time_1'];
}
/**
* Sets block_processing_time_1
*
* @param int|null $block_processing_time_1 block_processing_time_1
*
* @return $this
*/
public function setBlockProcessingTime1(?int $block_processing_time_1): static
{
if (is_null($block_processing_time_1)) {
throw new InvalidArgumentException('non-nullable block_processing_time_1 cannot be null');
}
$this->container['block_processing_time_1'] = $block_processing_time_1;
return $this;
}
/**
* Gets target_calculating_time_2
*
* @return int|null
*/
public function getTargetCalculatingTime2(): ?int
{
return $this->container['target_calculating_time_2'];
}
/**
* Sets target_calculating_time_2
*
* @param int|null $target_calculating_time_2 target_calculating_time_2
*
* @return $this
*/
public function setTargetCalculatingTime2(?int $target_calculating_time_2): static
{
if (is_null($target_calculating_time_2)) {
throw new InvalidArgumentException('non-nullable target_calculating_time_2 cannot be null');
}
$this->container['target_calculating_time_2'] = $target_calculating_time_2;
return $this;
}
/**
* Gets longhash_calculating_time_3
*
* @return int|null
*/
public function getLonghashCalculatingTime3(): ?int
{
return $this->container['longhash_calculating_time_3'];
}
/**
* Sets longhash_calculating_time_3
*
* @param int|null $longhash_calculating_time_3 longhash_calculating_time_3
*
* @return $this
*/
public function setLonghashCalculatingTime3(?int $longhash_calculating_time_3): static
{
if (is_null($longhash_calculating_time_3)) {
throw new InvalidArgumentException('non-nullable longhash_calculating_time_3 cannot be null');
}
$this->container['longhash_calculating_time_3'] = $longhash_calculating_time_3;
return $this;
}
/**
* Gets all_txs_insert_time_5
*
* @return int|null
*/
public function getAllTxsInsertTime5(): ?int
{
return $this->container['all_txs_insert_time_5'];
}
/**
* Sets all_txs_insert_time_5
*
* @param int|null $all_txs_insert_time_5 all_txs_insert_time_5
*
* @return $this
*/
public function setAllTxsInsertTime5(?int $all_txs_insert_time_5): static
{
if (is_null($all_txs_insert_time_5)) {
throw new InvalidArgumentException('non-nullable all_txs_insert_time_5 cannot be null');
}
$this->container['all_txs_insert_time_5'] = $all_txs_insert_time_5;
return $this;
}
/**
* Gets etc_stuff_6
*
* @return int|null
*/
public function getEtcStuff6(): ?int
{
return $this->container['etc_stuff_6'];
}
/**
* Sets etc_stuff_6
*
* @param int|null $etc_stuff_6 etc_stuff_6
*
* @return $this
*/
public function setEtcStuff6(?int $etc_stuff_6): static
{
if (is_null($etc_stuff_6)) {
throw new InvalidArgumentException('non-nullable etc_stuff_6 cannot be null');
}
$this->container['etc_stuff_6'] = $etc_stuff_6;
return $this;
}
/**
* Gets insert_time_4
*
* @return int|null
*/
public function getInsertTime4(): ?int
{
return $this->container['insert_time_4'];
}
/**
* Sets insert_time_4
*
* @param int|null $insert_time_4 insert_time_4
*
* @return $this
*/
public function setInsertTime4(?int $insert_time_4): static
{
if (is_null($insert_time_4)) {
throw new InvalidArgumentException('non-nullable insert_time_4 cannot be null');
}
$this->container['insert_time_4'] = $insert_time_4;
return $this;
}
/**
* Gets raise_block_core_event
*
* @return int|null
*/
public function getRaiseBlockCoreEvent(): ?int
{
return $this->container['raise_block_core_event'];
}
/**
* Sets raise_block_core_event
*
* @param int|null $raise_block_core_event raise_block_core_event
*
* @return $this
*/
public function setRaiseBlockCoreEvent(?int $raise_block_core_event): static
{
if (is_null($raise_block_core_event)) {
throw new InvalidArgumentException('non-nullable raise_block_core_event cannot be null');
}
$this->container['raise_block_core_event'] = $raise_block_core_event;
return $this;
}
/**
* Gets validate_miner_transaction_time
*
* @return int|null
*/
public function getValidateMinerTransactionTime(): ?int
{
return $this->container['validate_miner_transaction_time'];
}
/**
* Sets validate_miner_transaction_time
*
* @param int|null $validate_miner_transaction_time validate_miner_transaction_time
*
* @return $this
*/
public function setValidateMinerTransactionTime(?int $validate_miner_transaction_time): static
{
if (is_null($validate_miner_transaction_time)) {
throw new InvalidArgumentException('non-nullable validate_miner_transaction_time cannot be null');
}
$this->container['validate_miner_transaction_time'] = $validate_miner_transaction_time;
return $this;
}
/**
* Gets collect_rangeproofs_data_from_tx_time
*
* @return int|null
*/
public function getCollectRangeproofsDataFromTxTime(): ?int
{
return $this->container['collect_rangeproofs_data_from_tx_time'];
}
/**
* Sets collect_rangeproofs_data_from_tx_time
*
* @param int|null $collect_rangeproofs_data_from_tx_time collect_rangeproofs_data_from_tx_time
*
* @return $this
*/
public function setCollectRangeproofsDataFromTxTime(?int $collect_rangeproofs_data_from_tx_time): static
{
if (is_null($collect_rangeproofs_data_from_tx_time)) {
throw new InvalidArgumentException('non-nullable collect_rangeproofs_data_from_tx_time cannot be null');
}
$this->container['collect_rangeproofs_data_from_tx_time'] = $collect_rangeproofs_data_from_tx_time;
return $this;
}
/**
* Gets verify_multiple_zc_outs_range_proofs_time
*
* @return int|null
*/
public function getVerifyMultipleZcOutsRangeProofsTime(): ?int
{
return $this->container['verify_multiple_zc_outs_range_proofs_time'];
}
/**
* Sets verify_multiple_zc_outs_range_proofs_time
*
* @param int|null $verify_multiple_zc_outs_range_proofs_time verify_multiple_zc_outs_range_proofs_time
*
* @return $this
*/
public function setVerifyMultipleZcOutsRangeProofsTime(?int $verify_multiple_zc_outs_range_proofs_time): static
{
if (is_null($verify_multiple_zc_outs_range_proofs_time)) {
throw new InvalidArgumentException('non-nullable verify_multiple_zc_outs_range_proofs_time cannot be null');
}
$this->container['verify_multiple_zc_outs_range_proofs_time'] = $verify_multiple_zc_outs_range_proofs_time;
return $this;
}
/**
* Gets target_calculating_enum_blocks
*
* @return int|null
*/
public function getTargetCalculatingEnumBlocks(): ?int
{
return $this->container['target_calculating_enum_blocks'];
}
/**
* Sets target_calculating_enum_blocks
*
* @param int|null $target_calculating_enum_blocks target_calculating_enum_blocks
*
* @return $this
*/
public function setTargetCalculatingEnumBlocks(?int $target_calculating_enum_blocks): static
{
if (is_null($target_calculating_enum_blocks)) {
throw new InvalidArgumentException('non-nullable target_calculating_enum_blocks cannot be null');
}
$this->container['target_calculating_enum_blocks'] = $target_calculating_enum_blocks;
return $this;
}
/**
* Gets target_calculating_calc
*
* @return int|null
*/
public function getTargetCalculatingCalc(): ?int
{
return $this->container['target_calculating_calc'];
}
/**
* Sets target_calculating_calc
*
* @param int|null $target_calculating_calc target_calculating_calc
*
* @return $this
*/
public function setTargetCalculatingCalc(?int $target_calculating_calc): static
{
if (is_null($target_calculating_calc)) {
throw new InvalidArgumentException('non-nullable target_calculating_calc cannot be null');
}
$this->container['target_calculating_calc'] = $target_calculating_calc;
return $this;
}
/**
* Gets pos_validate_ki_search
*
* @return int|null
*/
public function getPosValidateKiSearch(): ?int
{
return $this->container['pos_validate_ki_search'];
}
/**
* Sets pos_validate_ki_search
*
* @param int|null $pos_validate_ki_search pos_validate_ki_search
*
* @return $this
*/
public function setPosValidateKiSearch(?int $pos_validate_ki_search): static
{
if (is_null($pos_validate_ki_search)) {
throw new InvalidArgumentException('non-nullable pos_validate_ki_search cannot be null');
}
$this->container['pos_validate_ki_search'] = $pos_validate_ki_search;
return $this;
}
/**
* Gets pos_validate_get_out_keys_for_inputs
*
* @return int|null
*/
public function getPosValidateGetOutKeysForInputs(): ?int
{
return $this->container['pos_validate_get_out_keys_for_inputs'];
}
/**
* Sets pos_validate_get_out_keys_for_inputs
*
* @param int|null $pos_validate_get_out_keys_for_inputs pos_validate_get_out_keys_for_inputs
*
* @return $this
*/
public function setPosValidateGetOutKeysForInputs(?int $pos_validate_get_out_keys_for_inputs): static
{
if (is_null($pos_validate_get_out_keys_for_inputs)) {
throw new InvalidArgumentException('non-nullable pos_validate_get_out_keys_for_inputs cannot be null');
}
$this->container['pos_validate_get_out_keys_for_inputs'] = $pos_validate_get_out_keys_for_inputs;
return $this;
}
/**
* Gets pos_validate_zvp
*
* @return int|null
*/
public function getPosValidateZvp(): ?int
{
return $this->container['pos_validate_zvp'];
}
/**
* Sets pos_validate_zvp
*
* @param int|null $pos_validate_zvp pos_validate_zvp
*
* @return $this
*/
public function setPosValidateZvp(?int $pos_validate_zvp): static
{
if (is_null($pos_validate_zvp)) {
throw new InvalidArgumentException('non-nullable pos_validate_zvp cannot be null');
}
$this->container['pos_validate_zvp'] = $pos_validate_zvp;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,679 @@
<?php
/**
* BlockTemplateModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* BlockTemplateModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class BlockTemplateModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'BlockTemplateModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'blocktemplate_blob' => 'string',
'difficulty' => 'string',
'height' => 'int',
'miner_tx_tgc' => '\lthn\lthn\TxGenerationContextModel',
'block_reward_without_fee' => 'int',
'block_reward' => 'int',
'txs_fee' => 'int',
'prev_hash' => 'string',
'seed' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'blocktemplate_blob' => null,
'difficulty' => null,
'height' => null,
'miner_tx_tgc' => null,
'block_reward_without_fee' => null,
'block_reward' => null,
'txs_fee' => null,
'prev_hash' => null,
'seed' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'blocktemplate_blob' => false,
'difficulty' => false,
'height' => false,
'miner_tx_tgc' => false,
'block_reward_without_fee' => false,
'block_reward' => false,
'txs_fee' => false,
'prev_hash' => false,
'seed' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'blocktemplate_blob' => 'blocktemplate_blob',
'difficulty' => 'difficulty',
'height' => 'height',
'miner_tx_tgc' => 'miner_tx_tgc',
'block_reward_without_fee' => 'block_reward_without_fee',
'block_reward' => 'block_reward',
'txs_fee' => 'txs_fee',
'prev_hash' => 'prev_hash',
'seed' => 'seed'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'blocktemplate_blob' => 'setBlocktemplateBlob',
'difficulty' => 'setDifficulty',
'height' => 'setHeight',
'miner_tx_tgc' => 'setMinerTxTgc',
'block_reward_without_fee' => 'setBlockRewardWithoutFee',
'block_reward' => 'setBlockReward',
'txs_fee' => 'setTxsFee',
'prev_hash' => 'setPrevHash',
'seed' => 'setSeed'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'blocktemplate_blob' => 'getBlocktemplateBlob',
'difficulty' => 'getDifficulty',
'height' => 'getHeight',
'miner_tx_tgc' => 'getMinerTxTgc',
'block_reward_without_fee' => 'getBlockRewardWithoutFee',
'block_reward' => 'getBlockReward',
'txs_fee' => 'getTxsFee',
'prev_hash' => 'getPrevHash',
'seed' => 'getSeed'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('blocktemplate_blob', $data ?? [], null);
$this->setIfExists('difficulty', $data ?? [], null);
$this->setIfExists('height', $data ?? [], null);
$this->setIfExists('miner_tx_tgc', $data ?? [], null);
$this->setIfExists('block_reward_without_fee', $data ?? [], null);
$this->setIfExists('block_reward', $data ?? [], null);
$this->setIfExists('txs_fee', $data ?? [], null);
$this->setIfExists('prev_hash', $data ?? [], null);
$this->setIfExists('seed', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets blocktemplate_blob
*
* @return string|null
*/
public function getBlocktemplateBlob(): ?string
{
return $this->container['blocktemplate_blob'];
}
/**
* Sets blocktemplate_blob
*
* @param string|null $blocktemplate_blob blocktemplate_blob
*
* @return $this
*/
public function setBlocktemplateBlob(?string $blocktemplate_blob): static
{
if (is_null($blocktemplate_blob)) {
throw new InvalidArgumentException('non-nullable blocktemplate_blob cannot be null');
}
$this->container['blocktemplate_blob'] = $blocktemplate_blob;
return $this;
}
/**
* Gets difficulty
*
* @return string|null
*/
public function getDifficulty(): ?string
{
return $this->container['difficulty'];
}
/**
* Sets difficulty
*
* @param string|null $difficulty difficulty
*
* @return $this
*/
public function setDifficulty(?string $difficulty): static
{
if (is_null($difficulty)) {
throw new InvalidArgumentException('non-nullable difficulty cannot be null');
}
$this->container['difficulty'] = $difficulty;
return $this;
}
/**
* Gets height
*
* @return int|null
*/
public function getHeight(): ?int
{
return $this->container['height'];
}
/**
* Sets height
*
* @param int|null $height height
*
* @return $this
*/
public function setHeight(?int $height): static
{
if (is_null($height)) {
throw new InvalidArgumentException('non-nullable height cannot be null');
}
$this->container['height'] = $height;
return $this;
}
/**
* Gets miner_tx_tgc
*
* @return \lthn\lthn\TxGenerationContextModel|null
*/
public function getMinerTxTgc(): ?\lthn\lthn\TxGenerationContextModel
{
return $this->container['miner_tx_tgc'];
}
/**
* Sets miner_tx_tgc
*
* @param \lthn\lthn\TxGenerationContextModel|null $miner_tx_tgc miner_tx_tgc
*
* @return $this
*/
public function setMinerTxTgc(?\lthn\lthn\TxGenerationContextModel $miner_tx_tgc): static
{
if (is_null($miner_tx_tgc)) {
throw new InvalidArgumentException('non-nullable miner_tx_tgc cannot be null');
}
$this->container['miner_tx_tgc'] = $miner_tx_tgc;
return $this;
}
/**
* Gets block_reward_without_fee
*
* @return int|null
*/
public function getBlockRewardWithoutFee(): ?int
{
return $this->container['block_reward_without_fee'];
}
/**
* Sets block_reward_without_fee
*
* @param int|null $block_reward_without_fee block_reward_without_fee
*
* @return $this
*/
public function setBlockRewardWithoutFee(?int $block_reward_without_fee): static
{
if (is_null($block_reward_without_fee)) {
throw new InvalidArgumentException('non-nullable block_reward_without_fee cannot be null');
}
$this->container['block_reward_without_fee'] = $block_reward_without_fee;
return $this;
}
/**
* Gets block_reward
*
* @return int|null
*/
public function getBlockReward(): ?int
{
return $this->container['block_reward'];
}
/**
* Sets block_reward
*
* @param int|null $block_reward block_reward
*
* @return $this
*/
public function setBlockReward(?int $block_reward): static
{
if (is_null($block_reward)) {
throw new InvalidArgumentException('non-nullable block_reward cannot be null');
}
$this->container['block_reward'] = $block_reward;
return $this;
}
/**
* Gets txs_fee
*
* @return int|null
*/
public function getTxsFee(): ?int
{
return $this->container['txs_fee'];
}
/**
* Sets txs_fee
*
* @param int|null $txs_fee txs_fee
*
* @return $this
*/
public function setTxsFee(?int $txs_fee): static
{
if (is_null($txs_fee)) {
throw new InvalidArgumentException('non-nullable txs_fee cannot be null');
}
$this->container['txs_fee'] = $txs_fee;
return $this;
}
/**
* Gets prev_hash
*
* @return string|null
*/
public function getPrevHash(): ?string
{
return $this->container['prev_hash'];
}
/**
* Sets prev_hash
*
* @param string|null $prev_hash prev_hash
*
* @return $this
*/
public function setPrevHash(?string $prev_hash): static
{
if (is_null($prev_hash)) {
throw new InvalidArgumentException('non-nullable prev_hash cannot be null');
}
$this->container['prev_hash'] = $prev_hash;
return $this;
}
/**
* Gets seed
*
* @return string|null
*/
public function getSeed(): ?string
{
return $this->container['seed'];
}
/**
* Sets seed
*
* @param string|null $seed seed
*
* @return $this
*/
public function setSeed(?string $seed): static
{
if (is_null($seed)) {
throw new InvalidArgumentException('non-nullable seed cannot be null');
}
$this->container['seed'] = $seed;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,611 @@
<?php
/**
* BlockTemplateRequestModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* BlockTemplateRequestModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class BlockTemplateRequestModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'BlockTemplateRequestModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'miner_address' => 'string',
'stakeholder_address' => 'string',
'ex_nonce' => 'string',
'pos_block' => 'bool',
'ignore_pow_ts_check' => 'bool',
'pe' => '\lthn\lthn\PosEntryModel',
'explicit_txs' => 'string[]'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'miner_address' => null,
'stakeholder_address' => null,
'ex_nonce' => null,
'pos_block' => null,
'ignore_pow_ts_check' => null,
'pe' => null,
'explicit_txs' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'miner_address' => false,
'stakeholder_address' => false,
'ex_nonce' => false,
'pos_block' => false,
'ignore_pow_ts_check' => false,
'pe' => false,
'explicit_txs' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'miner_address' => 'miner_address',
'stakeholder_address' => 'stakeholder_address',
'ex_nonce' => 'ex_nonce',
'pos_block' => 'pos_block',
'ignore_pow_ts_check' => 'ignore_pow_ts_check',
'pe' => 'pe',
'explicit_txs' => 'explicit_txs'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'miner_address' => 'setMinerAddress',
'stakeholder_address' => 'setStakeholderAddress',
'ex_nonce' => 'setExNonce',
'pos_block' => 'setPosBlock',
'ignore_pow_ts_check' => 'setIgnorePowTsCheck',
'pe' => 'setPe',
'explicit_txs' => 'setExplicitTxs'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'miner_address' => 'getMinerAddress',
'stakeholder_address' => 'getStakeholderAddress',
'ex_nonce' => 'getExNonce',
'pos_block' => 'getPosBlock',
'ignore_pow_ts_check' => 'getIgnorePowTsCheck',
'pe' => 'getPe',
'explicit_txs' => 'getExplicitTxs'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('miner_address', $data ?? [], null);
$this->setIfExists('stakeholder_address', $data ?? [], null);
$this->setIfExists('ex_nonce', $data ?? [], null);
$this->setIfExists('pos_block', $data ?? [], null);
$this->setIfExists('ignore_pow_ts_check', $data ?? [], null);
$this->setIfExists('pe', $data ?? [], null);
$this->setIfExists('explicit_txs', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets miner_address
*
* @return string|null
*/
public function getMinerAddress(): ?string
{
return $this->container['miner_address'];
}
/**
* Sets miner_address
*
* @param string|null $miner_address miner_address
*
* @return $this
*/
public function setMinerAddress(?string $miner_address): static
{
if (is_null($miner_address)) {
throw new InvalidArgumentException('non-nullable miner_address cannot be null');
}
$this->container['miner_address'] = $miner_address;
return $this;
}
/**
* Gets stakeholder_address
*
* @return string|null
*/
public function getStakeholderAddress(): ?string
{
return $this->container['stakeholder_address'];
}
/**
* Sets stakeholder_address
*
* @param string|null $stakeholder_address stakeholder_address
*
* @return $this
*/
public function setStakeholderAddress(?string $stakeholder_address): static
{
if (is_null($stakeholder_address)) {
throw new InvalidArgumentException('non-nullable stakeholder_address cannot be null');
}
$this->container['stakeholder_address'] = $stakeholder_address;
return $this;
}
/**
* Gets ex_nonce
*
* @return string|null
*/
public function getExNonce(): ?string
{
return $this->container['ex_nonce'];
}
/**
* Sets ex_nonce
*
* @param string|null $ex_nonce ex_nonce
*
* @return $this
*/
public function setExNonce(?string $ex_nonce): static
{
if (is_null($ex_nonce)) {
throw new InvalidArgumentException('non-nullable ex_nonce cannot be null');
}
$this->container['ex_nonce'] = $ex_nonce;
return $this;
}
/**
* Gets pos_block
*
* @return bool|null
*/
public function getPosBlock(): ?bool
{
return $this->container['pos_block'];
}
/**
* Sets pos_block
*
* @param bool|null $pos_block pos_block
*
* @return $this
*/
public function setPosBlock(?bool $pos_block): static
{
if (is_null($pos_block)) {
throw new InvalidArgumentException('non-nullable pos_block cannot be null');
}
$this->container['pos_block'] = $pos_block;
return $this;
}
/**
* Gets ignore_pow_ts_check
*
* @return bool|null
*/
public function getIgnorePowTsCheck(): ?bool
{
return $this->container['ignore_pow_ts_check'];
}
/**
* Sets ignore_pow_ts_check
*
* @param bool|null $ignore_pow_ts_check ignore_pow_ts_check
*
* @return $this
*/
public function setIgnorePowTsCheck(?bool $ignore_pow_ts_check): static
{
if (is_null($ignore_pow_ts_check)) {
throw new InvalidArgumentException('non-nullable ignore_pow_ts_check cannot be null');
}
$this->container['ignore_pow_ts_check'] = $ignore_pow_ts_check;
return $this;
}
/**
* Gets pe
*
* @return \lthn\lthn\PosEntryModel|null
*/
public function getPe(): ?\lthn\lthn\PosEntryModel
{
return $this->container['pe'];
}
/**
* Sets pe
*
* @param \lthn\lthn\PosEntryModel|null $pe pe
*
* @return $this
*/
public function setPe(?\lthn\lthn\PosEntryModel $pe): static
{
if (is_null($pe)) {
throw new InvalidArgumentException('non-nullable pe cannot be null');
}
$this->container['pe'] = $pe;
return $this;
}
/**
* Gets explicit_txs
*
* @return string[]|null
*/
public function getExplicitTxs(): ?array
{
return $this->container['explicit_txs'];
}
/**
* Sets explicit_txs
*
* @param string[]|null $explicit_txs explicit_txs
*
* @return $this
*/
public function setExplicitTxs(?array $explicit_txs): static
{
if (is_null($explicit_txs)) {
throw new InvalidArgumentException('non-nullable explicit_txs cannot be null');
}
$this->container['explicit_txs'] = $explicit_txs;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

531
utils/sdk/client/php/src/Configuration.php generated Normal file
View file

@ -0,0 +1,531 @@
<?php
/**
* Configuration
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn;
use InvalidArgumentException;
/**
* Configuration Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class Configuration
{
public const BOOLEAN_FORMAT_INT = 'int';
public const BOOLEAN_FORMAT_STRING = 'string';
/**
* @var Configuration|null
*/
private static ?Configuration $defaultConfiguration = null;
/**
* Associate array to store API key(s)
*
* @var string[]
*/
protected array $apiKeys = [];
/**
* Associate array to store API prefix (e.g. Bearer)
*
* @var string[]
*/
protected array $apiKeyPrefixes = [];
/**
* Access token for OAuth/Bearer authentication
*
* @var string
*/
protected string $accessToken = '';
/**
* Boolean format for query string
*
* @var string
*/
protected string $booleanFormatForQueryString = self::BOOLEAN_FORMAT_INT;
/**
* Username for HTTP basic authentication
*
* @var string
*/
protected string $username = '';
/**
* Password for HTTP basic authentication
*
* @var string
*/
protected string $password = '';
/**
* The host
*
* @var string
*/
protected string $host = 'http://127.0.0.1:36943';
/**
* User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
*
* @var string
*/
protected string $userAgent = 'OpenAPI-Generator/6.0.1/PHP';
/**
* Debug switch (default set to false)
*
* @var bool
*/
protected bool $debug = false;
/**
* Debug file location (log to STDOUT by default)
*
* @var string
*/
protected string $debugFile = 'php://output';
/**
* Debug file location (log to STDOUT by default)
*
* @var string
*/
protected string $tempFolderPath;
/**
* Constructor
*/
public function __construct()
{
$this->tempFolderPath = sys_get_temp_dir();
}
/**
* Sets API key
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $key API key or token
*
* @return $this
*/
public function setApiKey(string $apiKeyIdentifier, string $key): static
{
$this->apiKeys[$apiKeyIdentifier] = $key;
return $this;
}
/**
* Gets API key
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
* @return null|string API key or token
*/
public function getApiKey(string $apiKeyIdentifier): ?string
{
return $this->apiKeys[$apiKeyIdentifier] ?? null;
}
/**
* Sets the prefix for API key (e.g. Bearer)
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $prefix API key prefix, e.g. Bearer
*
* @return $this
*/
public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): static
{
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
return $this;
}
/**
* Gets API key prefix
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
* @return null|string
*/
public function getApiKeyPrefix(string $apiKeyIdentifier): ?string
{
return $this->apiKeyPrefixes[$apiKeyIdentifier] ?? null;
}
/**
* Sets the access token for OAuth
*
* @param string $accessToken Token for OAuth
*
* @return $this
*/
public function setAccessToken(string $accessToken): static
{
$this->accessToken = $accessToken;
return $this;
}
/**
* Gets the access token for OAuth
*
* @return string Access token for OAuth
*/
public function getAccessToken(): string
{
return $this->accessToken;
}
/**
* Sets boolean format for query string.
*
* @param string $booleanFormat Boolean format for query string
*
* @return $this
*/
public function setBooleanFormatForQueryString(string $booleanFormat): static
{
$this->booleanFormatForQueryString = $booleanFormat;
return $this;
}
/**
* Gets boolean format for query string.
*
* @return string Boolean format for query string
*/
public function getBooleanFormatForQueryString(): string
{
return $this->booleanFormatForQueryString;
}
/**
* Sets the username for HTTP basic authentication
*
* @param string $username Username for HTTP basic authentication
*
* @return $this
*/
public function setUsername(string $username): static
{
$this->username = $username;
return $this;
}
/**
* Gets the username for HTTP basic authentication
*
* @return string Username for HTTP basic authentication
*/
public function getUsername(): string
{
return $this->username;
}
/**
* Sets the password for HTTP basic authentication
*
* @param string $password Password for HTTP basic authentication
*
* @return $this
*/
public function setPassword(string $password): static
{
$this->password = $password;
return $this;
}
/**
* Gets the password for HTTP basic authentication
*
* @return string Password for HTTP basic authentication
*/
public function getPassword(): string
{
return $this->password;
}
/**
* Sets the host
*
* @param string $host Host
*
* @return $this
*/
public function setHost(string $host): static
{
$this->host = $host;
return $this;
}
/**
* Gets the host
*
* @return string Host
*/
public function getHost(): string
{
return $this->host;
}
/**
* Sets the user agent of the api client
*
* @param string $userAgent the user agent of the api client
*
* @throws InvalidArgumentException
* @return $this
*/
public function setUserAgent(string $userAgent): static
{
$this->userAgent = $userAgent;
return $this;
}
/**
* Gets the user agent of the api client
*
* @return string user agent
*/
public function getUserAgent(): string
{
return $this->userAgent;
}
/**
* Sets debug flag
*
* @param bool $debug Debug flag
*
* @return $this
*/
public function setDebug(bool $debug): static
{
$this->debug = $debug;
return $this;
}
/**
* Gets the debug flag
*
* @return bool
*/
public function getDebug(): bool
{
return $this->debug;
}
/**
* Sets the debug file
*
* @param string $debugFile Debug file
*
* @return $this
*/
public function setDebugFile(string $debugFile): static
{
$this->debugFile = $debugFile;
return $this;
}
/**
* Gets the debug file
*
* @return string
*/
public function getDebugFile(): string
{
return $this->debugFile;
}
/**
* Sets the temp folder path
*
* @param string $tempFolderPath Temp folder path
*
* @return $this
*/
public function setTempFolderPath(string $tempFolderPath): static
{
$this->tempFolderPath = $tempFolderPath;
return $this;
}
/**
* Gets the temp folder path
*
* @return string Temp folder path
*/
public function getTempFolderPath(): string
{
return $this->tempFolderPath;
}
/**
* Gets the default configuration instance
*
* @return Configuration
*/
public static function getDefaultConfiguration(): Configuration
{
if (self::$defaultConfiguration === null) {
self::$defaultConfiguration = new Configuration();
}
return self::$defaultConfiguration;
}
/**
* Sets the default configuration instance
*
* @param Configuration $config An instance of the Configuration Object
*
* @return void
*/
public static function setDefaultConfiguration(Configuration $config): void
{
self::$defaultConfiguration = $config;
}
/**
* Gets the essential information for debugging
*
* @return string The report for debugging
*/
public static function toDebugReport(): string
{
$report = 'PHP SDK (lthn) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' The version of the OpenAPI document: 6.0.1' . PHP_EOL;
$report .= ' SDK Package Version: 6.0.1' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
return $report;
}
/**
* Get API key (with prefix if set)
*
* @param string $apiKeyIdentifier name of apikey
*
* @return null|string API key with the prefix
*/
public function getApiKeyWithPrefix(string $apiKeyIdentifier): ?string
{
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
$apiKey = $this->getApiKey($apiKeyIdentifier);
if ($apiKey === null) {
return null;
}
if ($prefix === null) {
$keyWithPrefix = $apiKey;
} else {
$keyWithPrefix = $prefix . ' ' . $apiKey;
}
return $keyWithPrefix;
}
/**
* Returns an array of host settings
*
* @return array an array of host settings
*/
public function getHostSettings(): array
{
return [
[
"url" => "http://127.0.0.1:36943",
"description" => "Local Daemon",
],
[
"url" => "http://seed.lethean.io:36943",
"description" => "Seed Server",
]
];
}
/**
* Returns URL based on host settings, index and variables
*
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
* @param int $hostIndex index of the host settings
* @param array|null $variables hash of variable and the corresponding value (optional)
* @return string URL based on host settings
*/
public static function getHostString(array $hostSettings, int $hostIndex, ?array $variables = null): string
{
if (null === $variables) {
$variables = [];
}
// check array index out of bound
if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) {
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings));
}
$host = $hostSettings[$hostIndex];
$url = $host["url"];
// go through variable and assign a value
foreach ($host["variables"] ?? [] as $name => $variable) {
if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
$url = str_replace("{".$name."}", $variables[$name], $url);
} else {
throw new InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"]).".");
}
} else {
// use default value
$url = str_replace("{".$name."}", $variable["default_value"], $url);
}
}
return $url;
}
/**
* Returns URL based on the index and variables
*
* @param int $index index of the host settings
* @param array|null $variables hash of variable and the corresponding value (optional)
* @return string URL based on host settings
*/
public function getHostFromSettings(int $index, ?array $variables = null): string
{
return self::getHostString($this->getHostSettings(), $index, $variables);
}
}

View file

@ -0,0 +1,475 @@
<?php
/**
* DbStatInfoModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* DbStatInfoModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class DbStatInfoModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'DbStatInfoModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'tx_count' => 'int',
'write_tx_count' => 'int',
'map_size' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'tx_count' => null,
'write_tx_count' => null,
'map_size' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'tx_count' => false,
'write_tx_count' => false,
'map_size' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'tx_count' => 'tx_count',
'write_tx_count' => 'write_tx_count',
'map_size' => 'map_size'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'tx_count' => 'setTxCount',
'write_tx_count' => 'setWriteTxCount',
'map_size' => 'setMapSize'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'tx_count' => 'getTxCount',
'write_tx_count' => 'getWriteTxCount',
'map_size' => 'getMapSize'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('tx_count', $data ?? [], null);
$this->setIfExists('write_tx_count', $data ?? [], null);
$this->setIfExists('map_size', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets tx_count
*
* @return int|null
*/
public function getTxCount(): ?int
{
return $this->container['tx_count'];
}
/**
* Sets tx_count
*
* @param int|null $tx_count tx_count
*
* @return $this
*/
public function setTxCount(?int $tx_count): static
{
if (is_null($tx_count)) {
throw new InvalidArgumentException('non-nullable tx_count cannot be null');
}
$this->container['tx_count'] = $tx_count;
return $this;
}
/**
* Gets write_tx_count
*
* @return int|null
*/
public function getWriteTxCount(): ?int
{
return $this->container['write_tx_count'];
}
/**
* Sets write_tx_count
*
* @param int|null $write_tx_count write_tx_count
*
* @return $this
*/
public function setWriteTxCount(?int $write_tx_count): static
{
if (is_null($write_tx_count)) {
throw new InvalidArgumentException('non-nullable write_tx_count cannot be null');
}
$this->container['write_tx_count'] = $write_tx_count;
return $this;
}
/**
* Gets map_size
*
* @return int|null
*/
public function getMapSize(): ?int
{
return $this->container['map_size'];
}
/**
* Sets map_size
*
* @param int|null $map_size map_size
*
* @return $this
*/
public function setMapSize(?int $map_size): static
{
if (is_null($map_size)) {
throw new InvalidArgumentException('non-nullable map_size cannot be null');
}
$this->container['map_size'] = $map_size;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,240 @@
<?php
/**
* FormDataProcessor
* PHP version 8.1
*
* @category Class
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn;
use ArrayAccess;
use DateTime;
use GuzzleHttp\Psr7\Utils;
use Psr\Http\Message\StreamInterface;
use SplFileObject;
use lthn\lthn\ModelInterface;
class FormDataProcessor
{
/**
* Tags whether payload passed to ::prepare() contains one or more
* SplFileObject or stream values.
*/
public bool $has_file = false;
/**
* Take value and turn it into an array suitable for inclusion in
* the http body (form parameter). If it's a string, pass through unchanged
* If it's a datetime object, format it in ISO8601
*
* @param array<string|bool|array|DateTime|ArrayAccess|SplFileObject> $values the value of the form parameter
*
* @return array [key => value] of formdata
*/
public function prepare(array $values): array
{
$this->has_file = false;
$result = [];
foreach ($values as $k => $v) {
if ($v === null) {
continue;
}
$result[$k] = $this->makeFormSafe($v);
}
return $result;
}
/**
* Flattens a multi-level array of data and generates a single-level array
* compatible with formdata - a single-level array where the keys use bracket
* notation to signify nested data.
*
* credit: https://github.com/FranBar1966/FlatPHP
*/
public static function flatten(array $source, string $start = ''): array
{
$opt = [
'prefix' => '[',
'suffix' => ']',
'suffix-end' => true,
'prefix-list' => '[',
'suffix-list' => ']',
'suffix-list-end' => true,
];
if ($start === '') {
$currentPrefix = '';
$currentSuffix = '';
$currentSuffixEnd = false;
} elseif (array_is_list($source)) {
$currentPrefix = $opt['prefix-list'];
$currentSuffix = $opt['suffix-list'];
$currentSuffixEnd = $opt['suffix-list-end'];
} else {
$currentPrefix = $opt['prefix'];
$currentSuffix = $opt['suffix'];
$currentSuffixEnd = $opt['suffix-end'];
}
$currentName = $start;
$result = [];
foreach ($source as $key => $val) {
$currentName .= $currentPrefix . $key;
if (is_array($val) && !empty($val)) {
$currentName .= $currentSuffix;
$result += self::flatten($val, $currentName);
} else {
if ($currentSuffixEnd) {
$currentName .= $currentSuffix;
}
if (is_resource($val)) {
$result[$currentName] = $val;
} else {
$result[$currentName] = ObjectSerializer::toString($val);
}
}
$currentName = $start;
}
return $result;
}
/**
* formdata must be limited to scalars or arrays of scalar values,
* or a resource for a file upload. Here we iterate through all available
* data and identify how to handle each scenario
*
* @param string|bool|array|DateTime|ArrayAccess|SplFileObject $value
*/
protected function makeFormSafe(mixed $value)
{
if ($value instanceof SplFileObject) {
return $this->processFiles([$value])[0];
}
if (is_resource($value)) {
$this->has_file = true;
return $value;
}
if ($value instanceof ModelInterface) {
return $this->processModel($value);
}
if (is_array($value) || is_object($value)) {
$data = [];
foreach ($value as $k => $v) {
$data[$k] = $this->makeFormSafe($v);
}
return $data;
}
return ObjectSerializer::toString($value);
}
/**
* We are able to handle nested ModelInterface. We do not simply call
* json_decode(json_encode()) because any given model may have binary data
* or other data that cannot be serialized to a JSON string
*/
protected function processModel(ModelInterface $model): array
{
$result = [];
foreach ($model::openAPITypes() as $name => $type) {
$value = $model->offsetGet($name);
if ($value === null) {
continue;
}
if (str_contains($type, '\SplFileObject')) {
$file = is_array($value) ? $value : [$value];
$result[$name] = $this->processFiles($file);
continue;
}
if ($value instanceof ModelInterface) {
$result[$name] = $this->processModel($value);
continue;
}
if (is_array($value) || is_object($value)) {
$result[$name] = $this->makeFormSafe($value);
continue;
}
$result[$name] = ObjectSerializer::toString($value);
}
return $result;
}
/**
* Handle file data
*/
protected function processFiles(array $files): array
{
$this->has_file = true;
$result = [];
foreach ($files as $i => $file) {
if (is_array($file)) {
$result[$i] = $this->processFiles($file);
continue;
}
if ($file instanceof StreamInterface) {
$result[$i] = $file;
continue;
}
if ($file instanceof SplFileObject) {
$result[$i] = $this->tryFopen($file);
}
}
return $result;
}
private function tryFopen(SplFileObject $file)
{
return Utils::tryFopen($file->getRealPath(), 'rb');
}
}

View file

@ -0,0 +1,243 @@
<?php
/**
* HeaderSelector
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn;
/**
* HeaderSelector Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class HeaderSelector
{
/**
* @param string[] $accept
* @param string $contentType
* @param bool $isMultipart
* @return string[]
*/
public function selectHeaders(array $accept, string $contentType, bool $isMultipart): array
{
$headers = [];
$accept = $this->selectAcceptHeader($accept);
if ($accept !== null) {
$headers['Accept'] = $accept;
}
if (!$isMultipart) {
if($contentType === '') {
$contentType = 'application/json';
}
$headers['Content-Type'] = $contentType;
}
return $headers;
}
/**
* Return the header 'Accept' based on an array of Accept provided.
*
* @param string[] $accept Array of header
*
* @return null|string Accept (e.g. application/json)
*/
private function selectAcceptHeader(array $accept): ?string
{
# filter out empty entries
$accept = array_filter($accept);
if (count($accept) === 0) {
return null;
}
# If there's only one Accept header, just use it
if (count($accept) === 1) {
return reset($accept);
}
# If none of the available Accept headers is of type "json", then just use all them
$headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept);
if (count($headersWithJson) === 0) {
return implode(',', $accept);
}
# If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1,
# to give the highest priority to json-like headers - recalculating the existing ones, if needed
return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson);
}
/**
* Create an Accept header string from the given "Accept" headers array, recalculating all weights
*
* @param string[] $accept Array of Accept Headers
* @param string[] $headersWithJson Array of Accept Headers of type "json"
*
* @return string "Accept" Header (e.g. "application/json, text/html; q=0.9")
*/
private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string
{
$processedHeaders = [
'withApplicationJson' => [],
'withJson' => [],
'withoutJson' => [],
];
foreach ($accept as $header) {
$headerData = $this->getHeaderAndWeight($header);
if (stripos($headerData['header'], 'application/json') === 0) {
$processedHeaders['withApplicationJson'][] = $headerData;
} elseif (in_array($header, $headersWithJson, true)) {
$processedHeaders['withJson'][] = $headerData;
} else {
$processedHeaders['withoutJson'][] = $headerData;
}
}
$acceptHeaders = [];
$currentWeight = 1000;
$hasMoreThan28Headers = count($accept) > 28;
foreach($processedHeaders as $headers) {
if (count($headers) > 0) {
$acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers);
}
}
$acceptHeaders = array_merge(...$acceptHeaders);
return implode(',', $acceptHeaders);
}
/**
* Given an Accept header, returns an associative array splitting the header and its weight
*
* @param string $header "Accept" Header
*
* @return array with the header and its weight
*/
private function getHeaderAndWeight(string $header): array
{
# matches headers with weight, splitting the header and the weight in $outputArray
if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) {
$headerData = [
'header' => $outputArray[1],
'weight' => (int)($outputArray[2] * 1000),
];
} else {
$headerData = [
'header' => trim($header),
'weight' => 1000,
];
}
return $headerData;
}
/**
* @param array[] $headers
* @param float $currentWeight
* @param bool $hasMoreThan28Headers
* @return string[] array of adjusted "Accept" headers
*/
private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array
{
usort($headers, function (array $a, array $b) {
return $b['weight'] - $a['weight'];
});
$acceptHeaders = [];
foreach ($headers as $index => $header) {
if($index > 0 && $headers[$index - 1]['weight'] > $header['weight'])
{
$currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
}
$weight = $currentWeight;
$acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight);
}
$currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
return $acceptHeaders;
}
/**
* @param string $header
* @param int $weight
* @return string
*/
private function buildAcceptHeader(string $header, int $weight): string
{
if($weight === 1000) {
return $header;
}
return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0');
}
/**
* Calculate the next weight, based on the current one.
*
* If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the
* following formula:
*
* next weight = current weight - 10 ^ (floor(log(current weight - 1)))
*
* ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) )
*
* Starting from 1000, this generates the following series:
*
* 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
*
* The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works
* if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1
* decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc.
*
* @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value)
* @param bool $hasMoreThan28Headers
* @return int
*/
public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int
{
if ($currentWeight <= 1) {
return 1;
}
if ($hasMoreThan28Headers) {
return $currentWeight - 1;
}
return $currentWeight - 10 ** floor( log10($currentWeight - 1) );
}
}

407
utils/sdk/client/php/src/HeightModel.php generated Normal file
View file

@ -0,0 +1,407 @@
<?php
/**
* HeightModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* HeightModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class HeightModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'HeightModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'height' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'height' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'height' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'height' => 'height'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'height' => 'setHeight'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'height' => 'getHeight'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('height', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets height
*
* @return int|null
*/
public function getHeight(): ?int
{
return $this->container['height'];
}
/**
* Sets height
*
* @param int|null $height height
*
* @return $this
*/
public function setHeight(?int $height): static
{
if (is_null($height)) {
throw new InvalidArgumentException('non-nullable height cannot be null');
}
$this->container['height'] = $height;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

722
utils/sdk/client/php/src/InfoApi.php generated Normal file
View file

@ -0,0 +1,722 @@
<?php
/**
* InfoApi
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use InvalidArgumentException;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\MultipartStream;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use lthn\ApiException;
use lthn\Configuration;
use lthn\HeaderSelector;
use lthn\FormDataProcessor;
use lthn\ObjectSerializer;
/**
* InfoApi Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class InfoApi
{
/**
* @var ClientInterface
*/
protected ClientInterface $client;
/**
* @var Configuration
*/
protected Configuration $config;
/**
* @var HeaderSelector
*/
protected HeaderSelector $headerSelector;
/**
* @var int Host index
*/
protected int $hostIndex;
/** @var string[] $contentTypes **/
public const contentTypes = [
'getInfo' => [
'application/json',
],
'version' => [
'application/json',
],
];
/**
* @param ClientInterface|null $client
* @param Configuration|null $config
* @param HeaderSelector|null $selector
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
/**
* Set the host index
*
* @param int $hostIndex Host index (required)
*/
public function setHostIndex(int $hostIndex): void
{
$this->hostIndex = $hostIndex;
}
/**
* Get the host index
*
* @return int Host index
*/
public function getHostIndex(): int
{
return $this->hostIndex;
}
/**
* @return Configuration
*/
public function getConfig(): Configuration
{
return $this->config;
}
/**
* Operation getInfo
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return \lthn\lthn\InfoModel
*/
public function getInfo(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): \lthn\lthn\InfoModel
{
list($response) = $this->getInfoWithHttpInfo($flags, $contentType);
return $response;
}
/**
* Operation getInfoWithHttpInfo
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \lthn\lthn\InfoModel, HTTP status code, HTTP response headers (array of strings)
*/
public function getInfoWithHttpInfo(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): array
{
$request = $this->getInfoRequest($flags, $contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
switch($statusCode) {
case 200:
return $this->handleResponseWithDataType(
'\lthn\lthn\InfoModel',
$request,
$response,
);
}
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return $this->handleResponseWithDataType(
'\lthn\lthn\InfoModel',
$request,
$response,
);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\lthn\lthn\InfoModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
}
throw $e;
}
}
/**
* Operation getInfoAsync
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function getInfoAsync(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): PromiseInterface
{
return $this->getInfoAsyncWithHttpInfo($flags, $contentType)
->then(
function ($response) {
return $response[0];
}
);
}
/**
* Operation getInfoAsyncWithHttpInfo
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function getInfoAsyncWithHttpInfo(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): PromiseInterface
{
$returnType = '\lthn\lthn\InfoModel';
$request = $this->getInfoRequest($flags, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
}
/**
* Create request for operation 'getInfo'
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function getInfoRequest(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): Request
{
$resourcePath = '/info';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$flags,
'flags', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? []);
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
$multipart
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
* Operation version
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return \lthn\lthn\VersionModel
*/
public function version(
string $contentType = self::contentTypes['version'][0]
): \lthn\lthn\VersionModel
{
list($response) = $this->versionWithHttpInfo($contentType);
return $response;
}
/**
* Operation versionWithHttpInfo
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \lthn\lthn\VersionModel, HTTP status code, HTTP response headers (array of strings)
*/
public function versionWithHttpInfo(
string $contentType = self::contentTypes['version'][0]
): array
{
$request = $this->versionRequest($contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
switch($statusCode) {
case 200:
return $this->handleResponseWithDataType(
'\lthn\lthn\VersionModel',
$request,
$response,
);
}
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return $this->handleResponseWithDataType(
'\lthn\lthn\VersionModel',
$request,
$response,
);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\lthn\lthn\VersionModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
}
throw $e;
}
}
/**
* Operation versionAsync
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function versionAsync(
string $contentType = self::contentTypes['version'][0]
): PromiseInterface
{
return $this->versionAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
}
);
}
/**
* Operation versionAsyncWithHttpInfo
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function versionAsyncWithHttpInfo(
string $contentType = self::contentTypes['version'][0]
): PromiseInterface
{
$returnType = '\lthn\lthn\VersionModel';
$request = $this->versionRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
}
/**
* Create request for operation 'version'
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function versionRequest(
string $contentType = self::contentTypes['version'][0]
): Request
{
$resourcePath = '/info/version';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
$multipart
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
* Create http client option
*
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
if (!$options[RequestOptions::DEBUG]) {
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
}
}
return $options;
}
private function handleResponseWithDataType(
string $dataType,
RequestInterface $request,
ResponseInterface $response,
): array {
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($dataType !== 'string') {
try {
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
throw new ApiException(
sprintf(
'Error JSON decoding server response (%s)',
$request->getUri()
),
$response->getStatusCode(),
$response->getHeaders(),
$content
);
}
}
}
return [
ObjectSerializer::deserialize($content, $dataType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
private function responseWithinRangeCode(
string $rangeCode,
int $statusCode,
): bool {
$left = (int) ($rangeCode[0].'00');
$right = (int) ($rangeCode[0].'99');
return $statusCode >= $left && $statusCode <= $right;
}
}

1937
utils/sdk/client/php/src/InfoModel.php generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,623 @@
<?php
/**
* MaintainersInfoModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* MaintainersInfoModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class MaintainersInfoModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'MaintainersInfoModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'ver_major' => 'int',
'ver_minor' => 'int',
'ver_revision' => 'int',
'build_no' => 'int',
'mode' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'ver_major' => null,
'ver_minor' => null,
'ver_revision' => null,
'build_no' => null,
'mode' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'ver_major' => false,
'ver_minor' => false,
'ver_revision' => false,
'build_no' => false,
'mode' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'ver_major' => 'ver_major',
'ver_minor' => 'ver_minor',
'ver_revision' => 'ver_revision',
'build_no' => 'build_no',
'mode' => 'mode'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'ver_major' => 'setVerMajor',
'ver_minor' => 'setVerMinor',
'ver_revision' => 'setVerRevision',
'build_no' => 'setBuildNo',
'mode' => 'setMode'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'ver_major' => 'getVerMajor',
'ver_minor' => 'getVerMinor',
'ver_revision' => 'getVerRevision',
'build_no' => 'getBuildNo',
'mode' => 'getMode'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('ver_major', $data ?? [], null);
$this->setIfExists('ver_minor', $data ?? [], null);
$this->setIfExists('ver_revision', $data ?? [], null);
$this->setIfExists('build_no', $data ?? [], null);
$this->setIfExists('mode', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
if (!is_null($this->container['ver_major']) && ($this->container['ver_major'] > 255)) {
$invalidProperties[] = "invalid value for 'ver_major', must be smaller than or equal to 255.";
}
if (!is_null($this->container['ver_major']) && ($this->container['ver_major'] < 0)) {
$invalidProperties[] = "invalid value for 'ver_major', must be bigger than or equal to 0.";
}
if (!is_null($this->container['ver_minor']) && ($this->container['ver_minor'] > 255)) {
$invalidProperties[] = "invalid value for 'ver_minor', must be smaller than or equal to 255.";
}
if (!is_null($this->container['ver_minor']) && ($this->container['ver_minor'] < 0)) {
$invalidProperties[] = "invalid value for 'ver_minor', must be bigger than or equal to 0.";
}
if (!is_null($this->container['ver_revision']) && ($this->container['ver_revision'] > 255)) {
$invalidProperties[] = "invalid value for 'ver_revision', must be smaller than or equal to 255.";
}
if (!is_null($this->container['ver_revision']) && ($this->container['ver_revision'] < 0)) {
$invalidProperties[] = "invalid value for 'ver_revision', must be bigger than or equal to 0.";
}
if (!is_null($this->container['build_no']) && ($this->container['build_no'] > 4294967295)) {
$invalidProperties[] = "invalid value for 'build_no', must be smaller than or equal to 4294967295.";
}
if (!is_null($this->container['build_no']) && ($this->container['build_no'] < 0)) {
$invalidProperties[] = "invalid value for 'build_no', must be bigger than or equal to 0.";
}
if (!is_null($this->container['mode']) && ($this->container['mode'] > 255)) {
$invalidProperties[] = "invalid value for 'mode', must be smaller than or equal to 255.";
}
if (!is_null($this->container['mode']) && ($this->container['mode'] < 0)) {
$invalidProperties[] = "invalid value for 'mode', must be bigger than or equal to 0.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets ver_major
*
* @return int|null
*/
public function getVerMajor(): ?int
{
return $this->container['ver_major'];
}
/**
* Sets ver_major
*
* @param int|null $ver_major ver_major
*
* @return $this
*/
public function setVerMajor(?int $ver_major): static
{
if (is_null($ver_major)) {
throw new InvalidArgumentException('non-nullable ver_major cannot be null');
}
if (($ver_major > 255)) {
throw new InvalidArgumentException('invalid value for $ver_major when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($ver_major < 0)) {
throw new InvalidArgumentException('invalid value for $ver_major when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['ver_major'] = $ver_major;
return $this;
}
/**
* Gets ver_minor
*
* @return int|null
*/
public function getVerMinor(): ?int
{
return $this->container['ver_minor'];
}
/**
* Sets ver_minor
*
* @param int|null $ver_minor ver_minor
*
* @return $this
*/
public function setVerMinor(?int $ver_minor): static
{
if (is_null($ver_minor)) {
throw new InvalidArgumentException('non-nullable ver_minor cannot be null');
}
if (($ver_minor > 255)) {
throw new InvalidArgumentException('invalid value for $ver_minor when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($ver_minor < 0)) {
throw new InvalidArgumentException('invalid value for $ver_minor when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['ver_minor'] = $ver_minor;
return $this;
}
/**
* Gets ver_revision
*
* @return int|null
*/
public function getVerRevision(): ?int
{
return $this->container['ver_revision'];
}
/**
* Sets ver_revision
*
* @param int|null $ver_revision ver_revision
*
* @return $this
*/
public function setVerRevision(?int $ver_revision): static
{
if (is_null($ver_revision)) {
throw new InvalidArgumentException('non-nullable ver_revision cannot be null');
}
if (($ver_revision > 255)) {
throw new InvalidArgumentException('invalid value for $ver_revision when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($ver_revision < 0)) {
throw new InvalidArgumentException('invalid value for $ver_revision when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['ver_revision'] = $ver_revision;
return $this;
}
/**
* Gets build_no
*
* @return int|null
*/
public function getBuildNo(): ?int
{
return $this->container['build_no'];
}
/**
* Sets build_no
*
* @param int|null $build_no build_no
*
* @return $this
*/
public function setBuildNo(?int $build_no): static
{
if (is_null($build_no)) {
throw new InvalidArgumentException('non-nullable build_no cannot be null');
}
if (($build_no > 4294967295)) {
throw new InvalidArgumentException('invalid value for $build_no when calling MaintainersInfoModel., must be smaller than or equal to 4294967295.');
}
if (($build_no < 0)) {
throw new InvalidArgumentException('invalid value for $build_no when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['build_no'] = $build_no;
return $this;
}
/**
* Gets mode
*
* @return int|null
*/
public function getMode(): ?int
{
return $this->container['mode'];
}
/**
* Sets mode
*
* @param int|null $mode mode
*
* @return $this
*/
public function setMode(?int $mode): static
{
if (is_null($mode)) {
throw new InvalidArgumentException('non-nullable mode cannot be null');
}
if (($mode > 255)) {
throw new InvalidArgumentException('invalid value for $mode when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($mode < 0)) {
throw new InvalidArgumentException('invalid value for $mode when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['mode'] = $mode;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,917 @@
<?php
/**
* BlockProcessingPerformanceModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* BlockProcessingPerformanceModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class BlockProcessingPerformanceModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'BlockProcessingPerformanceModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'block_processing_time_0' => 'int',
'block_processing_time_1' => 'int',
'target_calculating_time_2' => 'int',
'longhash_calculating_time_3' => 'int',
'all_txs_insert_time_5' => 'int',
'etc_stuff_6' => 'int',
'insert_time_4' => 'int',
'raise_block_core_event' => 'int',
'validate_miner_transaction_time' => 'int',
'collect_rangeproofs_data_from_tx_time' => 'int',
'verify_multiple_zc_outs_range_proofs_time' => 'int',
'target_calculating_enum_blocks' => 'int',
'target_calculating_calc' => 'int',
'pos_validate_ki_search' => 'int',
'pos_validate_get_out_keys_for_inputs' => 'int',
'pos_validate_zvp' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'block_processing_time_0' => null,
'block_processing_time_1' => null,
'target_calculating_time_2' => null,
'longhash_calculating_time_3' => null,
'all_txs_insert_time_5' => null,
'etc_stuff_6' => null,
'insert_time_4' => null,
'raise_block_core_event' => null,
'validate_miner_transaction_time' => null,
'collect_rangeproofs_data_from_tx_time' => null,
'verify_multiple_zc_outs_range_proofs_time' => null,
'target_calculating_enum_blocks' => null,
'target_calculating_calc' => null,
'pos_validate_ki_search' => null,
'pos_validate_get_out_keys_for_inputs' => null,
'pos_validate_zvp' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'block_processing_time_0' => false,
'block_processing_time_1' => false,
'target_calculating_time_2' => false,
'longhash_calculating_time_3' => false,
'all_txs_insert_time_5' => false,
'etc_stuff_6' => false,
'insert_time_4' => false,
'raise_block_core_event' => false,
'validate_miner_transaction_time' => false,
'collect_rangeproofs_data_from_tx_time' => false,
'verify_multiple_zc_outs_range_proofs_time' => false,
'target_calculating_enum_blocks' => false,
'target_calculating_calc' => false,
'pos_validate_ki_search' => false,
'pos_validate_get_out_keys_for_inputs' => false,
'pos_validate_zvp' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'block_processing_time_0' => 'block_processing_time_0',
'block_processing_time_1' => 'block_processing_time_1',
'target_calculating_time_2' => 'target_calculating_time_2',
'longhash_calculating_time_3' => 'longhash_calculating_time_3',
'all_txs_insert_time_5' => 'all_txs_insert_time_5',
'etc_stuff_6' => 'etc_stuff_6',
'insert_time_4' => 'insert_time_4',
'raise_block_core_event' => 'raise_block_core_event',
'validate_miner_transaction_time' => 'validate_miner_transaction_time',
'collect_rangeproofs_data_from_tx_time' => 'collect_rangeproofs_data_from_tx_time',
'verify_multiple_zc_outs_range_proofs_time' => 'verify_multiple_zc_outs_range_proofs_time',
'target_calculating_enum_blocks' => 'target_calculating_enum_blocks',
'target_calculating_calc' => 'target_calculating_calc',
'pos_validate_ki_search' => 'pos_validate_ki_search',
'pos_validate_get_out_keys_for_inputs' => 'pos_validate_get_out_keys_for_inputs',
'pos_validate_zvp' => 'pos_validate_zvp'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'block_processing_time_0' => 'setBlockProcessingTime0',
'block_processing_time_1' => 'setBlockProcessingTime1',
'target_calculating_time_2' => 'setTargetCalculatingTime2',
'longhash_calculating_time_3' => 'setLonghashCalculatingTime3',
'all_txs_insert_time_5' => 'setAllTxsInsertTime5',
'etc_stuff_6' => 'setEtcStuff6',
'insert_time_4' => 'setInsertTime4',
'raise_block_core_event' => 'setRaiseBlockCoreEvent',
'validate_miner_transaction_time' => 'setValidateMinerTransactionTime',
'collect_rangeproofs_data_from_tx_time' => 'setCollectRangeproofsDataFromTxTime',
'verify_multiple_zc_outs_range_proofs_time' => 'setVerifyMultipleZcOutsRangeProofsTime',
'target_calculating_enum_blocks' => 'setTargetCalculatingEnumBlocks',
'target_calculating_calc' => 'setTargetCalculatingCalc',
'pos_validate_ki_search' => 'setPosValidateKiSearch',
'pos_validate_get_out_keys_for_inputs' => 'setPosValidateGetOutKeysForInputs',
'pos_validate_zvp' => 'setPosValidateZvp'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'block_processing_time_0' => 'getBlockProcessingTime0',
'block_processing_time_1' => 'getBlockProcessingTime1',
'target_calculating_time_2' => 'getTargetCalculatingTime2',
'longhash_calculating_time_3' => 'getLonghashCalculatingTime3',
'all_txs_insert_time_5' => 'getAllTxsInsertTime5',
'etc_stuff_6' => 'getEtcStuff6',
'insert_time_4' => 'getInsertTime4',
'raise_block_core_event' => 'getRaiseBlockCoreEvent',
'validate_miner_transaction_time' => 'getValidateMinerTransactionTime',
'collect_rangeproofs_data_from_tx_time' => 'getCollectRangeproofsDataFromTxTime',
'verify_multiple_zc_outs_range_proofs_time' => 'getVerifyMultipleZcOutsRangeProofsTime',
'target_calculating_enum_blocks' => 'getTargetCalculatingEnumBlocks',
'target_calculating_calc' => 'getTargetCalculatingCalc',
'pos_validate_ki_search' => 'getPosValidateKiSearch',
'pos_validate_get_out_keys_for_inputs' => 'getPosValidateGetOutKeysForInputs',
'pos_validate_zvp' => 'getPosValidateZvp'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('block_processing_time_0', $data ?? [], null);
$this->setIfExists('block_processing_time_1', $data ?? [], null);
$this->setIfExists('target_calculating_time_2', $data ?? [], null);
$this->setIfExists('longhash_calculating_time_3', $data ?? [], null);
$this->setIfExists('all_txs_insert_time_5', $data ?? [], null);
$this->setIfExists('etc_stuff_6', $data ?? [], null);
$this->setIfExists('insert_time_4', $data ?? [], null);
$this->setIfExists('raise_block_core_event', $data ?? [], null);
$this->setIfExists('validate_miner_transaction_time', $data ?? [], null);
$this->setIfExists('collect_rangeproofs_data_from_tx_time', $data ?? [], null);
$this->setIfExists('verify_multiple_zc_outs_range_proofs_time', $data ?? [], null);
$this->setIfExists('target_calculating_enum_blocks', $data ?? [], null);
$this->setIfExists('target_calculating_calc', $data ?? [], null);
$this->setIfExists('pos_validate_ki_search', $data ?? [], null);
$this->setIfExists('pos_validate_get_out_keys_for_inputs', $data ?? [], null);
$this->setIfExists('pos_validate_zvp', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets block_processing_time_0
*
* @return int|null
*/
public function getBlockProcessingTime0(): ?int
{
return $this->container['block_processing_time_0'];
}
/**
* Sets block_processing_time_0
*
* @param int|null $block_processing_time_0 block_processing_time_0
*
* @return $this
*/
public function setBlockProcessingTime0(?int $block_processing_time_0): static
{
if (is_null($block_processing_time_0)) {
throw new InvalidArgumentException('non-nullable block_processing_time_0 cannot be null');
}
$this->container['block_processing_time_0'] = $block_processing_time_0;
return $this;
}
/**
* Gets block_processing_time_1
*
* @return int|null
*/
public function getBlockProcessingTime1(): ?int
{
return $this->container['block_processing_time_1'];
}
/**
* Sets block_processing_time_1
*
* @param int|null $block_processing_time_1 block_processing_time_1
*
* @return $this
*/
public function setBlockProcessingTime1(?int $block_processing_time_1): static
{
if (is_null($block_processing_time_1)) {
throw new InvalidArgumentException('non-nullable block_processing_time_1 cannot be null');
}
$this->container['block_processing_time_1'] = $block_processing_time_1;
return $this;
}
/**
* Gets target_calculating_time_2
*
* @return int|null
*/
public function getTargetCalculatingTime2(): ?int
{
return $this->container['target_calculating_time_2'];
}
/**
* Sets target_calculating_time_2
*
* @param int|null $target_calculating_time_2 target_calculating_time_2
*
* @return $this
*/
public function setTargetCalculatingTime2(?int $target_calculating_time_2): static
{
if (is_null($target_calculating_time_2)) {
throw new InvalidArgumentException('non-nullable target_calculating_time_2 cannot be null');
}
$this->container['target_calculating_time_2'] = $target_calculating_time_2;
return $this;
}
/**
* Gets longhash_calculating_time_3
*
* @return int|null
*/
public function getLonghashCalculatingTime3(): ?int
{
return $this->container['longhash_calculating_time_3'];
}
/**
* Sets longhash_calculating_time_3
*
* @param int|null $longhash_calculating_time_3 longhash_calculating_time_3
*
* @return $this
*/
public function setLonghashCalculatingTime3(?int $longhash_calculating_time_3): static
{
if (is_null($longhash_calculating_time_3)) {
throw new InvalidArgumentException('non-nullable longhash_calculating_time_3 cannot be null');
}
$this->container['longhash_calculating_time_3'] = $longhash_calculating_time_3;
return $this;
}
/**
* Gets all_txs_insert_time_5
*
* @return int|null
*/
public function getAllTxsInsertTime5(): ?int
{
return $this->container['all_txs_insert_time_5'];
}
/**
* Sets all_txs_insert_time_5
*
* @param int|null $all_txs_insert_time_5 all_txs_insert_time_5
*
* @return $this
*/
public function setAllTxsInsertTime5(?int $all_txs_insert_time_5): static
{
if (is_null($all_txs_insert_time_5)) {
throw new InvalidArgumentException('non-nullable all_txs_insert_time_5 cannot be null');
}
$this->container['all_txs_insert_time_5'] = $all_txs_insert_time_5;
return $this;
}
/**
* Gets etc_stuff_6
*
* @return int|null
*/
public function getEtcStuff6(): ?int
{
return $this->container['etc_stuff_6'];
}
/**
* Sets etc_stuff_6
*
* @param int|null $etc_stuff_6 etc_stuff_6
*
* @return $this
*/
public function setEtcStuff6(?int $etc_stuff_6): static
{
if (is_null($etc_stuff_6)) {
throw new InvalidArgumentException('non-nullable etc_stuff_6 cannot be null');
}
$this->container['etc_stuff_6'] = $etc_stuff_6;
return $this;
}
/**
* Gets insert_time_4
*
* @return int|null
*/
public function getInsertTime4(): ?int
{
return $this->container['insert_time_4'];
}
/**
* Sets insert_time_4
*
* @param int|null $insert_time_4 insert_time_4
*
* @return $this
*/
public function setInsertTime4(?int $insert_time_4): static
{
if (is_null($insert_time_4)) {
throw new InvalidArgumentException('non-nullable insert_time_4 cannot be null');
}
$this->container['insert_time_4'] = $insert_time_4;
return $this;
}
/**
* Gets raise_block_core_event
*
* @return int|null
*/
public function getRaiseBlockCoreEvent(): ?int
{
return $this->container['raise_block_core_event'];
}
/**
* Sets raise_block_core_event
*
* @param int|null $raise_block_core_event raise_block_core_event
*
* @return $this
*/
public function setRaiseBlockCoreEvent(?int $raise_block_core_event): static
{
if (is_null($raise_block_core_event)) {
throw new InvalidArgumentException('non-nullable raise_block_core_event cannot be null');
}
$this->container['raise_block_core_event'] = $raise_block_core_event;
return $this;
}
/**
* Gets validate_miner_transaction_time
*
* @return int|null
*/
public function getValidateMinerTransactionTime(): ?int
{
return $this->container['validate_miner_transaction_time'];
}
/**
* Sets validate_miner_transaction_time
*
* @param int|null $validate_miner_transaction_time validate_miner_transaction_time
*
* @return $this
*/
public function setValidateMinerTransactionTime(?int $validate_miner_transaction_time): static
{
if (is_null($validate_miner_transaction_time)) {
throw new InvalidArgumentException('non-nullable validate_miner_transaction_time cannot be null');
}
$this->container['validate_miner_transaction_time'] = $validate_miner_transaction_time;
return $this;
}
/**
* Gets collect_rangeproofs_data_from_tx_time
*
* @return int|null
*/
public function getCollectRangeproofsDataFromTxTime(): ?int
{
return $this->container['collect_rangeproofs_data_from_tx_time'];
}
/**
* Sets collect_rangeproofs_data_from_tx_time
*
* @param int|null $collect_rangeproofs_data_from_tx_time collect_rangeproofs_data_from_tx_time
*
* @return $this
*/
public function setCollectRangeproofsDataFromTxTime(?int $collect_rangeproofs_data_from_tx_time): static
{
if (is_null($collect_rangeproofs_data_from_tx_time)) {
throw new InvalidArgumentException('non-nullable collect_rangeproofs_data_from_tx_time cannot be null');
}
$this->container['collect_rangeproofs_data_from_tx_time'] = $collect_rangeproofs_data_from_tx_time;
return $this;
}
/**
* Gets verify_multiple_zc_outs_range_proofs_time
*
* @return int|null
*/
public function getVerifyMultipleZcOutsRangeProofsTime(): ?int
{
return $this->container['verify_multiple_zc_outs_range_proofs_time'];
}
/**
* Sets verify_multiple_zc_outs_range_proofs_time
*
* @param int|null $verify_multiple_zc_outs_range_proofs_time verify_multiple_zc_outs_range_proofs_time
*
* @return $this
*/
public function setVerifyMultipleZcOutsRangeProofsTime(?int $verify_multiple_zc_outs_range_proofs_time): static
{
if (is_null($verify_multiple_zc_outs_range_proofs_time)) {
throw new InvalidArgumentException('non-nullable verify_multiple_zc_outs_range_proofs_time cannot be null');
}
$this->container['verify_multiple_zc_outs_range_proofs_time'] = $verify_multiple_zc_outs_range_proofs_time;
return $this;
}
/**
* Gets target_calculating_enum_blocks
*
* @return int|null
*/
public function getTargetCalculatingEnumBlocks(): ?int
{
return $this->container['target_calculating_enum_blocks'];
}
/**
* Sets target_calculating_enum_blocks
*
* @param int|null $target_calculating_enum_blocks target_calculating_enum_blocks
*
* @return $this
*/
public function setTargetCalculatingEnumBlocks(?int $target_calculating_enum_blocks): static
{
if (is_null($target_calculating_enum_blocks)) {
throw new InvalidArgumentException('non-nullable target_calculating_enum_blocks cannot be null');
}
$this->container['target_calculating_enum_blocks'] = $target_calculating_enum_blocks;
return $this;
}
/**
* Gets target_calculating_calc
*
* @return int|null
*/
public function getTargetCalculatingCalc(): ?int
{
return $this->container['target_calculating_calc'];
}
/**
* Sets target_calculating_calc
*
* @param int|null $target_calculating_calc target_calculating_calc
*
* @return $this
*/
public function setTargetCalculatingCalc(?int $target_calculating_calc): static
{
if (is_null($target_calculating_calc)) {
throw new InvalidArgumentException('non-nullable target_calculating_calc cannot be null');
}
$this->container['target_calculating_calc'] = $target_calculating_calc;
return $this;
}
/**
* Gets pos_validate_ki_search
*
* @return int|null
*/
public function getPosValidateKiSearch(): ?int
{
return $this->container['pos_validate_ki_search'];
}
/**
* Sets pos_validate_ki_search
*
* @param int|null $pos_validate_ki_search pos_validate_ki_search
*
* @return $this
*/
public function setPosValidateKiSearch(?int $pos_validate_ki_search): static
{
if (is_null($pos_validate_ki_search)) {
throw new InvalidArgumentException('non-nullable pos_validate_ki_search cannot be null');
}
$this->container['pos_validate_ki_search'] = $pos_validate_ki_search;
return $this;
}
/**
* Gets pos_validate_get_out_keys_for_inputs
*
* @return int|null
*/
public function getPosValidateGetOutKeysForInputs(): ?int
{
return $this->container['pos_validate_get_out_keys_for_inputs'];
}
/**
* Sets pos_validate_get_out_keys_for_inputs
*
* @param int|null $pos_validate_get_out_keys_for_inputs pos_validate_get_out_keys_for_inputs
*
* @return $this
*/
public function setPosValidateGetOutKeysForInputs(?int $pos_validate_get_out_keys_for_inputs): static
{
if (is_null($pos_validate_get_out_keys_for_inputs)) {
throw new InvalidArgumentException('non-nullable pos_validate_get_out_keys_for_inputs cannot be null');
}
$this->container['pos_validate_get_out_keys_for_inputs'] = $pos_validate_get_out_keys_for_inputs;
return $this;
}
/**
* Gets pos_validate_zvp
*
* @return int|null
*/
public function getPosValidateZvp(): ?int
{
return $this->container['pos_validate_zvp'];
}
/**
* Sets pos_validate_zvp
*
* @param int|null $pos_validate_zvp pos_validate_zvp
*
* @return $this
*/
public function setPosValidateZvp(?int $pos_validate_zvp): static
{
if (is_null($pos_validate_zvp)) {
throw new InvalidArgumentException('non-nullable pos_validate_zvp cannot be null');
}
$this->container['pos_validate_zvp'] = $pos_validate_zvp;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,679 @@
<?php
/**
* BlockTemplateModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* BlockTemplateModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class BlockTemplateModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'BlockTemplateModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'blocktemplate_blob' => 'string',
'difficulty' => 'string',
'height' => 'int',
'miner_tx_tgc' => '\OpenAPI\Client\Model\TxGenerationContextModel',
'block_reward_without_fee' => 'int',
'block_reward' => 'int',
'txs_fee' => 'int',
'prev_hash' => 'string',
'seed' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'blocktemplate_blob' => null,
'difficulty' => null,
'height' => null,
'miner_tx_tgc' => null,
'block_reward_without_fee' => null,
'block_reward' => null,
'txs_fee' => null,
'prev_hash' => null,
'seed' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'blocktemplate_blob' => false,
'difficulty' => false,
'height' => false,
'miner_tx_tgc' => false,
'block_reward_without_fee' => false,
'block_reward' => false,
'txs_fee' => false,
'prev_hash' => false,
'seed' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'blocktemplate_blob' => 'blocktemplate_blob',
'difficulty' => 'difficulty',
'height' => 'height',
'miner_tx_tgc' => 'miner_tx_tgc',
'block_reward_without_fee' => 'block_reward_without_fee',
'block_reward' => 'block_reward',
'txs_fee' => 'txs_fee',
'prev_hash' => 'prev_hash',
'seed' => 'seed'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'blocktemplate_blob' => 'setBlocktemplateBlob',
'difficulty' => 'setDifficulty',
'height' => 'setHeight',
'miner_tx_tgc' => 'setMinerTxTgc',
'block_reward_without_fee' => 'setBlockRewardWithoutFee',
'block_reward' => 'setBlockReward',
'txs_fee' => 'setTxsFee',
'prev_hash' => 'setPrevHash',
'seed' => 'setSeed'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'blocktemplate_blob' => 'getBlocktemplateBlob',
'difficulty' => 'getDifficulty',
'height' => 'getHeight',
'miner_tx_tgc' => 'getMinerTxTgc',
'block_reward_without_fee' => 'getBlockRewardWithoutFee',
'block_reward' => 'getBlockReward',
'txs_fee' => 'getTxsFee',
'prev_hash' => 'getPrevHash',
'seed' => 'getSeed'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('blocktemplate_blob', $data ?? [], null);
$this->setIfExists('difficulty', $data ?? [], null);
$this->setIfExists('height', $data ?? [], null);
$this->setIfExists('miner_tx_tgc', $data ?? [], null);
$this->setIfExists('block_reward_without_fee', $data ?? [], null);
$this->setIfExists('block_reward', $data ?? [], null);
$this->setIfExists('txs_fee', $data ?? [], null);
$this->setIfExists('prev_hash', $data ?? [], null);
$this->setIfExists('seed', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets blocktemplate_blob
*
* @return string|null
*/
public function getBlocktemplateBlob(): ?string
{
return $this->container['blocktemplate_blob'];
}
/**
* Sets blocktemplate_blob
*
* @param string|null $blocktemplate_blob blocktemplate_blob
*
* @return $this
*/
public function setBlocktemplateBlob(?string $blocktemplate_blob): static
{
if (is_null($blocktemplate_blob)) {
throw new InvalidArgumentException('non-nullable blocktemplate_blob cannot be null');
}
$this->container['blocktemplate_blob'] = $blocktemplate_blob;
return $this;
}
/**
* Gets difficulty
*
* @return string|null
*/
public function getDifficulty(): ?string
{
return $this->container['difficulty'];
}
/**
* Sets difficulty
*
* @param string|null $difficulty difficulty
*
* @return $this
*/
public function setDifficulty(?string $difficulty): static
{
if (is_null($difficulty)) {
throw new InvalidArgumentException('non-nullable difficulty cannot be null');
}
$this->container['difficulty'] = $difficulty;
return $this;
}
/**
* Gets height
*
* @return int|null
*/
public function getHeight(): ?int
{
return $this->container['height'];
}
/**
* Sets height
*
* @param int|null $height height
*
* @return $this
*/
public function setHeight(?int $height): static
{
if (is_null($height)) {
throw new InvalidArgumentException('non-nullable height cannot be null');
}
$this->container['height'] = $height;
return $this;
}
/**
* Gets miner_tx_tgc
*
* @return \OpenAPI\Client\Model\TxGenerationContextModel|null
*/
public function getMinerTxTgc(): ?\OpenAPI\Client\Model\TxGenerationContextModel
{
return $this->container['miner_tx_tgc'];
}
/**
* Sets miner_tx_tgc
*
* @param \OpenAPI\Client\Model\TxGenerationContextModel|null $miner_tx_tgc miner_tx_tgc
*
* @return $this
*/
public function setMinerTxTgc(?\OpenAPI\Client\Model\TxGenerationContextModel $miner_tx_tgc): static
{
if (is_null($miner_tx_tgc)) {
throw new InvalidArgumentException('non-nullable miner_tx_tgc cannot be null');
}
$this->container['miner_tx_tgc'] = $miner_tx_tgc;
return $this;
}
/**
* Gets block_reward_without_fee
*
* @return int|null
*/
public function getBlockRewardWithoutFee(): ?int
{
return $this->container['block_reward_without_fee'];
}
/**
* Sets block_reward_without_fee
*
* @param int|null $block_reward_without_fee block_reward_without_fee
*
* @return $this
*/
public function setBlockRewardWithoutFee(?int $block_reward_without_fee): static
{
if (is_null($block_reward_without_fee)) {
throw new InvalidArgumentException('non-nullable block_reward_without_fee cannot be null');
}
$this->container['block_reward_without_fee'] = $block_reward_without_fee;
return $this;
}
/**
* Gets block_reward
*
* @return int|null
*/
public function getBlockReward(): ?int
{
return $this->container['block_reward'];
}
/**
* Sets block_reward
*
* @param int|null $block_reward block_reward
*
* @return $this
*/
public function setBlockReward(?int $block_reward): static
{
if (is_null($block_reward)) {
throw new InvalidArgumentException('non-nullable block_reward cannot be null');
}
$this->container['block_reward'] = $block_reward;
return $this;
}
/**
* Gets txs_fee
*
* @return int|null
*/
public function getTxsFee(): ?int
{
return $this->container['txs_fee'];
}
/**
* Sets txs_fee
*
* @param int|null $txs_fee txs_fee
*
* @return $this
*/
public function setTxsFee(?int $txs_fee): static
{
if (is_null($txs_fee)) {
throw new InvalidArgumentException('non-nullable txs_fee cannot be null');
}
$this->container['txs_fee'] = $txs_fee;
return $this;
}
/**
* Gets prev_hash
*
* @return string|null
*/
public function getPrevHash(): ?string
{
return $this->container['prev_hash'];
}
/**
* Sets prev_hash
*
* @param string|null $prev_hash prev_hash
*
* @return $this
*/
public function setPrevHash(?string $prev_hash): static
{
if (is_null($prev_hash)) {
throw new InvalidArgumentException('non-nullable prev_hash cannot be null');
}
$this->container['prev_hash'] = $prev_hash;
return $this;
}
/**
* Gets seed
*
* @return string|null
*/
public function getSeed(): ?string
{
return $this->container['seed'];
}
/**
* Sets seed
*
* @param string|null $seed seed
*
* @return $this
*/
public function setSeed(?string $seed): static
{
if (is_null($seed)) {
throw new InvalidArgumentException('non-nullable seed cannot be null');
}
$this->container['seed'] = $seed;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,611 @@
<?php
/**
* BlockTemplateRequestModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* BlockTemplateRequestModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class BlockTemplateRequestModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'BlockTemplateRequestModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'miner_address' => 'string',
'stakeholder_address' => 'string',
'ex_nonce' => 'string',
'pos_block' => 'bool',
'ignore_pow_ts_check' => 'bool',
'pe' => '\OpenAPI\Client\Model\PosEntryModel',
'explicit_txs' => 'string[]'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'miner_address' => null,
'stakeholder_address' => null,
'ex_nonce' => null,
'pos_block' => null,
'ignore_pow_ts_check' => null,
'pe' => null,
'explicit_txs' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'miner_address' => false,
'stakeholder_address' => false,
'ex_nonce' => false,
'pos_block' => false,
'ignore_pow_ts_check' => false,
'pe' => false,
'explicit_txs' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'miner_address' => 'miner_address',
'stakeholder_address' => 'stakeholder_address',
'ex_nonce' => 'ex_nonce',
'pos_block' => 'pos_block',
'ignore_pow_ts_check' => 'ignore_pow_ts_check',
'pe' => 'pe',
'explicit_txs' => 'explicit_txs'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'miner_address' => 'setMinerAddress',
'stakeholder_address' => 'setStakeholderAddress',
'ex_nonce' => 'setExNonce',
'pos_block' => 'setPosBlock',
'ignore_pow_ts_check' => 'setIgnorePowTsCheck',
'pe' => 'setPe',
'explicit_txs' => 'setExplicitTxs'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'miner_address' => 'getMinerAddress',
'stakeholder_address' => 'getStakeholderAddress',
'ex_nonce' => 'getExNonce',
'pos_block' => 'getPosBlock',
'ignore_pow_ts_check' => 'getIgnorePowTsCheck',
'pe' => 'getPe',
'explicit_txs' => 'getExplicitTxs'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('miner_address', $data ?? [], null);
$this->setIfExists('stakeholder_address', $data ?? [], null);
$this->setIfExists('ex_nonce', $data ?? [], null);
$this->setIfExists('pos_block', $data ?? [], null);
$this->setIfExists('ignore_pow_ts_check', $data ?? [], null);
$this->setIfExists('pe', $data ?? [], null);
$this->setIfExists('explicit_txs', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets miner_address
*
* @return string|null
*/
public function getMinerAddress(): ?string
{
return $this->container['miner_address'];
}
/**
* Sets miner_address
*
* @param string|null $miner_address miner_address
*
* @return $this
*/
public function setMinerAddress(?string $miner_address): static
{
if (is_null($miner_address)) {
throw new InvalidArgumentException('non-nullable miner_address cannot be null');
}
$this->container['miner_address'] = $miner_address;
return $this;
}
/**
* Gets stakeholder_address
*
* @return string|null
*/
public function getStakeholderAddress(): ?string
{
return $this->container['stakeholder_address'];
}
/**
* Sets stakeholder_address
*
* @param string|null $stakeholder_address stakeholder_address
*
* @return $this
*/
public function setStakeholderAddress(?string $stakeholder_address): static
{
if (is_null($stakeholder_address)) {
throw new InvalidArgumentException('non-nullable stakeholder_address cannot be null');
}
$this->container['stakeholder_address'] = $stakeholder_address;
return $this;
}
/**
* Gets ex_nonce
*
* @return string|null
*/
public function getExNonce(): ?string
{
return $this->container['ex_nonce'];
}
/**
* Sets ex_nonce
*
* @param string|null $ex_nonce ex_nonce
*
* @return $this
*/
public function setExNonce(?string $ex_nonce): static
{
if (is_null($ex_nonce)) {
throw new InvalidArgumentException('non-nullable ex_nonce cannot be null');
}
$this->container['ex_nonce'] = $ex_nonce;
return $this;
}
/**
* Gets pos_block
*
* @return bool|null
*/
public function getPosBlock(): ?bool
{
return $this->container['pos_block'];
}
/**
* Sets pos_block
*
* @param bool|null $pos_block pos_block
*
* @return $this
*/
public function setPosBlock(?bool $pos_block): static
{
if (is_null($pos_block)) {
throw new InvalidArgumentException('non-nullable pos_block cannot be null');
}
$this->container['pos_block'] = $pos_block;
return $this;
}
/**
* Gets ignore_pow_ts_check
*
* @return bool|null
*/
public function getIgnorePowTsCheck(): ?bool
{
return $this->container['ignore_pow_ts_check'];
}
/**
* Sets ignore_pow_ts_check
*
* @param bool|null $ignore_pow_ts_check ignore_pow_ts_check
*
* @return $this
*/
public function setIgnorePowTsCheck(?bool $ignore_pow_ts_check): static
{
if (is_null($ignore_pow_ts_check)) {
throw new InvalidArgumentException('non-nullable ignore_pow_ts_check cannot be null');
}
$this->container['ignore_pow_ts_check'] = $ignore_pow_ts_check;
return $this;
}
/**
* Gets pe
*
* @return \OpenAPI\Client\Model\PosEntryModel|null
*/
public function getPe(): ?\OpenAPI\Client\Model\PosEntryModel
{
return $this->container['pe'];
}
/**
* Sets pe
*
* @param \OpenAPI\Client\Model\PosEntryModel|null $pe pe
*
* @return $this
*/
public function setPe(?\OpenAPI\Client\Model\PosEntryModel $pe): static
{
if (is_null($pe)) {
throw new InvalidArgumentException('non-nullable pe cannot be null');
}
$this->container['pe'] = $pe;
return $this;
}
/**
* Gets explicit_txs
*
* @return string[]|null
*/
public function getExplicitTxs(): ?array
{
return $this->container['explicit_txs'];
}
/**
* Sets explicit_txs
*
* @param string[]|null $explicit_txs explicit_txs
*
* @return $this
*/
public function setExplicitTxs(?array $explicit_txs): static
{
if (is_null($explicit_txs)) {
throw new InvalidArgumentException('non-nullable explicit_txs cannot be null');
}
$this->container['explicit_txs'] = $explicit_txs;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,475 @@
<?php
/**
* DbStatInfoModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* DbStatInfoModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class DbStatInfoModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'DbStatInfoModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'tx_count' => 'int',
'write_tx_count' => 'int',
'map_size' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'tx_count' => null,
'write_tx_count' => null,
'map_size' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'tx_count' => false,
'write_tx_count' => false,
'map_size' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'tx_count' => 'tx_count',
'write_tx_count' => 'write_tx_count',
'map_size' => 'map_size'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'tx_count' => 'setTxCount',
'write_tx_count' => 'setWriteTxCount',
'map_size' => 'setMapSize'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'tx_count' => 'getTxCount',
'write_tx_count' => 'getWriteTxCount',
'map_size' => 'getMapSize'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('tx_count', $data ?? [], null);
$this->setIfExists('write_tx_count', $data ?? [], null);
$this->setIfExists('map_size', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets tx_count
*
* @return int|null
*/
public function getTxCount(): ?int
{
return $this->container['tx_count'];
}
/**
* Sets tx_count
*
* @param int|null $tx_count tx_count
*
* @return $this
*/
public function setTxCount(?int $tx_count): static
{
if (is_null($tx_count)) {
throw new InvalidArgumentException('non-nullable tx_count cannot be null');
}
$this->container['tx_count'] = $tx_count;
return $this;
}
/**
* Gets write_tx_count
*
* @return int|null
*/
public function getWriteTxCount(): ?int
{
return $this->container['write_tx_count'];
}
/**
* Sets write_tx_count
*
* @param int|null $write_tx_count write_tx_count
*
* @return $this
*/
public function setWriteTxCount(?int $write_tx_count): static
{
if (is_null($write_tx_count)) {
throw new InvalidArgumentException('non-nullable write_tx_count cannot be null');
}
$this->container['write_tx_count'] = $write_tx_count;
return $this;
}
/**
* Gets map_size
*
* @return int|null
*/
public function getMapSize(): ?int
{
return $this->container['map_size'];
}
/**
* Sets map_size
*
* @param int|null $map_size map_size
*
* @return $this
*/
public function setMapSize(?int $map_size): static
{
if (is_null($map_size)) {
throw new InvalidArgumentException('non-nullable map_size cannot be null');
}
$this->container['map_size'] = $map_size;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,407 @@
<?php
/**
* HeightModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* HeightModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class HeightModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'HeightModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'height' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'height' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'height' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'height' => 'height'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'height' => 'setHeight'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'height' => 'getHeight'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('height', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets height
*
* @return int|null
*/
public function getHeight(): ?int
{
return $this->container['height'];
}
/**
* Sets height
*
* @param int|null $height height
*
* @return $this
*/
public function setHeight(?int $height): static
{
if (is_null($height)) {
throw new InvalidArgumentException('non-nullable height cannot be null');
}
$this->container['height'] = $height;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,623 @@
<?php
/**
* MaintainersInfoModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* MaintainersInfoModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class MaintainersInfoModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'MaintainersInfoModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'ver_major' => 'int',
'ver_minor' => 'int',
'ver_revision' => 'int',
'build_no' => 'int',
'mode' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'ver_major' => null,
'ver_minor' => null,
'ver_revision' => null,
'build_no' => null,
'mode' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'ver_major' => false,
'ver_minor' => false,
'ver_revision' => false,
'build_no' => false,
'mode' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'ver_major' => 'ver_major',
'ver_minor' => 'ver_minor',
'ver_revision' => 'ver_revision',
'build_no' => 'build_no',
'mode' => 'mode'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'ver_major' => 'setVerMajor',
'ver_minor' => 'setVerMinor',
'ver_revision' => 'setVerRevision',
'build_no' => 'setBuildNo',
'mode' => 'setMode'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'ver_major' => 'getVerMajor',
'ver_minor' => 'getVerMinor',
'ver_revision' => 'getVerRevision',
'build_no' => 'getBuildNo',
'mode' => 'getMode'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('ver_major', $data ?? [], null);
$this->setIfExists('ver_minor', $data ?? [], null);
$this->setIfExists('ver_revision', $data ?? [], null);
$this->setIfExists('build_no', $data ?? [], null);
$this->setIfExists('mode', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
if (!is_null($this->container['ver_major']) && ($this->container['ver_major'] > 255)) {
$invalidProperties[] = "invalid value for 'ver_major', must be smaller than or equal to 255.";
}
if (!is_null($this->container['ver_major']) && ($this->container['ver_major'] < 0)) {
$invalidProperties[] = "invalid value for 'ver_major', must be bigger than or equal to 0.";
}
if (!is_null($this->container['ver_minor']) && ($this->container['ver_minor'] > 255)) {
$invalidProperties[] = "invalid value for 'ver_minor', must be smaller than or equal to 255.";
}
if (!is_null($this->container['ver_minor']) && ($this->container['ver_minor'] < 0)) {
$invalidProperties[] = "invalid value for 'ver_minor', must be bigger than or equal to 0.";
}
if (!is_null($this->container['ver_revision']) && ($this->container['ver_revision'] > 255)) {
$invalidProperties[] = "invalid value for 'ver_revision', must be smaller than or equal to 255.";
}
if (!is_null($this->container['ver_revision']) && ($this->container['ver_revision'] < 0)) {
$invalidProperties[] = "invalid value for 'ver_revision', must be bigger than or equal to 0.";
}
if (!is_null($this->container['build_no']) && ($this->container['build_no'] > 4294967295)) {
$invalidProperties[] = "invalid value for 'build_no', must be smaller than or equal to 4294967295.";
}
if (!is_null($this->container['build_no']) && ($this->container['build_no'] < 0)) {
$invalidProperties[] = "invalid value for 'build_no', must be bigger than or equal to 0.";
}
if (!is_null($this->container['mode']) && ($this->container['mode'] > 255)) {
$invalidProperties[] = "invalid value for 'mode', must be smaller than or equal to 255.";
}
if (!is_null($this->container['mode']) && ($this->container['mode'] < 0)) {
$invalidProperties[] = "invalid value for 'mode', must be bigger than or equal to 0.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets ver_major
*
* @return int|null
*/
public function getVerMajor(): ?int
{
return $this->container['ver_major'];
}
/**
* Sets ver_major
*
* @param int|null $ver_major ver_major
*
* @return $this
*/
public function setVerMajor(?int $ver_major): static
{
if (is_null($ver_major)) {
throw new InvalidArgumentException('non-nullable ver_major cannot be null');
}
if (($ver_major > 255)) {
throw new InvalidArgumentException('invalid value for $ver_major when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($ver_major < 0)) {
throw new InvalidArgumentException('invalid value for $ver_major when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['ver_major'] = $ver_major;
return $this;
}
/**
* Gets ver_minor
*
* @return int|null
*/
public function getVerMinor(): ?int
{
return $this->container['ver_minor'];
}
/**
* Sets ver_minor
*
* @param int|null $ver_minor ver_minor
*
* @return $this
*/
public function setVerMinor(?int $ver_minor): static
{
if (is_null($ver_minor)) {
throw new InvalidArgumentException('non-nullable ver_minor cannot be null');
}
if (($ver_minor > 255)) {
throw new InvalidArgumentException('invalid value for $ver_minor when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($ver_minor < 0)) {
throw new InvalidArgumentException('invalid value for $ver_minor when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['ver_minor'] = $ver_minor;
return $this;
}
/**
* Gets ver_revision
*
* @return int|null
*/
public function getVerRevision(): ?int
{
return $this->container['ver_revision'];
}
/**
* Sets ver_revision
*
* @param int|null $ver_revision ver_revision
*
* @return $this
*/
public function setVerRevision(?int $ver_revision): static
{
if (is_null($ver_revision)) {
throw new InvalidArgumentException('non-nullable ver_revision cannot be null');
}
if (($ver_revision > 255)) {
throw new InvalidArgumentException('invalid value for $ver_revision when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($ver_revision < 0)) {
throw new InvalidArgumentException('invalid value for $ver_revision when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['ver_revision'] = $ver_revision;
return $this;
}
/**
* Gets build_no
*
* @return int|null
*/
public function getBuildNo(): ?int
{
return $this->container['build_no'];
}
/**
* Sets build_no
*
* @param int|null $build_no build_no
*
* @return $this
*/
public function setBuildNo(?int $build_no): static
{
if (is_null($build_no)) {
throw new InvalidArgumentException('non-nullable build_no cannot be null');
}
if (($build_no > 4294967295)) {
throw new InvalidArgumentException('invalid value for $build_no when calling MaintainersInfoModel., must be smaller than or equal to 4294967295.');
}
if (($build_no < 0)) {
throw new InvalidArgumentException('invalid value for $build_no when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['build_no'] = $build_no;
return $this;
}
/**
* Gets mode
*
* @return int|null
*/
public function getMode(): ?int
{
return $this->container['mode'];
}
/**
* Sets mode
*
* @param int|null $mode mode
*
* @return $this
*/
public function setMode(?int $mode): static
{
if (is_null($mode)) {
throw new InvalidArgumentException('non-nullable mode cannot be null');
}
if (($mode > 255)) {
throw new InvalidArgumentException('invalid value for $mode when calling MaintainersInfoModel., must be smaller than or equal to 255.');
}
if (($mode < 0)) {
throw new InvalidArgumentException('invalid value for $mode when calling MaintainersInfoModel., must be bigger than or equal to 0.');
}
$this->container['mode'] = $mode;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,110 @@
<?php
/**
* ModelInterface
*
* PHP version 8.1
*
* @package OpenAPI\Client\Model
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
/**
* Interface abstracting model access.
*
* @package OpenAPI\Client\Model
* @author OpenAPI Generator team
*/
interface ModelInterface
{
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string;
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPITypes(): array;
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPIFormats(): array;
/**
* Array of attributes where the key is the local name, and the value is the original name
*
* @return array
*/
public static function attributeMap(): array;
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters(): array;
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters(): array;
/**
* Show all the invalid properties with reasons.
*
* @return array
*/
public function listInvalidProperties(): array;
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool
*/
public function valid(): bool;
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool;
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool;
}

View file

@ -0,0 +1,509 @@
<?php
/**
* PerformanceModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* PerformanceModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class PerformanceModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'PerformanceModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'block_processing' => '\OpenAPI\Client\Model\BlockProcessingPerformanceModel',
'tx_processing' => '\OpenAPI\Client\Model\TxProcessingPerformanceModel',
'tx_pool' => '\OpenAPI\Client\Model\TxPoolPerformanceModel',
'db_stat_info' => '\OpenAPI\Client\Model\DbStatInfoModel'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'block_processing' => null,
'tx_processing' => null,
'tx_pool' => null,
'db_stat_info' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'block_processing' => false,
'tx_processing' => false,
'tx_pool' => false,
'db_stat_info' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'block_processing' => 'block_processing',
'tx_processing' => 'tx_processing',
'tx_pool' => 'tx_pool',
'db_stat_info' => 'db_stat_info'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'block_processing' => 'setBlockProcessing',
'tx_processing' => 'setTxProcessing',
'tx_pool' => 'setTxPool',
'db_stat_info' => 'setDbStatInfo'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'block_processing' => 'getBlockProcessing',
'tx_processing' => 'getTxProcessing',
'tx_pool' => 'getTxPool',
'db_stat_info' => 'getDbStatInfo'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('block_processing', $data ?? [], null);
$this->setIfExists('tx_processing', $data ?? [], null);
$this->setIfExists('tx_pool', $data ?? [], null);
$this->setIfExists('db_stat_info', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets block_processing
*
* @return \OpenAPI\Client\Model\BlockProcessingPerformanceModel|null
*/
public function getBlockProcessing(): ?\OpenAPI\Client\Model\BlockProcessingPerformanceModel
{
return $this->container['block_processing'];
}
/**
* Sets block_processing
*
* @param \OpenAPI\Client\Model\BlockProcessingPerformanceModel|null $block_processing block_processing
*
* @return $this
*/
public function setBlockProcessing(?\OpenAPI\Client\Model\BlockProcessingPerformanceModel $block_processing): static
{
if (is_null($block_processing)) {
throw new InvalidArgumentException('non-nullable block_processing cannot be null');
}
$this->container['block_processing'] = $block_processing;
return $this;
}
/**
* Gets tx_processing
*
* @return \OpenAPI\Client\Model\TxProcessingPerformanceModel|null
*/
public function getTxProcessing(): ?\OpenAPI\Client\Model\TxProcessingPerformanceModel
{
return $this->container['tx_processing'];
}
/**
* Sets tx_processing
*
* @param \OpenAPI\Client\Model\TxProcessingPerformanceModel|null $tx_processing tx_processing
*
* @return $this
*/
public function setTxProcessing(?\OpenAPI\Client\Model\TxProcessingPerformanceModel $tx_processing): static
{
if (is_null($tx_processing)) {
throw new InvalidArgumentException('non-nullable tx_processing cannot be null');
}
$this->container['tx_processing'] = $tx_processing;
return $this;
}
/**
* Gets tx_pool
*
* @return \OpenAPI\Client\Model\TxPoolPerformanceModel|null
*/
public function getTxPool(): ?\OpenAPI\Client\Model\TxPoolPerformanceModel
{
return $this->container['tx_pool'];
}
/**
* Sets tx_pool
*
* @param \OpenAPI\Client\Model\TxPoolPerformanceModel|null $tx_pool tx_pool
*
* @return $this
*/
public function setTxPool(?\OpenAPI\Client\Model\TxPoolPerformanceModel $tx_pool): static
{
if (is_null($tx_pool)) {
throw new InvalidArgumentException('non-nullable tx_pool cannot be null');
}
$this->container['tx_pool'] = $tx_pool;
return $this;
}
/**
* Gets db_stat_info
*
* @return \OpenAPI\Client\Model\DbStatInfoModel|null
*/
public function getDbStatInfo(): ?\OpenAPI\Client\Model\DbStatInfoModel
{
return $this->container['db_stat_info'];
}
/**
* Sets db_stat_info
*
* @param \OpenAPI\Client\Model\DbStatInfoModel|null $db_stat_info db_stat_info
*
* @return $this
*/
public function setDbStatInfo(?\OpenAPI\Client\Model\DbStatInfoModel $db_stat_info): static
{
if (is_null($db_stat_info)) {
throw new InvalidArgumentException('non-nullable db_stat_info cannot be null');
}
$this->container['db_stat_info'] = $db_stat_info;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,645 @@
<?php
/**
* PosEntryModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* PosEntryModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class PosEntryModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'PosEntryModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'g_index' => 'int',
'keyimage' => 'string',
'block_timestamp' => 'int',
'stake_unlock_time' => 'int',
'tx_id' => 'string',
'tx_out_index' => 'int',
'wallet_index' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'g_index' => null,
'keyimage' => null,
'block_timestamp' => null,
'stake_unlock_time' => null,
'tx_id' => null,
'tx_out_index' => null,
'wallet_index' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'g_index' => false,
'keyimage' => false,
'block_timestamp' => false,
'stake_unlock_time' => false,
'tx_id' => false,
'tx_out_index' => false,
'wallet_index' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'g_index' => 'g_index',
'keyimage' => 'keyimage',
'block_timestamp' => 'block_timestamp',
'stake_unlock_time' => 'stake_unlock_time',
'tx_id' => 'tx_id',
'tx_out_index' => 'tx_out_index',
'wallet_index' => 'wallet_index'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'g_index' => 'setGIndex',
'keyimage' => 'setKeyimage',
'block_timestamp' => 'setBlockTimestamp',
'stake_unlock_time' => 'setStakeUnlockTime',
'tx_id' => 'setTxId',
'tx_out_index' => 'setTxOutIndex',
'wallet_index' => 'setWalletIndex'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'g_index' => 'getGIndex',
'keyimage' => 'getKeyimage',
'block_timestamp' => 'getBlockTimestamp',
'stake_unlock_time' => 'getStakeUnlockTime',
'tx_id' => 'getTxId',
'tx_out_index' => 'getTxOutIndex',
'wallet_index' => 'getWalletIndex'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('g_index', $data ?? [], null);
$this->setIfExists('keyimage', $data ?? [], null);
$this->setIfExists('block_timestamp', $data ?? [], null);
$this->setIfExists('stake_unlock_time', $data ?? [], null);
$this->setIfExists('tx_id', $data ?? [], null);
$this->setIfExists('tx_out_index', $data ?? [], null);
$this->setIfExists('wallet_index', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets g_index
*
* @return int|null
*/
public function getGIndex(): ?int
{
return $this->container['g_index'];
}
/**
* Sets g_index
*
* @param int|null $g_index g_index
*
* @return $this
*/
public function setGIndex(?int $g_index): static
{
if (is_null($g_index)) {
throw new InvalidArgumentException('non-nullable g_index cannot be null');
}
$this->container['g_index'] = $g_index;
return $this;
}
/**
* Gets keyimage
*
* @return string|null
*/
public function getKeyimage(): ?string
{
return $this->container['keyimage'];
}
/**
* Sets keyimage
*
* @param string|null $keyimage keyimage
*
* @return $this
*/
public function setKeyimage(?string $keyimage): static
{
if (is_null($keyimage)) {
throw new InvalidArgumentException('non-nullable keyimage cannot be null');
}
$this->container['keyimage'] = $keyimage;
return $this;
}
/**
* Gets block_timestamp
*
* @return int|null
*/
public function getBlockTimestamp(): ?int
{
return $this->container['block_timestamp'];
}
/**
* Sets block_timestamp
*
* @param int|null $block_timestamp block_timestamp
*
* @return $this
*/
public function setBlockTimestamp(?int $block_timestamp): static
{
if (is_null($block_timestamp)) {
throw new InvalidArgumentException('non-nullable block_timestamp cannot be null');
}
$this->container['block_timestamp'] = $block_timestamp;
return $this;
}
/**
* Gets stake_unlock_time
*
* @return int|null
*/
public function getStakeUnlockTime(): ?int
{
return $this->container['stake_unlock_time'];
}
/**
* Sets stake_unlock_time
*
* @param int|null $stake_unlock_time stake_unlock_time
*
* @return $this
*/
public function setStakeUnlockTime(?int $stake_unlock_time): static
{
if (is_null($stake_unlock_time)) {
throw new InvalidArgumentException('non-nullable stake_unlock_time cannot be null');
}
$this->container['stake_unlock_time'] = $stake_unlock_time;
return $this;
}
/**
* Gets tx_id
*
* @return string|null
*/
public function getTxId(): ?string
{
return $this->container['tx_id'];
}
/**
* Sets tx_id
*
* @param string|null $tx_id tx_id
*
* @return $this
*/
public function setTxId(?string $tx_id): static
{
if (is_null($tx_id)) {
throw new InvalidArgumentException('non-nullable tx_id cannot be null');
}
$this->container['tx_id'] = $tx_id;
return $this;
}
/**
* Gets tx_out_index
*
* @return int|null
*/
public function getTxOutIndex(): ?int
{
return $this->container['tx_out_index'];
}
/**
* Sets tx_out_index
*
* @param int|null $tx_out_index tx_out_index
*
* @return $this
*/
public function setTxOutIndex(?int $tx_out_index): static
{
if (is_null($tx_out_index)) {
throw new InvalidArgumentException('non-nullable tx_out_index cannot be null');
}
$this->container['tx_out_index'] = $tx_out_index;
return $this;
}
/**
* Gets wallet_index
*
* @return int|null
*/
public function getWalletIndex(): ?int
{
return $this->container['wallet_index'];
}
/**
* Sets wallet_index
*
* @param int|null $wallet_index wallet_index
*
* @return $this
*/
public function setWalletIndex(?int $wallet_index): static
{
if (is_null($wallet_index)) {
throw new InvalidArgumentException('non-nullable wallet_index cannot be null');
}
$this->container['wallet_index'] = $wallet_index;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,407 @@
<?php
/**
* SubmitBlockRequestModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* SubmitBlockRequestModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class SubmitBlockRequestModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'SubmitBlockRequestModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'block_blob' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'block_blob' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'block_blob' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'block_blob' => 'block_blob'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'block_blob' => 'setBlockBlob'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'block_blob' => 'getBlockBlob'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('block_blob', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets block_blob
*
* @return string|null
*/
public function getBlockBlob(): ?string
{
return $this->container['block_blob'];
}
/**
* Sets block_blob
*
* @param string|null $block_blob block_blob
*
* @return $this
*/
public function setBlockBlob(?string $block_blob): static
{
if (is_null($block_blob)) {
throw new InvalidArgumentException('non-nullable block_blob cannot be null');
}
$this->container['block_blob'] = $block_blob;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,407 @@
<?php
/**
* SubmitBlockResponseModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* SubmitBlockResponseModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class SubmitBlockResponseModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'SubmitBlockResponseModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'status' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'status' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'status' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'status' => 'status'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'status' => 'setStatus'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'status' => 'getStatus'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('status', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets status
*
* @return string|null
*/
public function getStatus(): ?string
{
return $this->container['status'];
}
/**
* Sets status
*
* @param string|null $status status
*
* @return $this
*/
public function setStatus(?string $status): static
{
if (is_null($status)) {
throw new InvalidArgumentException('non-nullable status cannot be null');
}
$this->container['status'] = $status;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,475 @@
<?php
/**
* TransactionAttachmentModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TransactionAttachmentModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionAttachmentModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionAttachmentModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'type' => 'string',
'short_view' => 'string',
'details_view' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'type' => null,
'short_view' => null,
'details_view' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'type' => false,
'short_view' => false,
'details_view' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'type' => 'type',
'short_view' => 'short_view',
'details_view' => 'details_view'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'type' => 'setType',
'short_view' => 'setShortView',
'details_view' => 'setDetailsView'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'type' => 'getType',
'short_view' => 'getShortView',
'details_view' => 'getDetailsView'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('type', $data ?? [], null);
$this->setIfExists('short_view', $data ?? [], null);
$this->setIfExists('details_view', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets type
*
* @return string|null
*/
public function getType(): ?string
{
return $this->container['type'];
}
/**
* Sets type
*
* @param string|null $type type
*
* @return $this
*/
public function setType(?string $type): static
{
if (is_null($type)) {
throw new InvalidArgumentException('non-nullable type cannot be null');
}
$this->container['type'] = $type;
return $this;
}
/**
* Gets short_view
*
* @return string|null
*/
public function getShortView(): ?string
{
return $this->container['short_view'];
}
/**
* Sets short_view
*
* @param string|null $short_view short_view
*
* @return $this
*/
public function setShortView(?string $short_view): static
{
if (is_null($short_view)) {
throw new InvalidArgumentException('non-nullable short_view cannot be null');
}
$this->container['short_view'] = $short_view;
return $this;
}
/**
* Gets details_view
*
* @return string|null
*/
public function getDetailsView(): ?string
{
return $this->container['details_view'];
}
/**
* Sets details_view
*
* @param string|null $details_view details_view
*
* @return $this
*/
public function setDetailsView(?string $details_view): static
{
if (is_null($details_view)) {
throw new InvalidArgumentException('non-nullable details_view cannot be null');
}
$this->container['details_view'] = $details_view;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,815 @@
<?php
/**
* TransactionDetailsModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TransactionDetailsModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionDetailsModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionDetailsModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'attachments' => '\OpenAPI\Client\Model\TransactionAttachmentModel[]',
'blob' => 'string',
'blob_size' => 'int',
'extra' => '\OpenAPI\Client\Model\TransactionExtraModel[]',
'fee' => 'int',
'id' => 'string',
'ins' => '\OpenAPI\Client\Model\TransactionInputModel[]',
'keeper_block' => 'int',
'object_in_json' => 'string',
'outs' => '\OpenAPI\Client\Model\TransactionOutputModel[]',
'pub_key' => 'string',
'timestamp' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'attachments' => null,
'blob' => null,
'blob_size' => null,
'extra' => null,
'fee' => null,
'id' => null,
'ins' => null,
'keeper_block' => 'int64',
'object_in_json' => null,
'outs' => null,
'pub_key' => null,
'timestamp' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'attachments' => false,
'blob' => false,
'blob_size' => false,
'extra' => false,
'fee' => false,
'id' => false,
'ins' => false,
'keeper_block' => false,
'object_in_json' => false,
'outs' => false,
'pub_key' => false,
'timestamp' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'attachments' => 'attachments',
'blob' => 'blob',
'blob_size' => 'blob_size',
'extra' => 'extra',
'fee' => 'fee',
'id' => 'id',
'ins' => 'ins',
'keeper_block' => 'keeper_block',
'object_in_json' => 'object_in_json',
'outs' => 'outs',
'pub_key' => 'pub_key',
'timestamp' => 'timestamp'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'attachments' => 'setAttachments',
'blob' => 'setBlob',
'blob_size' => 'setBlobSize',
'extra' => 'setExtra',
'fee' => 'setFee',
'id' => 'setId',
'ins' => 'setIns',
'keeper_block' => 'setKeeperBlock',
'object_in_json' => 'setObjectInJson',
'outs' => 'setOuts',
'pub_key' => 'setPubKey',
'timestamp' => 'setTimestamp'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'attachments' => 'getAttachments',
'blob' => 'getBlob',
'blob_size' => 'getBlobSize',
'extra' => 'getExtra',
'fee' => 'getFee',
'id' => 'getId',
'ins' => 'getIns',
'keeper_block' => 'getKeeperBlock',
'object_in_json' => 'getObjectInJson',
'outs' => 'getOuts',
'pub_key' => 'getPubKey',
'timestamp' => 'getTimestamp'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('attachments', $data ?? [], null);
$this->setIfExists('blob', $data ?? [], null);
$this->setIfExists('blob_size', $data ?? [], null);
$this->setIfExists('extra', $data ?? [], null);
$this->setIfExists('fee', $data ?? [], null);
$this->setIfExists('id', $data ?? [], null);
$this->setIfExists('ins', $data ?? [], null);
$this->setIfExists('keeper_block', $data ?? [], null);
$this->setIfExists('object_in_json', $data ?? [], null);
$this->setIfExists('outs', $data ?? [], null);
$this->setIfExists('pub_key', $data ?? [], null);
$this->setIfExists('timestamp', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets attachments
*
* @return \OpenAPI\Client\Model\TransactionAttachmentModel[]|null
*/
public function getAttachments(): ?array
{
return $this->container['attachments'];
}
/**
* Sets attachments
*
* @param \OpenAPI\Client\Model\TransactionAttachmentModel[]|null $attachments attachments
*
* @return $this
*/
public function setAttachments(?array $attachments): static
{
if (is_null($attachments)) {
throw new InvalidArgumentException('non-nullable attachments cannot be null');
}
$this->container['attachments'] = $attachments;
return $this;
}
/**
* Gets blob
*
* @return string|null
*/
public function getBlob(): ?string
{
return $this->container['blob'];
}
/**
* Sets blob
*
* @param string|null $blob blob
*
* @return $this
*/
public function setBlob(?string $blob): static
{
if (is_null($blob)) {
throw new InvalidArgumentException('non-nullable blob cannot be null');
}
$this->container['blob'] = $blob;
return $this;
}
/**
* Gets blob_size
*
* @return int|null
*/
public function getBlobSize(): ?int
{
return $this->container['blob_size'];
}
/**
* Sets blob_size
*
* @param int|null $blob_size blob_size
*
* @return $this
*/
public function setBlobSize(?int $blob_size): static
{
if (is_null($blob_size)) {
throw new InvalidArgumentException('non-nullable blob_size cannot be null');
}
$this->container['blob_size'] = $blob_size;
return $this;
}
/**
* Gets extra
*
* @return \OpenAPI\Client\Model\TransactionExtraModel[]|null
*/
public function getExtra(): ?array
{
return $this->container['extra'];
}
/**
* Sets extra
*
* @param \OpenAPI\Client\Model\TransactionExtraModel[]|null $extra extra
*
* @return $this
*/
public function setExtra(?array $extra): static
{
if (is_null($extra)) {
throw new InvalidArgumentException('non-nullable extra cannot be null');
}
$this->container['extra'] = $extra;
return $this;
}
/**
* Gets fee
*
* @return int|null
*/
public function getFee(): ?int
{
return $this->container['fee'];
}
/**
* Sets fee
*
* @param int|null $fee fee
*
* @return $this
*/
public function setFee(?int $fee): static
{
if (is_null($fee)) {
throw new InvalidArgumentException('non-nullable fee cannot be null');
}
$this->container['fee'] = $fee;
return $this;
}
/**
* Gets id
*
* @return string|null
*/
public function getId(): ?string
{
return $this->container['id'];
}
/**
* Sets id
*
* @param string|null $id id
*
* @return $this
*/
public function setId(?string $id): static
{
if (is_null($id)) {
throw new InvalidArgumentException('non-nullable id cannot be null');
}
$this->container['id'] = $id;
return $this;
}
/**
* Gets ins
*
* @return \OpenAPI\Client\Model\TransactionInputModel[]|null
*/
public function getIns(): ?array
{
return $this->container['ins'];
}
/**
* Sets ins
*
* @param \OpenAPI\Client\Model\TransactionInputModel[]|null $ins ins
*
* @return $this
*/
public function setIns(?array $ins): static
{
if (is_null($ins)) {
throw new InvalidArgumentException('non-nullable ins cannot be null');
}
$this->container['ins'] = $ins;
return $this;
}
/**
* Gets keeper_block
*
* @return int|null
*/
public function getKeeperBlock(): ?int
{
return $this->container['keeper_block'];
}
/**
* Sets keeper_block
*
* @param int|null $keeper_block keeper_block
*
* @return $this
*/
public function setKeeperBlock(?int $keeper_block): static
{
if (is_null($keeper_block)) {
throw new InvalidArgumentException('non-nullable keeper_block cannot be null');
}
$this->container['keeper_block'] = $keeper_block;
return $this;
}
/**
* Gets object_in_json
*
* @return string|null
*/
public function getObjectInJson(): ?string
{
return $this->container['object_in_json'];
}
/**
* Sets object_in_json
*
* @param string|null $object_in_json object_in_json
*
* @return $this
*/
public function setObjectInJson(?string $object_in_json): static
{
if (is_null($object_in_json)) {
throw new InvalidArgumentException('non-nullable object_in_json cannot be null');
}
$this->container['object_in_json'] = $object_in_json;
return $this;
}
/**
* Gets outs
*
* @return \OpenAPI\Client\Model\TransactionOutputModel[]|null
*/
public function getOuts(): ?array
{
return $this->container['outs'];
}
/**
* Sets outs
*
* @param \OpenAPI\Client\Model\TransactionOutputModel[]|null $outs outs
*
* @return $this
*/
public function setOuts(?array $outs): static
{
if (is_null($outs)) {
throw new InvalidArgumentException('non-nullable outs cannot be null');
}
$this->container['outs'] = $outs;
return $this;
}
/**
* Gets pub_key
*
* @return string|null
*/
public function getPubKey(): ?string
{
return $this->container['pub_key'];
}
/**
* Sets pub_key
*
* @param string|null $pub_key pub_key
*
* @return $this
*/
public function setPubKey(?string $pub_key): static
{
if (is_null($pub_key)) {
throw new InvalidArgumentException('non-nullable pub_key cannot be null');
}
$this->container['pub_key'] = $pub_key;
return $this;
}
/**
* Gets timestamp
*
* @return int|null
*/
public function getTimestamp(): ?int
{
return $this->container['timestamp'];
}
/**
* Sets timestamp
*
* @param int|null $timestamp timestamp
*
* @return $this
*/
public function setTimestamp(?int $timestamp): static
{
if (is_null($timestamp)) {
throw new InvalidArgumentException('non-nullable timestamp cannot be null');
}
$this->container['timestamp'] = $timestamp;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,475 @@
<?php
/**
* TransactionExtraModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TransactionExtraModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionExtraModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionExtraModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'type' => 'string',
'short_view' => 'string',
'details_view' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'type' => null,
'short_view' => null,
'details_view' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'type' => false,
'short_view' => false,
'details_view' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'type' => 'type',
'short_view' => 'short_view',
'details_view' => 'details_view'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'type' => 'setType',
'short_view' => 'setShortView',
'details_view' => 'setDetailsView'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'type' => 'getType',
'short_view' => 'getShortView',
'details_view' => 'getDetailsView'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('type', $data ?? [], null);
$this->setIfExists('short_view', $data ?? [], null);
$this->setIfExists('details_view', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets type
*
* @return string|null
*/
public function getType(): ?string
{
return $this->container['type'];
}
/**
* Sets type
*
* @param string|null $type type
*
* @return $this
*/
public function setType(?string $type): static
{
if (is_null($type)) {
throw new InvalidArgumentException('non-nullable type cannot be null');
}
$this->container['type'] = $type;
return $this;
}
/**
* Gets short_view
*
* @return string|null
*/
public function getShortView(): ?string
{
return $this->container['short_view'];
}
/**
* Sets short_view
*
* @param string|null $short_view short_view
*
* @return $this
*/
public function setShortView(?string $short_view): static
{
if (is_null($short_view)) {
throw new InvalidArgumentException('non-nullable short_view cannot be null');
}
$this->container['short_view'] = $short_view;
return $this;
}
/**
* Gets details_view
*
* @return string|null
*/
public function getDetailsView(): ?string
{
return $this->container['details_view'];
}
/**
* Sets details_view
*
* @param string|null $details_view details_view
*
* @return $this
*/
public function setDetailsView(?string $details_view): static
{
if (is_null($details_view)) {
throw new InvalidArgumentException('non-nullable details_view cannot be null');
}
$this->container['details_view'] = $details_view;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,559 @@
<?php
/**
* TransactionInputModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TransactionInputModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionInputModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionInputModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'global_indexes' => 'int[]',
'htlc_origin' => 'string',
'kimage_or_ms_id' => 'string',
'multisig_count' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'global_indexes' => null,
'htlc_origin' => null,
'kimage_or_ms_id' => null,
'multisig_count' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'global_indexes' => false,
'htlc_origin' => false,
'kimage_or_ms_id' => false,
'multisig_count' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'global_indexes' => 'global_indexes',
'htlc_origin' => 'htlc_origin',
'kimage_or_ms_id' => 'kimage_or_ms_id',
'multisig_count' => 'multisig_count'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'global_indexes' => 'setGlobalIndexes',
'htlc_origin' => 'setHtlcOrigin',
'kimage_or_ms_id' => 'setKimageOrMsId',
'multisig_count' => 'setMultisigCount'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'global_indexes' => 'getGlobalIndexes',
'htlc_origin' => 'getHtlcOrigin',
'kimage_or_ms_id' => 'getKimageOrMsId',
'multisig_count' => 'getMultisigCount'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('global_indexes', $data ?? [], null);
$this->setIfExists('htlc_origin', $data ?? [], null);
$this->setIfExists('kimage_or_ms_id', $data ?? [], null);
$this->setIfExists('multisig_count', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
if (!is_null($this->container['multisig_count']) && ($this->container['multisig_count'] > 4294967295)) {
$invalidProperties[] = "invalid value for 'multisig_count', must be smaller than or equal to 4294967295.";
}
if (!is_null($this->container['multisig_count']) && ($this->container['multisig_count'] < 0)) {
$invalidProperties[] = "invalid value for 'multisig_count', must be bigger than or equal to 0.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets global_indexes
*
* @return int[]|null
*/
public function getGlobalIndexes(): ?array
{
return $this->container['global_indexes'];
}
/**
* Sets global_indexes
*
* @param int[]|null $global_indexes global_indexes
*
* @return $this
*/
public function setGlobalIndexes(?array $global_indexes): static
{
if (is_null($global_indexes)) {
throw new InvalidArgumentException('non-nullable global_indexes cannot be null');
}
$this->container['global_indexes'] = $global_indexes;
return $this;
}
/**
* Gets htlc_origin
*
* @return string|null
*/
public function getHtlcOrigin(): ?string
{
return $this->container['htlc_origin'];
}
/**
* Sets htlc_origin
*
* @param string|null $htlc_origin htlc_origin
*
* @return $this
*/
public function setHtlcOrigin(?string $htlc_origin): static
{
if (is_null($htlc_origin)) {
throw new InvalidArgumentException('non-nullable htlc_origin cannot be null');
}
$this->container['htlc_origin'] = $htlc_origin;
return $this;
}
/**
* Gets kimage_or_ms_id
*
* @return string|null
*/
public function getKimageOrMsId(): ?string
{
return $this->container['kimage_or_ms_id'];
}
/**
* Sets kimage_or_ms_id
*
* @param string|null $kimage_or_ms_id kimage_or_ms_id
*
* @return $this
*/
public function setKimageOrMsId(?string $kimage_or_ms_id): static
{
if (is_null($kimage_or_ms_id)) {
throw new InvalidArgumentException('non-nullable kimage_or_ms_id cannot be null');
}
$this->container['kimage_or_ms_id'] = $kimage_or_ms_id;
return $this;
}
/**
* Gets multisig_count
*
* @return int|null
*/
public function getMultisigCount(): ?int
{
return $this->container['multisig_count'];
}
/**
* Sets multisig_count
*
* @param int|null $multisig_count multisig_count
*
* @return $this
*/
public function setMultisigCount(?int $multisig_count): static
{
if (is_null($multisig_count)) {
throw new InvalidArgumentException('non-nullable multisig_count cannot be null');
}
if (($multisig_count > 4294967295)) {
throw new InvalidArgumentException('invalid value for $multisig_count when calling TransactionInputModel., must be smaller than or equal to 4294967295.');
}
if (($multisig_count < 0)) {
throw new InvalidArgumentException('invalid value for $multisig_count when calling TransactionInputModel., must be bigger than or equal to 0.');
}
$this->container['multisig_count'] = $multisig_count;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,559 @@
<?php
/**
* TransactionOutputModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TransactionOutputModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionOutputModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionOutputModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'global_index' => 'int',
'is_spent' => 'bool',
'minimum_sigs' => 'int',
'pub_keys' => 'string[]'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'global_index' => null,
'is_spent' => null,
'minimum_sigs' => null,
'pub_keys' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'global_index' => false,
'is_spent' => false,
'minimum_sigs' => false,
'pub_keys' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'global_index' => 'global_index',
'is_spent' => 'is_spent',
'minimum_sigs' => 'minimum_sigs',
'pub_keys' => 'pub_keys'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'global_index' => 'setGlobalIndex',
'is_spent' => 'setIsSpent',
'minimum_sigs' => 'setMinimumSigs',
'pub_keys' => 'setPubKeys'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'global_index' => 'getGlobalIndex',
'is_spent' => 'getIsSpent',
'minimum_sigs' => 'getMinimumSigs',
'pub_keys' => 'getPubKeys'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('global_index', $data ?? [], null);
$this->setIfExists('is_spent', $data ?? [], null);
$this->setIfExists('minimum_sigs', $data ?? [], null);
$this->setIfExists('pub_keys', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
if (!is_null($this->container['minimum_sigs']) && ($this->container['minimum_sigs'] > 4294967295)) {
$invalidProperties[] = "invalid value for 'minimum_sigs', must be smaller than or equal to 4294967295.";
}
if (!is_null($this->container['minimum_sigs']) && ($this->container['minimum_sigs'] < 0)) {
$invalidProperties[] = "invalid value for 'minimum_sigs', must be bigger than or equal to 0.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets global_index
*
* @return int|null
*/
public function getGlobalIndex(): ?int
{
return $this->container['global_index'];
}
/**
* Sets global_index
*
* @param int|null $global_index global_index
*
* @return $this
*/
public function setGlobalIndex(?int $global_index): static
{
if (is_null($global_index)) {
throw new InvalidArgumentException('non-nullable global_index cannot be null');
}
$this->container['global_index'] = $global_index;
return $this;
}
/**
* Gets is_spent
*
* @return bool|null
*/
public function getIsSpent(): ?bool
{
return $this->container['is_spent'];
}
/**
* Sets is_spent
*
* @param bool|null $is_spent is_spent
*
* @return $this
*/
public function setIsSpent(?bool $is_spent): static
{
if (is_null($is_spent)) {
throw new InvalidArgumentException('non-nullable is_spent cannot be null');
}
$this->container['is_spent'] = $is_spent;
return $this;
}
/**
* Gets minimum_sigs
*
* @return int|null
*/
public function getMinimumSigs(): ?int
{
return $this->container['minimum_sigs'];
}
/**
* Sets minimum_sigs
*
* @param int|null $minimum_sigs minimum_sigs
*
* @return $this
*/
public function setMinimumSigs(?int $minimum_sigs): static
{
if (is_null($minimum_sigs)) {
throw new InvalidArgumentException('non-nullable minimum_sigs cannot be null');
}
if (($minimum_sigs > 4294967295)) {
throw new InvalidArgumentException('invalid value for $minimum_sigs when calling TransactionOutputModel., must be smaller than or equal to 4294967295.');
}
if (($minimum_sigs < 0)) {
throw new InvalidArgumentException('invalid value for $minimum_sigs when calling TransactionOutputModel., must be bigger than or equal to 0.');
}
$this->container['minimum_sigs'] = $minimum_sigs;
return $this;
}
/**
* Gets pub_keys
*
* @return string[]|null
*/
public function getPubKeys(): ?array
{
return $this->container['pub_keys'];
}
/**
* Sets pub_keys
*
* @param string[]|null $pub_keys pub_keys
*
* @return $this
*/
public function setPubKeys(?array $pub_keys): static
{
if (is_null($pub_keys)) {
throw new InvalidArgumentException('non-nullable pub_keys cannot be null');
}
$this->container['pub_keys'] = $pub_keys;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,747 @@
<?php
/**
* TxPoolPerformanceModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TxPoolPerformanceModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TxPoolPerformanceModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TxPoolPerformanceModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'tx_processing_time' => 'int',
'check_inputs_types_supported_time' => 'int',
'expiration_validate_time' => 'int',
'validate_amount_time' => 'int',
'validate_alias_time' => 'int',
'check_keyimages_ws_ms_time' => 'int',
'check_inputs_time' => 'int',
'begin_tx_time' => 'int',
'update_db_time' => 'int',
'db_commit_time' => 'int',
'check_post_hf4_balance' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'tx_processing_time' => null,
'check_inputs_types_supported_time' => null,
'expiration_validate_time' => null,
'validate_amount_time' => null,
'validate_alias_time' => null,
'check_keyimages_ws_ms_time' => null,
'check_inputs_time' => null,
'begin_tx_time' => null,
'update_db_time' => null,
'db_commit_time' => null,
'check_post_hf4_balance' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'tx_processing_time' => false,
'check_inputs_types_supported_time' => false,
'expiration_validate_time' => false,
'validate_amount_time' => false,
'validate_alias_time' => false,
'check_keyimages_ws_ms_time' => false,
'check_inputs_time' => false,
'begin_tx_time' => false,
'update_db_time' => false,
'db_commit_time' => false,
'check_post_hf4_balance' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'tx_processing_time' => 'tx_processing_time',
'check_inputs_types_supported_time' => 'check_inputs_types_supported_time',
'expiration_validate_time' => 'expiration_validate_time',
'validate_amount_time' => 'validate_amount_time',
'validate_alias_time' => 'validate_alias_time',
'check_keyimages_ws_ms_time' => 'check_keyimages_ws_ms_time',
'check_inputs_time' => 'check_inputs_time',
'begin_tx_time' => 'begin_tx_time',
'update_db_time' => 'update_db_time',
'db_commit_time' => 'db_commit_time',
'check_post_hf4_balance' => 'check_post_hf4_balance'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'tx_processing_time' => 'setTxProcessingTime',
'check_inputs_types_supported_time' => 'setCheckInputsTypesSupportedTime',
'expiration_validate_time' => 'setExpirationValidateTime',
'validate_amount_time' => 'setValidateAmountTime',
'validate_alias_time' => 'setValidateAliasTime',
'check_keyimages_ws_ms_time' => 'setCheckKeyimagesWsMsTime',
'check_inputs_time' => 'setCheckInputsTime',
'begin_tx_time' => 'setBeginTxTime',
'update_db_time' => 'setUpdateDbTime',
'db_commit_time' => 'setDbCommitTime',
'check_post_hf4_balance' => 'setCheckPostHf4Balance'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'tx_processing_time' => 'getTxProcessingTime',
'check_inputs_types_supported_time' => 'getCheckInputsTypesSupportedTime',
'expiration_validate_time' => 'getExpirationValidateTime',
'validate_amount_time' => 'getValidateAmountTime',
'validate_alias_time' => 'getValidateAliasTime',
'check_keyimages_ws_ms_time' => 'getCheckKeyimagesWsMsTime',
'check_inputs_time' => 'getCheckInputsTime',
'begin_tx_time' => 'getBeginTxTime',
'update_db_time' => 'getUpdateDbTime',
'db_commit_time' => 'getDbCommitTime',
'check_post_hf4_balance' => 'getCheckPostHf4Balance'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('tx_processing_time', $data ?? [], null);
$this->setIfExists('check_inputs_types_supported_time', $data ?? [], null);
$this->setIfExists('expiration_validate_time', $data ?? [], null);
$this->setIfExists('validate_amount_time', $data ?? [], null);
$this->setIfExists('validate_alias_time', $data ?? [], null);
$this->setIfExists('check_keyimages_ws_ms_time', $data ?? [], null);
$this->setIfExists('check_inputs_time', $data ?? [], null);
$this->setIfExists('begin_tx_time', $data ?? [], null);
$this->setIfExists('update_db_time', $data ?? [], null);
$this->setIfExists('db_commit_time', $data ?? [], null);
$this->setIfExists('check_post_hf4_balance', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets tx_processing_time
*
* @return int|null
*/
public function getTxProcessingTime(): ?int
{
return $this->container['tx_processing_time'];
}
/**
* Sets tx_processing_time
*
* @param int|null $tx_processing_time tx_processing_time
*
* @return $this
*/
public function setTxProcessingTime(?int $tx_processing_time): static
{
if (is_null($tx_processing_time)) {
throw new InvalidArgumentException('non-nullable tx_processing_time cannot be null');
}
$this->container['tx_processing_time'] = $tx_processing_time;
return $this;
}
/**
* Gets check_inputs_types_supported_time
*
* @return int|null
*/
public function getCheckInputsTypesSupportedTime(): ?int
{
return $this->container['check_inputs_types_supported_time'];
}
/**
* Sets check_inputs_types_supported_time
*
* @param int|null $check_inputs_types_supported_time check_inputs_types_supported_time
*
* @return $this
*/
public function setCheckInputsTypesSupportedTime(?int $check_inputs_types_supported_time): static
{
if (is_null($check_inputs_types_supported_time)) {
throw new InvalidArgumentException('non-nullable check_inputs_types_supported_time cannot be null');
}
$this->container['check_inputs_types_supported_time'] = $check_inputs_types_supported_time;
return $this;
}
/**
* Gets expiration_validate_time
*
* @return int|null
*/
public function getExpirationValidateTime(): ?int
{
return $this->container['expiration_validate_time'];
}
/**
* Sets expiration_validate_time
*
* @param int|null $expiration_validate_time expiration_validate_time
*
* @return $this
*/
public function setExpirationValidateTime(?int $expiration_validate_time): static
{
if (is_null($expiration_validate_time)) {
throw new InvalidArgumentException('non-nullable expiration_validate_time cannot be null');
}
$this->container['expiration_validate_time'] = $expiration_validate_time;
return $this;
}
/**
* Gets validate_amount_time
*
* @return int|null
*/
public function getValidateAmountTime(): ?int
{
return $this->container['validate_amount_time'];
}
/**
* Sets validate_amount_time
*
* @param int|null $validate_amount_time validate_amount_time
*
* @return $this
*/
public function setValidateAmountTime(?int $validate_amount_time): static
{
if (is_null($validate_amount_time)) {
throw new InvalidArgumentException('non-nullable validate_amount_time cannot be null');
}
$this->container['validate_amount_time'] = $validate_amount_time;
return $this;
}
/**
* Gets validate_alias_time
*
* @return int|null
*/
public function getValidateAliasTime(): ?int
{
return $this->container['validate_alias_time'];
}
/**
* Sets validate_alias_time
*
* @param int|null $validate_alias_time validate_alias_time
*
* @return $this
*/
public function setValidateAliasTime(?int $validate_alias_time): static
{
if (is_null($validate_alias_time)) {
throw new InvalidArgumentException('non-nullable validate_alias_time cannot be null');
}
$this->container['validate_alias_time'] = $validate_alias_time;
return $this;
}
/**
* Gets check_keyimages_ws_ms_time
*
* @return int|null
*/
public function getCheckKeyimagesWsMsTime(): ?int
{
return $this->container['check_keyimages_ws_ms_time'];
}
/**
* Sets check_keyimages_ws_ms_time
*
* @param int|null $check_keyimages_ws_ms_time check_keyimages_ws_ms_time
*
* @return $this
*/
public function setCheckKeyimagesWsMsTime(?int $check_keyimages_ws_ms_time): static
{
if (is_null($check_keyimages_ws_ms_time)) {
throw new InvalidArgumentException('non-nullable check_keyimages_ws_ms_time cannot be null');
}
$this->container['check_keyimages_ws_ms_time'] = $check_keyimages_ws_ms_time;
return $this;
}
/**
* Gets check_inputs_time
*
* @return int|null
*/
public function getCheckInputsTime(): ?int
{
return $this->container['check_inputs_time'];
}
/**
* Sets check_inputs_time
*
* @param int|null $check_inputs_time check_inputs_time
*
* @return $this
*/
public function setCheckInputsTime(?int $check_inputs_time): static
{
if (is_null($check_inputs_time)) {
throw new InvalidArgumentException('non-nullable check_inputs_time cannot be null');
}
$this->container['check_inputs_time'] = $check_inputs_time;
return $this;
}
/**
* Gets begin_tx_time
*
* @return int|null
*/
public function getBeginTxTime(): ?int
{
return $this->container['begin_tx_time'];
}
/**
* Sets begin_tx_time
*
* @param int|null $begin_tx_time begin_tx_time
*
* @return $this
*/
public function setBeginTxTime(?int $begin_tx_time): static
{
if (is_null($begin_tx_time)) {
throw new InvalidArgumentException('non-nullable begin_tx_time cannot be null');
}
$this->container['begin_tx_time'] = $begin_tx_time;
return $this;
}
/**
* Gets update_db_time
*
* @return int|null
*/
public function getUpdateDbTime(): ?int
{
return $this->container['update_db_time'];
}
/**
* Sets update_db_time
*
* @param int|null $update_db_time update_db_time
*
* @return $this
*/
public function setUpdateDbTime(?int $update_db_time): static
{
if (is_null($update_db_time)) {
throw new InvalidArgumentException('non-nullable update_db_time cannot be null');
}
$this->container['update_db_time'] = $update_db_time;
return $this;
}
/**
* Gets db_commit_time
*
* @return int|null
*/
public function getDbCommitTime(): ?int
{
return $this->container['db_commit_time'];
}
/**
* Sets db_commit_time
*
* @param int|null $db_commit_time db_commit_time
*
* @return $this
*/
public function setDbCommitTime(?int $db_commit_time): static
{
if (is_null($db_commit_time)) {
throw new InvalidArgumentException('non-nullable db_commit_time cannot be null');
}
$this->container['db_commit_time'] = $db_commit_time;
return $this;
}
/**
* Gets check_post_hf4_balance
*
* @return int|null
*/
public function getCheckPostHf4Balance(): ?int
{
return $this->container['check_post_hf4_balance'];
}
/**
* Sets check_post_hf4_balance
*
* @param int|null $check_post_hf4_balance check_post_hf4_balance
*
* @return $this
*/
public function setCheckPostHf4Balance(?int $check_post_hf4_balance): static
{
if (is_null($check_post_hf4_balance)) {
throw new InvalidArgumentException('non-nullable check_post_hf4_balance cannot be null');
}
$this->container['check_post_hf4_balance'] = $check_post_hf4_balance;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,543 @@
<?php
/**
* VersionModel
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* VersionModel Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class VersionModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'VersionModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'version' => 'string',
'version_long' => 'string',
'major' => 'string',
'minor' => 'string',
'revision' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'version' => null,
'version_long' => null,
'major' => null,
'minor' => null,
'revision' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'version' => false,
'version_long' => false,
'major' => false,
'minor' => false,
'revision' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'version' => 'version',
'version_long' => 'version_long',
'major' => 'major',
'minor' => 'minor',
'revision' => 'revision'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'version' => 'setVersion',
'version_long' => 'setVersionLong',
'major' => 'setMajor',
'minor' => 'setMinor',
'revision' => 'setRevision'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'version' => 'getVersion',
'version_long' => 'getVersionLong',
'major' => 'getMajor',
'minor' => 'getMinor',
'revision' => 'getRevision'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('version', $data ?? [], null);
$this->setIfExists('version_long', $data ?? [], null);
$this->setIfExists('major', $data ?? [], null);
$this->setIfExists('minor', $data ?? [], null);
$this->setIfExists('revision', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets version
*
* @return string|null
*/
public function getVersion(): ?string
{
return $this->container['version'];
}
/**
* Sets version
*
* @param string|null $version version
*
* @return $this
*/
public function setVersion(?string $version): static
{
if (is_null($version)) {
throw new InvalidArgumentException('non-nullable version cannot be null');
}
$this->container['version'] = $version;
return $this;
}
/**
* Gets version_long
*
* @return string|null
*/
public function getVersionLong(): ?string
{
return $this->container['version_long'];
}
/**
* Sets version_long
*
* @param string|null $version_long version_long
*
* @return $this
*/
public function setVersionLong(?string $version_long): static
{
if (is_null($version_long)) {
throw new InvalidArgumentException('non-nullable version_long cannot be null');
}
$this->container['version_long'] = $version_long;
return $this;
}
/**
* Gets major
*
* @return string|null
*/
public function getMajor(): ?string
{
return $this->container['major'];
}
/**
* Sets major
*
* @param string|null $major major
*
* @return $this
*/
public function setMajor(?string $major): static
{
if (is_null($major)) {
throw new InvalidArgumentException('non-nullable major cannot be null');
}
$this->container['major'] = $major;
return $this;
}
/**
* Gets minor
*
* @return string|null
*/
public function getMinor(): ?string
{
return $this->container['minor'];
}
/**
* Sets minor
*
* @param string|null $minor minor
*
* @return $this
*/
public function setMinor(?string $minor): static
{
if (is_null($minor)) {
throw new InvalidArgumentException('non-nullable minor cannot be null');
}
$this->container['minor'] = $minor;
return $this;
}
/**
* Gets revision
*
* @return string|null
*/
public function getRevision(): ?string
{
return $this->container['revision'];
}
/**
* Sets revision
*
* @param string|null $revision revision
*
* @return $this
*/
public function setRevision(?string $revision): static
{
if (is_null($revision)) {
throw new InvalidArgumentException('non-nullable revision cannot be null');
}
$this->container['revision'] = $revision;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,110 @@
<?php
/**
* ModelInterface
*
* PHP version 8.1
*
* @package lthn\lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
/**
* Interface abstracting model access.
*
* @package lthn\lthn
* @author OpenAPI Generator team
*/
interface ModelInterface
{
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string;
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPITypes(): array;
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPIFormats(): array;
/**
* Array of attributes where the key is the local name, and the value is the original name
*
* @return array
*/
public static function attributeMap(): array;
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters(): array;
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters(): array;
/**
* Show all the invalid properties with reasons.
*
* @return array
*/
public function listInvalidProperties(): array;
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool
*/
public function valid(): bool;
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool;
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool;
}

View file

@ -0,0 +1,592 @@
<?php
/**
* ObjectSerializer
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn;
use DateTimeInterface;
use DateTime;
use GuzzleHttp\Psr7\Utils;
use lthn\lthn\ModelInterface;
/**
* ObjectSerializer Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ObjectSerializer
{
/** @var string */
private static string $dateTimeFormat = DateTimeInterface::ATOM;
/**
* Change the date format
*
* @param string $format the new date format to use
*
* @return void
*/
public static function setDateTimeFormat(string $format): void
{
self::$dateTimeFormat = $format;
}
/**
* Serialize data
*
* @param mixed $data the data to serialize
* @param string|null $type the OpenAPIToolsType of the data
* @param string|null $format the format of the OpenAPITools type of the data
*
* @return scalar|object|array|null serialized form of $data
*/
public static function sanitizeForSerialization(mixed $data, ?string $type = null, ?string $format = null): mixed
{
if (is_scalar($data) || null === $data) {
return $data;
}
if ($data instanceof DateTime) {
return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat);
}
if ($data instanceof \BackedEnum) {
return $data->value;
}
if (is_array($data)) {
foreach ($data as $property => $value) {
$data[$property] = self::sanitizeForSerialization($value);
}
return $data;
}
if (is_object($data)) {
$values = [];
if ($data instanceof ModelInterface) {
$formats = $data::openAPIFormats();
foreach ($data::openAPITypes() as $property => $openAPIType) {
$getter = $data::getters()[$property];
$value = $data->$getter();
if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
if (is_subclass_of($openAPIType, '\BackedEnum')) {
if (is_scalar($value)) {
$value = $openAPIType::tryFrom($value);
if ($value === null) {
$imploded = implode("', '", array_map(fn($case) => $case->value, $openAPIType::cases()));
throw new \InvalidArgumentException(
sprintf(
"Invalid value for enum '%s', must be one of: '%s'",
$openAPIType::class,
$imploded
)
);
}
}
}
}
if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) {
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
}
}
} else {
foreach($data as $property => $value) {
$values[$property] = self::sanitizeForSerialization($value);
}
}
return (object)$values;
} else {
return (string)$data;
}
}
/**
* Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif
*
* @param string $filename filename to be sanitized
*
* @return string the sanitized filename
*/
public static function sanitizeFilename(string $filename): string
{
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
return $match[1];
} else {
return $filename;
}
}
/**
* Shorter timestamp microseconds to 6 digits length.
*
* @param string $timestamp Original timestamp
*
* @return string the shorten timestamp
*/
public static function sanitizeTimestamp(string $timestamp): string
{
return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp);
}
/**
* Take value and turn it into a string suitable for inclusion in
* the path, by url-encoding.
*
* @param string $value a string which will be part of the path
*
* @return string the serialized object
*/
public static function toPathValue(string $value): string
{
return rawurlencode(self::toString($value));
}
/**
* Checks if a value is empty, based on its OpenAPI type.
*
* @param mixed $value
* @param string $openApiType
*
* @return bool true if $value is empty
*/
private static function isEmptyValue(mixed $value, string $openApiType): bool
{
# If empty() returns false, it is not empty regardless of its type.
if (!empty($value)) {
return false;
}
# Null is always empty, as we cannot send a real "null" value in a query parameter.
if ($value === null) {
return true;
}
return match ($openApiType) {
# For numeric values, false and '' are considered empty.
# This comparison is safe for floating point values, since the previous call to empty() will
# filter out values that don't match 0.
'int','integer' => $value !== 0,
'number'|'float' => $value !== 0 && $value !== 0.0,
# For boolean values, '' is considered empty
'bool','boolean' => !in_array($value, [false, 0], true),
# For string values, '' is considered empty.
'string' => $value === '',
# For all the other types, any value at this point can be considered empty.
default => true
};
}
/**
* Take query parameter properties and turn it into an array suitable for
* native http_build_query or GuzzleHttp\Psr7\Query::build.
*
* @param mixed $value Parameter value
* @param string $paramName Parameter name
* @param string $openApiType OpenAPIType e.g. array or object
* @param string $style Parameter serialization style
* @param bool $explode Parameter explode option
* @param bool $required Whether query param is required or not
*
* @return array
*/
public static function toQueryValue(
mixed $value,
string $paramName,
string $openApiType = 'string',
string $style = 'form',
bool $explode = true,
bool $required = true
): array {
# Check if we should omit this parameter from the query. This should only happen when:
# - Parameter is NOT required; AND
# - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For
# example, 0 as "int" or "boolean" is NOT an empty value.
if (self::isEmptyValue($value, $openApiType)) {
if ($required) {
return ["{$paramName}" => ''];
} else {
return [];
}
}
# Handle DateTime objects in query
if($openApiType === "\DateTime" && $value instanceof DateTime) {
return ["{$paramName}" => $value->format(self::$dateTimeFormat)];
}
$query = [];
$value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value;
// since \GuzzleHttp\Psr7\Query::build fails with nested arrays
// need to flatten array first
$flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) {
if (!is_array($arr)) return $arr;
foreach ($arr as $k => $v) {
$prop = ($style === 'deepObject') ? "{$name}[{$k}]" : $k;
if (is_array($v)) {
$flattenArray($v, $prop, $result);
} else {
if ($style !== 'deepObject' && !$explode) {
// push key itself
$result[] = $prop;
}
$result[$prop] = $v;
}
}
return $result;
};
$value = $flattenArray($value, $paramName);
// https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
if ($openApiType === 'array' && $style === 'deepObject' && $explode) {
return $value;
}
if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) {
return $value;
}
if ('boolean' === $openApiType && is_bool($value)) {
$value = self::convertBoolToQueryStringFormat($value);
}
// handle style in serializeCollection
$query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style);
return $query;
}
/**
* Convert boolean value to format for query string.
*
* @param bool $value Boolean value
*
* @return int|string Boolean value in format
*/
public static function convertBoolToQueryStringFormat(bool $value): int|string
{
if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) {
return $value ? 'true' : 'false';
}
return (int) $value;
}
/**
* Take value and turn it into a string suitable for inclusion in
* the header. If it's a string, pass through unchanged
* If it's a datetime object, format it in ISO8601
*
* @param string $value a string which will be part of the header
*
* @return string the header string
*/
public static function toHeaderValue(string $value): string
{
$callable = [$value, 'toHeaderValue'];
if (is_callable($callable)) {
return $callable();
}
return self::toString($value);
}
/**
* Take value and turn it into a string suitable for inclusion in
* the parameter. If it's a string, pass through unchanged
* If it's a datetime object, format it in ISO8601
* If it's a boolean, convert it to "true" or "false".
*
* @param string|bool|DateTime $value the value of the parameter
*
* @return string the header string
*/
public static function toString(string|bool|DateTime $value): string
{
if ($value instanceof DateTime) { // datetime in ISO8601 format
return $value->format(self::$dateTimeFormat);
} elseif (is_bool($value)) {
return $value ? 'true' : 'false';
} else {
return (string) $value;
}
}
/**
* Serialize an array to a string.
*
* @param array $collection collection to serialize to a string
* @param string $style the format use for serialization (csv,
* ssv, tsv, pipes, multi)
* @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array
*
* @return string
*/
public static function serializeCollection(array $collection, string $style, bool $allowCollectionFormatMulti = false): string
{
if ($allowCollectionFormatMulti && ('multi' === $style)) {
// http_build_query() almost does the job for us. We just
// need to fix the result of multidimensional arrays.
return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&'));
}
return match ($style) {
'pipeDelimited', 'pipes' => implode('|', $collection),
'tsv' => implode("\t", $collection),
'spaceDelimited', 'ssv' => implode(' ', $collection),
default => implode(',', $collection),
};
}
/**
* Deserialize a JSON string into an object
*
* @param mixed $data object or primitive to be deserialized
* @param string $class class name is passed as a string
* @param string[]|null $httpHeaders HTTP headers
*
* @return mixed a single or an array of $class instances
*/
public static function deserialize(mixed $data, string $class, ?array $httpHeaders = null): mixed
{
if (null === $data) {
return null;
}
if (strcasecmp(substr($class, -2), '[]') === 0) {
$data = is_string($data) ? json_decode($data) : $data;
if (!is_array($data)) {
throw new \InvalidArgumentException("Invalid array '$class'");
}
$subClass = substr($class, 0, -2);
$values = [];
foreach ($data as $key => $value) {
$values[] = self::deserialize($value, $subClass, null);
}
return $values;
}
if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array<string,int>
$data = is_string($data) ? json_decode($data) : $data;
settype($data, 'array');
$inner = substr($class, 4, -1);
$deserialized = [];
if (strrpos($inner, ",") !== false) {
$subClass_array = explode(',', $inner, 2);
$subClass = $subClass_array[1];
foreach ($data as $key => $value) {
$deserialized[$key] = self::deserialize($value, $subClass, null);
}
}
return $deserialized;
}
if ($class === 'mixed') {
settype($data, gettype($data));
return $data;
}
if ($class === '\DateTime') {
// Some APIs return an invalid, empty string as a
// date-time property. DateTime::__construct() will return
// the current time for empty input which is probably not
// what is meant. The invalid empty string is probably to
// be interpreted as a missing field/value. Let's handle
// this graceful.
if (!empty($data)) {
try {
return new DateTime($data);
} catch (\Exception $exception) {
// Some APIs return a date-time with too high nanosecond
// precision for php's DateTime to handle.
// With provided regexp 6 digits of microseconds saved
return new DateTime(self::sanitizeTimestamp($data));
}
} else {
return null;
}
}
if ($class === '\Psr\Http\Message\StreamInterface') {
return Utils::streamFor($data);
}
if ($class === '\SplFileObject') {
$data = Utils::streamFor($data);
/** @var \Psr\Http\Message\StreamInterface $data */
// determine file name
if (
is_array($httpHeaders)
&& array_key_exists('Content-Disposition', $httpHeaders)
&& preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)
) {
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
} else {
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
}
$file = fopen($filename, 'w');
while ($chunk = $data->read(200)) {
fwrite($file, $chunk);
}
fclose($file);
return new \SplFileObject($filename, 'r');
}
/** @psalm-suppress ParadoxicalCondition */
// handle primitive types
if (in_array($class, ['\DateTime', '\SplFileObject'], true)) {
return $data;
} elseif (in_array($class, ['array', 'bool', 'boolean', 'float', 'double', 'int', 'integer', 'object', 'string', 'null'], true)) {
// type ref: https://www.php.net/manual/en/function.settype.php
// byte, mixed, void in the old php client were removed
settype($data, $class);
return $data;
}
if (is_subclass_of($class, '\BackedEnum')) {
$data = $class::tryFrom($data);
if ($data === null) {
$imploded = implode("', '", array_map(fn($case) => $case->value, $class::cases()));
throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'");
}
return $data;
} else {
$data = is_string($data) ? json_decode($data) : $data;
if (is_array($data)) {
$data = (object)$data;
}
// If a discriminator is defined and points to a valid subclass, use it.
$discriminator = $class::DISCRIMINATOR;
if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) {
$subclass = '\lthn\Model\\' . $data->{$discriminator};
if (is_subclass_of($subclass, $class)) {
$class = $subclass;
}
}
/** @var ModelInterface $instance */
$instance = new $class();
foreach ($instance::openAPITypes() as $property => $type) {
$propertySetter = $instance::setters()[$property];
if (!isset($propertySetter)) {
continue;
}
if (!isset($data->{$instance::attributeMap()[$property]})) {
if ($instance::isNullable($property)) {
$instance->$propertySetter(null);
}
continue;
}
if (isset($data->{$instance::attributeMap()[$property]})) {
$propertyValue = $data->{$instance::attributeMap()[$property]};
$instance->$propertySetter(self::deserialize($propertyValue, $type, null));
}
}
return $instance;
}
}
/**
* Build a query string from an array of key value pairs.
*
* This function can use the return value of `parse()` to build a query
* string. This function does not modify the provided keys when an array is
* encountered (like `http_build_query()` would).
*
* @param array $params Query string parameters.
* @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
* to encode using RFC3986, or PHP_QUERY_RFC1738
* to encode using RFC1738.
*/
public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string
{
if (!$params) {
return '';
}
if ($encoding === false) {
$encoder = function (string $str): string {
return $str;
};
} elseif ($encoding === PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode';
} elseif ($encoding === PHP_QUERY_RFC1738) {
$encoder = 'urlencode';
} else {
throw new \InvalidArgumentException('Invalid type');
}
$castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()
? function ($v) { return (int) $v; }
: function ($v) { return $v ? 'true' : 'false'; };
$qs = '';
foreach ($params as $k => $v) {
$k = $encoder((string) $k);
if (!is_array($v)) {
$qs .= $k;
$v = is_bool($v) ? $castBool($v) : $v;
if ($v !== null) {
$qs .= '='.$encoder((string) $v);
}
$qs .= '&';
} else {
foreach ($v as $vv) {
$qs .= $k;
$vv = is_bool($vv) ? $castBool($vv) : $vv;
if ($vv !== null) {
$qs .= '='.$encoder((string) $vv);
}
$qs .= '&';
}
}
}
return $qs ? (string) substr($qs, 0, -1) : '';
}
}

View file

@ -0,0 +1,509 @@
<?php
/**
* PerformanceModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* PerformanceModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class PerformanceModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'PerformanceModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'block_processing' => '\lthn\lthn\BlockProcessingPerformanceModel',
'tx_processing' => '\lthn\lthn\TxProcessingPerformanceModel',
'tx_pool' => '\lthn\lthn\TxPoolPerformanceModel',
'db_stat_info' => '\lthn\lthn\DbStatInfoModel'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'block_processing' => null,
'tx_processing' => null,
'tx_pool' => null,
'db_stat_info' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'block_processing' => false,
'tx_processing' => false,
'tx_pool' => false,
'db_stat_info' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'block_processing' => 'block_processing',
'tx_processing' => 'tx_processing',
'tx_pool' => 'tx_pool',
'db_stat_info' => 'db_stat_info'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'block_processing' => 'setBlockProcessing',
'tx_processing' => 'setTxProcessing',
'tx_pool' => 'setTxPool',
'db_stat_info' => 'setDbStatInfo'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'block_processing' => 'getBlockProcessing',
'tx_processing' => 'getTxProcessing',
'tx_pool' => 'getTxPool',
'db_stat_info' => 'getDbStatInfo'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('block_processing', $data ?? [], null);
$this->setIfExists('tx_processing', $data ?? [], null);
$this->setIfExists('tx_pool', $data ?? [], null);
$this->setIfExists('db_stat_info', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets block_processing
*
* @return \lthn\lthn\BlockProcessingPerformanceModel|null
*/
public function getBlockProcessing(): ?\lthn\lthn\BlockProcessingPerformanceModel
{
return $this->container['block_processing'];
}
/**
* Sets block_processing
*
* @param \lthn\lthn\BlockProcessingPerformanceModel|null $block_processing block_processing
*
* @return $this
*/
public function setBlockProcessing(?\lthn\lthn\BlockProcessingPerformanceModel $block_processing): static
{
if (is_null($block_processing)) {
throw new InvalidArgumentException('non-nullable block_processing cannot be null');
}
$this->container['block_processing'] = $block_processing;
return $this;
}
/**
* Gets tx_processing
*
* @return \lthn\lthn\TxProcessingPerformanceModel|null
*/
public function getTxProcessing(): ?\lthn\lthn\TxProcessingPerformanceModel
{
return $this->container['tx_processing'];
}
/**
* Sets tx_processing
*
* @param \lthn\lthn\TxProcessingPerformanceModel|null $tx_processing tx_processing
*
* @return $this
*/
public function setTxProcessing(?\lthn\lthn\TxProcessingPerformanceModel $tx_processing): static
{
if (is_null($tx_processing)) {
throw new InvalidArgumentException('non-nullable tx_processing cannot be null');
}
$this->container['tx_processing'] = $tx_processing;
return $this;
}
/**
* Gets tx_pool
*
* @return \lthn\lthn\TxPoolPerformanceModel|null
*/
public function getTxPool(): ?\lthn\lthn\TxPoolPerformanceModel
{
return $this->container['tx_pool'];
}
/**
* Sets tx_pool
*
* @param \lthn\lthn\TxPoolPerformanceModel|null $tx_pool tx_pool
*
* @return $this
*/
public function setTxPool(?\lthn\lthn\TxPoolPerformanceModel $tx_pool): static
{
if (is_null($tx_pool)) {
throw new InvalidArgumentException('non-nullable tx_pool cannot be null');
}
$this->container['tx_pool'] = $tx_pool;
return $this;
}
/**
* Gets db_stat_info
*
* @return \lthn\lthn\DbStatInfoModel|null
*/
public function getDbStatInfo(): ?\lthn\lthn\DbStatInfoModel
{
return $this->container['db_stat_info'];
}
/**
* Sets db_stat_info
*
* @param \lthn\lthn\DbStatInfoModel|null $db_stat_info db_stat_info
*
* @return $this
*/
public function setDbStatInfo(?\lthn\lthn\DbStatInfoModel $db_stat_info): static
{
if (is_null($db_stat_info)) {
throw new InvalidArgumentException('non-nullable db_stat_info cannot be null');
}
$this->container['db_stat_info'] = $db_stat_info;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

645
utils/sdk/client/php/src/PosEntryModel.php generated Normal file
View file

@ -0,0 +1,645 @@
<?php
/**
* PosEntryModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* PosEntryModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class PosEntryModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'PosEntryModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'g_index' => 'int',
'keyimage' => 'string',
'block_timestamp' => 'int',
'stake_unlock_time' => 'int',
'tx_id' => 'string',
'tx_out_index' => 'int',
'wallet_index' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'g_index' => null,
'keyimage' => null,
'block_timestamp' => null,
'stake_unlock_time' => null,
'tx_id' => null,
'tx_out_index' => null,
'wallet_index' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'g_index' => false,
'keyimage' => false,
'block_timestamp' => false,
'stake_unlock_time' => false,
'tx_id' => false,
'tx_out_index' => false,
'wallet_index' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'g_index' => 'g_index',
'keyimage' => 'keyimage',
'block_timestamp' => 'block_timestamp',
'stake_unlock_time' => 'stake_unlock_time',
'tx_id' => 'tx_id',
'tx_out_index' => 'tx_out_index',
'wallet_index' => 'wallet_index'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'g_index' => 'setGIndex',
'keyimage' => 'setKeyimage',
'block_timestamp' => 'setBlockTimestamp',
'stake_unlock_time' => 'setStakeUnlockTime',
'tx_id' => 'setTxId',
'tx_out_index' => 'setTxOutIndex',
'wallet_index' => 'setWalletIndex'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'g_index' => 'getGIndex',
'keyimage' => 'getKeyimage',
'block_timestamp' => 'getBlockTimestamp',
'stake_unlock_time' => 'getStakeUnlockTime',
'tx_id' => 'getTxId',
'tx_out_index' => 'getTxOutIndex',
'wallet_index' => 'getWalletIndex'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('g_index', $data ?? [], null);
$this->setIfExists('keyimage', $data ?? [], null);
$this->setIfExists('block_timestamp', $data ?? [], null);
$this->setIfExists('stake_unlock_time', $data ?? [], null);
$this->setIfExists('tx_id', $data ?? [], null);
$this->setIfExists('tx_out_index', $data ?? [], null);
$this->setIfExists('wallet_index', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets g_index
*
* @return int|null
*/
public function getGIndex(): ?int
{
return $this->container['g_index'];
}
/**
* Sets g_index
*
* @param int|null $g_index g_index
*
* @return $this
*/
public function setGIndex(?int $g_index): static
{
if (is_null($g_index)) {
throw new InvalidArgumentException('non-nullable g_index cannot be null');
}
$this->container['g_index'] = $g_index;
return $this;
}
/**
* Gets keyimage
*
* @return string|null
*/
public function getKeyimage(): ?string
{
return $this->container['keyimage'];
}
/**
* Sets keyimage
*
* @param string|null $keyimage keyimage
*
* @return $this
*/
public function setKeyimage(?string $keyimage): static
{
if (is_null($keyimage)) {
throw new InvalidArgumentException('non-nullable keyimage cannot be null');
}
$this->container['keyimage'] = $keyimage;
return $this;
}
/**
* Gets block_timestamp
*
* @return int|null
*/
public function getBlockTimestamp(): ?int
{
return $this->container['block_timestamp'];
}
/**
* Sets block_timestamp
*
* @param int|null $block_timestamp block_timestamp
*
* @return $this
*/
public function setBlockTimestamp(?int $block_timestamp): static
{
if (is_null($block_timestamp)) {
throw new InvalidArgumentException('non-nullable block_timestamp cannot be null');
}
$this->container['block_timestamp'] = $block_timestamp;
return $this;
}
/**
* Gets stake_unlock_time
*
* @return int|null
*/
public function getStakeUnlockTime(): ?int
{
return $this->container['stake_unlock_time'];
}
/**
* Sets stake_unlock_time
*
* @param int|null $stake_unlock_time stake_unlock_time
*
* @return $this
*/
public function setStakeUnlockTime(?int $stake_unlock_time): static
{
if (is_null($stake_unlock_time)) {
throw new InvalidArgumentException('non-nullable stake_unlock_time cannot be null');
}
$this->container['stake_unlock_time'] = $stake_unlock_time;
return $this;
}
/**
* Gets tx_id
*
* @return string|null
*/
public function getTxId(): ?string
{
return $this->container['tx_id'];
}
/**
* Sets tx_id
*
* @param string|null $tx_id tx_id
*
* @return $this
*/
public function setTxId(?string $tx_id): static
{
if (is_null($tx_id)) {
throw new InvalidArgumentException('non-nullable tx_id cannot be null');
}
$this->container['tx_id'] = $tx_id;
return $this;
}
/**
* Gets tx_out_index
*
* @return int|null
*/
public function getTxOutIndex(): ?int
{
return $this->container['tx_out_index'];
}
/**
* Sets tx_out_index
*
* @param int|null $tx_out_index tx_out_index
*
* @return $this
*/
public function setTxOutIndex(?int $tx_out_index): static
{
if (is_null($tx_out_index)) {
throw new InvalidArgumentException('non-nullable tx_out_index cannot be null');
}
$this->container['tx_out_index'] = $tx_out_index;
return $this;
}
/**
* Gets wallet_index
*
* @return int|null
*/
public function getWalletIndex(): ?int
{
return $this->container['wallet_index'];
}
/**
* Sets wallet_index
*
* @param int|null $wallet_index wallet_index
*
* @return $this
*/
public function setWalletIndex(?int $wallet_index): static
{
if (is_null($wallet_index)) {
throw new InvalidArgumentException('non-nullable wallet_index cannot be null');
}
$this->container['wallet_index'] = $wallet_index;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,407 @@
<?php
/**
* SubmitBlockRequestModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* SubmitBlockRequestModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class SubmitBlockRequestModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'SubmitBlockRequestModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'block_blob' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'block_blob' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'block_blob' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'block_blob' => 'block_blob'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'block_blob' => 'setBlockBlob'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'block_blob' => 'getBlockBlob'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('block_blob', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets block_blob
*
* @return string|null
*/
public function getBlockBlob(): ?string
{
return $this->container['block_blob'];
}
/**
* Sets block_blob
*
* @param string|null $block_blob block_blob
*
* @return $this
*/
public function setBlockBlob(?string $block_blob): static
{
if (is_null($block_blob)) {
throw new InvalidArgumentException('non-nullable block_blob cannot be null');
}
$this->container['block_blob'] = $block_blob;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,407 @@
<?php
/**
* SubmitBlockResponseModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* SubmitBlockResponseModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class SubmitBlockResponseModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'SubmitBlockResponseModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'status' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'status' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'status' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'status' => 'status'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'status' => 'setStatus'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'status' => 'getStatus'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('status', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets status
*
* @return string|null
*/
public function getStatus(): ?string
{
return $this->container['status'];
}
/**
* Sets status
*
* @param string|null $status status
*
* @return $this
*/
public function setStatus(?string $status): static
{
if (is_null($status)) {
throw new InvalidArgumentException('non-nullable status cannot be null');
}
$this->container['status'] = $status;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,475 @@
<?php
/**
* TransactionAttachmentModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* TransactionAttachmentModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionAttachmentModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionAttachmentModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'type' => 'string',
'short_view' => 'string',
'details_view' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'type' => null,
'short_view' => null,
'details_view' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'type' => false,
'short_view' => false,
'details_view' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'type' => 'type',
'short_view' => 'short_view',
'details_view' => 'details_view'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'type' => 'setType',
'short_view' => 'setShortView',
'details_view' => 'setDetailsView'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'type' => 'getType',
'short_view' => 'getShortView',
'details_view' => 'getDetailsView'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('type', $data ?? [], null);
$this->setIfExists('short_view', $data ?? [], null);
$this->setIfExists('details_view', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets type
*
* @return string|null
*/
public function getType(): ?string
{
return $this->container['type'];
}
/**
* Sets type
*
* @param string|null $type type
*
* @return $this
*/
public function setType(?string $type): static
{
if (is_null($type)) {
throw new InvalidArgumentException('non-nullable type cannot be null');
}
$this->container['type'] = $type;
return $this;
}
/**
* Gets short_view
*
* @return string|null
*/
public function getShortView(): ?string
{
return $this->container['short_view'];
}
/**
* Sets short_view
*
* @param string|null $short_view short_view
*
* @return $this
*/
public function setShortView(?string $short_view): static
{
if (is_null($short_view)) {
throw new InvalidArgumentException('non-nullable short_view cannot be null');
}
$this->container['short_view'] = $short_view;
return $this;
}
/**
* Gets details_view
*
* @return string|null
*/
public function getDetailsView(): ?string
{
return $this->container['details_view'];
}
/**
* Sets details_view
*
* @param string|null $details_view details_view
*
* @return $this
*/
public function setDetailsView(?string $details_view): static
{
if (is_null($details_view)) {
throw new InvalidArgumentException('non-nullable details_view cannot be null');
}
$this->container['details_view'] = $details_view;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,815 @@
<?php
/**
* TransactionDetailsModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* TransactionDetailsModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionDetailsModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionDetailsModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'attachments' => '\lthn\lthn\TransactionAttachmentModel[]',
'blob' => 'string',
'blob_size' => 'int',
'extra' => '\lthn\lthn\TransactionExtraModel[]',
'fee' => 'int',
'id' => 'string',
'ins' => '\lthn\lthn\TransactionInputModel[]',
'keeper_block' => 'int',
'object_in_json' => 'string',
'outs' => '\lthn\lthn\TransactionOutputModel[]',
'pub_key' => 'string',
'timestamp' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'attachments' => null,
'blob' => null,
'blob_size' => null,
'extra' => null,
'fee' => null,
'id' => null,
'ins' => null,
'keeper_block' => 'int64',
'object_in_json' => null,
'outs' => null,
'pub_key' => null,
'timestamp' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'attachments' => false,
'blob' => false,
'blob_size' => false,
'extra' => false,
'fee' => false,
'id' => false,
'ins' => false,
'keeper_block' => false,
'object_in_json' => false,
'outs' => false,
'pub_key' => false,
'timestamp' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'attachments' => 'attachments',
'blob' => 'blob',
'blob_size' => 'blob_size',
'extra' => 'extra',
'fee' => 'fee',
'id' => 'id',
'ins' => 'ins',
'keeper_block' => 'keeper_block',
'object_in_json' => 'object_in_json',
'outs' => 'outs',
'pub_key' => 'pub_key',
'timestamp' => 'timestamp'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'attachments' => 'setAttachments',
'blob' => 'setBlob',
'blob_size' => 'setBlobSize',
'extra' => 'setExtra',
'fee' => 'setFee',
'id' => 'setId',
'ins' => 'setIns',
'keeper_block' => 'setKeeperBlock',
'object_in_json' => 'setObjectInJson',
'outs' => 'setOuts',
'pub_key' => 'setPubKey',
'timestamp' => 'setTimestamp'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'attachments' => 'getAttachments',
'blob' => 'getBlob',
'blob_size' => 'getBlobSize',
'extra' => 'getExtra',
'fee' => 'getFee',
'id' => 'getId',
'ins' => 'getIns',
'keeper_block' => 'getKeeperBlock',
'object_in_json' => 'getObjectInJson',
'outs' => 'getOuts',
'pub_key' => 'getPubKey',
'timestamp' => 'getTimestamp'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('attachments', $data ?? [], null);
$this->setIfExists('blob', $data ?? [], null);
$this->setIfExists('blob_size', $data ?? [], null);
$this->setIfExists('extra', $data ?? [], null);
$this->setIfExists('fee', $data ?? [], null);
$this->setIfExists('id', $data ?? [], null);
$this->setIfExists('ins', $data ?? [], null);
$this->setIfExists('keeper_block', $data ?? [], null);
$this->setIfExists('object_in_json', $data ?? [], null);
$this->setIfExists('outs', $data ?? [], null);
$this->setIfExists('pub_key', $data ?? [], null);
$this->setIfExists('timestamp', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets attachments
*
* @return \lthn\lthn\TransactionAttachmentModel[]|null
*/
public function getAttachments(): ?array
{
return $this->container['attachments'];
}
/**
* Sets attachments
*
* @param \lthn\lthn\TransactionAttachmentModel[]|null $attachments attachments
*
* @return $this
*/
public function setAttachments(?array $attachments): static
{
if (is_null($attachments)) {
throw new InvalidArgumentException('non-nullable attachments cannot be null');
}
$this->container['attachments'] = $attachments;
return $this;
}
/**
* Gets blob
*
* @return string|null
*/
public function getBlob(): ?string
{
return $this->container['blob'];
}
/**
* Sets blob
*
* @param string|null $blob blob
*
* @return $this
*/
public function setBlob(?string $blob): static
{
if (is_null($blob)) {
throw new InvalidArgumentException('non-nullable blob cannot be null');
}
$this->container['blob'] = $blob;
return $this;
}
/**
* Gets blob_size
*
* @return int|null
*/
public function getBlobSize(): ?int
{
return $this->container['blob_size'];
}
/**
* Sets blob_size
*
* @param int|null $blob_size blob_size
*
* @return $this
*/
public function setBlobSize(?int $blob_size): static
{
if (is_null($blob_size)) {
throw new InvalidArgumentException('non-nullable blob_size cannot be null');
}
$this->container['blob_size'] = $blob_size;
return $this;
}
/**
* Gets extra
*
* @return \lthn\lthn\TransactionExtraModel[]|null
*/
public function getExtra(): ?array
{
return $this->container['extra'];
}
/**
* Sets extra
*
* @param \lthn\lthn\TransactionExtraModel[]|null $extra extra
*
* @return $this
*/
public function setExtra(?array $extra): static
{
if (is_null($extra)) {
throw new InvalidArgumentException('non-nullable extra cannot be null');
}
$this->container['extra'] = $extra;
return $this;
}
/**
* Gets fee
*
* @return int|null
*/
public function getFee(): ?int
{
return $this->container['fee'];
}
/**
* Sets fee
*
* @param int|null $fee fee
*
* @return $this
*/
public function setFee(?int $fee): static
{
if (is_null($fee)) {
throw new InvalidArgumentException('non-nullable fee cannot be null');
}
$this->container['fee'] = $fee;
return $this;
}
/**
* Gets id
*
* @return string|null
*/
public function getId(): ?string
{
return $this->container['id'];
}
/**
* Sets id
*
* @param string|null $id id
*
* @return $this
*/
public function setId(?string $id): static
{
if (is_null($id)) {
throw new InvalidArgumentException('non-nullable id cannot be null');
}
$this->container['id'] = $id;
return $this;
}
/**
* Gets ins
*
* @return \lthn\lthn\TransactionInputModel[]|null
*/
public function getIns(): ?array
{
return $this->container['ins'];
}
/**
* Sets ins
*
* @param \lthn\lthn\TransactionInputModel[]|null $ins ins
*
* @return $this
*/
public function setIns(?array $ins): static
{
if (is_null($ins)) {
throw new InvalidArgumentException('non-nullable ins cannot be null');
}
$this->container['ins'] = $ins;
return $this;
}
/**
* Gets keeper_block
*
* @return int|null
*/
public function getKeeperBlock(): ?int
{
return $this->container['keeper_block'];
}
/**
* Sets keeper_block
*
* @param int|null $keeper_block keeper_block
*
* @return $this
*/
public function setKeeperBlock(?int $keeper_block): static
{
if (is_null($keeper_block)) {
throw new InvalidArgumentException('non-nullable keeper_block cannot be null');
}
$this->container['keeper_block'] = $keeper_block;
return $this;
}
/**
* Gets object_in_json
*
* @return string|null
*/
public function getObjectInJson(): ?string
{
return $this->container['object_in_json'];
}
/**
* Sets object_in_json
*
* @param string|null $object_in_json object_in_json
*
* @return $this
*/
public function setObjectInJson(?string $object_in_json): static
{
if (is_null($object_in_json)) {
throw new InvalidArgumentException('non-nullable object_in_json cannot be null');
}
$this->container['object_in_json'] = $object_in_json;
return $this;
}
/**
* Gets outs
*
* @return \lthn\lthn\TransactionOutputModel[]|null
*/
public function getOuts(): ?array
{
return $this->container['outs'];
}
/**
* Sets outs
*
* @param \lthn\lthn\TransactionOutputModel[]|null $outs outs
*
* @return $this
*/
public function setOuts(?array $outs): static
{
if (is_null($outs)) {
throw new InvalidArgumentException('non-nullable outs cannot be null');
}
$this->container['outs'] = $outs;
return $this;
}
/**
* Gets pub_key
*
* @return string|null
*/
public function getPubKey(): ?string
{
return $this->container['pub_key'];
}
/**
* Sets pub_key
*
* @param string|null $pub_key pub_key
*
* @return $this
*/
public function setPubKey(?string $pub_key): static
{
if (is_null($pub_key)) {
throw new InvalidArgumentException('non-nullable pub_key cannot be null');
}
$this->container['pub_key'] = $pub_key;
return $this;
}
/**
* Gets timestamp
*
* @return int|null
*/
public function getTimestamp(): ?int
{
return $this->container['timestamp'];
}
/**
* Sets timestamp
*
* @param int|null $timestamp timestamp
*
* @return $this
*/
public function setTimestamp(?int $timestamp): static
{
if (is_null($timestamp)) {
throw new InvalidArgumentException('non-nullable timestamp cannot be null');
}
$this->container['timestamp'] = $timestamp;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,475 @@
<?php
/**
* TransactionExtraModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* TransactionExtraModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionExtraModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionExtraModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'type' => 'string',
'short_view' => 'string',
'details_view' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'type' => null,
'short_view' => null,
'details_view' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'type' => false,
'short_view' => false,
'details_view' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'type' => 'type',
'short_view' => 'short_view',
'details_view' => 'details_view'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'type' => 'setType',
'short_view' => 'setShortView',
'details_view' => 'setDetailsView'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'type' => 'getType',
'short_view' => 'getShortView',
'details_view' => 'getDetailsView'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('type', $data ?? [], null);
$this->setIfExists('short_view', $data ?? [], null);
$this->setIfExists('details_view', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets type
*
* @return string|null
*/
public function getType(): ?string
{
return $this->container['type'];
}
/**
* Sets type
*
* @param string|null $type type
*
* @return $this
*/
public function setType(?string $type): static
{
if (is_null($type)) {
throw new InvalidArgumentException('non-nullable type cannot be null');
}
$this->container['type'] = $type;
return $this;
}
/**
* Gets short_view
*
* @return string|null
*/
public function getShortView(): ?string
{
return $this->container['short_view'];
}
/**
* Sets short_view
*
* @param string|null $short_view short_view
*
* @return $this
*/
public function setShortView(?string $short_view): static
{
if (is_null($short_view)) {
throw new InvalidArgumentException('non-nullable short_view cannot be null');
}
$this->container['short_view'] = $short_view;
return $this;
}
/**
* Gets details_view
*
* @return string|null
*/
public function getDetailsView(): ?string
{
return $this->container['details_view'];
}
/**
* Sets details_view
*
* @param string|null $details_view details_view
*
* @return $this
*/
public function setDetailsView(?string $details_view): static
{
if (is_null($details_view)) {
throw new InvalidArgumentException('non-nullable details_view cannot be null');
}
$this->container['details_view'] = $details_view;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,559 @@
<?php
/**
* TransactionInputModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* TransactionInputModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionInputModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionInputModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'global_indexes' => 'int[]',
'htlc_origin' => 'string',
'kimage_or_ms_id' => 'string',
'multisig_count' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'global_indexes' => null,
'htlc_origin' => null,
'kimage_or_ms_id' => null,
'multisig_count' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'global_indexes' => false,
'htlc_origin' => false,
'kimage_or_ms_id' => false,
'multisig_count' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'global_indexes' => 'global_indexes',
'htlc_origin' => 'htlc_origin',
'kimage_or_ms_id' => 'kimage_or_ms_id',
'multisig_count' => 'multisig_count'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'global_indexes' => 'setGlobalIndexes',
'htlc_origin' => 'setHtlcOrigin',
'kimage_or_ms_id' => 'setKimageOrMsId',
'multisig_count' => 'setMultisigCount'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'global_indexes' => 'getGlobalIndexes',
'htlc_origin' => 'getHtlcOrigin',
'kimage_or_ms_id' => 'getKimageOrMsId',
'multisig_count' => 'getMultisigCount'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('global_indexes', $data ?? [], null);
$this->setIfExists('htlc_origin', $data ?? [], null);
$this->setIfExists('kimage_or_ms_id', $data ?? [], null);
$this->setIfExists('multisig_count', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
if (!is_null($this->container['multisig_count']) && ($this->container['multisig_count'] > 4294967295)) {
$invalidProperties[] = "invalid value for 'multisig_count', must be smaller than or equal to 4294967295.";
}
if (!is_null($this->container['multisig_count']) && ($this->container['multisig_count'] < 0)) {
$invalidProperties[] = "invalid value for 'multisig_count', must be bigger than or equal to 0.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets global_indexes
*
* @return int[]|null
*/
public function getGlobalIndexes(): ?array
{
return $this->container['global_indexes'];
}
/**
* Sets global_indexes
*
* @param int[]|null $global_indexes global_indexes
*
* @return $this
*/
public function setGlobalIndexes(?array $global_indexes): static
{
if (is_null($global_indexes)) {
throw new InvalidArgumentException('non-nullable global_indexes cannot be null');
}
$this->container['global_indexes'] = $global_indexes;
return $this;
}
/**
* Gets htlc_origin
*
* @return string|null
*/
public function getHtlcOrigin(): ?string
{
return $this->container['htlc_origin'];
}
/**
* Sets htlc_origin
*
* @param string|null $htlc_origin htlc_origin
*
* @return $this
*/
public function setHtlcOrigin(?string $htlc_origin): static
{
if (is_null($htlc_origin)) {
throw new InvalidArgumentException('non-nullable htlc_origin cannot be null');
}
$this->container['htlc_origin'] = $htlc_origin;
return $this;
}
/**
* Gets kimage_or_ms_id
*
* @return string|null
*/
public function getKimageOrMsId(): ?string
{
return $this->container['kimage_or_ms_id'];
}
/**
* Sets kimage_or_ms_id
*
* @param string|null $kimage_or_ms_id kimage_or_ms_id
*
* @return $this
*/
public function setKimageOrMsId(?string $kimage_or_ms_id): static
{
if (is_null($kimage_or_ms_id)) {
throw new InvalidArgumentException('non-nullable kimage_or_ms_id cannot be null');
}
$this->container['kimage_or_ms_id'] = $kimage_or_ms_id;
return $this;
}
/**
* Gets multisig_count
*
* @return int|null
*/
public function getMultisigCount(): ?int
{
return $this->container['multisig_count'];
}
/**
* Sets multisig_count
*
* @param int|null $multisig_count multisig_count
*
* @return $this
*/
public function setMultisigCount(?int $multisig_count): static
{
if (is_null($multisig_count)) {
throw new InvalidArgumentException('non-nullable multisig_count cannot be null');
}
if (($multisig_count > 4294967295)) {
throw new InvalidArgumentException('invalid value for $multisig_count when calling TransactionInputModel., must be smaller than or equal to 4294967295.');
}
if (($multisig_count < 0)) {
throw new InvalidArgumentException('invalid value for $multisig_count when calling TransactionInputModel., must be bigger than or equal to 0.');
}
$this->container['multisig_count'] = $multisig_count;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View file

@ -0,0 +1,559 @@
<?php
/**
* TransactionOutputModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* TransactionOutputModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TransactionOutputModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TransactionOutputModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'amount' => 'int',
'global_index' => 'int',
'is_spent' => 'bool',
'minimum_sigs' => 'int',
'pub_keys' => 'string[]'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'amount' => null,
'global_index' => null,
'is_spent' => null,
'minimum_sigs' => null,
'pub_keys' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'amount' => false,
'global_index' => false,
'is_spent' => false,
'minimum_sigs' => false,
'pub_keys' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'amount' => 'amount',
'global_index' => 'global_index',
'is_spent' => 'is_spent',
'minimum_sigs' => 'minimum_sigs',
'pub_keys' => 'pub_keys'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'amount' => 'setAmount',
'global_index' => 'setGlobalIndex',
'is_spent' => 'setIsSpent',
'minimum_sigs' => 'setMinimumSigs',
'pub_keys' => 'setPubKeys'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'amount' => 'getAmount',
'global_index' => 'getGlobalIndex',
'is_spent' => 'getIsSpent',
'minimum_sigs' => 'getMinimumSigs',
'pub_keys' => 'getPubKeys'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('amount', $data ?? [], null);
$this->setIfExists('global_index', $data ?? [], null);
$this->setIfExists('is_spent', $data ?? [], null);
$this->setIfExists('minimum_sigs', $data ?? [], null);
$this->setIfExists('pub_keys', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
if (!is_null($this->container['minimum_sigs']) && ($this->container['minimum_sigs'] > 4294967295)) {
$invalidProperties[] = "invalid value for 'minimum_sigs', must be smaller than or equal to 4294967295.";
}
if (!is_null($this->container['minimum_sigs']) && ($this->container['minimum_sigs'] < 0)) {
$invalidProperties[] = "invalid value for 'minimum_sigs', must be bigger than or equal to 0.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets amount
*
* @return int|null
*/
public function getAmount(): ?int
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param int|null $amount amount
*
* @return $this
*/
public function setAmount(?int $amount): static
{
if (is_null($amount)) {
throw new InvalidArgumentException('non-nullable amount cannot be null');
}
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets global_index
*
* @return int|null
*/
public function getGlobalIndex(): ?int
{
return $this->container['global_index'];
}
/**
* Sets global_index
*
* @param int|null $global_index global_index
*
* @return $this
*/
public function setGlobalIndex(?int $global_index): static
{
if (is_null($global_index)) {
throw new InvalidArgumentException('non-nullable global_index cannot be null');
}
$this->container['global_index'] = $global_index;
return $this;
}
/**
* Gets is_spent
*
* @return bool|null
*/
public function getIsSpent(): ?bool
{
return $this->container['is_spent'];
}
/**
* Sets is_spent
*
* @param bool|null $is_spent is_spent
*
* @return $this
*/
public function setIsSpent(?bool $is_spent): static
{
if (is_null($is_spent)) {
throw new InvalidArgumentException('non-nullable is_spent cannot be null');
}
$this->container['is_spent'] = $is_spent;
return $this;
}
/**
* Gets minimum_sigs
*
* @return int|null
*/
public function getMinimumSigs(): ?int
{
return $this->container['minimum_sigs'];
}
/**
* Sets minimum_sigs
*
* @param int|null $minimum_sigs minimum_sigs
*
* @return $this
*/
public function setMinimumSigs(?int $minimum_sigs): static
{
if (is_null($minimum_sigs)) {
throw new InvalidArgumentException('non-nullable minimum_sigs cannot be null');
}
if (($minimum_sigs > 4294967295)) {
throw new InvalidArgumentException('invalid value for $minimum_sigs when calling TransactionOutputModel., must be smaller than or equal to 4294967295.');
}
if (($minimum_sigs < 0)) {
throw new InvalidArgumentException('invalid value for $minimum_sigs when calling TransactionOutputModel., must be bigger than or equal to 0.');
}
$this->container['minimum_sigs'] = $minimum_sigs;
return $this;
}
/**
* Gets pub_keys
*
* @return string[]|null
*/
public function getPubKeys(): ?array
{
return $this->container['pub_keys'];
}
/**
* Sets pub_keys
*
* @param string[]|null $pub_keys pub_keys
*
* @return $this
*/
public function setPubKeys(?array $pub_keys): static
{
if (is_null($pub_keys)) {
throw new InvalidArgumentException('non-nullable pub_keys cannot be null');
}
$this->container['pub_keys'] = $pub_keys;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,747 @@
<?php
/**
* TxPoolPerformanceModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* TxPoolPerformanceModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TxPoolPerformanceModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'TxPoolPerformanceModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'tx_processing_time' => 'int',
'check_inputs_types_supported_time' => 'int',
'expiration_validate_time' => 'int',
'validate_amount_time' => 'int',
'validate_alias_time' => 'int',
'check_keyimages_ws_ms_time' => 'int',
'check_inputs_time' => 'int',
'begin_tx_time' => 'int',
'update_db_time' => 'int',
'db_commit_time' => 'int',
'check_post_hf4_balance' => 'int'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'tx_processing_time' => null,
'check_inputs_types_supported_time' => null,
'expiration_validate_time' => null,
'validate_amount_time' => null,
'validate_alias_time' => null,
'check_keyimages_ws_ms_time' => null,
'check_inputs_time' => null,
'begin_tx_time' => null,
'update_db_time' => null,
'db_commit_time' => null,
'check_post_hf4_balance' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'tx_processing_time' => false,
'check_inputs_types_supported_time' => false,
'expiration_validate_time' => false,
'validate_amount_time' => false,
'validate_alias_time' => false,
'check_keyimages_ws_ms_time' => false,
'check_inputs_time' => false,
'begin_tx_time' => false,
'update_db_time' => false,
'db_commit_time' => false,
'check_post_hf4_balance' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'tx_processing_time' => 'tx_processing_time',
'check_inputs_types_supported_time' => 'check_inputs_types_supported_time',
'expiration_validate_time' => 'expiration_validate_time',
'validate_amount_time' => 'validate_amount_time',
'validate_alias_time' => 'validate_alias_time',
'check_keyimages_ws_ms_time' => 'check_keyimages_ws_ms_time',
'check_inputs_time' => 'check_inputs_time',
'begin_tx_time' => 'begin_tx_time',
'update_db_time' => 'update_db_time',
'db_commit_time' => 'db_commit_time',
'check_post_hf4_balance' => 'check_post_hf4_balance'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'tx_processing_time' => 'setTxProcessingTime',
'check_inputs_types_supported_time' => 'setCheckInputsTypesSupportedTime',
'expiration_validate_time' => 'setExpirationValidateTime',
'validate_amount_time' => 'setValidateAmountTime',
'validate_alias_time' => 'setValidateAliasTime',
'check_keyimages_ws_ms_time' => 'setCheckKeyimagesWsMsTime',
'check_inputs_time' => 'setCheckInputsTime',
'begin_tx_time' => 'setBeginTxTime',
'update_db_time' => 'setUpdateDbTime',
'db_commit_time' => 'setDbCommitTime',
'check_post_hf4_balance' => 'setCheckPostHf4Balance'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'tx_processing_time' => 'getTxProcessingTime',
'check_inputs_types_supported_time' => 'getCheckInputsTypesSupportedTime',
'expiration_validate_time' => 'getExpirationValidateTime',
'validate_amount_time' => 'getValidateAmountTime',
'validate_alias_time' => 'getValidateAliasTime',
'check_keyimages_ws_ms_time' => 'getCheckKeyimagesWsMsTime',
'check_inputs_time' => 'getCheckInputsTime',
'begin_tx_time' => 'getBeginTxTime',
'update_db_time' => 'getUpdateDbTime',
'db_commit_time' => 'getDbCommitTime',
'check_post_hf4_balance' => 'getCheckPostHf4Balance'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('tx_processing_time', $data ?? [], null);
$this->setIfExists('check_inputs_types_supported_time', $data ?? [], null);
$this->setIfExists('expiration_validate_time', $data ?? [], null);
$this->setIfExists('validate_amount_time', $data ?? [], null);
$this->setIfExists('validate_alias_time', $data ?? [], null);
$this->setIfExists('check_keyimages_ws_ms_time', $data ?? [], null);
$this->setIfExists('check_inputs_time', $data ?? [], null);
$this->setIfExists('begin_tx_time', $data ?? [], null);
$this->setIfExists('update_db_time', $data ?? [], null);
$this->setIfExists('db_commit_time', $data ?? [], null);
$this->setIfExists('check_post_hf4_balance', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets tx_processing_time
*
* @return int|null
*/
public function getTxProcessingTime(): ?int
{
return $this->container['tx_processing_time'];
}
/**
* Sets tx_processing_time
*
* @param int|null $tx_processing_time tx_processing_time
*
* @return $this
*/
public function setTxProcessingTime(?int $tx_processing_time): static
{
if (is_null($tx_processing_time)) {
throw new InvalidArgumentException('non-nullable tx_processing_time cannot be null');
}
$this->container['tx_processing_time'] = $tx_processing_time;
return $this;
}
/**
* Gets check_inputs_types_supported_time
*
* @return int|null
*/
public function getCheckInputsTypesSupportedTime(): ?int
{
return $this->container['check_inputs_types_supported_time'];
}
/**
* Sets check_inputs_types_supported_time
*
* @param int|null $check_inputs_types_supported_time check_inputs_types_supported_time
*
* @return $this
*/
public function setCheckInputsTypesSupportedTime(?int $check_inputs_types_supported_time): static
{
if (is_null($check_inputs_types_supported_time)) {
throw new InvalidArgumentException('non-nullable check_inputs_types_supported_time cannot be null');
}
$this->container['check_inputs_types_supported_time'] = $check_inputs_types_supported_time;
return $this;
}
/**
* Gets expiration_validate_time
*
* @return int|null
*/
public function getExpirationValidateTime(): ?int
{
return $this->container['expiration_validate_time'];
}
/**
* Sets expiration_validate_time
*
* @param int|null $expiration_validate_time expiration_validate_time
*
* @return $this
*/
public function setExpirationValidateTime(?int $expiration_validate_time): static
{
if (is_null($expiration_validate_time)) {
throw new InvalidArgumentException('non-nullable expiration_validate_time cannot be null');
}
$this->container['expiration_validate_time'] = $expiration_validate_time;
return $this;
}
/**
* Gets validate_amount_time
*
* @return int|null
*/
public function getValidateAmountTime(): ?int
{
return $this->container['validate_amount_time'];
}
/**
* Sets validate_amount_time
*
* @param int|null $validate_amount_time validate_amount_time
*
* @return $this
*/
public function setValidateAmountTime(?int $validate_amount_time): static
{
if (is_null($validate_amount_time)) {
throw new InvalidArgumentException('non-nullable validate_amount_time cannot be null');
}
$this->container['validate_amount_time'] = $validate_amount_time;
return $this;
}
/**
* Gets validate_alias_time
*
* @return int|null
*/
public function getValidateAliasTime(): ?int
{
return $this->container['validate_alias_time'];
}
/**
* Sets validate_alias_time
*
* @param int|null $validate_alias_time validate_alias_time
*
* @return $this
*/
public function setValidateAliasTime(?int $validate_alias_time): static
{
if (is_null($validate_alias_time)) {
throw new InvalidArgumentException('non-nullable validate_alias_time cannot be null');
}
$this->container['validate_alias_time'] = $validate_alias_time;
return $this;
}
/**
* Gets check_keyimages_ws_ms_time
*
* @return int|null
*/
public function getCheckKeyimagesWsMsTime(): ?int
{
return $this->container['check_keyimages_ws_ms_time'];
}
/**
* Sets check_keyimages_ws_ms_time
*
* @param int|null $check_keyimages_ws_ms_time check_keyimages_ws_ms_time
*
* @return $this
*/
public function setCheckKeyimagesWsMsTime(?int $check_keyimages_ws_ms_time): static
{
if (is_null($check_keyimages_ws_ms_time)) {
throw new InvalidArgumentException('non-nullable check_keyimages_ws_ms_time cannot be null');
}
$this->container['check_keyimages_ws_ms_time'] = $check_keyimages_ws_ms_time;
return $this;
}
/**
* Gets check_inputs_time
*
* @return int|null
*/
public function getCheckInputsTime(): ?int
{
return $this->container['check_inputs_time'];
}
/**
* Sets check_inputs_time
*
* @param int|null $check_inputs_time check_inputs_time
*
* @return $this
*/
public function setCheckInputsTime(?int $check_inputs_time): static
{
if (is_null($check_inputs_time)) {
throw new InvalidArgumentException('non-nullable check_inputs_time cannot be null');
}
$this->container['check_inputs_time'] = $check_inputs_time;
return $this;
}
/**
* Gets begin_tx_time
*
* @return int|null
*/
public function getBeginTxTime(): ?int
{
return $this->container['begin_tx_time'];
}
/**
* Sets begin_tx_time
*
* @param int|null $begin_tx_time begin_tx_time
*
* @return $this
*/
public function setBeginTxTime(?int $begin_tx_time): static
{
if (is_null($begin_tx_time)) {
throw new InvalidArgumentException('non-nullable begin_tx_time cannot be null');
}
$this->container['begin_tx_time'] = $begin_tx_time;
return $this;
}
/**
* Gets update_db_time
*
* @return int|null
*/
public function getUpdateDbTime(): ?int
{
return $this->container['update_db_time'];
}
/**
* Sets update_db_time
*
* @param int|null $update_db_time update_db_time
*
* @return $this
*/
public function setUpdateDbTime(?int $update_db_time): static
{
if (is_null($update_db_time)) {
throw new InvalidArgumentException('non-nullable update_db_time cannot be null');
}
$this->container['update_db_time'] = $update_db_time;
return $this;
}
/**
* Gets db_commit_time
*
* @return int|null
*/
public function getDbCommitTime(): ?int
{
return $this->container['db_commit_time'];
}
/**
* Sets db_commit_time
*
* @param int|null $db_commit_time db_commit_time
*
* @return $this
*/
public function setDbCommitTime(?int $db_commit_time): static
{
if (is_null($db_commit_time)) {
throw new InvalidArgumentException('non-nullable db_commit_time cannot be null');
}
$this->container['db_commit_time'] = $db_commit_time;
return $this;
}
/**
* Gets check_post_hf4_balance
*
* @return int|null
*/
public function getCheckPostHf4Balance(): ?int
{
return $this->container['check_post_hf4_balance'];
}
/**
* Sets check_post_hf4_balance
*
* @param int|null $check_post_hf4_balance check_post_hf4_balance
*
* @return $this
*/
public function setCheckPostHf4Balance(?int $check_post_hf4_balance): static
{
if (is_null($check_post_hf4_balance)) {
throw new InvalidArgumentException('non-nullable check_post_hf4_balance cannot be null');
}
$this->container['check_post_hf4_balance'] = $check_post_hf4_balance;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

File diff suppressed because it is too large Load diff

543
utils/sdk/client/php/src/VersionModel.php generated Normal file
View file

@ -0,0 +1,543 @@
<?php
/**
* VersionModel
*
* PHP version 8.1
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace lthn\lthn;
use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;
/**
* VersionModel Class Doc Comment
*
* @package lthn
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class VersionModel implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'VersionModel';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'version' => 'string',
'version_long' => 'string',
'major' => 'string',
'minor' => 'string',
'revision' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'version' => null,
'version_long' => null,
'major' => null,
'minor' => null,
'revision' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'version' => false,
'version_long' => false,
'major' => false,
'minor' => false,
'revision' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'version' => 'version',
'version_long' => 'version_long',
'major' => 'major',
'minor' => 'minor',
'revision' => 'revision'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'version' => 'setVersion',
'version_long' => 'setVersionLong',
'major' => 'setMajor',
'minor' => 'setMinor',
'revision' => 'setRevision'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'version' => 'getVersion',
'version_long' => 'getVersionLong',
'major' => 'getMajor',
'minor' => 'getMinor',
'revision' => 'getRevision'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('version', $data ?? [], null);
$this->setIfExists('version_long', $data ?? [], null);
$this->setIfExists('major', $data ?? [], null);
$this->setIfExists('minor', $data ?? [], null);
$this->setIfExists('revision', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets version
*
* @return string|null
*/
public function getVersion(): ?string
{
return $this->container['version'];
}
/**
* Sets version
*
* @param string|null $version version
*
* @return $this
*/
public function setVersion(?string $version): static
{
if (is_null($version)) {
throw new InvalidArgumentException('non-nullable version cannot be null');
}
$this->container['version'] = $version;
return $this;
}
/**
* Gets version_long
*
* @return string|null
*/
public function getVersionLong(): ?string
{
return $this->container['version_long'];
}
/**
* Sets version_long
*
* @param string|null $version_long version_long
*
* @return $this
*/
public function setVersionLong(?string $version_long): static
{
if (is_null($version_long)) {
throw new InvalidArgumentException('non-nullable version_long cannot be null');
}
$this->container['version_long'] = $version_long;
return $this;
}
/**
* Gets major
*
* @return string|null
*/
public function getMajor(): ?string
{
return $this->container['major'];
}
/**
* Sets major
*
* @param string|null $major major
*
* @return $this
*/
public function setMajor(?string $major): static
{
if (is_null($major)) {
throw new InvalidArgumentException('non-nullable major cannot be null');
}
$this->container['major'] = $major;
return $this;
}
/**
* Gets minor
*
* @return string|null
*/
public function getMinor(): ?string
{
return $this->container['minor'];
}
/**
* Sets minor
*
* @param string|null $minor minor
*
* @return $this
*/
public function setMinor(?string $minor): static
{
if (is_null($minor)) {
throw new InvalidArgumentException('non-nullable minor cannot be null');
}
$this->container['minor'] = $minor;
return $this;
}
/**
* Gets revision
*
* @return string|null
*/
public function getRevision(): ?string
{
return $this->container['revision'];
}
/**
* Sets revision
*
* @param string|null $revision revision
*
* @return $this
*/
public function setRevision(?string $revision): static
{
if (is_null($revision)) {
throw new InvalidArgumentException('non-nullable revision cannot be null');
}
$this->container['revision'] = $revision;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

1549
utils/sdk/client/php/src/lthn/BlockApi.php generated Normal file

File diff suppressed because it is too large Load diff

722
utils/sdk/client/php/src/lthn/InfoApi.php generated Normal file
View file

@ -0,0 +1,722 @@
<?php
/**
* InfoApi
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\lthn;
use InvalidArgumentException;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\MultipartStream;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use OpenAPI\Client\ApiException;
use OpenAPI\Client\Configuration;
use OpenAPI\Client\HeaderSelector;
use OpenAPI\Client\FormDataProcessor;
use OpenAPI\Client\ObjectSerializer;
/**
* InfoApi Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class InfoApi
{
/**
* @var ClientInterface
*/
protected ClientInterface $client;
/**
* @var Configuration
*/
protected Configuration $config;
/**
* @var HeaderSelector
*/
protected HeaderSelector $headerSelector;
/**
* @var int Host index
*/
protected int $hostIndex;
/** @var string[] $contentTypes **/
public const contentTypes = [
'getInfo' => [
'application/json',
],
'version' => [
'application/json',
],
];
/**
* @param ClientInterface|null $client
* @param Configuration|null $config
* @param HeaderSelector|null $selector
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
/**
* Set the host index
*
* @param int $hostIndex Host index (required)
*/
public function setHostIndex(int $hostIndex): void
{
$this->hostIndex = $hostIndex;
}
/**
* Get the host index
*
* @return int Host index
*/
public function getHostIndex(): int
{
return $this->hostIndex;
}
/**
* @return Configuration
*/
public function getConfig(): Configuration
{
return $this->config;
}
/**
* Operation getInfo
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return \OpenAPI\Client\Model\InfoModel
*/
public function getInfo(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): \OpenAPI\Client\Model\InfoModel
{
list($response) = $this->getInfoWithHttpInfo($flags, $contentType);
return $response;
}
/**
* Operation getInfoWithHttpInfo
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \OpenAPI\Client\Model\InfoModel, HTTP status code, HTTP response headers (array of strings)
*/
public function getInfoWithHttpInfo(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): array
{
$request = $this->getInfoRequest($flags, $contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
switch($statusCode) {
case 200:
return $this->handleResponseWithDataType(
'\OpenAPI\Client\Model\InfoModel',
$request,
$response,
);
}
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return $this->handleResponseWithDataType(
'\OpenAPI\Client\Model\InfoModel',
$request,
$response,
);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\OpenAPI\Client\Model\InfoModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
}
throw $e;
}
}
/**
* Operation getInfoAsync
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function getInfoAsync(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): PromiseInterface
{
return $this->getInfoAsyncWithHttpInfo($flags, $contentType)
->then(
function ($response) {
return $response[0];
}
);
}
/**
* Operation getInfoAsyncWithHttpInfo
*
* Get detailed information about the blockchain and daemon state
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function getInfoAsyncWithHttpInfo(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): PromiseInterface
{
$returnType = '\OpenAPI\Client\Model\InfoModel';
$request = $this->getInfoRequest($flags, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
}
/**
* Create request for operation 'getInfo'
*
* @param string|null $flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function getInfoRequest(
?string $flags = null,
string $contentType = self::contentTypes['getInfo'][0]
): Request
{
$resourcePath = '/info';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$flags,
'flags', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? []);
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
$multipart
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
* Operation version
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return \OpenAPI\Client\Model\VersionModel
*/
public function version(
string $contentType = self::contentTypes['version'][0]
): \OpenAPI\Client\Model\VersionModel
{
list($response) = $this->versionWithHttpInfo($contentType);
return $response;
}
/**
* Operation versionWithHttpInfo
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \OpenAPI\Client\Model\VersionModel, HTTP status code, HTTP response headers (array of strings)
*/
public function versionWithHttpInfo(
string $contentType = self::contentTypes['version'][0]
): array
{
$request = $this->versionRequest($contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
switch($statusCode) {
case 200:
return $this->handleResponseWithDataType(
'\OpenAPI\Client\Model\VersionModel',
$request,
$response,
);
}
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return $this->handleResponseWithDataType(
'\OpenAPI\Client\Model\VersionModel',
$request,
$response,
);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\OpenAPI\Client\Model\VersionModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
}
throw $e;
}
}
/**
* Operation versionAsync
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function versionAsync(
string $contentType = self::contentTypes['version'][0]
): PromiseInterface
{
return $this->versionAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
}
);
}
/**
* Operation versionAsyncWithHttpInfo
*
* Get API version
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function versionAsyncWithHttpInfo(
string $contentType = self::contentTypes['version'][0]
): PromiseInterface
{
$returnType = '\OpenAPI\Client\Model\VersionModel';
$request = $this->versionRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
}
/**
* Create request for operation 'version'
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['version'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function versionRequest(
string $contentType = self::contentTypes['version'][0]
): Request
{
$resourcePath = '/info/version';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
$multipart
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
* Create http client option
*
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
if (!$options[RequestOptions::DEBUG]) {
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
}
}
return $options;
}
private function handleResponseWithDataType(
string $dataType,
RequestInterface $request,
ResponseInterface $response,
): array {
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($dataType !== 'string') {
try {
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
throw new ApiException(
sprintf(
'Error JSON decoding server response (%s)',
$request->getUri()
),
$response->getStatusCode(),
$response->getHeaders(),
$content
);
}
}
}
return [
ObjectSerializer::deserialize($content, $dataType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
private function responseWithinRangeCode(
string $rangeCode,
int $statusCode,
): bool {
$left = (int) ($rangeCode[0].'00');
$right = (int) ($rangeCode[0].'99');
return $statusCode >= $left && $statusCode <= $right;
}
}

View file

@ -0,0 +1,131 @@
<?php
/**
* BlockApiTest
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the endpoint.
*/
namespace OpenAPI\Client\Test\Api;
use OpenAPI\Client\Configuration;
use OpenAPI\Client\ApiException;
use OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;
/**
* BlockApiTest Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class BlockApiTest extends TestCase
{
/**
* Setup before running any test cases
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test case for createBlockTemplate
*
* Create a block template for mining.
*
*/
public function testCreateBlockTemplate()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test case for getBlock
*
* Get a block by its hash or height (ID).
*
*/
public function testGetBlock()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test case for getBlocks
*
* Get one or more blocks, with optional pagination..
*
*/
public function testGetBlocks()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test case for getHeight
*
* Get the current blockchain height.
*
*/
public function testGetHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test case for submitBlock
*
* Submit a new block to the network.
*
*/
public function testSubmitBlock()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,95 @@
<?php
/**
* InfoApiTest
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the endpoint.
*/
namespace OpenAPI\Client\Test\Api;
use OpenAPI\Client\Configuration;
use OpenAPI\Client\ApiException;
use OpenAPI\Client\ObjectSerializer;
use PHPUnit\Framework\TestCase;
/**
* InfoApiTest Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class InfoApiTest extends TestCase
{
/**
* Setup before running any test cases
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test case for getInfo
*
* Get detailed information about the blockchain and daemon state.
*
*/
public function testGetInfo()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test case for version
*
* Get API version.
*
*/
public function testVersion()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,304 @@
<?php
/**
* BlockDetailsModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* BlockDetailsModelTest Class Doc Comment
*
* @description BlockDetailsModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class BlockDetailsModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "BlockDetailsModel"
*/
public function testBlockDetailsModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "actual_timestamp"
*/
public function testPropertyActualTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "already_generated_coins"
*/
public function testPropertyAlreadyGeneratedCoins()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "base_reward"
*/
public function testPropertyBaseReward()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "blob"
*/
public function testPropertyBlob()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_cumulative_size"
*/
public function testPropertyBlockCumulativeSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_tself_size"
*/
public function testPropertyBlockTselfSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "cumulative_diff_adjusted"
*/
public function testPropertyCumulativeDiffAdjusted()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "cumulative_diff_precise"
*/
public function testPropertyCumulativeDiffPrecise()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "difficulty"
*/
public function testPropertyDifficulty()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "effective_fee_median"
*/
public function testPropertyEffectiveFeeMedian()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "height"
*/
public function testPropertyHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "id"
*/
public function testPropertyId()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "is_orphan"
*/
public function testPropertyIsOrphan()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "miner_text_info"
*/
public function testPropertyMinerTextInfo()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "object_in_json"
*/
public function testPropertyObjectInJson()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "penalty"
*/
public function testPropertyPenalty()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pow_seed"
*/
public function testPropertyPowSeed()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "prev_id"
*/
public function testPropertyPrevId()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "summary_reward"
*/
public function testPropertySummaryReward()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "this_block_fee_median"
*/
public function testPropertyThisBlockFeeMedian()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "timestamp"
*/
public function testPropertyTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "total_fee"
*/
public function testPropertyTotalFee()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "total_txs_size"
*/
public function testPropertyTotalTxsSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "transactions_details"
*/
public function testPropertyTransactionsDetails()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "type"
*/
public function testPropertyType()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,223 @@
<?php
/**
* BlockProcessingPerformanceModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* BlockProcessingPerformanceModelTest Class Doc Comment
*
* @description BlockProcessingPerformanceModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class BlockProcessingPerformanceModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "BlockProcessingPerformanceModel"
*/
public function testBlockProcessingPerformanceModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_processing_time_0"
*/
public function testPropertyBlockProcessingTime0()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_processing_time_1"
*/
public function testPropertyBlockProcessingTime1()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "target_calculating_time_2"
*/
public function testPropertyTargetCalculatingTime2()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "longhash_calculating_time_3"
*/
public function testPropertyLonghashCalculatingTime3()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "all_txs_insert_time_5"
*/
public function testPropertyAllTxsInsertTime5()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "etc_stuff_6"
*/
public function testPropertyEtcStuff6()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "insert_time_4"
*/
public function testPropertyInsertTime4()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "raise_block_core_event"
*/
public function testPropertyRaiseBlockCoreEvent()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "validate_miner_transaction_time"
*/
public function testPropertyValidateMinerTransactionTime()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "collect_rangeproofs_data_from_tx_time"
*/
public function testPropertyCollectRangeproofsDataFromTxTime()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "verify_multiple_zc_outs_range_proofs_time"
*/
public function testPropertyVerifyMultipleZcOutsRangeProofsTime()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "target_calculating_enum_blocks"
*/
public function testPropertyTargetCalculatingEnumBlocks()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "target_calculating_calc"
*/
public function testPropertyTargetCalculatingCalc()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_validate_ki_search"
*/
public function testPropertyPosValidateKiSearch()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_validate_get_out_keys_for_inputs"
*/
public function testPropertyPosValidateGetOutKeysForInputs()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_validate_zvp"
*/
public function testPropertyPosValidateZvp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,160 @@
<?php
/**
* BlockTemplateModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* BlockTemplateModelTest Class Doc Comment
*
* @description BlockTemplateModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class BlockTemplateModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "BlockTemplateModel"
*/
public function testBlockTemplateModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "blocktemplate_blob"
*/
public function testPropertyBlocktemplateBlob()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "difficulty"
*/
public function testPropertyDifficulty()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "height"
*/
public function testPropertyHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "miner_tx_tgc"
*/
public function testPropertyMinerTxTgc()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_reward_without_fee"
*/
public function testPropertyBlockRewardWithoutFee()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_reward"
*/
public function testPropertyBlockReward()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "txs_fee"
*/
public function testPropertyTxsFee()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "prev_hash"
*/
public function testPropertyPrevHash()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "seed"
*/
public function testPropertySeed()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,142 @@
<?php
/**
* BlockTemplateRequestModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* BlockTemplateRequestModelTest Class Doc Comment
*
* @description BlockTemplateRequestModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class BlockTemplateRequestModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "BlockTemplateRequestModel"
*/
public function testBlockTemplateRequestModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "miner_address"
*/
public function testPropertyMinerAddress()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "stakeholder_address"
*/
public function testPropertyStakeholderAddress()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "ex_nonce"
*/
public function testPropertyExNonce()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_block"
*/
public function testPropertyPosBlock()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "ignore_pow_ts_check"
*/
public function testPropertyIgnorePowTsCheck()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pe"
*/
public function testPropertyPe()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "explicit_txs"
*/
public function testPropertyExplicitTxs()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,106 @@
<?php
/**
* DbStatInfoModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* DbStatInfoModelTest Class Doc Comment
*
* @description DbStatInfoModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class DbStatInfoModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "DbStatInfoModel"
*/
public function testDbStatInfoModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_count"
*/
public function testPropertyTxCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "write_tx_count"
*/
public function testPropertyWriteTxCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "map_size"
*/
public function testPropertyMapSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,88 @@
<?php
/**
* HeightModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* HeightModelTest Class Doc Comment
*
* @description HeightModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class HeightModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "HeightModel"
*/
public function testHeightModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "height"
*/
public function testPropertyHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,493 @@
<?php
/**
* InfoModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* InfoModelTest Class Doc Comment
*
* @description InfoModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class InfoModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "InfoModel"
*/
public function testInfoModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "height"
*/
public function testPropertyHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_count"
*/
public function testPropertyTxCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_pool_size"
*/
public function testPropertyTxPoolSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "alt_blocks_count"
*/
public function testPropertyAltBlocksCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "outgoing_connections_count"
*/
public function testPropertyOutgoingConnectionsCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "incoming_connections_count"
*/
public function testPropertyIncomingConnectionsCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "synchronized_connections_count"
*/
public function testPropertySynchronizedConnectionsCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "white_peerlist_size"
*/
public function testPropertyWhitePeerlistSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "grey_peerlist_size"
*/
public function testPropertyGreyPeerlistSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "current_blocks_median"
*/
public function testPropertyCurrentBlocksMedian()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "alias_count"
*/
public function testPropertyAliasCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "current_max_allowed_block_size"
*/
public function testPropertyCurrentMaxAllowedBlockSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "daemon_network_state"
*/
public function testPropertyDaemonNetworkState()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "synchronization_start_height"
*/
public function testPropertySynchronizationStartHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "max_net_seen_height"
*/
public function testPropertyMaxNetSeenHeight()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "mi"
*/
public function testPropertyMi()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_allowed"
*/
public function testPropertyPosAllowed()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_difficulty"
*/
public function testPropertyPosDifficulty()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pow_difficulty"
*/
public function testPropertyPowDifficulty()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "default_fee"
*/
public function testPropertyDefaultFee()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "minimum_fee"
*/
public function testPropertyMinimumFee()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "is_hardfork_active"
*/
public function testPropertyIsHardforkActive()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "net_time_delta_median"
*/
public function testPropertyNetTimeDeltaMedian()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "current_network_hashrate_50"
*/
public function testPropertyCurrentNetworkHashrate50()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "current_network_hashrate_350"
*/
public function testPropertyCurrentNetworkHashrate350()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "seconds_for_10_blocks"
*/
public function testPropertySecondsFor10Blocks()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "seconds_for_30_blocks"
*/
public function testPropertySecondsFor30Blocks()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "transactions_cnt_per_day"
*/
public function testPropertyTransactionsCntPerDay()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "transactions_volume_per_day"
*/
public function testPropertyTransactionsVolumePerDay()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "last_pos_timestamp"
*/
public function testPropertyLastPosTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "last_pow_timestamp"
*/
public function testPropertyLastPowTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "total_coins"
*/
public function testPropertyTotalCoins()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "last_block_size"
*/
public function testPropertyLastBlockSize()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_count_in_last_block"
*/
public function testPropertyTxCountInLastBlock()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_sequence_factor"
*/
public function testPropertyPosSequenceFactor()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pow_sequence_factor"
*/
public function testPropertyPowSequenceFactor()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_reward"
*/
public function testPropertyBlockReward()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "last_block_total_reward"
*/
public function testPropertyLastBlockTotalReward()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_diff_total_coins_rate"
*/
public function testPropertyPosDiffTotalCoinsRate()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "last_block_timestamp"
*/
public function testPropertyLastBlockTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "last_block_hash"
*/
public function testPropertyLastBlockHash()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "pos_block_ts_shift_vs_actual"
*/
public function testPropertyPosBlockTsShiftVsActual()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "outs_stat"
*/
public function testPropertyOutsStat()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "performance_data"
*/
public function testPropertyPerformanceData()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "offers_count"
*/
public function testPropertyOffersCount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "expiration_median_timestamp"
*/
public function testPropertyExpirationMedianTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,124 @@
<?php
/**
* MaintainersInfoModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* MaintainersInfoModelTest Class Doc Comment
*
* @description MaintainersInfoModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class MaintainersInfoModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "MaintainersInfoModel"
*/
public function testMaintainersInfoModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "ver_major"
*/
public function testPropertyVerMajor()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "ver_minor"
*/
public function testPropertyVerMinor()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "ver_revision"
*/
public function testPropertyVerRevision()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "build_no"
*/
public function testPropertyBuildNo()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "mode"
*/
public function testPropertyMode()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,115 @@
<?php
/**
* PerformanceModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* PerformanceModelTest Class Doc Comment
*
* @description PerformanceModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class PerformanceModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "PerformanceModel"
*/
public function testPerformanceModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_processing"
*/
public function testPropertyBlockProcessing()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_processing"
*/
public function testPropertyTxProcessing()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_pool"
*/
public function testPropertyTxPool()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "db_stat_info"
*/
public function testPropertyDbStatInfo()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,151 @@
<?php
/**
* PosEntryModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* PosEntryModelTest Class Doc Comment
*
* @description PosEntryModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class PosEntryModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "PosEntryModel"
*/
public function testPosEntryModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "amount"
*/
public function testPropertyAmount()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "g_index"
*/
public function testPropertyGIndex()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "keyimage"
*/
public function testPropertyKeyimage()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_timestamp"
*/
public function testPropertyBlockTimestamp()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "stake_unlock_time"
*/
public function testPropertyStakeUnlockTime()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_id"
*/
public function testPropertyTxId()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "tx_out_index"
*/
public function testPropertyTxOutIndex()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "wallet_index"
*/
public function testPropertyWalletIndex()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,88 @@
<?php
/**
* SubmitBlockRequestModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* SubmitBlockRequestModelTest Class Doc Comment
*
* @description SubmitBlockRequestModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SubmitBlockRequestModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "SubmitBlockRequestModel"
*/
public function testSubmitBlockRequestModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "block_blob"
*/
public function testPropertyBlockBlob()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,88 @@
<?php
/**
* SubmitBlockResponseModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* SubmitBlockResponseModelTest Class Doc Comment
*
* @description SubmitBlockResponseModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SubmitBlockResponseModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "SubmitBlockResponseModel"
*/
public function testSubmitBlockResponseModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "status"
*/
public function testPropertyStatus()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View file

@ -0,0 +1,106 @@
<?php
/**
* TransactionAttachmentModelTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Lethean Blockchain API
*
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.16.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* TransactionAttachmentModelTest Class Doc Comment
*
* @description TransactionAttachmentModel
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class TransactionAttachmentModelTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "TransactionAttachmentModel"
*/
public function testTransactionAttachmentModel()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "type"
*/
public function testPropertyType()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "short_view"
*/
public function testPropertyShortView()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "details_view"
*/
public function testPropertyDetailsView()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

Some files were not shown because too many files have changed in this diff Show more