From ad6201cc619cf09f74f31389eb24fe208ea1ddc4 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Tue, 2 Jan 2024 19:41:30 +0100 Subject: [PATCH 1/4] feat: deprecate `IPLocation` --- README.md | 1 + docs/Model/DataCenter.md | 2 + docs/Model/DataCenterInfo.md | 10 + docs/Model/IPLocation.md | 2 + docs/Model/IpInfoResultV4.md | 1 + docs/Model/IpInfoResultV6.md | 1 + res/fingerprint-server-api.yaml | 28 ++- src/Model/DataCenter.php | 1 + src/Model/DataCenterInfo.php | 328 ++++++++++++++++++++++++++++++++ src/Model/IPLocation.php | 1 + src/Model/IpInfoResultV4.php | 30 +++ src/Model/IpInfoResultV6.php | 30 +++ test/mocks/get_event.json | 4 +- 13 files changed, 435 insertions(+), 4 deletions(-) create mode 100644 docs/Model/DataCenterInfo.md create mode 100644 src/Model/DataCenterInfo.php diff --git a/README.md b/README.md index b412e598..1c8eeeea 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ Class | Method | HTTP request | Description - [BrowserDetails](docs/Model/BrowserDetails.md) - [Confidence](docs/Model/Confidence.md) - [DataCenter](docs/Model/DataCenter.md) + - [DataCenterInfo](docs/Model/DataCenterInfo.md) - [ErrorEvent403Response](docs/Model/ErrorEvent403Response.md) - [ErrorEvent403ResponseError](docs/Model/ErrorEvent403ResponseError.md) - [ErrorEvent404Response](docs/Model/ErrorEvent404Response.md) diff --git a/docs/Model/DataCenter.md b/docs/Model/DataCenter.md index 048a90a2..01dbbf4d 100644 --- a/docs/Model/DataCenter.md +++ b/docs/Model/DataCenter.md @@ -1,4 +1,6 @@ # DataCenter +`dataCenter` is deprecated in favor of `datacenter` + ## Properties Name | Type | Description | Notes diff --git a/docs/Model/DataCenterInfo.md b/docs/Model/DataCenterInfo.md new file mode 100644 index 00000000..389f286c --- /dev/null +++ b/docs/Model/DataCenterInfo.md @@ -0,0 +1,10 @@ +# DataCenterInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | | +**name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/IPLocation.md b/docs/Model/IPLocation.md index b9ad6d10..80e4c881 100644 --- a/docs/Model/IPLocation.md +++ b/docs/Model/IPLocation.md @@ -1,4 +1,6 @@ # IPLocation +This field is **deprecated** and will not return a result for **accounts created after December 18th, 2023**. Please use the [`ipInfo` Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information. + ## Properties Name | Type | Description | Notes diff --git a/docs/Model/IpInfoResultV4.md b/docs/Model/IpInfoResultV4.md index 33d3658c..7b887be0 100644 --- a/docs/Model/IpInfoResultV4.md +++ b/docs/Model/IpInfoResultV4.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **address** | **string** | | [optional] **geolocation** | [**\Fingerprint\ServerAPI\Model\IPLocation**](IPLocation.md) | | [optional] **asn** | [**\Fingerprint\ServerAPI\Model\ASN**](ASN.md) | | [optional] +**datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenterInfo**](DataCenterInfo.md) | | [optional] **data_center** | [**\Fingerprint\ServerAPI\Model\DataCenter**](DataCenter.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IpInfoResultV6.md b/docs/Model/IpInfoResultV6.md index 00575d90..87c8c070 100644 --- a/docs/Model/IpInfoResultV6.md +++ b/docs/Model/IpInfoResultV6.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **address** | **string** | | [optional] **geolocation** | [**\Fingerprint\ServerAPI\Model\IPLocation**](IPLocation.md) | | [optional] **asn** | [**\Fingerprint\ServerAPI\Model\ASN**](ASN.md) | | [optional] +**datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenterInfo**](DataCenterInfo.md) | | [optional] **data_center** | [**\Fingerprint\ServerAPI\Model\DataCenter**](DataCenter.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index d5a61a28..4329383a 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -158,7 +158,7 @@ paths: asn: '7922' name: COMCAST-7922 network: 73.136.0.0/13 - dataCenter: + datacenter: result: true name: DediPath incognito: @@ -3701,7 +3701,7 @@ paths: asn: '7922' name: COMCAST-7922 network: 73.136.0.0/13 - dataCenter: + datacenter: result: true name: DediPath rootApps: @@ -4320,8 +4320,22 @@ components: - asn - network title: ASN + DataCenterInfo: + type: object + additionalProperties: false + properties: + result: + type: boolean + name: + type: string + example: DediPath + required: + - result + title: DataCenterInfo DataCenter: type: object + deprecated: true + description: '`dataCenter` is deprecated in favor of `datacenter`' additionalProperties: false properties: result: @@ -4335,6 +4349,12 @@ components: IPLocation: type: object additionalProperties: false + deprecated: true + description: >- + This field is **deprecated** and will not return a result for **accounts + created after December 18th, 2023**. Please use the [`ipInfo` Smart + signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) + for geolocation information. properties: accuracyRadius: description: >- @@ -4857,6 +4877,8 @@ components: $ref: '#/components/schemas/IPLocation' asn: $ref: '#/components/schemas/ASN' + datacenter: + $ref: '#/components/schemas/DataCenterInfo' dataCenter: $ref: '#/components/schemas/DataCenter' v6: @@ -4871,6 +4893,8 @@ components: $ref: '#/components/schemas/IPLocation' asn: $ref: '#/components/schemas/ASN' + datacenter: + $ref: '#/components/schemas/DataCenterInfo' dataCenter: $ref: '#/components/schemas/DataCenter' IpBlockListResult: diff --git a/src/Model/DataCenter.php b/src/Model/DataCenter.php index 2a0fa7ac..b3cc6a13 100644 --- a/src/Model/DataCenter.php +++ b/src/Model/DataCenter.php @@ -35,6 +35,7 @@ * DataCenter Class Doc Comment * * @category Class + * @description `dataCenter` is deprecated in favor of `datacenter` * @package Fingerprint\ServerAPI * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen diff --git a/src/Model/DataCenterInfo.php b/src/Model/DataCenterInfo.php new file mode 100644 index 00000000..3bc60a6a --- /dev/null +++ b/src/Model/DataCenterInfo.php @@ -0,0 +1,328 @@ + 'bool', +'name' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'result' => null, +'name' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result' => 'result', +'name' => 'name' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result' => 'setResult', +'name' => 'setName' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result' => 'getResult', +'name' => 'getName' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['result'] === null) { + $invalidProperties[] = "'result' can't be null"; + } + 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() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets result + * + * @return bool + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param bool $result result + * + * @return $this + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/IPLocation.php b/src/Model/IPLocation.php index 3709db3f..a182bd02 100644 --- a/src/Model/IPLocation.php +++ b/src/Model/IPLocation.php @@ -35,6 +35,7 @@ * IPLocation Class Doc Comment * * @category Class + * @description This field is **deprecated** and will not return a result for **accounts created after December 18th, 2023**. Please use the [`ipInfo` Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information. * @package Fingerprint\ServerAPI * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen diff --git a/src/Model/IpInfoResultV4.php b/src/Model/IpInfoResultV4.php index 5160caeb..7137ba48 100644 --- a/src/Model/IpInfoResultV4.php +++ b/src/Model/IpInfoResultV4.php @@ -59,6 +59,7 @@ class IpInfoResultV4 implements ModelInterface, ArrayAccess 'address' => 'string', 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', 'asn' => '\Fingerprint\ServerAPI\Model\ASN', +'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo', 'data_center' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; /** @@ -70,6 +71,7 @@ class IpInfoResultV4 implements ModelInterface, ArrayAccess 'address' => 'ipv4', 'geolocation' => null, 'asn' => null, +'datacenter' => null, 'data_center' => null ]; /** @@ -102,6 +104,7 @@ public static function swaggerFormats() 'address' => 'address', 'geolocation' => 'geolocation', 'asn' => 'asn', +'datacenter' => 'datacenter', 'data_center' => 'dataCenter' ]; /** @@ -113,6 +116,7 @@ public static function swaggerFormats() 'address' => 'setAddress', 'geolocation' => 'setGeolocation', 'asn' => 'setAsn', +'datacenter' => 'setDatacenter', 'data_center' => 'setDataCenter' ]; /** @@ -124,6 +128,7 @@ public static function swaggerFormats() 'address' => 'getAddress', 'geolocation' => 'getGeolocation', 'asn' => 'getAsn', +'datacenter' => 'getDatacenter', 'data_center' => 'getDataCenter' ]; /** @@ -187,6 +192,7 @@ public function __construct(array $data = null) $this->container['address'] = isset($data['address']) ? $data['address'] : null; $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; + $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; $this->container['data_center'] = isset($data['data_center']) ? $data['data_center'] : null; } @@ -286,6 +292,30 @@ public function setAsn($asn) return $this; } + /** + * Gets datacenter + * + * @return \Fingerprint\ServerAPI\Model\DataCenterInfo + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param \Fingerprint\ServerAPI\Model\DataCenterInfo $datacenter datacenter + * + * @return $this + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + /** * Gets data_center * diff --git a/src/Model/IpInfoResultV6.php b/src/Model/IpInfoResultV6.php index ad459f2f..0dbd9994 100644 --- a/src/Model/IpInfoResultV6.php +++ b/src/Model/IpInfoResultV6.php @@ -59,6 +59,7 @@ class IpInfoResultV6 implements ModelInterface, ArrayAccess 'address' => 'string', 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', 'asn' => '\Fingerprint\ServerAPI\Model\ASN', +'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo', 'data_center' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; /** @@ -70,6 +71,7 @@ class IpInfoResultV6 implements ModelInterface, ArrayAccess 'address' => 'ipv6', 'geolocation' => null, 'asn' => null, +'datacenter' => null, 'data_center' => null ]; /** @@ -102,6 +104,7 @@ public static function swaggerFormats() 'address' => 'address', 'geolocation' => 'geolocation', 'asn' => 'asn', +'datacenter' => 'datacenter', 'data_center' => 'dataCenter' ]; /** @@ -113,6 +116,7 @@ public static function swaggerFormats() 'address' => 'setAddress', 'geolocation' => 'setGeolocation', 'asn' => 'setAsn', +'datacenter' => 'setDatacenter', 'data_center' => 'setDataCenter' ]; /** @@ -124,6 +128,7 @@ public static function swaggerFormats() 'address' => 'getAddress', 'geolocation' => 'getGeolocation', 'asn' => 'getAsn', +'datacenter' => 'getDatacenter', 'data_center' => 'getDataCenter' ]; /** @@ -187,6 +192,7 @@ public function __construct(array $data = null) $this->container['address'] = isset($data['address']) ? $data['address'] : null; $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; + $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; $this->container['data_center'] = isset($data['data_center']) ? $data['data_center'] : null; } @@ -286,6 +292,30 @@ public function setAsn($asn) return $this; } + /** + * Gets datacenter + * + * @return \Fingerprint\ServerAPI\Model\DataCenterInfo + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param \Fingerprint\ServerAPI\Model\DataCenterInfo $datacenter datacenter + * + * @return $this + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + /** * Gets data_center * diff --git a/test/mocks/get_event.json b/test/mocks/get_event.json index 0a89f7d4..808f12f4 100644 --- a/test/mocks/get_event.json +++ b/test/mocks/get_event.json @@ -100,7 +100,7 @@ "name": "COMCAST-7922", "network": "73.136.0.0/13" }, - "dataCenter": { + "datacenter": { "result": true, "name": "DediPath" } @@ -229,4 +229,4 @@ } } } -} \ No newline at end of file +} From a1ab4d6e48b4a3d260ecfcdf393ed81aa7e25aa7 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Wed, 3 Jan 2024 11:38:07 +0100 Subject: [PATCH 2/4] chore: fix case insensitive function names problems for php --- docs/Model/IpInfoResultV4.md | 1 - docs/Model/IpInfoResultV6.md | 1 - res/fingerprint-server-api.yaml | 4 ---- scripts/sync.sh | 4 ++++ src/Model/IpInfoResultV4.php | 40 +++++---------------------------- src/Model/IpInfoResultV6.php | 40 +++++---------------------------- 6 files changed, 14 insertions(+), 76 deletions(-) diff --git a/docs/Model/IpInfoResultV4.md b/docs/Model/IpInfoResultV4.md index 7b887be0..98eeda96 100644 --- a/docs/Model/IpInfoResultV4.md +++ b/docs/Model/IpInfoResultV4.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes **geolocation** | [**\Fingerprint\ServerAPI\Model\IPLocation**](IPLocation.md) | | [optional] **asn** | [**\Fingerprint\ServerAPI\Model\ASN**](ASN.md) | | [optional] **datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenterInfo**](DataCenterInfo.md) | | [optional] -**data_center** | [**\Fingerprint\ServerAPI\Model\DataCenter**](DataCenter.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IpInfoResultV6.md b/docs/Model/IpInfoResultV6.md index 87c8c070..aaa1926d 100644 --- a/docs/Model/IpInfoResultV6.md +++ b/docs/Model/IpInfoResultV6.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes **geolocation** | [**\Fingerprint\ServerAPI\Model\IPLocation**](IPLocation.md) | | [optional] **asn** | [**\Fingerprint\ServerAPI\Model\ASN**](ASN.md) | | [optional] **datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenterInfo**](DataCenterInfo.md) | | [optional] -**data_center** | [**\Fingerprint\ServerAPI\Model\DataCenter**](DataCenter.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 4329383a..699cceed 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -4879,8 +4879,6 @@ components: $ref: '#/components/schemas/ASN' datacenter: $ref: '#/components/schemas/DataCenterInfo' - dataCenter: - $ref: '#/components/schemas/DataCenter' v6: type: object additionalProperties: false @@ -4895,8 +4893,6 @@ components: $ref: '#/components/schemas/ASN' datacenter: $ref: '#/components/schemas/DataCenterInfo' - dataCenter: - $ref: '#/components/schemas/DataCenter' IpBlockListResult: type: object properties: diff --git a/scripts/sync.sh b/scripts/sync.sh index 008f471c..13a2a195 100644 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -13,4 +13,8 @@ for example in ${examplesList[*]}; do curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/"$example" done +# PHP function names are case insensitive, so we can just ignore wrong DataCenter value from INTER-481 bug. +# this command looks between IpInfoResult and IpBlockListResult strings and deletes the line with "dataCenter:" and next one if found +sed -i '' '/IpInfoResult:/,/IpBlockListResult:/ { /dataCenter:/ { N; d; }; }' ./res/fingerprint-server-api.yaml + ./scripts/generate.sh diff --git a/src/Model/IpInfoResultV4.php b/src/Model/IpInfoResultV4.php index 7137ba48..68e943fd 100644 --- a/src/Model/IpInfoResultV4.php +++ b/src/Model/IpInfoResultV4.php @@ -59,8 +59,7 @@ class IpInfoResultV4 implements ModelInterface, ArrayAccess 'address' => 'string', 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', 'asn' => '\Fingerprint\ServerAPI\Model\ASN', -'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo', -'data_center' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; +'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -71,8 +70,7 @@ class IpInfoResultV4 implements ModelInterface, ArrayAccess 'address' => 'ipv4', 'geolocation' => null, 'asn' => null, -'datacenter' => null, -'data_center' => null ]; +'datacenter' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -104,8 +102,7 @@ public static function swaggerFormats() 'address' => 'address', 'geolocation' => 'geolocation', 'asn' => 'asn', -'datacenter' => 'datacenter', -'data_center' => 'dataCenter' ]; +'datacenter' => 'datacenter' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -116,8 +113,7 @@ public static function swaggerFormats() 'address' => 'setAddress', 'geolocation' => 'setGeolocation', 'asn' => 'setAsn', -'datacenter' => 'setDatacenter', -'data_center' => 'setDataCenter' ]; +'datacenter' => 'setDatacenter' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -128,8 +124,7 @@ public static function swaggerFormats() 'address' => 'getAddress', 'geolocation' => 'getGeolocation', 'asn' => 'getAsn', -'datacenter' => 'getDatacenter', -'data_center' => 'getDataCenter' ]; +'datacenter' => 'getDatacenter' ]; /** * Array of attributes where the key is the local name, @@ -193,7 +188,6 @@ public function __construct(array $data = null) $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; - $this->container['data_center'] = isset($data['data_center']) ? $data['data_center'] : null; } /** @@ -315,30 +309,6 @@ public function setDatacenter($datacenter) return $this; } - - /** - * Gets data_center - * - * @return \Fingerprint\ServerAPI\Model\DataCenter - */ - public function getDataCenter() - { - return $this->container['data_center']; - } - - /** - * Sets data_center - * - * @param \Fingerprint\ServerAPI\Model\DataCenter $data_center data_center - * - * @return $this - */ - public function setDataCenter($data_center) - { - $this->container['data_center'] = $data_center; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/IpInfoResultV6.php b/src/Model/IpInfoResultV6.php index 0dbd9994..ec2caab4 100644 --- a/src/Model/IpInfoResultV6.php +++ b/src/Model/IpInfoResultV6.php @@ -59,8 +59,7 @@ class IpInfoResultV6 implements ModelInterface, ArrayAccess 'address' => 'string', 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', 'asn' => '\Fingerprint\ServerAPI\Model\ASN', -'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo', -'data_center' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; +'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -71,8 +70,7 @@ class IpInfoResultV6 implements ModelInterface, ArrayAccess 'address' => 'ipv6', 'geolocation' => null, 'asn' => null, -'datacenter' => null, -'data_center' => null ]; +'datacenter' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -104,8 +102,7 @@ public static function swaggerFormats() 'address' => 'address', 'geolocation' => 'geolocation', 'asn' => 'asn', -'datacenter' => 'datacenter', -'data_center' => 'dataCenter' ]; +'datacenter' => 'datacenter' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -116,8 +113,7 @@ public static function swaggerFormats() 'address' => 'setAddress', 'geolocation' => 'setGeolocation', 'asn' => 'setAsn', -'datacenter' => 'setDatacenter', -'data_center' => 'setDataCenter' ]; +'datacenter' => 'setDatacenter' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -128,8 +124,7 @@ public static function swaggerFormats() 'address' => 'getAddress', 'geolocation' => 'getGeolocation', 'asn' => 'getAsn', -'datacenter' => 'getDatacenter', -'data_center' => 'getDataCenter' ]; +'datacenter' => 'getDatacenter' ]; /** * Array of attributes where the key is the local name, @@ -193,7 +188,6 @@ public function __construct(array $data = null) $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; - $this->container['data_center'] = isset($data['data_center']) ? $data['data_center'] : null; } /** @@ -315,30 +309,6 @@ public function setDatacenter($datacenter) return $this; } - - /** - * Gets data_center - * - * @return \Fingerprint\ServerAPI\Model\DataCenter - */ - public function getDataCenter() - { - return $this->container['data_center']; - } - - /** - * Sets data_center - * - * @param \Fingerprint\ServerAPI\Model\DataCenter $data_center data_center - * - * @return $this - */ - public function setDataCenter($data_center) - { - $this->container['data_center'] = $data_center; - - return $this; - } /** * Returns true if offset exists. False otherwise. * From d0cfe6e54189a3f8ca8a518f3fb3adf6e5000cf1 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Wed, 10 Jan 2024 13:24:04 +0100 Subject: [PATCH 3/4] chore: clean models before generating --- scripts/generate.sh | 3 + src/Model/ErrorResponse.php | 291 --------------------------- src/Model/ErrorResponseError.php | 321 ------------------------------ src/Model/StSeenAt.php | 327 ------------------------------- 4 files changed, 3 insertions(+), 939 deletions(-) delete mode 100644 src/Model/ErrorResponse.php delete mode 100644 src/Model/ErrorResponseError.php delete mode 100644 src/Model/StSeenAt.php diff --git a/scripts/generate.sh b/scripts/generate.sh index dbbf0e70..f08adc71 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -33,6 +33,9 @@ platform=$(uname) fi ) +# clean models before generating +rm -f ./src/Model/* + java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l php -i ./res/fingerprint-server-api.yaml -o ./ -c config.json # fix invalid code generated for structure with additionalProperties diff --git a/src/Model/ErrorResponse.php b/src/Model/ErrorResponse.php deleted file mode 100644 index 91d9f45b..00000000 --- a/src/Model/ErrorResponse.php +++ /dev/null @@ -1,291 +0,0 @@ - '\Fingerprint\ServerAPI\Model\ErrorResponseError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'error' => null ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'error' => 'error' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'error' => 'setError' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'error' => 'getError' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['error'] = isset($data['error']) ? $data['error'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $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() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets error - * - * @return \Fingerprint\ServerAPI\Model\ErrorResponseError - */ - public function getError() - { - return $this->container['error']; - } - - /** - * Sets error - * - * @param \Fingerprint\ServerAPI\Model\ErrorResponseError $error error - * - * @return $this - */ - public function setError($error) - { - $this->container['error'] = $error; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Model/ErrorResponseError.php b/src/Model/ErrorResponseError.php deleted file mode 100644 index 43b6e7f7..00000000 --- a/src/Model/ErrorResponseError.php +++ /dev/null @@ -1,321 +0,0 @@ - 'string', -'message' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'code' => null, -'message' => null ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'code' => 'code', -'message' => 'message' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'code' => 'setCode', -'message' => 'setMessage' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'code' => 'getCode', -'message' => 'getMessage' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $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() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return $this - */ - public function setCode($code) - { - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets message - * - * @return string - */ - public function getMessage() - { - return $this->container['message']; - } - - /** - * Sets message - * - * @param string $message message - * - * @return $this - */ - public function setMessage($message) - { - $this->container['message'] = $message; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Model/StSeenAt.php b/src/Model/StSeenAt.php deleted file mode 100644 index a23f11db..00000000 --- a/src/Model/StSeenAt.php +++ /dev/null @@ -1,327 +0,0 @@ - '\DateTime', -'subscription' => '\DateTime' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'global' => 'date-time', -'subscription' => 'date-time' ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'global' => 'global', -'subscription' => 'subscription' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'global' => 'setGlobal', -'subscription' => 'setSubscription' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'global' => 'getGlobal', -'subscription' => 'getSubscription' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['global'] = isset($data['global']) ? $data['global'] : null; - $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['global'] === null) { - $invalidProperties[] = "'global' can't be null"; - } - if ($this->container['subscription'] === null) { - $invalidProperties[] = "'subscription' can't be null"; - } - 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() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets global - * - * @return \DateTime - */ - public function getGlobal() - { - return $this->container['global']; - } - - /** - * Sets global - * - * @param \DateTime $global global - * - * @return $this - */ - public function setGlobal($global) - { - $this->container['global'] = $global; - - return $this; - } - - /** - * Gets subscription - * - * @return \DateTime - */ - public function getSubscription() - { - return $this->container['subscription']; - } - - /** - * Sets subscription - * - * @param \DateTime $subscription subscription - * - * @return $this - */ - public function setSubscription($subscription) - { - $this->container['subscription'] = $subscription; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} From 19158aa0054c37975a83cfe0076ad48626155943 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Wed, 10 Jan 2024 13:26:02 +0100 Subject: [PATCH 4/4] feat: use `datacenter` instead of the wrong `dataCenter` BREAKING CHANGE: `IpInfo` field `data_center` renamed to `datacenter` --- README.md | 1 - docs/Model/DataCenter.md | 2 - docs/Model/DataCenterInfo.md | 10 - docs/Model/IpInfoResultV4.md | 2 +- docs/Model/IpInfoResultV6.md | 2 +- res/fingerprint-server-api.yaml | 18 +- src/Model/DataCenter.php | 1 - src/Model/DataCenterInfo.php | 328 -------------------------------- src/Model/IpInfoResultV4.php | 6 +- src/Model/IpInfoResultV6.php | 6 +- 10 files changed, 10 insertions(+), 366 deletions(-) delete mode 100644 docs/Model/DataCenterInfo.md delete mode 100644 src/Model/DataCenterInfo.php diff --git a/README.md b/README.md index 1c8eeeea..b412e598 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,6 @@ Class | Method | HTTP request | Description - [BrowserDetails](docs/Model/BrowserDetails.md) - [Confidence](docs/Model/Confidence.md) - [DataCenter](docs/Model/DataCenter.md) - - [DataCenterInfo](docs/Model/DataCenterInfo.md) - [ErrorEvent403Response](docs/Model/ErrorEvent403Response.md) - [ErrorEvent403ResponseError](docs/Model/ErrorEvent403ResponseError.md) - [ErrorEvent404Response](docs/Model/ErrorEvent404Response.md) diff --git a/docs/Model/DataCenter.md b/docs/Model/DataCenter.md index 01dbbf4d..048a90a2 100644 --- a/docs/Model/DataCenter.md +++ b/docs/Model/DataCenter.md @@ -1,6 +1,4 @@ # DataCenter -`dataCenter` is deprecated in favor of `datacenter` - ## Properties Name | Type | Description | Notes diff --git a/docs/Model/DataCenterInfo.md b/docs/Model/DataCenterInfo.md deleted file mode 100644 index 389f286c..00000000 --- a/docs/Model/DataCenterInfo.md +++ /dev/null @@ -1,10 +0,0 @@ -# DataCenterInfo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | | -**name** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/docs/Model/IpInfoResultV4.md b/docs/Model/IpInfoResultV4.md index 98eeda96..42e7a959 100644 --- a/docs/Model/IpInfoResultV4.md +++ b/docs/Model/IpInfoResultV4.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **address** | **string** | | [optional] **geolocation** | [**\Fingerprint\ServerAPI\Model\IPLocation**](IPLocation.md) | | [optional] **asn** | [**\Fingerprint\ServerAPI\Model\ASN**](ASN.md) | | [optional] -**datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenterInfo**](DataCenterInfo.md) | | [optional] +**datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenter**](DataCenter.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IpInfoResultV6.md b/docs/Model/IpInfoResultV6.md index aaa1926d..536c642b 100644 --- a/docs/Model/IpInfoResultV6.md +++ b/docs/Model/IpInfoResultV6.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **address** | **string** | | [optional] **geolocation** | [**\Fingerprint\ServerAPI\Model\IPLocation**](IPLocation.md) | | [optional] **asn** | [**\Fingerprint\ServerAPI\Model\ASN**](ASN.md) | | [optional] -**datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenterInfo**](DataCenterInfo.md) | | [optional] +**datacenter** | [**\Fingerprint\ServerAPI\Model\DataCenter**](DataCenter.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 699cceed..da9215cd 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -4320,22 +4320,8 @@ components: - asn - network title: ASN - DataCenterInfo: - type: object - additionalProperties: false - properties: - result: - type: boolean - name: - type: string - example: DediPath - required: - - result - title: DataCenterInfo DataCenter: type: object - deprecated: true - description: '`dataCenter` is deprecated in favor of `datacenter`' additionalProperties: false properties: result: @@ -4878,7 +4864,7 @@ components: asn: $ref: '#/components/schemas/ASN' datacenter: - $ref: '#/components/schemas/DataCenterInfo' + $ref: '#/components/schemas/DataCenter' v6: type: object additionalProperties: false @@ -4892,7 +4878,7 @@ components: asn: $ref: '#/components/schemas/ASN' datacenter: - $ref: '#/components/schemas/DataCenterInfo' + $ref: '#/components/schemas/DataCenter' IpBlockListResult: type: object properties: diff --git a/src/Model/DataCenter.php b/src/Model/DataCenter.php index b3cc6a13..2a0fa7ac 100644 --- a/src/Model/DataCenter.php +++ b/src/Model/DataCenter.php @@ -35,7 +35,6 @@ * DataCenter Class Doc Comment * * @category Class - * @description `dataCenter` is deprecated in favor of `datacenter` * @package Fingerprint\ServerAPI * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen diff --git a/src/Model/DataCenterInfo.php b/src/Model/DataCenterInfo.php deleted file mode 100644 index 3bc60a6a..00000000 --- a/src/Model/DataCenterInfo.php +++ /dev/null @@ -1,328 +0,0 @@ - 'bool', -'name' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'name' => null ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'result' => 'result', -'name' => 'name' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'result' => 'setResult', -'name' => 'setName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'result' => 'getResult', -'name' => 'getName' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['result'] === null) { - $invalidProperties[] = "'result' can't be null"; - } - 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() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets result - * - * @return bool - */ - public function getResult() - { - return $this->container['result']; - } - - /** - * Sets result - * - * @param bool $result result - * - * @return $this - */ - public function setResult($result) - { - $this->container['result'] = $result; - - return $this; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Model/IpInfoResultV4.php b/src/Model/IpInfoResultV4.php index 68e943fd..2fbdf6b2 100644 --- a/src/Model/IpInfoResultV4.php +++ b/src/Model/IpInfoResultV4.php @@ -59,7 +59,7 @@ class IpInfoResultV4 implements ModelInterface, ArrayAccess 'address' => 'string', 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', 'asn' => '\Fingerprint\ServerAPI\Model\ASN', -'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo' ]; +'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -289,7 +289,7 @@ public function setAsn($asn) /** * Gets datacenter * - * @return \Fingerprint\ServerAPI\Model\DataCenterInfo + * @return \Fingerprint\ServerAPI\Model\DataCenter */ public function getDatacenter() { @@ -299,7 +299,7 @@ public function getDatacenter() /** * Sets datacenter * - * @param \Fingerprint\ServerAPI\Model\DataCenterInfo $datacenter datacenter + * @param \Fingerprint\ServerAPI\Model\DataCenter $datacenter datacenter * * @return $this */ diff --git a/src/Model/IpInfoResultV6.php b/src/Model/IpInfoResultV6.php index ec2caab4..d1081a0a 100644 --- a/src/Model/IpInfoResultV6.php +++ b/src/Model/IpInfoResultV6.php @@ -59,7 +59,7 @@ class IpInfoResultV6 implements ModelInterface, ArrayAccess 'address' => 'string', 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', 'asn' => '\Fingerprint\ServerAPI\Model\ASN', -'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenterInfo' ]; +'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -289,7 +289,7 @@ public function setAsn($asn) /** * Gets datacenter * - * @return \Fingerprint\ServerAPI\Model\DataCenterInfo + * @return \Fingerprint\ServerAPI\Model\DataCenter */ public function getDatacenter() { @@ -299,7 +299,7 @@ public function getDatacenter() /** * Sets datacenter * - * @param \Fingerprint\ServerAPI\Model\DataCenterInfo $datacenter datacenter + * @param \Fingerprint\ServerAPI\Model\DataCenter $datacenter datacenter * * @return $this */