Skip to content

Commit

Permalink
feat: only generate models and docs from swagger codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
Orkuncakilkaya committed Jul 10, 2024
1 parent 5abf4ca commit 26e984f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 214 deletions.
74 changes: 0 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,83 +193,9 @@ All URIs are relative to your region's base URL.

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FingerprintApi* | [**getEvent**](docs/Api/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by requestId
*FingerprintApi* | [**getVisits**](docs/Api/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId

## Documentation for Models

- [ASN](docs/Model/ASN.md)
- [BotdDetectionResult](docs/Model/BotdDetectionResult.md)
- [BotdResult](docs/Model/BotdResult.md)
- [BrowserDetails](docs/Model/BrowserDetails.md)
- [ClonedAppResult](docs/Model/ClonedAppResult.md)
- [Confidence](docs/Model/Confidence.md)
- [DataCenter](docs/Model/DataCenter.md)
- [DeprecatedIPLocation](docs/Model/DeprecatedIPLocation.md)
- [DeprecatedIPLocationCity](docs/Model/DeprecatedIPLocationCity.md)
- [EmulatorResult](docs/Model/EmulatorResult.md)
- [ErrorEvent403Response](docs/Model/ErrorEvent403Response.md)
- [ErrorEvent403ResponseError](docs/Model/ErrorEvent403ResponseError.md)
- [ErrorEvent404Response](docs/Model/ErrorEvent404Response.md)
- [ErrorEvent404ResponseError](docs/Model/ErrorEvent404ResponseError.md)
- [ErrorVisits403](docs/Model/ErrorVisits403.md)
- [EventResponse](docs/Model/EventResponse.md)
- [FactoryResetResult](docs/Model/FactoryResetResult.md)
- [FridaResult](docs/Model/FridaResult.md)
- [HighActivityResult](docs/Model/HighActivityResult.md)
- [IPLocation](docs/Model/IPLocation.md)
- [IPLocationCity](docs/Model/IPLocationCity.md)
- [IdentificationError](docs/Model/IdentificationError.md)
- [IncognitoResult](docs/Model/IncognitoResult.md)
- [IpBlockListResult](docs/Model/IpBlockListResult.md)
- [IpBlockListResultDetails](docs/Model/IpBlockListResultDetails.md)
- [IpInfoResult](docs/Model/IpInfoResult.md)
- [IpInfoResultV4](docs/Model/IpInfoResultV4.md)
- [IpInfoResultV6](docs/Model/IpInfoResultV6.md)
- [JailbrokenResult](docs/Model/JailbrokenResult.md)
- [Location](docs/Model/Location.md)
- [LocationSpoofingResult](docs/Model/LocationSpoofingResult.md)
- [ManyRequestsResponse](docs/Model/ManyRequestsResponse.md)
- [PrivacySettingsResult](docs/Model/PrivacySettingsResult.md)
- [ProductError](docs/Model/ProductError.md)
- [ProductsResponse](docs/Model/ProductsResponse.md)
- [ProductsResponseBotd](docs/Model/ProductsResponseBotd.md)
- [ProductsResponseIdentification](docs/Model/ProductsResponseIdentification.md)
- [ProductsResponseIdentificationData](docs/Model/ProductsResponseIdentificationData.md)
- [ProxyResult](docs/Model/ProxyResult.md)
- [RawDeviceAttributesResult](docs/Model/RawDeviceAttributesResult.md)
- [Response](docs/Model/Response.md)
- [ResponseVisits](docs/Model/ResponseVisits.md)
- [RootAppsResult](docs/Model/RootAppsResult.md)
- [SeenAt](docs/Model/SeenAt.md)
- [SignalResponseClonedApp](docs/Model/SignalResponseClonedApp.md)
- [SignalResponseEmulator](docs/Model/SignalResponseEmulator.md)
- [SignalResponseFactoryReset](docs/Model/SignalResponseFactoryReset.md)
- [SignalResponseFrida](docs/Model/SignalResponseFrida.md)
- [SignalResponseHighActivity](docs/Model/SignalResponseHighActivity.md)
- [SignalResponseIncognito](docs/Model/SignalResponseIncognito.md)
- [SignalResponseIpBlocklist](docs/Model/SignalResponseIpBlocklist.md)
- [SignalResponseIpInfo](docs/Model/SignalResponseIpInfo.md)
- [SignalResponseJailbroken](docs/Model/SignalResponseJailbroken.md)
- [SignalResponseLocationSpoofing](docs/Model/SignalResponseLocationSpoofing.md)
- [SignalResponsePrivacySettings](docs/Model/SignalResponsePrivacySettings.md)
- [SignalResponseProxy](docs/Model/SignalResponseProxy.md)
- [SignalResponseRawDeviceAttributes](docs/Model/SignalResponseRawDeviceAttributes.md)
- [SignalResponseRootApps](docs/Model/SignalResponseRootApps.md)
- [SignalResponseSuspectScore](docs/Model/SignalResponseSuspectScore.md)
- [SignalResponseTampering](docs/Model/SignalResponseTampering.md)
- [SignalResponseTor](docs/Model/SignalResponseTor.md)
- [SignalResponseVirtualMachine](docs/Model/SignalResponseVirtualMachine.md)
- [SignalResponseVpn](docs/Model/SignalResponseVpn.md)
- [Subdivision](docs/Model/Subdivision.md)
- [SuspectScoreResult](docs/Model/SuspectScoreResult.md)
- [TamperingResult](docs/Model/TamperingResult.md)
- [TorResult](docs/Model/TorResult.md)
- [VirtualMachineResult](docs/Model/VirtualMachineResult.md)
- [Visit](docs/Model/Visit.md)
- [VpnResult](docs/Model/VpnResult.md)
- [VpnResultMethods](docs/Model/VpnResultMethods.md)
- [WebhookVisit](docs/Model/WebhookVisit.md)

## Documentation for Authorization

Expand Down
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Most files in the project are autogenerated by [swagger-codegen](https://swagger.io/tools/swagger-codegen/) for php.

- [template](./template) - folder contains redefined templates of `swagger-codegen`. Original templates you can find in [swagger-codegen repo](https://github.com/swagger-api/swagger-codegen/tree/751e59df060b1c3ecf54921e104f2086dfa9f820/modules/swagger-codegen/src/main/resources/php).
- [docs](./docs) - generated documentation for models and [API Client](./docs/Api/FingerprintApi.md).
- [src](./src) - API Client code is generated automatically.
- [docs](./docs) - generated documentation for models and [API Client](docs/Api/FingerprintApi.md).
- [src](./src) - API Client code and generated models.

## Code generation

Expand Down
137 changes: 0 additions & 137 deletions docs/Api/FingerprintApi.md
Original file line number Diff line number Diff line change
@@ -1,137 +0,0 @@
# Fingerprint\ServerAPI\FingerprintApi

All URIs are relative to *https://api.fpjs.io*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by requestId
[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId

# **getEvent**
> \Fingerprint\ServerAPI\Model\EventResponse getEvent($request_id)
Get event by requestId

This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`.

### Example
```php
<?php

require_once(__DIR__ . '/vendor/autoload.php');

const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key

// Import Fingerprint Classes and Guzzle HTTP Client
use Fingerprint\ServerAPI\Api\FingerprintApi;
use Fingerprint\ServerAPI\Configuration;
use GuzzleHttp\Client;

// Create new Configuration instance with defaultValues, added our API Secret and our Region
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
$client = new FingerprintApi(
new Client(),
$config
);

$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request.

try {
$result = $client->getEvent($request_id);
echo "<pre>" . $response->__toString() . "</pre>";
} catch (Exception $e) {
echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. |

### Return type

[**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md)

### Authorization

[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **getVisits**
> \Fingerprint\ServerAPI\Model\Response getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before)
Get visits by visitorId

This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received.

### Example
```php
<?php

require_once(__DIR__ . '/vendor/autoload.php');

const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key

// Import Fingerprint Classes and Guzzle HTTP Client
use Fingerprint\ServerAPI\Api\FingerprintApi;
use Fingerprint\ServerAPI\Configuration;
use GuzzleHttp\Client;

// Create new Configuration instance with defaultValues, added our API Secret and our Region
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
$client = new FingerprintApi(
new Client(),
$config
);

$visitor_id = "visitor_id_example"; // string | Unique identifier of the visitor issued by Fingerprint Pro.
$request_id = "request_id_example"; // string | Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned.
$linked_id = "linked_id_example"; // string | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier.
$limit = 56; // int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500.
$pagination_key = "pagination_key_example"; // string | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned.
$before = 789; // int | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.

try {
$result = $client->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before);
echo "<pre>" . $response->__toString() . "</pre>";
} catch (Exception $e) {
echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**visitor_id** | **string**| Unique identifier of the visitor issued by Fingerprint Pro. |
**request_id** | **string**| Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. | [optional]
**linked_id** | **string**| Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. | [optional]
**limit** | **int**| Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. | [optional]
**pagination_key** | **string**| Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. | [optional]
**before** | **int**| ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. | [optional]

### Return type

[**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md)

### Authorization

[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

4 changes: 3 additions & 1 deletion scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ platform=$(uname)
# 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
java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l php -i ./res/fingerprint-server-api.yaml -o ./ -c config.json -Dmodels
java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l php -i ./res/fingerprint-server-api.yaml -o ./ -c config.json -DsupportingFiles

# fix invalid code generated for structure with additionalProperties
(
Expand Down Expand Up @@ -67,3 +68,4 @@ mv -f src/README.md ./README.md
mv -f src/composer.json composer.json
find ./docs -type f ! -name "DecryptionKey.md" ! -name "Sealed.md" -exec rm {} +
mv -f src/docs/* ./docs
cp template/docs/FingerprintApi.md docs/Api
Empty file added template/docs/FingerprintApi.md
Empty file.

0 comments on commit 26e984f

Please sign in to comment.