diff --git a/.changeset/silent-frogs-judge.md b/.changeset/silent-frogs-judge.md new file mode 100644 index 0000000..ffc4e26 --- /dev/null +++ b/.changeset/silent-frogs-judge.md @@ -0,0 +1,11 @@ +--- +"fingerprint-server-dotnet-sdk": major +--- + +Rename .NET SDK project and namespaces from `FingerprintPro.ServerSdk.*` to `Fingerprint.ServerSdk.*`. + +**Breaking changes** + +- Update all `using` directives and fully-qualified type names: + - `FingerprintPro.ServerSdk.*` → `Fingerprint.ServerSdk.*` +- If you reference solution/project file names or CI paths, update them to the new `Fingerprint.ServerSdk.*` locations. diff --git a/.env.example b/.env.example index 96dc9db..2486326 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ SECRET_API_KEY= VISITOR_ID= -REQUEST_ID= +EVENT_ID= +UPDATE_EVENT_ID= REGION= # if different than `us` diff --git a/.gitignore b/.gitignore index 1f1e1da..82f40cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -# Ref: https://gist.github.com/kmorcinek/2710267 -# Download this file using PowerShell v3 under Windows with the following comand -# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore +### Project +/bin + +### .NET # User-specific files *.suo diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..acf30c8 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,14 @@ +git_push.sh +.gitignore +appveyor.yml + +src/Fingerprint.ServerSdk/Api/DefaultApi.cs + +src/Fingerprint.ServerSdk.Test/Api/DefaultApiTests.cs +src/Fingerprint.ServerSdk.Test/Model/** +src/Fingerprint.ServerSdk.Test/README.md + +docs/apis/DefaultApi.md +docs/scripts/** + +api/openapi.yaml diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..faf7b39 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,93 @@ +Fingerprint.ServerSdk.sln +README.md +docs/DecryptionKey.md +docs/Sealed.md +docs/WebhookValidation.md +docs/apis/FingerprintApi.md +docs/models/BotResult.md +docs/models/BrowserDetails.md +docs/models/Error.md +docs/models/ErrorCode.md +docs/models/ErrorResponse.md +docs/models/Event.md +docs/models/EventSearch.md +docs/models/EventUpdate.md +docs/models/Geolocation.md +docs/models/GeolocationSubdivisionsInner.md +docs/models/IPBlockList.md +docs/models/IPInfo.md +docs/models/IPInfoV4.md +docs/models/IPInfoV6.md +docs/models/Identification.md +docs/models/IdentificationConfidence.md +docs/models/Integration.md +docs/models/IntegrationSubintegration.md +docs/models/Proximity.md +docs/models/ProxyConfidence.md +docs/models/ProxyDetails.md +docs/models/SDK.md +docs/models/SupplementaryIDHighRecall.md +docs/models/TamperingDetails.md +docs/models/TriggeredByInner.md +docs/models/Velocity.md +docs/models/VelocityData.md +docs/models/VpnConfidence.md +docs/models/VpnMethods.md +src/Fingerprint.ServerSdk.Test/Api/DependencyInjectionTests.cs +src/Fingerprint.ServerSdk.Test/Fingerprint.ServerSdk.Test.csproj +src/Fingerprint.ServerSdk/Api/FingerprintApi.cs +src/Fingerprint.ServerSdk/Api/IApi.cs +src/Fingerprint.ServerSdk/Client/ApiException.cs +src/Fingerprint.ServerSdk/Client/ApiFactory.cs +src/Fingerprint.ServerSdk/Client/ApiResponseEventArgs.cs +src/Fingerprint.ServerSdk/Client/ApiResponse`1.cs +src/Fingerprint.ServerSdk/Client/BearerToken.cs +src/Fingerprint.ServerSdk/Client/ClientUtils.cs +src/Fingerprint.ServerSdk/Client/CookieContainer.cs +src/Fingerprint.ServerSdk/Client/DateTimeJsonConverter.cs +src/Fingerprint.ServerSdk/Client/DateTimeNullableJsonConverter.cs +src/Fingerprint.ServerSdk/Client/ExceptionEventArgs.cs +src/Fingerprint.ServerSdk/Client/HostConfiguration.cs +src/Fingerprint.ServerSdk/Client/JsonSerializerOptionsProvider.cs +src/Fingerprint.ServerSdk/Client/Option.cs +src/Fingerprint.ServerSdk/Client/RateLimitProvider`1.cs +src/Fingerprint.ServerSdk/Client/Region.cs +src/Fingerprint.ServerSdk/Client/TokenBase.cs +src/Fingerprint.ServerSdk/Client/TokenContainer`1.cs +src/Fingerprint.ServerSdk/Client/TokenProvider`1.cs +src/Fingerprint.ServerSdk/Extensions/IHostBuilderExtensions.cs +src/Fingerprint.ServerSdk/Extensions/IHttpClientBuilderExtensions.cs +src/Fingerprint.ServerSdk/Extensions/IServiceCollectionExtensions.cs +src/Fingerprint.ServerSdk/Fingerprint.ServerSdk.csproj +src/Fingerprint.ServerSdk/Model/BotResult.cs +src/Fingerprint.ServerSdk/Model/BrowserDetails.cs +src/Fingerprint.ServerSdk/Model/Error.cs +src/Fingerprint.ServerSdk/Model/ErrorCode.cs +src/Fingerprint.ServerSdk/Model/ErrorResponse.cs +src/Fingerprint.ServerSdk/Model/Event.cs +src/Fingerprint.ServerSdk/Model/EventSearch.cs +src/Fingerprint.ServerSdk/Model/EventUpdate.cs +src/Fingerprint.ServerSdk/Model/Geolocation.cs +src/Fingerprint.ServerSdk/Model/GeolocationSubdivisionsInner.cs +src/Fingerprint.ServerSdk/Model/IPBlockList.cs +src/Fingerprint.ServerSdk/Model/IPInfo.cs +src/Fingerprint.ServerSdk/Model/IPInfoV4.cs +src/Fingerprint.ServerSdk/Model/IPInfoV6.cs +src/Fingerprint.ServerSdk/Model/Identification.cs +src/Fingerprint.ServerSdk/Model/IdentificationConfidence.cs +src/Fingerprint.ServerSdk/Model/Integration.cs +src/Fingerprint.ServerSdk/Model/IntegrationSubintegration.cs +src/Fingerprint.ServerSdk/Model/Proximity.cs +src/Fingerprint.ServerSdk/Model/ProxyConfidence.cs +src/Fingerprint.ServerSdk/Model/ProxyDetails.cs +src/Fingerprint.ServerSdk/Model/SDK.cs +src/Fingerprint.ServerSdk/Model/SupplementaryIDHighRecall.cs +src/Fingerprint.ServerSdk/Model/TamperingDetails.cs +src/Fingerprint.ServerSdk/Model/TriggeredByInner.cs +src/Fingerprint.ServerSdk/Model/Velocity.cs +src/Fingerprint.ServerSdk/Model/VelocityData.cs +src/Fingerprint.ServerSdk/Model/VpnConfidence.cs +src/Fingerprint.ServerSdk/Model/VpnMethods.cs +src/Fingerprint.ServerSdk/README.md +src/Fingerprint.ServerSdk/Sealed.cs +src/Fingerprint.ServerSdk/WebhookValidation.cs diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..971ecb2 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.16.0 diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore deleted file mode 100644 index 9b7ff27..0000000 --- a/.swagger-codegen-ignore +++ /dev/null @@ -1,44 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md - -.travis.yml -git_push.sh - -**/packages.config -src/FingerprintPro.ServerSdk.Test/** -src/FingerprintPro.ServerSdk/Model/Model.cs -src/FingerprintPro.ServerSdk/Model/ASN.cs -src/FingerprintPro.ServerSdk/Client/ApiClient.cs -src/FingerprintPro.ServerSdk/Client/ApiResponse.cs -src/FingerprintPro.ServerSdk/Client/IApiAccessor.cs -src/FingerprintPro.ServerSdk/Client/ApiException.cs -src/FingerprintPro.ServerSdk/Client/IReadableConfiguration.cs -src/FingerprintPro.ServerSdk/Client/ExceptionFactory.cs -src/FingerprintPro.ServerSdk/Client/SwaggerDateConverter.cs - -**/GlobalConfiguration.cs -.gitignore - -build.bat -build.sh diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION deleted file mode 100644 index 10bbf27..0000000 --- a/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.34 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index cc18d57..7bced57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Fingerprint Server API Dotnet SDK +# Fingerprint Server Dotnet SDK ## 7.9.0 diff --git a/Dockerfile b/Dockerfile index 564f5b4..603d7aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 # Copy the project file and restore dependencies -COPY ["fingerprint-pro-server-api-dotnet-sdk.sln", "./"] +COPY ["Fingerprint.ServerSdk.sln", "./"] # LICENSE is required for building the package COPY ["LICENSE", "./"] COPY ["res", "res/"] -COPY ["src/FingerprintPro.ServerSdk/FingerprintPro.ServerSdk.csproj", "src/FingerprintPro.ServerSdk/"] -COPY ["src/FingerprintPro.ServerSdk.Examples/FingerprintPro.ServerSdk.Examples.csproj", "src/FingerprintPro.ServerSdk.Examples/"] -COPY ["src/FingerprintPro.ServerSdk.FunctionalTest/FingerprintPro.ServerSdk.FunctionalTest.csproj", "src/FingerprintPro.ServerSdk.FunctionalTest/"] -COPY ["src/FingerprintPro.ServerSdk.SealedResultExample/FingerprintPro.ServerSdk.SealedResultExample.csproj", "src/FingerprintPro.ServerSdk.SealedResultExample/"] -COPY ["src/FingerprintPro.ServerSdk.Test/FingerprintPro.ServerSdk.Test.csproj", "src/FingerprintPro.ServerSdk.Test/"] -COPY ["src/FingerprintPro.ServerSdk.WebhookExample/FingerprintPro.ServerSdk.WebhookExample.csproj", "src/FingerprintPro.ServerSdk.WebhookExample/"] +COPY ["src/Fingerprint.ServerSdk/Fingerprint.ServerSdk.csproj", "src/Fingerprint.ServerSdk/"] +COPY ["src/Fingerprint.ServerSdk.Examples/Fingerprint.ServerSdk.Examples.csproj", "src/Fingerprint.ServerSdk.Examples/"] +COPY ["src/Fingerprint.ServerSdk.FunctionalTest/Fingerprint.ServerSdk.FunctionalTest.csproj", "src/Fingerprint.ServerSdk.FunctionalTest/"] +COPY ["src/Fingerprint.ServerSdk.SealedResultExample/Fingerprint.ServerSdk.SealedResultExample.csproj", "src/Fingerprint.ServerSdk.SealedResultExample/"] +COPY ["src/Fingerprint.ServerSdk.Test/Fingerprint.ServerSdk.Test.csproj", "src/Fingerprint.ServerSdk.Test/"] +COPY ["src/Fingerprint.ServerSdk.WebhookExample/Fingerprint.ServerSdk.WebhookExample.csproj", "src/Fingerprint.ServerSdk.WebhookExample/"] RUN dotnet restore COPY ["./src", "src/"] CMD ["dotnet", "list", "package"] \ No newline at end of file diff --git a/fingerprint-pro-server-api-dotnet-sdk.sln b/Fingerprint.ServerSdk.sln similarity index 65% rename from fingerprint-pro-server-api-dotnet-sdk.sln rename to Fingerprint.ServerSdk.sln index 416b5ce..9444e67 100644 --- a/fingerprint-pro-server-api-dotnet-sdk.sln +++ b/Fingerprint.ServerSdk.sln @@ -1,17 +1,18 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerprintPro.ServerSdk", "src\FingerprintPro.ServerSdk\FingerprintPro.ServerSdk.csproj", "{DEE4B355-41FC-4B06-92D3-FE21753D84EE}" +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fingerprint.ServerSdk", "src\Fingerprint.ServerSdk\Fingerprint.ServerSdk.csproj", "{DEE4B355-41FC-4B06-92D3-FE21753D84EE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerprintPro.ServerSdk.Test", "src\FingerprintPro.ServerSdk.Test\FingerprintPro.ServerSdk.Test.csproj", "{A17D53A9-4987-4E7B-BDA9-3A4BE826FF7B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fingerprint.ServerSdk.Test", "src\Fingerprint.ServerSdk.Test\Fingerprint.ServerSdk.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerprintPro.ServerSdk.Examples", "src\FingerprintPro.ServerSdk.Examples\FingerprintPro.ServerSdk.Examples.csproj", "{7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fingerprint.ServerSdk.Examples", "src\Fingerprint.ServerSdk.Examples\Fingerprint.ServerSdk.Examples.csproj", "{7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerprintPro.ServerSdk.FunctionalTest", "src\FingerprintPro.ServerSdk.FunctionalTest\FingerprintPro.ServerSdk.FunctionalTest.csproj", "{60A3F0A3-764A-43CA-9BDD-E2A727F86347}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fingerprint.ServerSdk.FunctionalTest", "src\Fingerprint.ServerSdk.FunctionalTest\Fingerprint.ServerSdk.FunctionalTest.csproj", "{60A3F0A3-764A-43CA-9BDD-E2A727F86347}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerprintPro.ServerSdk.SealedResultExample", "src\FingerprintPro.ServerSdk.SealedResultExample\FingerprintPro.ServerSdk.SealedResultExample.csproj", "{68302477-4772-4F13-B569-54881B84F6B4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fingerprint.ServerSdk.SealedResultExample", "src\Fingerprint.ServerSdk.SealedResultExample\Fingerprint.ServerSdk.SealedResultExample.csproj", "{68302477-4772-4F13-B569-54881B84F6B4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerprintPro.ServerSdk.WebhookExample", "src\FingerprintPro.ServerSdk.WebhookExample\FingerprintPro.ServerSdk.WebhookExample.csproj", "{F95774AB-BC02-45AE-8916-0EFF0689E89F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fingerprint.ServerSdk.WebhookExample", "src\Fingerprint.ServerSdk.WebhookExample\Fingerprint.ServerSdk.WebhookExample.csproj", "{F95774AB-BC02-45AE-8916-0EFF0689E89F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,10 +24,10 @@ Global {DEE4B355-41FC-4B06-92D3-FE21753D84EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {DEE4B355-41FC-4B06-92D3-FE21753D84EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {DEE4B355-41FC-4B06-92D3-FE21753D84EE}.Release|Any CPU.Build.0 = Release|Any CPU - {A17D53A9-4987-4E7B-BDA9-3A4BE826FF7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A17D53A9-4987-4E7B-BDA9-3A4BE826FF7B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A17D53A9-4987-4E7B-BDA9-3A4BE826FF7B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A17D53A9-4987-4E7B-BDA9-3A4BE826FF7B}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Debug|Any CPU.Build.0 = Debug|Any CPU {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -44,9 +45,12 @@ Global {F95774AB-BC02-45AE-8916-0EFF0689E89F}.Release|Any CPU.ActiveCfg = Release|Any CPU {F95774AB-BC02-45AE-8916-0EFF0689E89F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution + GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.DotNetNamingPolicy = $1 $1.DirectoryNamespaceAssociation = PrefixedHierarchical + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection -EndGlobal +EndGlobal \ No newline at end of file diff --git a/README.md b/README.md index 73124cc..a23e7a5 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,14 @@ # Fingerprint Server API Dotnet SDK [Fingerprint](https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. -Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. +Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. -This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 3 +- API version: 4 - SDK version: 7.9.0 -- Build package: io.swagger.codegen.v3.generators.dotnet.CSharpClientCodegen +- Generator version: 7.16.0 +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen ## Requirements @@ -34,120 +35,138 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c We recommend installing the package from [NuGet](https://docs.nuget.org/consume/installing-nuget): ```shell -dotnet add package FingerprintPro.ServerSdk +dotnet add package Fingerprint.ServerSdk ``` ## Getting Started ```csharp -// See https://aka.ms/new-console-template for more information // Example usage of our SDK // Import namespaces -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; - -// Initialize configuration and add your api key -var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); - -var api = new FingerprintApi( - configuration -); - -var requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!; -var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!; - -var visits = api.GetVisits(visitorId); -var events = api.GetEvent(requestId); -var eventsFound = api.SearchEvents(20, paginationKey: "1740815825085", bot: "bad"); - -Console.WriteLine(visits); -Console.WriteLine(events); -Console.WriteLine(eventsFound); - -var tag = new Tag -{ - ["key"] = "value" -}; -var body = new EventsUpdateRequest() +using System.Net; +using System.Net.Http.Headers; +using System.Text.Json; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Model; + +namespace YourProject { - Suspect = false, - Tag = tag, - LinkedId = "" -}; -api.UpdateEvent(body, requestId); -``` - -You can also access the raw HTTP response by using the `WithHttpInfo` methods: - -```csharp -// See https://aka.ms/new-console-template for more information -// Example usage of our SDK - -// Import namespaces -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; - -// Initialize configuration and add your api key -var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); + public class Program + { + public static async Task Main(string[] args) + { + IHost host = CreateHostBuilder(args).Build(); + IFingerprintApi api = host.Services.GetRequiredService(); -var api = new FingerprintApi( - configuration -); + string eventId = Environment.GetEnvironmentVariable("EVENT_ID")!; -var requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!; -var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!; + // Example usage of Try method + IGetEventApiResponse getEventResponse = await api.GetEventAsync(eventId); + if (getEventResponse.TryOk(out Event getEvent)) { + Console.WriteLine(JsonSerializer.Serialize(getEvent)); + } -var visits = api.GetVisitsWithHttpInfo(visitorId); + // Example usage of `IsOk` property and typed response + ISearchEventsApiResponse searchEventsResponse = await api.SearchEventsAsync(limit: 20, paginationKey: "1740815825085", bot: "bad"); + if (searchEventsResponse.IsOk) { + EventSearch searchEvents = searchEventsResponse.Ok(); + Console.WriteLine(JsonSerializer.Serialize(searchEvents)); + } + // You can also access the raw content, headers, and status code: + // string rawContent = searchEventsResponse.RawContent; + // HttpResponseHeaders headers = searchEventsResponse.Headers; + // HttpStatusCode statusCode = searchEventsResponse.StatusCode; -// HttpResponseMessage -Console.WriteLine(visits.Response); + var tags = new Dictionary + { + ["key"] = "value" + }; + var body = new EventUpdate + { + Suspect = false, + Tags = tags, + LinkedId = "" + }; + await api.UpdateEventAsync(eventId, body); + } -// Response data -Console.WriteLine(visits.Data); + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + BearerToken token = new(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, BearerToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(client => + { + // custom client configuration + }, builder => + { + builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)); + // add whatever middleware you prefer + } + ); + }); + } +} ``` -You can view more examples in [src/FingerprintPro.ServerSdk.Examples/Program.cs](src/FingerprintPro.ServerSdk.Examples/Program.cs). +You can view more examples in [src/Fingerprint.ServerSdk.Examples/Program.cs](src/Fingerprint.ServerSdk.Examples/Program.cs). ### Region -If your subscription is in region other than US, you need to change the region in the configuration: +If your subscription is in a region other than the US, you need to change the region when building a host: ```csharp -using FingerprintPro.ServerSdk.Client; - -var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!) -{ - Region = Region.Eu // or Region.Asia -}; +public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + // ... + options.SetRegion(Region.EU); + }); ``` ## Sealed results This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). + ```csharp -using FingerprintPro.ServerSdk; +using Fingerprint.ServerSdk; var sealedResult = Environment.GetEnvironmentVariable("BASE64_SEALED_RESULT")!; var sealedKey = Environment.GetEnvironmentVariable("BASE64_KEY")!; -var events = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), new[] +var event = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), new[] { new Sealed.DecryptionKey(Convert.FromBase64String(sealedKey), Sealed.DecryptionAlgorithm.Aes256Gcm) }); - -Console.WriteLine(events.ToJson()); ``` -To learn more, refer to example located in [src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs](src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs). + +To learn more, refer to example located in [src/Fingerprint.ServerSdk.SealedResultExample/Program.cs](src/Fingerprint.ServerSdk.SealedResultExample/Program.cs). ## Webhook signature validation This SDK provides utility method for verifying the HMAC signature of the incoming webhook request. + ```csharp namespace FingerprintAspNetCore.Areas.Identity.Pages; -using FingerprintPro.ServerSdk; +using Fingerprint.ServerSdk; using Microsoft.AspNetCore.Mvc; using System; using System.IO; @@ -198,163 +217,55 @@ public class WebhookController : ControllerBase } } } - ``` -To learn more, refer to example located in [src/FingerprintPro.ServerSdk.WebhookExample/Program.cs](src/FingerprintPro.ServerSdk.WebhookExample/Program.cs). + +To learn more, refer to example located in [src/Fingerprint.ServerSdk.WebhookExample/Program.cs](src/Fingerprint.ServerSdk.WebhookExample/Program.cs). ## Documentation for API Endpoints -All URIs are relative to *https://api.fpjs.io* +All URIs are relative to *https://api.fpjs.io/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FingerprintApi* | [**DeleteVisitorData**](docs/FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID -*FingerprintApi* | [**GetEvent**](docs/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by request ID -*FingerprintApi* | [**GetRelatedVisitors**](docs/FingerprintApi.md#getrelatedvisitors) | **GET** /related-visitors | Get Related Visitors -*FingerprintApi* | [**GetVisits**](docs/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID -*FingerprintApi* | [**SearchEvents**](docs/FingerprintApi.md#searchevents) | **GET** /events/search | Get events via search -*FingerprintApi* | [**UpdateEvent**](docs/FingerprintApi.md#updateevent) | **PUT** /events/{request_id} | Update an event with a given request ID +*FingerprintApi* | [**DeleteVisitorDataAsync**](docs/FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID +*FingerprintApi* | [**GetEventAsync**](docs/FingerprintApi.md#getevent) | **GET** /events/{event_id} | Get an event by event ID +*FingerprintApi* | [**SearchEventsAsync**](docs/FingerprintApi.md#searchevents) | **GET** /events | Search events +*FingerprintApi* | [**UpdateEventAsync**](docs/FingerprintApi.md#updateevent) | **PATCH** /events/{event_id} | Update an event + ## Documentation for Models - - [Model.Botd](docs/Botd.md) - - [Model.BotdBot](docs/BotdBot.md) - - [Model.BotdBotResult](docs/BotdBotResult.md) - - [Model.BrowserDetails](docs/BrowserDetails.md) - - [Model.ClonedApp](docs/ClonedApp.md) - - [Model.DeprecatedGeolocation](docs/DeprecatedGeolocation.md) - - [Model.DeveloperTools](docs/DeveloperTools.md) - - [Model.Emulator](docs/Emulator.md) - - [Model.Error](docs/Error.md) - - [Model.ErrorCode](docs/ErrorCode.md) - - [Model.ErrorPlainResponse](docs/ErrorPlainResponse.md) - - [Model.ErrorResponse](docs/ErrorResponse.md) - - [Model.EventsGetResponse](docs/EventsGetResponse.md) - - [Model.EventsUpdateRequest](docs/EventsUpdateRequest.md) - - [Model.FactoryReset](docs/FactoryReset.md) - - [Model.Frida](docs/Frida.md) - - [Model.Geolocation](docs/Geolocation.md) - - [Model.GeolocationCity](docs/GeolocationCity.md) - - [Model.GeolocationContinent](docs/GeolocationContinent.md) - - [Model.GeolocationCountry](docs/GeolocationCountry.md) - - [Model.GeolocationSubdivision](docs/GeolocationSubdivision.md) - - [Model.GeolocationSubdivisions](docs/GeolocationSubdivisions.md) - - [Model.HighActivity](docs/HighActivity.md) - - [Model.IPBlocklist](docs/IPBlocklist.md) - - [Model.IPBlocklistDetails](docs/IPBlocklistDetails.md) - - [Model.IPInfo](docs/IPInfo.md) - - [Model.IPInfoASN](docs/IPInfoASN.md) - - [Model.IPInfoDataCenter](docs/IPInfoDataCenter.md) - - [Model.IPInfoV4](docs/IPInfoV4.md) - - [Model.IPInfoV6](docs/IPInfoV6.md) - - [Model.Identification](docs/Identification.md) - - [Model.IdentificationConfidence](docs/IdentificationConfidence.md) - - [Model.IdentificationSeenAt](docs/IdentificationSeenAt.md) - - [Model.Incognito](docs/Incognito.md) - - [Model.Jailbroken](docs/Jailbroken.md) - - [Model.LocationSpoofing](docs/LocationSpoofing.md) - - [Model.MitMAttack](docs/MitMAttack.md) - - [Model.PrivacySettings](docs/PrivacySettings.md) - - [Model.ProductBotd](docs/ProductBotd.md) - - [Model.ProductClonedApp](docs/ProductClonedApp.md) - - [Model.ProductDeveloperTools](docs/ProductDeveloperTools.md) - - [Model.ProductEmulator](docs/ProductEmulator.md) - - [Model.ProductFactoryReset](docs/ProductFactoryReset.md) - - [Model.ProductFrida](docs/ProductFrida.md) - - [Model.ProductHighActivity](docs/ProductHighActivity.md) - - [Model.ProductIPBlocklist](docs/ProductIPBlocklist.md) - - [Model.ProductIPInfo](docs/ProductIPInfo.md) - - [Model.ProductIdentification](docs/ProductIdentification.md) - - [Model.ProductIncognito](docs/ProductIncognito.md) - - [Model.ProductJailbroken](docs/ProductJailbroken.md) - - [Model.ProductLocationSpoofing](docs/ProductLocationSpoofing.md) - - [Model.ProductMitMAttack](docs/ProductMitMAttack.md) - - [Model.ProductPrivacySettings](docs/ProductPrivacySettings.md) - - [Model.ProductProximity](docs/ProductProximity.md) - - [Model.ProductProxy](docs/ProductProxy.md) - - [Model.ProductRawDeviceAttributes](docs/ProductRawDeviceAttributes.md) - - [Model.ProductRemoteControl](docs/ProductRemoteControl.md) - - [Model.ProductRootApps](docs/ProductRootApps.md) - - [Model.ProductSuspectScore](docs/ProductSuspectScore.md) - - [Model.ProductTampering](docs/ProductTampering.md) - - [Model.ProductTor](docs/ProductTor.md) - - [Model.ProductVPN](docs/ProductVPN.md) - - [Model.ProductVelocity](docs/ProductVelocity.md) - - [Model.ProductVirtualMachine](docs/ProductVirtualMachine.md) - - [Model.Products](docs/Products.md) - - [Model.Proximity](docs/Proximity.md) - - [Model.Proxy](docs/Proxy.md) - - [Model.ProxyConfidence](docs/ProxyConfidence.md) - - [Model.ProxyDetails](docs/ProxyDetails.md) - - [Model.RawDeviceAttribute](docs/RawDeviceAttribute.md) - - [Model.RawDeviceAttributeError](docs/RawDeviceAttributeError.md) - - [Model.RawDeviceAttributes](docs/RawDeviceAttributes.md) - - [Model.RelatedVisitor](docs/RelatedVisitor.md) - - [Model.RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md) - - [Model.RemoteControl](docs/RemoteControl.md) - - [Model.RootApps](docs/RootApps.md) - - [Model.SDK](docs/SDK.md) - - [Model.SearchEventsResponse](docs/SearchEventsResponse.md) - - [Model.SearchEventsResponseEvents](docs/SearchEventsResponseEvents.md) - - [Model.SupplementaryID](docs/SupplementaryID.md) - - [Model.SuspectScore](docs/SuspectScore.md) - - [Model.Tag](docs/Tag.md) - - [Model.Tampering](docs/Tampering.md) - - [Model.Tor](docs/Tor.md) - - [Model.VPN](docs/VPN.md) - - [Model.VPNConfidence](docs/VPNConfidence.md) - - [Model.VPNMethods](docs/VPNMethods.md) - - [Model.Velocity](docs/Velocity.md) - - [Model.VelocityData](docs/VelocityData.md) - - [Model.VelocityIntervals](docs/VelocityIntervals.md) - - [Model.VirtualMachine](docs/VirtualMachine.md) - - [Model.Visit](docs/Visit.md) - - [Model.VisitorsGetResponse](docs/VisitorsGetResponse.md) - - [Model.Webhook](docs/Webhook.md) - - [Model.WebhookClonedApp](docs/WebhookClonedApp.md) - - [Model.WebhookDeveloperTools](docs/WebhookDeveloperTools.md) - - [Model.WebhookEmulator](docs/WebhookEmulator.md) - - [Model.WebhookFactoryReset](docs/WebhookFactoryReset.md) - - [Model.WebhookFrida](docs/WebhookFrida.md) - - [Model.WebhookHighActivity](docs/WebhookHighActivity.md) - - [Model.WebhookIPBlocklist](docs/WebhookIPBlocklist.md) - - [Model.WebhookIPInfo](docs/WebhookIPInfo.md) - - [Model.WebhookJailbroken](docs/WebhookJailbroken.md) - - [Model.WebhookLocationSpoofing](docs/WebhookLocationSpoofing.md) - - [Model.WebhookMitMAttack](docs/WebhookMitMAttack.md) - - [Model.WebhookPrivacySettings](docs/WebhookPrivacySettings.md) - - [Model.WebhookProximity](docs/WebhookProximity.md) - - [Model.WebhookProxy](docs/WebhookProxy.md) - - [Model.WebhookRawDeviceAttributes](docs/WebhookRawDeviceAttributes.md) - - [Model.WebhookRemoteControl](docs/WebhookRemoteControl.md) - - [Model.WebhookRootApps](docs/WebhookRootApps.md) - - [Model.WebhookSupplementaryIDs](docs/WebhookSupplementaryIDs.md) - - [Model.WebhookSuspectScore](docs/WebhookSuspectScore.md) - - [Model.WebhookTampering](docs/WebhookTampering.md) - - [Model.WebhookTor](docs/WebhookTor.md) - - [Model.WebhookVPN](docs/WebhookVPN.md) - - [Model.WebhookVelocity](docs/WebhookVelocity.md) - - [Model.WebhookVirtualMachine](docs/WebhookVirtualMachine.md) - - -## Documentation for Authorization - - -### ApiKeyHeader - -- **Type**: API key -- **API key parameter name**: Auth-API-Key -- **Location**: HTTP header - - -### ApiKeyQuery - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: URL query string - + - [Model.BotResult](docs/models/BotResult.md) + - [Model.BrowserDetails](docs/models/BrowserDetails.md) + - [Model.Error](docs/models/Error.md) + - [Model.ErrorCode](docs/models/ErrorCode.md) + - [Model.ErrorResponse](docs/models/ErrorResponse.md) + - [Model.Event](docs/models/Event.md) + - [Model.EventSearch](docs/models/EventSearch.md) + - [Model.EventUpdate](docs/models/EventUpdate.md) + - [Model.Geolocation](docs/models/Geolocation.md) + - [Model.GeolocationSubdivisionsInner](docs/models/GeolocationSubdivisionsInner.md) + - [Model.IPBlockList](docs/models/IPBlockList.md) + - [Model.IPInfo](docs/models/IPInfo.md) + - [Model.IPInfoV4](docs/models/IPInfoV4.md) + - [Model.IPInfoV6](docs/models/IPInfoV6.md) + - [Model.Identification](docs/models/Identification.md) + - [Model.IdentificationConfidence](docs/models/IdentificationConfidence.md) + - [Model.Integration](docs/models/Integration.md) + - [Model.IntegrationSubintegration](docs/models/IntegrationSubintegration.md) + - [Model.Proximity](docs/models/Proximity.md) + - [Model.ProxyConfidence](docs/models/ProxyConfidence.md) + - [Model.ProxyDetails](docs/models/ProxyDetails.md) + - [Model.SDK](docs/models/SDK.md) + - [Model.SupplementaryIDHighRecall](docs/models/SupplementaryIDHighRecall.md) + - [Model.TamperingDetails](docs/models/TamperingDetails.md) + - [Model.TriggeredByInner](docs/models/TriggeredByInner.md) + - [Model.Velocity](docs/models/Velocity.md) + - [Model.VelocityData](docs/models/VelocityData.md) + - [Model.VpnConfidence](docs/models/VpnConfidence.md) + - [Model.VpnMethods](docs/models/VpnMethods.md) ## Documentation for sealed results diff --git a/bin/swagger-codegen-cli.jar b/bin/swagger-codegen-cli.jar deleted file mode 100644 index 204e76f..0000000 Binary files a/bin/swagger-codegen-cli.jar and /dev/null differ diff --git a/bumpConfig.mjs b/bumpConfig.mjs index 5e2a50b..4cfbad0 100644 --- a/bumpConfig.mjs +++ b/bumpConfig.mjs @@ -12,7 +12,7 @@ console.info('dirname', dirname); const paths = { config: path.resolve(dirname, './config.json'), - csproj: path.resolve(dirname, './src/FingerprintPro.ServerSdk/FingerprintPro.ServerSdk.csproj'), + csproj: path.resolve(dirname, './src/Fingerprint.ServerSdk/Fingerprint.ServerSdk.csproj'), } console.info('paths', paths); diff --git a/config.json b/config.json index 2a9dea2..0fc5b56 100644 --- a/config.json +++ b/config.json @@ -1,10 +1,44 @@ { - "packageName": "FingerprintPro.ServerSdk", + "packageName": "Fingerprint.ServerSdk", "packageVersion": "7.9.0", - "packageUrl": "https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk", + "packageGuid": "DEE4B355-41FC-4B06-92D3-FE21753D84EE", + "packageAuthors": "Fingerprint", + "packageCompany": "Fingerprint", + "packageProjectUrl": "https://fingerprint.com/", + "packageReadmeFile": "README.md", + "packageLicenseFile": "LICENSE", + "packageIcon": "logo.png", + "packageTitle": "Fingerprint Server API Dotnet SDK", + "packageDescription": "Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.", + "packageCopyright": "Copyright (c) 2023 FingerprintJS", + "packageTags": "browser,detection,fingerprint,identification,fingerprinting,browser-fingerprinting,fraud-detection,fraud,audio-fingerprinting,fingerprintjs,fingerprintjs-pro,visitor-identification", "gitUserId": "fingerprintjs", "gitRepoId": "fingerprint-pro-server-api-dotnet-sdk", - "projectGuid": "DEE4B355-41FC-4B06-92D3-FE21753D84EE", - "optionalAssemblyInfo": false, - "optionalProjectFile": false + "targetFramework": "net8.0;netstandard2.0;netstandard2.1;net48", + "testTargetFramework": "net8.0", + "library": "generichost", + "files": { + "Region.mustache": { + "folder": "src/Fingerprint.ServerSdk/Client", + "destinationFilename": "Region.cs" + }, + "Sealed.mustache": { + "folder": "src/Fingerprint.ServerSdk", + "destinationFilename": "Sealed.cs" + }, + "WebhookValidation.mustache": { + "folder": "src/Fingerprint.ServerSdk", + "destinationFilename": "WebhookValidation.cs" + }, + "DecryptionKey.md": { + "folder": "docs" + }, + "Sealed.md": { + "folder": "docs" + }, + "WebhookValidation.md": { + "folder": "docs" + } + }, + "releaseNote": null } \ No newline at end of file diff --git a/contributing.md b/contributing.md index 761706f..ee6ff44 100644 --- a/contributing.md +++ b/contributing.md @@ -1,4 +1,4 @@ -# Contributing to Fingerprint Server API SDK +# Contributing to Fingerprint Server Dotnet SDK ## Structure @@ -6,7 +6,7 @@ Most files in the project are autogenerated by [swagger-codegen](https://swagger - [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-generators/tree/master/src/main/resources/handlebars/csharp). - [docs](./docs) - generated documentation for models and [API Client](./docs/FingerprintApi.md). -- [src/FingerprintPro.ServerSdk](./src/FingerprintPro.ServerSdk) - API Client code is generated automatically. +- [src/Fingerprint.ServerSdk](./src/Fingerprint.ServerSdk) - API Client code is generated automatically. ## Code generation @@ -28,8 +28,8 @@ java -jar ./bin/swagger-codegen-cli.jar config-help -l csharp ### Running tests We have two type of tests: -- Unit tests, located in [src/FingerprintPro.ServerSdk.Test](src/FingerprintPro.ServerSdk.Test) -- Functional tests, that use real API located in [src/FingerprintPro.ServerSdk.FunctionalTest](src/FingerprintPro.ServerSdk.FunctionalTest) +- Unit tests, located in [src/Fingerprint.ServerSdk.Test](src/Fingerprint.ServerSdk.Test) +- Functional tests, that use real API located in [src/Fingerprint.ServerSdk.FunctionalTest](src/Fingerprint.ServerSdk.FunctionalTest) To run tests you can use IDE instruments or just run: @@ -41,7 +41,7 @@ dotnet test We recommend using our [docker-compose.yml](docker-compose.yml) file for running the project locally. To do that: -1. Build the image used for running the project: `docker build --tag fingerprint-pro-server-api-dotnet:latest ./` +1. Build the image used for running the project: `docker build --tag fingerprint-server-dotnet-sdk:latest ./` 2. Prepare env file based on the [.env.example](.env.example). 3. Run the example project: `docker compose run --rm example`. The `--rm` flag ensures the service is removed once the command completes execution. diff --git a/docker-compose.yml b/docker-compose.yml index d78a02d..f0ca9bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,27 +1,27 @@ -# Hint: run `docker build --tag fingerprint-pro-server-api-dotnet:latest ./` to prepare image required for these service +# Hint: run `docker build --tag fingerprint-server-dotnet-sdk:latest ./` to prepare image required for these service services: # Generic service for running arbitrary dotnet commands # Example usage: `docker compose run --rm dotnet "dotnet list package"` dotnet: - image: fingerprint-pro-server-api-dotnet:latest + image: fingerprint-server-dotnet-sdk:latest env_file: &env - .env volumes: &volumes - ./src:/src - - ./fingerprint-pro-server-api-dotnet-sdk.sln:/fingerprint-pro-server-api-dotnet-sdk.sln + - ./fingerprint-server-dotnet-sdk.sln:/fingerprint-server-dotnet-sdk.sln # Service for running example project. # To run, use: `docker compose run --rm example` example: - image: fingerprint-pro-server-api-dotnet:latest - command: ["dotnet", "run", "--project", "src/FingerprintPro.ServerSdk.Examples"] + image: fingerprint-server-dotnet-sdk:latest + command: ["dotnet", "run", "--project", "src/Fingerprint.ServerSdk.Examples"] env_file: *env volumes: *volumes # Service for running tests. # To run, use: `docker compose run --rm test` test: - image: fingerprint-pro-server-api-dotnet:latest + image: fingerprint-server-dotnet-sdk:latest command: ["dotnet", "test"] env_file: *env volumes: *volumes \ No newline at end of file diff --git a/docs/Botd.md b/docs/Botd.md deleted file mode 100644 index f7a7323..0000000 --- a/docs/Botd.md +++ /dev/null @@ -1,18 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Botd -Contains all the information from Bot Detection product - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bot** | [**BotdBot**](BotdBot.md) | | -**Meta** | [**Tag**](Tag.md) | | [optional] -**LinkedId** | **string** | A customer-provided id that was sent with the request. | [optional] -**Url** | **string** | Page URL from which the request was sent. | -**Ip** | **string** | IP address of the requesting browser or bot. | -**Time** | **DateTime?** | Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**UserAgent** | **string** | | -**RequestId** | **string** | Unique identifier of the user's request. | - -[[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/BotdBot.md b/docs/BotdBot.md deleted file mode 100644 index 8dac50b..0000000 --- a/docs/BotdBot.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.BotdBot -Stores bot detection result - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **BotdBotResult** | | -**Type** | **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/ClonedApp.md b/docs/ClonedApp.md deleted file mode 100644 index 580e0dc..0000000 --- a/docs/ClonedApp.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ClonedApp -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | - -[[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/DecryptionKey.md b/docs/DecryptionKey.md index c0285d8..d4b936e 100644 --- a/docs/DecryptionKey.md +++ b/docs/DecryptionKey.md @@ -1,10 +1,10 @@ -# FingerprintPro.ServerSdk.Sealed.DecryptionKey +# Fingerprint.ServerSdk.Sealed.DecryptionKey ## Properties -| Name | Type | Description | Notes | -|---------------|---------------------------------------------------------|------------------------------------------------------------------------------------|-------| -| **Key** | **byte[]** | Key generated in dashboard that will be used to decrypt sealed result | | -| **Algorithm** | **FingerprintPro.ServerSdk.Sealed.DecryptionAlgorithm** | Algorithm to use for decryption. Currently only "Aes256Gcm" value is supported. | | +| Name | Type | Description | Notes | +|---------------|------------------------------------------------------|------------------------------------------------------------------------------------|-------| +| **Key** | **byte[]** | Key generated in dashboard that will be used to decrypt sealed result | | +| **Algorithm** | **Fingerprint.ServerSdk.Sealed.DecryptionAlgorithm** | Algorithm to use for decryption. Currently only "Aes256Gcm" value is supported. | | diff --git a/docs/DeprecatedGeolocation.md b/docs/DeprecatedGeolocation.md deleted file mode 100644 index 5f56436..0000000 --- a/docs/DeprecatedGeolocation.md +++ /dev/null @@ -1,19 +0,0 @@ -# FingerprintPro.ServerSdk.Model.DeprecatedGeolocation -This field is **deprecated** and will not return a result for **applications created after January 23rd, 2024**. Please use the [IP Geolocation Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccuracyRadius** | **int?** | The IP address is likely to be within this radius (in km) of the specified location. | [optional] -**Latitude** | **double?** | | [optional] -**Longitude** | **double?** | | [optional] -**PostalCode** | **string** | | [optional] -**Timezone** | **string** | | [optional] -**City** | [**GeolocationCity**](GeolocationCity.md) | | [optional] -**Country** | [**GeolocationCountry**](GeolocationCountry.md) | | [optional] -**Continent** | [**GeolocationContinent**](GeolocationContinent.md) | | [optional] -**Subdivisions** | [**GeolocationSubdivisions**](GeolocationSubdivisions.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/DeveloperTools.md b/docs/DeveloperTools.md deleted file mode 100644 index 8325539..0000000 --- a/docs/DeveloperTools.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.DeveloperTools -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | - -[[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/Emulator.md b/docs/Emulator.md deleted file mode 100644 index a6b7fc3..0000000 --- a/docs/Emulator.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Emulator -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | - -[[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/Error.md b/docs/Error.md deleted file mode 100644 index 6349101..0000000 --- a/docs/Error.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Error -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **ErrorCode** | | -**Message** | **string** | | - -[[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/ErrorCode.md b/docs/ErrorCode.md deleted file mode 100644 index a5997e9..0000000 --- a/docs/ErrorCode.md +++ /dev/null @@ -1,21 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ErrorCode -Error code: - * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors - that prevented us from parsing it (wrong type/surpassed limits). - * `TokenRequired` - `Auth-API-Key` header is missing or empty. - * `TokenNotFound` - no Fingerprint application found for specified secret key. - * `SubscriptionNotActive` - Fingerprint application is not active. - * `WrongRegion` - server and application region differ. - * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application. - * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. - * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. - * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. - * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. - * `StateNotReady` - The event specified with request id is - not ready for updates yet. Try again. - This error happens in rare cases when update API is called immediately - after receiving the request id on the client. In case you need to send - information right away, we recommend using the JS agent API instead. - * `Failed` - internal server error. - - diff --git a/docs/ErrorPlainResponse.md b/docs/ErrorPlainResponse.md deleted file mode 100644 index 9f462ad..0000000 --- a/docs/ErrorPlainResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ErrorPlainResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | **string** | | - -[[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/ErrorResponse.md b/docs/ErrorResponse.md deleted file mode 100644 index a928dd3..0000000 --- a/docs/ErrorResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ErrorResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | [**Error**](Error.md) | | - -[[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/EventsGetResponse.md b/docs/EventsGetResponse.md deleted file mode 100644 index d3b3a77..0000000 --- a/docs/EventsGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.EventsGetResponse -Contains results from all activated products - Fingerprint Pro, Bot Detection, and others. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Products** | [**Products**](Products.md) | | - -[[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/EventsUpdateRequest.md b/docs/EventsUpdateRequest.md deleted file mode 100644 index a8b1c55..0000000 --- a/docs/EventsUpdateRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.EventsUpdateRequest -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**LinkedId** | **string** | LinkedID value to assign to the existing event | [optional] -**Tag** | [**Tag**](Tag.md) | | [optional] -**Suspect** | **bool?** | Suspect flag indicating observed suspicious or fraudulent event | [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/FactoryReset.md b/docs/FactoryReset.md deleted file mode 100644 index 057aeb4..0000000 --- a/docs/FactoryReset.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.FactoryReset -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Time** | **DateTime?** | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | -**Timestamp** | **long?** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | - -[[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/FingerprintApi.md b/docs/FingerprintApi.md index 94d5a37..ac5a0c2 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -1,61 +1,59 @@ -# FingerprintPro.ServerSdk.Api.FingerprintApi +# Fingerprint.ServerSdk.Api.FingerprintApi -All URIs are relative to *https://api.fpjs.io* +All URIs are relative to *https://api.fpjs.io/v4* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteVisitorData**](FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID -[**GetEvent**](FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by request ID -[**GetRelatedVisitors**](FingerprintApi.md#getrelatedvisitors) | **GET** /related-visitors | Get Related Visitors -[**GetVisits**](FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID -[**SearchEvents**](FingerprintApi.md#searchevents) | **GET** /events/search | Get events via search -[**UpdateEvent**](FingerprintApi.md#updateevent) | **PUT** /events/{request_id} | Update an event with a given request ID +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**DeleteVisitorData**](FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID | +| [**GetEvent**](FingerprintApi.md#getevent) | **GET** /events/{event_id} | Get an event by event ID | +| [**SearchEvents**](FingerprintApi.md#searchevents) | **GET** /events | Search events | +| [**UpdateEvent**](FingerprintApi.md#updateevent) | **PATCH** /events/{event_id} | Update an event | - + # **DeleteVisitorData** > void DeleteVisitorData (string visitorId) Delete data by visitor ID -Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. +Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. ### Example ```csharp -using System; using System.Diagnostics; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace Example +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Fingerprint.ServerSdk.Model; + +namespace DeleteVisitorDataExample { - public class DeleteVisitorDataExample + public static async Task Main(string[] args) { - public void main() - { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new FingerprintApi(configuration); - var visitorId = visitorId_example; // string | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. - - try - { - // Delete data by visitor ID - apiInstance.DeleteVisitorData(visitorId); - } - catch (Exception e) - { - Debug.Print("Exception when calling FingerprintApi.DeleteVisitorData: " + e.Message ); - } - } + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + + var visitorId = "visitorId_example"; // string | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. + + // Delete data by visitor ID + await api.DeleteVisitorDataAsync(visitorId); } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((_, _, options) => + { + BearerToken token = new("YOUR_API_KEY"); + options.AddTokens(token); + }); } ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **visitorId** | **string**| The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. | +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **visitorId** | **string** | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. | | ### Return type @@ -63,383 +61,281 @@ void (empty response body) ### Authorization -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +[bearerAuth](../README.md#bearerAuth) ### 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) - + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK. The visitor ID is scheduled for deletion. | - | +| **400** | Bad request. The visitor ID parameter is missing or in the wrong format. | - | +| **403** | Forbidden. Access to this API is denied. | - | +| **404** | Not found. The visitor ID cannot be found in this application's data. | - | +| **429** | Too Many Requests. The request is throttled. | - | + +[[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) + + # **GetEvent** -> EventsGetResponse GetEvent (string requestId) +> Event GetEvent (string eventId) -Get event by request ID +Get an event by event ID -Get a detailed analysis of an individual identification event, including Smart Signals. 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`. +Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. ### Example ```csharp -using System; using System.Diagnostics; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace Example +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Fingerprint.ServerSdk.Model; + +namespace GetEventExample { - public class GetEventExample + public static async Task Main(string[] args) { - public void main() - { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new FingerprintApi(configuration); - var requestId = requestId_example; // string | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. - - try - { - // Get event by request ID - EventsGetResponse result = apiInstance.GetEvent(requestId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling FingerprintApi.GetEvent: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestId** | **string**| The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. | + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); -### Return type + var eventId = "eventId_example"; // string | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). -[**EventsGetResponse**](EventsGetResponse.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) - -# **GetRelatedVisitors** -> RelatedVisitorsResponse GetRelatedVisitors (string visitorId) - -Get Related Visitors - -Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). - -### Example -```csharp -using System; -using System.Diagnostics; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; + // Get an event by event ID + IGetEventApiResponse result = await api.GetEventAsync(eventId); + Debug.WriteLine(result.Ok()); + } -namespace Example -{ - public class GetRelatedVisitorsExample - { - public void main() + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((_, _, options) => { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new FingerprintApi(configuration); - var visitorId = visitorId_example; // string | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. - - try - { - // Get Related Visitors - RelatedVisitorsResponse result = apiInstance.GetRelatedVisitors(visitorId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling FingerprintApi.GetRelatedVisitors: " + e.Message ); - } - } - } + BearerToken token = new("YOUR_API_KEY"); + options.AddTokens(token); + }); } ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **visitorId** | **string**| The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. | +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **eventId** | **string** | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). | | ### Return type -[**RelatedVisitorsResponse**](RelatedVisitorsResponse.md) +[**Event**](Event.md) ### Authorization -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +[bearerAuth](../README.md#bearerAuth) ### 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** -> VisitorsGetResponse GetVisits (string visitorId, string requestId = null, string linkedId = null, int? limit = null, string paginationKey = null, long? before = null) - -Get visits by visitor ID - -Get a history of visits (identification events) 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 -```csharp -using System; -using System.Diagnostics; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace Example -{ - public class GetVisitsExample - { - public void main() - { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new FingerprintApi(configuration); - var visitorId = visitorId_example; // string | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. - var requestId = requestId_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/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - var linkedId = linkedId_example; // string | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#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) - var 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. (optional) - var paginationKey = paginationKey_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. (optional) - var before = 789; // long? | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) - - try - { - // Get visits by visitor ID - VisitorsGetResponse result = apiInstance.GetVisits(visitorId, requestId, linkedId, limit, paginationKey, before); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling FingerprintApi.GetVisits: " + e.Message ); - } - } - } -} -``` +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK. | - | +| **400** | Bad request. The event Id provided is not valid. | - | +| **403** | Forbidden. Access to this API is denied. | - | +| **404** | Not found. The event Id cannot be found in this application's data. | - | +| **500** | Application error. | - | -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **visitorId** | **string**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. | - **requestId** | **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/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned. | [optional] - **linkedId** | **string**| Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#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] - **paginationKey** | **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** | **long?**| ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. | [optional] - -### Return type - -[**VisitorsGetResponse**](VisitorsGetResponse.md) - -### Authorization - -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) - -### HTTP request headers +[[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) - - **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) - + # **SearchEvents** -> SearchEventsResponse SearchEvents (int? limit, string paginationKey = null, string visitorId = null, string bot = null, string ipAddress = null, string linkedId = null, long? start = null, long? end = null, bool? reverse = null, bool? suspect = null, bool? vpn = null, bool? virtualMachine = null, bool? tampering = null, bool? antiDetectBrowser = null, bool? incognito = null, bool? privacySettings = null, bool? jailbroken = null, bool? frida = null, bool? factoryReset = null, bool? clonedApp = null, bool? emulator = null, bool? rootApps = null, string vpnConfidence = null, float? minSuspectScore = null, bool? ipBlocklist = null, bool? datacenter = null, bool? developerTools = null, bool? locationSpoofing = null, bool? mitmAttack = null, bool? proxy = null, string sdkVersion = null, string sdkPlatform = null, List environment = null, string proximityId = null, int? proximityPrecisionRadius = null) +> EventSearch SearchEvents (int limit = null, string paginationKey = null, string visitorId = null, string bot = null, string ipAddress = null, string linkedId = null, string url = null, string origin = null, long start = null, long end = null, bool reverse = null, bool suspect = null, bool vpn = null, bool virtualMachine = null, bool tampering = null, bool antiDetectBrowser = null, bool incognito = null, bool privacySettings = null, bool jailbroken = null, bool frida = null, bool factoryReset = null, bool clonedApp = null, bool emulator = null, bool rootApps = null, string vpnConfidence = null, float minSuspectScore = null, bool developerTools = null, bool locationSpoofing = null, bool mitmAttack = null, bool proxy = null, string sdkVersion = null, string sdkPlatform = null, List environment = null, long totalHits = null) -Get events via search +Search events -Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. +## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the`suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. ### Example ```csharp -using System; using System.Diagnostics; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace Example +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Fingerprint.ServerSdk.Model; + +namespace SearchEventsExample { - public class SearchEventsExample + public static async Task Main(string[] args) { - public void main() - { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new FingerprintApi(configuration); - var limit = 56; // int? | Limit the number of events returned. - var paginationKey = paginationKey_example; // string | Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` (optional) - var visitorId = visitorId_example; // string | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - var bot = bot_example; // string | Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) - var ipAddress = ipAddress_example; // string | Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - var linkedId = linkedId_example; // string | Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#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) - var start = 789; // long? | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - var end = 789; // long? | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - var reverse = true; // bool? | Sort events in reverse timestamp order. (optional) - var suspect = true; // bool? | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) - var vpn = true; // bool? | Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - var virtualMachine = true; // bool? | Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) - var tampering = true; // bool? | Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - var antiDetectBrowser = true; // bool? | Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - var incognito = true; // bool? | Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) - var privacySettings = true; // bool? | Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) - var jailbroken = true; // bool? | Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) - var frida = true; // bool? | Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) - var factoryReset = true; // bool? | Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) - var clonedApp = true; // bool? | Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) - var emulator = true; // bool? | Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) - var rootApps = true; // bool? | Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) - var vpnConfidence = vpnConfidence_example; // string | Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - var minSuspectScore = 3.4; // float? | Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) - var ipBlocklist = true; // bool? | Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) - var datacenter = true; // bool? | Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) - var developerTools = true; // bool? | Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response. (optional) - var locationSpoofing = true; // bool? | Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response. (optional) - var mitmAttack = true; // bool? | Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response. (optional) - var proxy = true; // bool? | Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response. (optional) - var sdkVersion = sdkVersion_example; // string | Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` (optional) - var sdkPlatform = sdkPlatform_example; // string | Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) - var environment = new List(); // List | Filter for events by providing one or more environment IDs. (optional) - var proximityId = proximityId_example; // string | Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response. (optional) - var proximityPrecisionRadius = 56; // int? | Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response. (optional) - - try - { - // Get events via search - SearchEventsResponse result = apiInstance.SearchEvents(limit, paginationKey, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, ipBlocklist, datacenter, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, proximityId, proximityPrecisionRadius); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling FingerprintApi.SearchEvents: " + e.Message ); - } - } + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + + var limit = 10; // int | Limit the number of events returned. (optional) (default to 10) + var paginationKey = "paginationKey_example"; // string | Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` (optional) + var visitorId = "visitorId_example"; // string | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. (optional) + var bot = "all"; // string | Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. (optional) + var ipAddress = "ipAddress_example"; // string | Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) + var linkedId = "linkedId_example"; // string | Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/get-function#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) + var url = "url_example"; // string | Filter events by the URL (`url` property) associated with the event. (optional) + var origin = "origin_example"; // string | Filter events by the origin field of the event. Origin could be the website domain or mobile app bundle ID (eg: com.foo.bar) (optional) + var start = 789L; // long | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + var end = 789L; // long | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + var reverse = true; // bool | Sort events in reverse timestamp order. (optional) + var suspect = true; // bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) + var vpn = true; // bool | Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + var virtualMachine = true; // bool | Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. (optional) + var tampering = true; // bool | Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + var antiDetectBrowser = true; // bool | Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + var incognito = true; // bool | Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. (optional) + var privacySettings = true; // bool | Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. (optional) + var jailbroken = true; // bool | Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. (optional) + var frida = true; // bool | Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. (optional) + var factoryReset = true; // bool | Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. (optional) + var clonedApp = true; // bool | Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. (optional) + var emulator = true; // bool | Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. (optional) + var rootApps = true; // bool | Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. (optional) + var vpnConfidence = "high,"; // string | Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + var minSuspectScore = 3.4F; // float | Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. (optional) + var developerTools = true; // bool | Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. (optional) + var locationSpoofing = true; // bool | Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. (optional) + var mitmAttack = true; // bool | Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. (optional) + var proxy = true; // bool | Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. (optional) + var sdkVersion = "sdkVersion_example"; // string | Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` (optional) + var sdkPlatform = "js"; // string | Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) + var environment = new List(); // List | Filter for events by providing one or more environment IDs (`environment_id` property). (optional) + var totalHits = 789L; // long | When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. (optional) + + // Search events + ISearchEventsApiResponse result = await api.SearchEventsAsync(limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits); + Debug.WriteLine(result.Ok()); } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((_, _, options) => + { + BearerToken token = new("YOUR_API_KEY"); + options.AddTokens(token); + }); } ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **int?**| Limit the number of events returned. | - **paginationKey** | **string**| Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` | [optional] - **visitorId** | **string**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. | [optional] - **bot** | **string**| Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. | [optional] - **ipAddress** | **string**| Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 | [optional] - **linkedId** | **string**| Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#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] - **start** | **long?**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional] - **end** | **long?**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional] - **reverse** | **bool?**| Sort events in reverse timestamp order. | [optional] - **suspect** | **bool?**| Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. | [optional] - **vpn** | **bool?**| Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. | [optional] - **virtualMachine** | **bool?**| Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. | [optional] - **tampering** | **bool?**| Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. | [optional] - **antiDetectBrowser** | **bool?**| Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. | [optional] - **incognito** | **bool?**| Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. | [optional] - **privacySettings** | **bool?**| Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. | [optional] - **jailbroken** | **bool?**| Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. | [optional] - **frida** | **bool?**| Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. | [optional] - **factoryReset** | **bool?**| Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. | [optional] - **clonedApp** | **bool?**| Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. | [optional] - **emulator** | **bool?**| Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. | [optional] - **rootApps** | **bool?**| Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. | [optional] - **vpnConfidence** | **string**| Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. | [optional] - **minSuspectScore** | **float?**| Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. | [optional] - **ipBlocklist** | **bool?**| Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. | [optional] - **datacenter** | **bool?**| Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. | [optional] - **developerTools** | **bool?**| Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response. | [optional] - **locationSpoofing** | **bool?**| Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response. | [optional] - **mitmAttack** | **bool?**| Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response. | [optional] - **proxy** | **bool?**| Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response. | [optional] - **sdkVersion** | **string**| Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` | [optional] - **sdkPlatform** | **string**| Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. | [optional] - **environment** | [**List<string>**](string.md)| Filter for events by providing one or more environment IDs. | [optional] - **proximityId** | **string**| Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response. | [optional] - **proximityPrecisionRadius** | **int?**| Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response. | [optional] +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **limit** | **int** | Limit the number of events returned. | [optional] [default to 10] | +| **paginationKey** | **string** | Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` | [optional] | +| **visitorId** | **string** | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. | [optional] | +| **bot** | **string** | Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. | [optional] | +| **ipAddress** | **string** | Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 | [optional] | +| **linkedId** | **string** | Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/get-function#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] | +| **url** | **string** | Filter events by the URL (`url` property) associated with the event. | [optional] | +| **origin** | **string** | Filter events by the origin field of the event. Origin could be the website domain or mobile app bundle ID (eg: com.foo.bar) | [optional] | +| **start** | **long** | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional] | +| **end** | **long** | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional] | +| **reverse** | **bool** | Sort events in reverse timestamp order. | [optional] | +| **suspect** | **bool** | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. | [optional] | +| **vpn** | **bool** | Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. | [optional] | +| **virtualMachine** | **bool** | Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. | [optional] | +| **tampering** | **bool** | Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. | [optional] | +| **antiDetectBrowser** | **bool** | Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. | [optional] | +| **incognito** | **bool** | Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. | [optional] | +| **privacySettings** | **bool** | Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. | [optional] | +| **jailbroken** | **bool** | Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. | [optional] | +| **frida** | **bool** | Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. | [optional] | +| **factoryReset** | **bool** | Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. | [optional] | +| **clonedApp** | **bool** | Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. | [optional] | +| **emulator** | **bool** | Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. | [optional] | +| **rootApps** | **bool** | Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. | [optional] | +| **vpnConfidence** | **string** | Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. | [optional] | +| **minSuspectScore** | **float** | Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. | [optional] | +| **developerTools** | **bool** | Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. | [optional] | +| **locationSpoofing** | **bool** | Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. | [optional] | +| **mitmAttack** | **bool** | Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. | [optional] | +| **proxy** | **bool** | Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. | [optional] | +| **sdkVersion** | **string** | Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` | [optional] | +| **sdkPlatform** | **string** | Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. | [optional] | +| **environment** | [**List<string>**](string.md) | Filter for events by providing one or more environment IDs (`environment_id` property). | [optional] | +| **totalHits** | **long** | When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. | [optional] | ### Return type -[**SearchEventsResponse**](SearchEventsResponse.md) +[**EventSearch**](EventSearch.md) ### Authorization -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +[bearerAuth](../README.md#bearerAuth) ### 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) - + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Events matching the filter(s). | - | +| **400** | Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. | - | +| **403** | Forbidden. Access to this API is denied. | - | +| **500** | Application error. | - | + +[[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) + + # **UpdateEvent** -> void UpdateEvent (EventsUpdateRequest body, string requestId) +> void UpdateEvent (string eventId, EventUpdate eventUpdate) -Update an event with a given request ID +Update an event -Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. +Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. ### Example ```csharp -using System; using System.Diagnostics; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace Example +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Fingerprint.ServerSdk.Model; + +namespace UpdateEventExample { - public class UpdateEventExample + public static async Task Main(string[] args) { - public void main() - { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new FingerprintApi(configuration); - var body = new EventsUpdateRequest(); // EventsUpdateRequest | - var requestId = requestId_example; // string | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). - - try - { - // Update an event with a given request ID - apiInstance.UpdateEvent(body, requestId); - } - catch (Exception e) - { - Debug.Print("Exception when calling FingerprintApi.UpdateEvent: " + e.Message ); - } - } + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + + var eventId = "eventId_example"; // string | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + var eventUpdate = new EventUpdate(); // EventUpdate | + + // Update an event + await api.UpdateEventAsync(eventId, eventUpdate); } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((_, _, options) => + { + BearerToken token = new("YOUR_API_KEY"); + options.AddTokens(token); + }); } ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**EventsUpdateRequest**](EventsUpdateRequest.md)| | - **requestId** | **string**| The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). | +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **eventId** | **string** | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). | | +| **eventUpdate** | [**EventUpdate**](EventUpdate.md) | | | ### Return type @@ -447,11 +343,22 @@ void (empty response body) ### Authorization -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **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) + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK. | - | +| **400** | Bad request. The request payload is not valid. | - | +| **403** | Forbidden. Access to this API is denied. | - | +| **404** | Not found. The event Id cannot be found in this application's data. | - | +| **409** | Conflict. The event is not mutable yet. | - | + +[[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) + diff --git a/docs/Frida.md b/docs/Frida.md deleted file mode 100644 index feef740..0000000 --- a/docs/Frida.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Frida -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | - -[[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/Geolocation.md b/docs/Geolocation.md deleted file mode 100644 index 1053d34..0000000 --- a/docs/Geolocation.md +++ /dev/null @@ -1,17 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Geolocation -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccuracyRadius** | **int?** | The IP address is likely to be within this radius (in km) of the specified location. | [optional] -**Latitude** | **double?** | | [optional] -**Longitude** | **double?** | | [optional] -**PostalCode** | **string** | | [optional] -**Timezone** | **string** | | [optional] -**City** | [**GeolocationCity**](GeolocationCity.md) | | [optional] -**Country** | [**GeolocationCountry**](GeolocationCountry.md) | | [optional] -**Continent** | [**GeolocationContinent**](GeolocationContinent.md) | | [optional] -**Subdivisions** | [**GeolocationSubdivisions**](GeolocationSubdivisions.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/GeolocationCity.md b/docs/GeolocationCity.md deleted file mode 100644 index 2608116..0000000 --- a/docs/GeolocationCity.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.GeolocationCity -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | - -[[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/GeolocationContinent.md b/docs/GeolocationContinent.md deleted file mode 100644 index 57fd3ad..0000000 --- a/docs/GeolocationContinent.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.GeolocationContinent -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **string** | | -**Name** | **string** | | - -[[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/GeolocationCountry.md b/docs/GeolocationCountry.md deleted file mode 100644 index b304b82..0000000 --- a/docs/GeolocationCountry.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.GeolocationCountry -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **string** | | -**Name** | **string** | | - -[[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/GeolocationSubdivision.md b/docs/GeolocationSubdivision.md deleted file mode 100644 index dd26b88..0000000 --- a/docs/GeolocationSubdivision.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.GeolocationSubdivision -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IsoCode** | **string** | | -**Name** | **string** | | - -[[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/GeolocationSubdivisions.md b/docs/GeolocationSubdivisions.md deleted file mode 100644 index c9945e9..0000000 --- a/docs/GeolocationSubdivisions.md +++ /dev/null @@ -1,8 +0,0 @@ -# FingerprintPro.ServerSdk.Model.GeolocationSubdivisions -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/HighActivity.md b/docs/HighActivity.md deleted file mode 100644 index 8d77126..0000000 --- a/docs/HighActivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.HighActivity -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Flag indicating if the request came from a high-activity visitor. | -**DailyRequests** | **long?** | Number of requests from the same visitor in the previous day. | [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/IPBlocklist.md b/docs/IPBlocklist.md deleted file mode 100644 index 570d586..0000000 --- a/docs/IPBlocklist.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IPBlocklist -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. | -**Details** | [**IPBlocklistDetails**](IPBlocklistDetails.md) | | - -[[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/IPBlocklistDetails.md b/docs/IPBlocklistDetails.md deleted file mode 100644 index c63ed24..0000000 --- a/docs/IPBlocklistDetails.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IPBlocklistDetails -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EmailSpam** | **bool?** | IP address was part of a known email spam attack (SMTP). | -**AttackSource** | **bool?** | IP address was part of a known network attack (SSH/HTTPS). | - -[[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/IPInfoASN.md b/docs/IPInfoASN.md deleted file mode 100644 index 50c8b05..0000000 --- a/docs/IPInfoASN.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IPInfoASN -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Asn** | **string** | | -**Name** | **string** | | -**Network** | **string** | | - -[[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/IPInfoDataCenter.md b/docs/IPInfoDataCenter.md deleted file mode 100644 index 4a802d7..0000000 --- a/docs/IPInfoDataCenter.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IPInfoDataCenter -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | | -**Name** | **string** | | - -[[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/IPInfoV4.md b/docs/IPInfoV4.md deleted file mode 100644 index 6dc208b..0000000 --- a/docs/IPInfoV4.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IPInfoV4 -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Address** | **string** | | -**Geolocation** | [**Geolocation**](Geolocation.md) | | -**Asn** | [**IPInfoASN**](IPInfoASN.md) | | [optional] -**Datacenter** | [**IPInfoDataCenter**](IPInfoDataCenter.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/IPInfoV6.md b/docs/IPInfoV6.md deleted file mode 100644 index 5c5eae6..0000000 --- a/docs/IPInfoV6.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IPInfoV6 -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Address** | **string** | | -**Geolocation** | [**Geolocation**](Geolocation.md) | | -**Asn** | [**IPInfoASN**](IPInfoASN.md) | | [optional] -**Datacenter** | [**IPInfoDataCenter**](IPInfoDataCenter.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/Identification.md b/docs/Identification.md deleted file mode 100644 index f389b3c..0000000 --- a/docs/Identification.md +++ /dev/null @@ -1,28 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Identification -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VisitorId** | **string** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | -**RequestId** | **string** | Unique identifier of the user's request. | -**BrowserDetails** | [**BrowserDetails**](BrowserDetails.md) | | -**Incognito** | **bool?** | Flag if user used incognito session. | -**Ip** | **string** | IP address of the requesting browser or bot. | -**IpLocation** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] -**LinkedId** | **string** | A customer-provided id that was sent with the request. | [optional] -**Suspect** | **bool?** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). | [optional] -**Timestamp** | **long?** | Timestamp of the event with millisecond precision in Unix time. | -**Time** | **DateTime?** | Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**Url** | **string** | Page URL from which the request was sent. | -**Tag** | [**Tag**](Tag.md) | | -**Confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**VisitorFound** | **bool?** | Attribute represents if a visitor had been identified before. | -**FirstSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**LastSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**Components** | [**RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] -**Replayed** | **bool?** | `true` if we determined that this payload was replayed, `false` otherwise. | -**Sdk** | [**SDK**](SDK.md) | | [optional] -**EnvironmentId** | **string** | Environment ID associated with the event | [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/IdentificationConfidence.md b/docs/IdentificationConfidence.md deleted file mode 100644 index 4c07893..0000000 --- a/docs/IdentificationConfidence.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IdentificationConfidence -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Score** | **double?** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. | -**Revision** | **string** | The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [optional] -**Comment** | **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/IdentificationSeenAt.md b/docs/IdentificationSeenAt.md deleted file mode 100644 index d450767..0000000 --- a/docs/IdentificationSeenAt.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.IdentificationSeenAt -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Global** | **DateTime?** | | -**Subscription** | **DateTime?** | | - -[[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/Incognito.md b/docs/Incognito.md deleted file mode 100644 index 9b22ba5..0000000 --- a/docs/Incognito.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Incognito -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if we detected incognito mode used in the browser, `false` otherwise. | - -[[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/Jailbroken.md b/docs/Jailbroken.md deleted file mode 100644 index e574db9..0000000 --- a/docs/Jailbroken.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Jailbroken -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | - -[[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/LocationSpoofing.md b/docs/LocationSpoofing.md deleted file mode 100644 index c2b7ce7..0000000 --- a/docs/LocationSpoofing.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.LocationSpoofing -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | - -[[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/MitMAttack.md b/docs/MitMAttack.md deleted file mode 100644 index 965d67f..0000000 --- a/docs/MitMAttack.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.MitMAttack -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | - -[[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/PrivacySettings.md b/docs/PrivacySettings.md deleted file mode 100644 index f35efd7..0000000 --- a/docs/PrivacySettings.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.PrivacySettings -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | - -[[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/ProductBotd.md b/docs/ProductBotd.md deleted file mode 100644 index daf6e60..0000000 --- a/docs/ProductBotd.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductBotd -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Botd**](Botd.md) | | [optional] -**Error** | [**Error**](Error.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/ProductClonedApp.md b/docs/ProductClonedApp.md deleted file mode 100644 index 50d5e8f..0000000 --- a/docs/ProductClonedApp.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductClonedApp -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ClonedApp**](ClonedApp.md) | | [optional] -**Error** | [**Error**](Error.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/ProductDeveloperTools.md b/docs/ProductDeveloperTools.md deleted file mode 100644 index f7ea939..0000000 --- a/docs/ProductDeveloperTools.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductDeveloperTools -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**DeveloperTools**](DeveloperTools.md) | | [optional] -**Error** | [**Error**](Error.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/ProductEmulator.md b/docs/ProductEmulator.md deleted file mode 100644 index 0e97a06..0000000 --- a/docs/ProductEmulator.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductEmulator -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Emulator**](Emulator.md) | | [optional] -**Error** | [**Error**](Error.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/ProductFactoryReset.md b/docs/ProductFactoryReset.md deleted file mode 100644 index fe11edc..0000000 --- a/docs/ProductFactoryReset.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductFactoryReset -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**FactoryReset**](FactoryReset.md) | | [optional] -**Error** | [**Error**](Error.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/ProductFrida.md b/docs/ProductFrida.md deleted file mode 100644 index c626f96..0000000 --- a/docs/ProductFrida.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductFrida -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Frida**](Frida.md) | | [optional] -**Error** | [**Error**](Error.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/ProductHighActivity.md b/docs/ProductHighActivity.md deleted file mode 100644 index 3729bcb..0000000 --- a/docs/ProductHighActivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductHighActivity -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**HighActivity**](HighActivity.md) | | [optional] -**Error** | [**Error**](Error.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/ProductIPBlocklist.md b/docs/ProductIPBlocklist.md deleted file mode 100644 index 8406176..0000000 --- a/docs/ProductIPBlocklist.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductIPBlocklist -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**IPBlocklist**](IPBlocklist.md) | | [optional] -**Error** | [**Error**](Error.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/ProductIPInfo.md b/docs/ProductIPInfo.md deleted file mode 100644 index a40a2cf..0000000 --- a/docs/ProductIPInfo.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductIPInfo -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**IPInfo**](IPInfo.md) | | [optional] -**Error** | [**Error**](Error.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/ProductIdentification.md b/docs/ProductIdentification.md deleted file mode 100644 index 0b2f9b2..0000000 --- a/docs/ProductIdentification.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductIdentification -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Identification**](Identification.md) | | [optional] -**Error** | [**Error**](Error.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/ProductIncognito.md b/docs/ProductIncognito.md deleted file mode 100644 index dac1da4..0000000 --- a/docs/ProductIncognito.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductIncognito -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Incognito**](Incognito.md) | | [optional] -**Error** | [**Error**](Error.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/ProductJailbroken.md b/docs/ProductJailbroken.md deleted file mode 100644 index 9617b59..0000000 --- a/docs/ProductJailbroken.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductJailbroken -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Jailbroken**](Jailbroken.md) | | [optional] -**Error** | [**Error**](Error.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/ProductLocationSpoofing.md b/docs/ProductLocationSpoofing.md deleted file mode 100644 index 7e76aec..0000000 --- a/docs/ProductLocationSpoofing.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductLocationSpoofing -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**LocationSpoofing**](LocationSpoofing.md) | | [optional] -**Error** | [**Error**](Error.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/ProductMitMAttack.md b/docs/ProductMitMAttack.md deleted file mode 100644 index 4f716ac..0000000 --- a/docs/ProductMitMAttack.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductMitMAttack -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**MitMAttack**](MitMAttack.md) | | [optional] -**Error** | [**Error**](Error.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/ProductPrivacySettings.md b/docs/ProductPrivacySettings.md deleted file mode 100644 index 0d461a9..0000000 --- a/docs/ProductPrivacySettings.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductPrivacySettings -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**PrivacySettings**](PrivacySettings.md) | | [optional] -**Error** | [**Error**](Error.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/ProductProximity.md b/docs/ProductProximity.md deleted file mode 100644 index c629450..0000000 --- a/docs/ProductProximity.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductProximity -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Proximity**](Proximity.md) | | [optional] -**Error** | [**Error**](Error.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/ProductProxy.md b/docs/ProductProxy.md deleted file mode 100644 index fab2f7a..0000000 --- a/docs/ProductProxy.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductProxy -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Proxy**](Proxy.md) | | [optional] -**Error** | [**Error**](Error.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/ProductRawDeviceAttributes.md b/docs/ProductRawDeviceAttributes.md deleted file mode 100644 index a5060c8..0000000 --- a/docs/ProductRawDeviceAttributes.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductRawDeviceAttributes -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] -**Error** | [**Error**](Error.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/ProductRemoteControl.md b/docs/ProductRemoteControl.md deleted file mode 100644 index 43054b2..0000000 --- a/docs/ProductRemoteControl.md +++ /dev/null @@ -1,13 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductRemoteControl -This product is deprecated. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RemoteControl**](RemoteControl.md) | | [optional] -**Error** | [**Error**](Error.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/ProductRootApps.md b/docs/ProductRootApps.md deleted file mode 100644 index 7d1e399..0000000 --- a/docs/ProductRootApps.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductRootApps -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RootApps**](RootApps.md) | | [optional] -**Error** | [**Error**](Error.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/ProductSuspectScore.md b/docs/ProductSuspectScore.md deleted file mode 100644 index 1ccb417..0000000 --- a/docs/ProductSuspectScore.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductSuspectScore -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**SuspectScore**](SuspectScore.md) | | [optional] -**Error** | [**Error**](Error.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/ProductTampering.md b/docs/ProductTampering.md deleted file mode 100644 index 03c6f7a..0000000 --- a/docs/ProductTampering.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductTampering -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Tampering**](Tampering.md) | | [optional] -**Error** | [**Error**](Error.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/ProductTor.md b/docs/ProductTor.md deleted file mode 100644 index 40e88be..0000000 --- a/docs/ProductTor.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductTor -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Tor**](Tor.md) | | [optional] -**Error** | [**Error**](Error.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/ProductVPN.md b/docs/ProductVPN.md deleted file mode 100644 index 71e3eac..0000000 --- a/docs/ProductVPN.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductVPN -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**VPN**](VPN.md) | | [optional] -**Error** | [**Error**](Error.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/ProductVelocity.md b/docs/ProductVelocity.md deleted file mode 100644 index 99a7a1e..0000000 --- a/docs/ProductVelocity.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductVelocity -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Velocity**](Velocity.md) | | [optional] -**Error** | [**Error**](Error.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/ProductVirtualMachine.md b/docs/ProductVirtualMachine.md deleted file mode 100644 index 76840c6..0000000 --- a/docs/ProductVirtualMachine.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProductVirtualMachine -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**VirtualMachine**](VirtualMachine.md) | | [optional] -**Error** | [**Error**](Error.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/Products.md b/docs/Products.md deleted file mode 100644 index 9ac2762..0000000 --- a/docs/Products.md +++ /dev/null @@ -1,36 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Products -Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise) - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Identification** | [**ProductIdentification**](ProductIdentification.md) | | [optional] -**Botd** | [**ProductBotd**](ProductBotd.md) | | [optional] -**RootApps** | [**ProductRootApps**](ProductRootApps.md) | | [optional] -**Emulator** | [**ProductEmulator**](ProductEmulator.md) | | [optional] -**IpInfo** | [**ProductIPInfo**](ProductIPInfo.md) | | [optional] -**IpBlocklist** | [**ProductIPBlocklist**](ProductIPBlocklist.md) | | [optional] -**Tor** | [**ProductTor**](ProductTor.md) | | [optional] -**Vpn** | [**ProductVPN**](ProductVPN.md) | | [optional] -**Proxy** | [**ProductProxy**](ProductProxy.md) | | [optional] -**Incognito** | [**ProductIncognito**](ProductIncognito.md) | | [optional] -**Tampering** | [**ProductTampering**](ProductTampering.md) | | [optional] -**ClonedApp** | [**ProductClonedApp**](ProductClonedApp.md) | | [optional] -**FactoryReset** | [**ProductFactoryReset**](ProductFactoryReset.md) | | [optional] -**Jailbroken** | [**ProductJailbroken**](ProductJailbroken.md) | | [optional] -**Frida** | [**ProductFrida**](ProductFrida.md) | | [optional] -**PrivacySettings** | [**ProductPrivacySettings**](ProductPrivacySettings.md) | | [optional] -**VirtualMachine** | [**ProductVirtualMachine**](ProductVirtualMachine.md) | | [optional] -**RawDeviceAttributes** | [**ProductRawDeviceAttributes**](ProductRawDeviceAttributes.md) | | [optional] -**HighActivity** | [**ProductHighActivity**](ProductHighActivity.md) | | [optional] -**LocationSpoofing** | [**ProductLocationSpoofing**](ProductLocationSpoofing.md) | | [optional] -**SuspectScore** | [**ProductSuspectScore**](ProductSuspectScore.md) | | [optional] -**RemoteControl** | [**ProductRemoteControl**](ProductRemoteControl.md) | | [optional] -**Velocity** | [**ProductVelocity**](ProductVelocity.md) | | [optional] -**DeveloperTools** | [**ProductDeveloperTools**](ProductDeveloperTools.md) | | [optional] -**MitmAttack** | [**ProductMitMAttack**](ProductMitMAttack.md) | | [optional] -**Proximity** | [**ProductProximity**](ProductProximity.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/Proximity.md b/docs/Proximity.md deleted file mode 100644 index 7597ae2..0000000 --- a/docs/Proximity.md +++ /dev/null @@ -1,14 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Proximity -Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A stable privacy-preserving identifier for a given proximity zone. | -**PrecisionRadius** | **int?** | The radius of the proximity zone’s precision level, in meters. | -**Confidence** | **float?** | A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. | - -[[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/Proxy.md b/docs/Proxy.md deleted file mode 100644 index 0a8746c..0000000 --- a/docs/Proxy.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Proxy -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | -**Confidence** | **ProxyConfidence** | | -**Details** | [**ProxyDetails**](ProxyDetails.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/ProxyConfidence.md b/docs/ProxyConfidence.md deleted file mode 100644 index 8c3877c..0000000 --- a/docs/ProxyConfidence.md +++ /dev/null @@ -1,6 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProxyConfidence -Confidence level of the proxy detection. -If a proxy is not detected, confidence is "high". -If it's detected, can be "low", "medium", or "high". - - diff --git a/docs/ProxyDetails.md b/docs/ProxyDetails.md deleted file mode 100644 index a3b7dc1..0000000 --- a/docs/ProxyDetails.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.ProxyDetails -Proxy detection details (present if proxy is detected) - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ProxyType** | **string** | Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers | -**LastSeenAt** | **DateTime?** | ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. | [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/RawDeviceAttribute.md b/docs/RawDeviceAttribute.md deleted file mode 100644 index edf46c6..0000000 --- a/docs/RawDeviceAttribute.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RawDeviceAttribute -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Value** | **JsonElement** | | [optional] -**Error** | [**RawDeviceAttributeError**](RawDeviceAttributeError.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/RawDeviceAttributeError.md b/docs/RawDeviceAttributeError.md deleted file mode 100644 index f55dd8b..0000000 --- a/docs/RawDeviceAttributeError.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RawDeviceAttributeError -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] -**Message** | **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/RawDeviceAttributes.md b/docs/RawDeviceAttributes.md deleted file mode 100644 index d710abf..0000000 --- a/docs/RawDeviceAttributes.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RawDeviceAttributes -It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. -Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/RelatedVisitor.md b/docs/RelatedVisitor.md deleted file mode 100644 index d2c8a3b..0000000 --- a/docs/RelatedVisitor.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RelatedVisitor -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VisitorId** | **string** | Visitor ID of a browser that originates from the same mobile device as the input visitor ID. | - -[[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/RelatedVisitorsResponse.md b/docs/RelatedVisitorsResponse.md deleted file mode 100644 index d7ec36e..0000000 --- a/docs/RelatedVisitorsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RelatedVisitorsResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RelatedVisitors** | [**List<RelatedVisitor>**](RelatedVisitor.md) | | - -[[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/RemoteControl.md b/docs/RemoteControl.md deleted file mode 100644 index dc0147d..0000000 --- a/docs/RemoteControl.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RemoteControl -This signal is deprecated. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | - -[[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/RootApps.md b/docs/RootApps.md deleted file mode 100644 index 7a85453..0000000 --- a/docs/RootApps.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.RootApps -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | - -[[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/SDK.md b/docs/SDK.md deleted file mode 100644 index 007d591..0000000 --- a/docs/SDK.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.SDK -Contains information about the SDK used to perform the request. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Platform** | **string** | Platform of the SDK. | -**Version** | **string** | SDK version string. | - -[[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/Sealed.md b/docs/Sealed.md index 348df86..dc5f891 100644 --- a/docs/Sealed.md +++ b/docs/Sealed.md @@ -1,14 +1,27 @@ -# FingerprintPro.ServerSdk.Sealed +# Fingerprint.ServerSdk.Sealed ## **UnsealEventsResponse** -> EventResponse unsealEventResponse(sealed []byte, keys DecryptionKey[]) +> Event UnsealEventResponse(sealedData []byte, keys DecryptionKey[]) -Decrypts the sealed response with provided keys. +Decrypts the sealed response with provided keys and returns deserialized Event instance. ### Required Parameters -| Name | Type | Description | Notes | -|------------|---------------------|------------------------------------------------------------------------------------------|-------| -| **sealed** | **byte[]** | Base64 encoded sealed data | | -| **keys** | **DecryptionKey[]** | Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. | | +| Name | Type | Description | Notes | +|----------------|---------------------|------------------------------------------------------------------------------------------|-------| +| **sealedData** | **byte[]** | Base64 encoded sealed data | | +| **keys** | **DecryptionKey[]** | Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. | | + +## **Unseal** + +> byte[] Unseal(sealedData []byte, keys DecryptionKey[]) + +Decrypts the sealed response with provided keys and returns byte array. + +### Required Parameters + +| Name | Type | Description | Notes | +|----------------|---------------------|------------------------------------------------------------------------------------------|-------| +| **sealedData** | **byte[]** | Base64 encoded sealed data | | +| **keys** | **DecryptionKey[]** | Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. | | diff --git a/docs/SearchEventsResponse.md b/docs/SearchEventsResponse.md deleted file mode 100644 index 8ce8754..0000000 --- a/docs/SearchEventsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.SearchEventsResponse -Contains a list of all identification events matching the specified search criteria. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Events** | [**List<SearchEventsResponseEvents>**](SearchEventsResponseEvents.md) | | [optional] -**PaginationKey** | **string** | Use this value in the `pagination_key` parameter to request the next page of search results. | [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/SearchEventsResponseEvents.md b/docs/SearchEventsResponseEvents.md deleted file mode 100644 index 2ee306a..0000000 --- a/docs/SearchEventsResponseEvents.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.SearchEventsResponseEvents -Device intelligence results for the identification event. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Products** | [**Products**](Products.md) | | - -[[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/SupplementaryID.md b/docs/SupplementaryID.md deleted file mode 100644 index 284a85d..0000000 --- a/docs/SupplementaryID.md +++ /dev/null @@ -1,13 +0,0 @@ -# FingerprintPro.ServerSdk.Model.SupplementaryID -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VisitorId** | **string** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | [optional] -**VisitorFound** | **bool?** | Attribute represents if a visitor had been identified before. | [optional] -**Confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**FirstSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | [optional] -**LastSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.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/SuspectScore.md b/docs/SuspectScore.md deleted file mode 100644 index d25edd2..0000000 --- a/docs/SuspectScore.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.SuspectScore -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **int?** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | - -[[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/Tag.md b/docs/Tag.md deleted file mode 100644 index 018a386..0000000 --- a/docs/Tag.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Tag -A customer-provided value or an object that was sent with identification request. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/Tampering.md b/docs/Tampering.md deleted file mode 100644 index 93f214c..0000000 --- a/docs/Tampering.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Tampering -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. | -**AnomalyScore** | **double?** | A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. | -**AntiDetectBrowser** | **bool?** | Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. | - -[[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/Tor.md b/docs/Tor.md deleted file mode 100644 index d628964..0000000 --- a/docs/Tor.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Tor -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request IP address is a known tor exit node, `false` otherwise. | - -[[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/VPN.md b/docs/VPN.md deleted file mode 100644 index 43fb353..0000000 --- a/docs/VPN.md +++ /dev/null @@ -1,13 +0,0 @@ -# FingerprintPro.ServerSdk.Model.VPN -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | VPN or other anonymizing service has been used when sending the request. | -**Confidence** | **VPNConfidence** | | -**OriginTimezone** | **string** | Local timezone which is used in timezoneMismatch method. | -**OriginCountry** | **string** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | -**Methods** | [**VPNMethods**](VPNMethods.md) | | - -[[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/VPNMethods.md b/docs/VPNMethods.md deleted file mode 100644 index 6c03243..0000000 --- a/docs/VPNMethods.md +++ /dev/null @@ -1,13 +0,0 @@ -# FingerprintPro.ServerSdk.Model.VPNMethods -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TimezoneMismatch** | **bool?** | The browser timezone doesn't match the timezone inferred from the request IP address. | -**PublicVPN** | **bool?** | Request IP address is owned and used by a public VPN service provider. | -**AuxiliaryMobile** | **bool?** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | -**OsMismatch** | **bool?** | The browser runs on a different operating system than the operating system inferred from the request network signature. | -**Relay** | **bool?** | Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. | - -[[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/Velocity.md b/docs/Velocity.md deleted file mode 100644 index a422c70..0000000 --- a/docs/Velocity.md +++ /dev/null @@ -1,32 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Velocity -Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time -intervals: 5 minutes, 1 hour, and 24 hours as follows: - -- Number of distinct IP addresses associated to the visitor ID. -- Number of distinct linked IDs associated with the visitor ID. -- Number of distinct countries associated with the visitor ID. -- Number of identification events associated with the visitor ID. -- Number of identification events associated with the detected IP address. -- Number of distinct IP addresses associated with the provided linked ID. -- Number of distinct visitor IDs associated with the provided linked ID. - -The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, -`distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted -if the number of `events` for the visitor ID in the last 24 -hours (`events.intervals.['24h']`) is higher than 20.000. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DistinctIp** | [**VelocityData**](VelocityData.md) | | -**DistinctLinkedId** | [**VelocityData**](VelocityData.md) | | -**DistinctCountry** | [**VelocityData**](VelocityData.md) | | -**Events** | [**VelocityData**](VelocityData.md) | | -**IpEvents** | [**VelocityData**](VelocityData.md) | | -**DistinctIpByLinkedId** | [**VelocityData**](VelocityData.md) | | -**DistinctVisitorIdByLinkedId** | [**VelocityData**](VelocityData.md) | | - -[[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/VelocityData.md b/docs/VelocityData.md deleted file mode 100644 index 1351c42..0000000 --- a/docs/VelocityData.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.VelocityData -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Intervals** | [**VelocityIntervals**](VelocityIntervals.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/VelocityIntervals.md b/docs/VelocityIntervals.md deleted file mode 100644 index d0fa5da..0000000 --- a/docs/VelocityIntervals.md +++ /dev/null @@ -1,14 +0,0 @@ -# FingerprintPro.ServerSdk.Model.VelocityIntervals -Is absent if the velocity data could not be generated for the visitor ID. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_5m** | **int?** | | -**_1h** | **int?** | | -**_24h** | **int?** | The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. | [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/VirtualMachine.md b/docs/VirtualMachine.md deleted file mode 100644 index ebebde5..0000000 --- a/docs/VirtualMachine.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.VirtualMachine -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | - -[[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/Visit.md b/docs/Visit.md deleted file mode 100644 index 0c7eb60..0000000 --- a/docs/Visit.md +++ /dev/null @@ -1,23 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Visit -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RequestId** | **string** | Unique identifier of the user's request. | -**BrowserDetails** | [**BrowserDetails**](BrowserDetails.md) | | -**Incognito** | **bool?** | Flag if user used incognito session. | -**Ip** | **string** | IP address of the requesting browser or bot. | -**IpLocation** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] -**LinkedId** | **string** | A customer-provided id that was sent with the request. | [optional] -**Timestamp** | **long?** | Timestamp of the event with millisecond precision in Unix time. | -**Time** | **DateTime?** | Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**Url** | **string** | Page URL from which the request was sent. | -**Tag** | [**Tag**](Tag.md) | | -**Confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**VisitorFound** | **bool?** | Attribute represents if a visitor had been identified before. | -**FirstSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**LastSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**Components** | [**RawDeviceAttributes**](RawDeviceAttributes.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/VisitorsGetResponse.md b/docs/VisitorsGetResponse.md deleted file mode 100644 index 30afce8..0000000 --- a/docs/VisitorsGetResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# FingerprintPro.ServerSdk.Model.VisitorsGetResponse -Pagination-related fields `lastTimestamp` and `paginationKey` are included if you use a pagination parameter like `limit` or `before` and there is more data available on the next page. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VisitorId** | **string** | | -**Visits** | [**List<Visit>**](Visit.md) | | -**LastTimestamp** | **long?** | ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. | [optional] -**PaginationKey** | **string** | Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. | [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/Webhook.md b/docs/Webhook.md deleted file mode 100644 index 281ecb6..0000000 --- a/docs/Webhook.md +++ /dev/null @@ -1,54 +0,0 @@ -# FingerprintPro.ServerSdk.Model.Webhook -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RequestId** | **string** | Unique identifier of the user's request. | -**Url** | **string** | Page URL from which the request was sent. | -**Ip** | **string** | IP address of the requesting browser or bot. | -**EnvironmentId** | **string** | Environment ID of the event. | [optional] -**Tag** | [**Tag**](Tag.md) | | [optional] -**Time** | **DateTime?** | Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**Timestamp** | **long?** | Timestamp of the event with millisecond precision in Unix time. | -**IpLocation** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] -**LinkedId** | **string** | A customer-provided id that was sent with the request. | [optional] -**VisitorId** | **string** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | [optional] -**VisitorFound** | **bool?** | Attribute represents if a visitor had been identified before. | [optional] -**Confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**FirstSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | [optional] -**LastSeenAt** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | [optional] -**BrowserDetails** | [**BrowserDetails**](BrowserDetails.md) | | [optional] -**Incognito** | **bool?** | Flag if user used incognito session. | [optional] -**ClientReferrer** | **string** | | [optional] -**Components** | [**RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] -**Bot** | [**BotdBot**](BotdBot.md) | | [optional] -**UserAgent** | **string** | | [optional] -**RootApps** | [**WebhookRootApps**](WebhookRootApps.md) | | [optional] -**Emulator** | [**WebhookEmulator**](WebhookEmulator.md) | | [optional] -**IpInfo** | [**WebhookIPInfo**](WebhookIPInfo.md) | | [optional] -**IpBlocklist** | [**WebhookIPBlocklist**](WebhookIPBlocklist.md) | | [optional] -**Tor** | [**WebhookTor**](WebhookTor.md) | | [optional] -**Vpn** | [**WebhookVPN**](WebhookVPN.md) | | [optional] -**Proxy** | [**WebhookProxy**](WebhookProxy.md) | | [optional] -**Tampering** | [**WebhookTampering**](WebhookTampering.md) | | [optional] -**ClonedApp** | [**WebhookClonedApp**](WebhookClonedApp.md) | | [optional] -**FactoryReset** | [**WebhookFactoryReset**](WebhookFactoryReset.md) | | [optional] -**Jailbroken** | [**WebhookJailbroken**](WebhookJailbroken.md) | | [optional] -**Frida** | [**WebhookFrida**](WebhookFrida.md) | | [optional] -**PrivacySettings** | [**WebhookPrivacySettings**](WebhookPrivacySettings.md) | | [optional] -**VirtualMachine** | [**WebhookVirtualMachine**](WebhookVirtualMachine.md) | | [optional] -**RawDeviceAttributes** | [**WebhookRawDeviceAttributes**](WebhookRawDeviceAttributes.md) | | [optional] -**HighActivity** | [**WebhookHighActivity**](WebhookHighActivity.md) | | [optional] -**LocationSpoofing** | [**WebhookLocationSpoofing**](WebhookLocationSpoofing.md) | | [optional] -**SuspectScore** | [**WebhookSuspectScore**](WebhookSuspectScore.md) | | [optional] -**RemoteControl** | [**WebhookRemoteControl**](WebhookRemoteControl.md) | | [optional] -**Velocity** | [**WebhookVelocity**](WebhookVelocity.md) | | [optional] -**DeveloperTools** | [**WebhookDeveloperTools**](WebhookDeveloperTools.md) | | [optional] -**MitmAttack** | [**WebhookMitMAttack**](WebhookMitMAttack.md) | | [optional] -**Replayed** | **bool?** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] -**Sdk** | [**SDK**](SDK.md) | | -**SupplementaryIds** | [**WebhookSupplementaryIDs**](WebhookSupplementaryIDs.md) | | [optional] -**Proximity** | [**WebhookProximity**](WebhookProximity.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/WebhookClonedApp.md b/docs/WebhookClonedApp.md deleted file mode 100644 index 2a6b24c..0000000 --- a/docs/WebhookClonedApp.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookClonedApp -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | [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/WebhookDeveloperTools.md b/docs/WebhookDeveloperTools.md deleted file mode 100644 index 5d3c01b..0000000 --- a/docs/WebhookDeveloperTools.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookDeveloperTools -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | [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/WebhookEmulator.md b/docs/WebhookEmulator.md deleted file mode 100644 index 624b0f3..0000000 --- a/docs/WebhookEmulator.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookEmulator -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | [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/WebhookFactoryReset.md b/docs/WebhookFactoryReset.md deleted file mode 100644 index ce5a4de..0000000 --- a/docs/WebhookFactoryReset.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookFactoryReset -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Time** | **DateTime?** | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | [optional] -**Timestamp** | **long?** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | [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/WebhookFrida.md b/docs/WebhookFrida.md deleted file mode 100644 index 356c325..0000000 --- a/docs/WebhookFrida.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookFrida -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | [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/WebhookHighActivity.md b/docs/WebhookHighActivity.md deleted file mode 100644 index 5d29c19..0000000 --- a/docs/WebhookHighActivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookHighActivity -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Flag indicating if the request came from a high-activity visitor. | -**DailyRequests** | **long?** | Number of requests from the same visitor in the previous day. | [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/WebhookIPBlocklist.md b/docs/WebhookIPBlocklist.md deleted file mode 100644 index 4955801..0000000 --- a/docs/WebhookIPBlocklist.md +++ /dev/null @@ -1,10 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookIPBlocklist -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. | [optional] -**Details** | [**IPBlocklistDetails**](IPBlocklistDetails.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/WebhookIPInfo.md b/docs/WebhookIPInfo.md deleted file mode 100644 index 0d7768d..0000000 --- a/docs/WebhookIPInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookIPInfo -Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**V4** | [**IPInfoV4**](IPInfoV4.md) | | [optional] -**V6** | [**IPInfoV6**](IPInfoV6.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/WebhookJailbroken.md b/docs/WebhookJailbroken.md deleted file mode 100644 index 81a778c..0000000 --- a/docs/WebhookJailbroken.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookJailbroken -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [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/WebhookLocationSpoofing.md b/docs/WebhookLocationSpoofing.md deleted file mode 100644 index 507aecd..0000000 --- a/docs/WebhookLocationSpoofing.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookLocationSpoofing -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | [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/WebhookMitMAttack.md b/docs/WebhookMitMAttack.md deleted file mode 100644 index f02dff5..0000000 --- a/docs/WebhookMitMAttack.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookMitMAttack -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. | [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/WebhookPrivacySettings.md b/docs/WebhookPrivacySettings.md deleted file mode 100644 index 09524bd..0000000 --- a/docs/WebhookPrivacySettings.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookPrivacySettings -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | [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/WebhookProximity.md b/docs/WebhookProximity.md deleted file mode 100644 index 0a942a6..0000000 --- a/docs/WebhookProximity.md +++ /dev/null @@ -1,14 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookProximity -Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A stable privacy-preserving identifier for a given proximity zone. | -**PrecisionRadius** | **int?** | The radius of the proximity zone’s precision level, in meters. | -**Confidence** | **float?** | A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. | - -[[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/WebhookProxy.md b/docs/WebhookProxy.md deleted file mode 100644 index aa045ff..0000000 --- a/docs/WebhookProxy.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookProxy -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] -**Confidence** | **ProxyConfidence** | | [optional] -**Details** | [**ProxyDetails**](ProxyDetails.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/WebhookRawDeviceAttributes.md b/docs/WebhookRawDeviceAttributes.md deleted file mode 100644 index a678dca..0000000 --- a/docs/WebhookRawDeviceAttributes.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookRawDeviceAttributes -It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. -Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/WebhookRemoteControl.md b/docs/WebhookRemoteControl.md deleted file mode 100644 index 41f4e82..0000000 --- a/docs/WebhookRemoteControl.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookRemoteControl -This signal is deprecated. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | [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/WebhookRootApps.md b/docs/WebhookRootApps.md deleted file mode 100644 index b36e1a8..0000000 --- a/docs/WebhookRootApps.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookRootApps -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | [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/WebhookSupplementaryIDs.md b/docs/WebhookSupplementaryIDs.md deleted file mode 100644 index cb12c4c..0000000 --- a/docs/WebhookSupplementaryIDs.md +++ /dev/null @@ -1,12 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookSupplementaryIDs -Other identities that have been established for a given Visitor. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Standard** | [**SupplementaryID**](SupplementaryID.md) | | -**HighRecall** | [**SupplementaryID**](SupplementaryID.md) | | - -[[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/WebhookSuspectScore.md b/docs/WebhookSuspectScore.md deleted file mode 100644 index e71b216..0000000 --- a/docs/WebhookSuspectScore.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookSuspectScore -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **int?** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | [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/WebhookTampering.md b/docs/WebhookTampering.md deleted file mode 100644 index aad0dd7..0000000 --- a/docs/WebhookTampering.md +++ /dev/null @@ -1,11 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookTampering -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. | [optional] -**AnomalyScore** | **double?** | A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. | [optional] -**AntiDetectBrowser** | **bool?** | Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. | [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/WebhookTor.md b/docs/WebhookTor.md deleted file mode 100644 index 3db7713..0000000 --- a/docs/WebhookTor.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookTor -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request IP address is a known tor exit node, `false` otherwise. | [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/WebhookVPN.md b/docs/WebhookVPN.md deleted file mode 100644 index 97e7d69..0000000 --- a/docs/WebhookVPN.md +++ /dev/null @@ -1,13 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookVPN -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | VPN or other anonymizing service has been used when sending the request. | [optional] -**Confidence** | **VPNConfidence** | | [optional] -**OriginTimezone** | **string** | Local timezone which is used in timezoneMismatch method. | [optional] -**OriginCountry** | **string** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | [optional] -**Methods** | [**VPNMethods**](VPNMethods.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/WebhookValidation.md b/docs/WebhookValidation.md index 3b66f8d..ac4664b 100644 --- a/docs/WebhookValidation.md +++ b/docs/WebhookValidation.md @@ -1,4 +1,4 @@ -# FingerprintPro.ServerSdk.WebhookValidation +# Fingerprint.ServerSdk.WebhookValidation ## **IsValidSignature** diff --git a/docs/WebhookVelocity.md b/docs/WebhookVelocity.md deleted file mode 100644 index b237761..0000000 --- a/docs/WebhookVelocity.md +++ /dev/null @@ -1,32 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookVelocity -Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time -intervals: 5 minutes, 1 hour, and 24 hours as follows: - -- Number of distinct IP addresses associated to the visitor ID. -- Number of distinct linked IDs associated with the visitor ID. -- Number of distinct countries associated with the visitor ID. -- Number of identification events associated with the visitor ID. -- Number of identification events associated with the detected IP address. -- Number of distinct IP addresses associated with the provided linked ID. -- Number of distinct visitor IDs associated with the provided linked ID. - -The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, -`distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted -if the number of `events` for the visitor ID in the last 24 -hours (`events.intervals.['24h']`) is higher than 20.000. - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DistinctIp** | [**VelocityData**](VelocityData.md) | | [optional] -**DistinctLinkedId** | [**VelocityData**](VelocityData.md) | | [optional] -**DistinctCountry** | [**VelocityData**](VelocityData.md) | | [optional] -**Events** | [**VelocityData**](VelocityData.md) | | [optional] -**IpEvents** | [**VelocityData**](VelocityData.md) | | [optional] -**DistinctIpByLinkedId** | [**VelocityData**](VelocityData.md) | | [optional] -**DistinctVisitorIdByLinkedId** | [**VelocityData**](VelocityData.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/WebhookVirtualMachine.md b/docs/WebhookVirtualMachine.md deleted file mode 100644 index 5c18c16..0000000 --- a/docs/WebhookVirtualMachine.md +++ /dev/null @@ -1,9 +0,0 @@ -# FingerprintPro.ServerSdk.Model.WebhookVirtualMachine -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool?** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | [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/BotdBotResult.md b/docs/models/BotResult.md similarity index 69% rename from docs/BotdBotResult.md rename to docs/models/BotResult.md index 5ebde3a..68c3837 100644 --- a/docs/BotdBotResult.md +++ b/docs/models/BotResult.md @@ -1,7 +1,6 @@ -# FingerprintPro.ServerSdk.Model.BotdBotResult +# Fingerprint.ServerSdk.Model.BotResult Bot detection result: - * `notDetected` - the visitor is not a bot + * `not_detected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - diff --git a/docs/BrowserDetails.md b/docs/models/BrowserDetails.md similarity index 56% rename from docs/BrowserDetails.md rename to docs/models/BrowserDetails.md index cbee467..c83909c 100644 --- a/docs/BrowserDetails.md +++ b/docs/models/BrowserDetails.md @@ -1,4 +1,5 @@ -# FingerprintPro.ServerSdk.Model.BrowserDetails +# Fingerprint.ServerSdk.Model.BrowserDetails + ## Properties Name | Type | Description | Notes @@ -9,7 +10,6 @@ Name | Type | Description | Notes **Os** | **string** | | **OsVersion** | **string** | | **Device** | **string** | | -**UserAgent** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[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/models/Error.md b/docs/models/Error.md new file mode 100644 index 0000000..bb2f836 --- /dev/null +++ b/docs/models/Error.md @@ -0,0 +1,11 @@ +# Fingerprint.ServerSdk.Model.Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **ErrorCode** | | +**Message** | **string** | | + +[[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/models/ErrorCode.md b/docs/models/ErrorCode.md new file mode 100644 index 0000000..034db7e --- /dev/null +++ b/docs/models/ErrorCode.md @@ -0,0 +1,24 @@ +# Fingerprint.ServerSdk.Model.ErrorCode +Error code: +* `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors + that prevented us from parsing it (wrong type/surpassed limits). +* `secret_api_key_required` - secret API key in header is missing or empty. +* `secret_api_key_not_found` - No Fingerprint application found for specified secret API key. +* `public_api_key_required` - public API key in header is missing or empty. +* `public_api_key_not_found` - No Fingerprint application found for specified public API key. +* `subscription_not_active` - Fingerprint application is not active. +* `wrong_region` - Server and application region differ. +* `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your application. +* `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. +* `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. +* `too_many_requests` - The limit on secret API key requests per second has been exceeded. +* `state_not_ready` - The event specified with event ID is + not ready for updates yet. Try again. + This error happens in rare cases when update API is called immediately + after receiving the event ID on the client. In case you need to send + information right away, we recommend using the JS agent API instead. +* `failed` - Internal server error. +* `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. +* `missing_module` - The request is invalid because it is missing a required module. +* `payload_too_large` - The request payload is too large and cannot be processed. + diff --git a/docs/models/ErrorResponse.md b/docs/models/ErrorResponse.md new file mode 100644 index 0000000..73220c1 --- /dev/null +++ b/docs/models/ErrorResponse.md @@ -0,0 +1,10 @@ +# Fingerprint.ServerSdk.Model.ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | [**Error**](Error.md) | | + +[[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/models/Event.md b/docs/models/Event.md new file mode 100644 index 0000000..6cb6d29 --- /dev/null +++ b/docs/models/Event.md @@ -0,0 +1,55 @@ +# Fingerprint.ServerSdk.Model.Event +Contains results from Fingerprint Identification and all active Smart Signals. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventId** | **string** | Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` | +**Timestamp** | **long** | Timestamp of the event with millisecond precision in Unix time. | +**LinkedId** | **string** | A customer-provided id that was sent with the request. | [optional] +**EnvironmentId** | **string** | Environment Id of the event. For example: `ae_47abaca3db2c7c43` | [optional] +**Suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). | [optional] +**Sdk** | [**SDK**](SDK.md) | | [optional] +**Replayed** | **bool** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] +**Identification** | [**Identification**](Identification.md) | | [optional] +**SupplementaryIdHighRecall** | [**SupplementaryIDHighRecall**](SupplementaryIDHighRecall.md) | | [optional] +**Tags** | **Object** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] +**Url** | **string** | Page URL from which the request was sent. For example `https://example.com/` | [optional] +**BundleId** | **string** | Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` | [optional] +**PackageName** | **string** | Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` | [optional] +**IpAddress** | **string** | IP address of the requesting browser or bot. | [optional] +**UserAgent** | **string** | User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` | [optional] +**BrowserDetails** | [**BrowserDetails**](BrowserDetails.md) | | [optional] +**Proximity** | [**Proximity**](Proximity.md) | | [optional] +**Bot** | **BotResult** | | [optional] +**BotType** | **string** | Additional classification of the bot type if detected. | [optional] +**ClonedApp** | **bool** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | [optional] +**DeveloperTools** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | [optional] +**Emulator** | **bool** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | [optional] +**FactoryResetTimestamp** | **long** | The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | [optional] +**Frida** | **bool** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | [optional] +**IpBlocklist** | [**IPBlockList**](IPBlockList.md) | | [optional] +**IpInfo** | [**IPInfo**](IPInfo.md) | | [optional] +**Proxy** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] +**ProxyConfidence** | **ProxyConfidence** | | [optional] +**ProxyDetails** | [**ProxyDetails**](ProxyDetails.md) | | [optional] +**Incognito** | **bool** | `true` if we detected incognito mode used in the browser, `false` otherwise. | [optional] +**Jailbroken** | **bool** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [optional] +**LocationSpoofing** | **bool** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | [optional] +**MitmAttack** | **bool** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | [optional] +**PrivacySettings** | **bool** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | [optional] +**RootApps** | **bool** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | [optional] +**SuspectScore** | **int** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | [optional] +**Tampering** | **bool** | Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). | [optional] +**TamperingDetails** | [**TamperingDetails**](TamperingDetails.md) | | [optional] +**Velocity** | [**Velocity**](Velocity.md) | | [optional] +**VirtualMachine** | **bool** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | [optional] +**Vpn** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] +**VpnConfidence** | **VpnConfidence** | | [optional] +**VpnOriginTimezone** | **string** | Local timezone which is used in timezone_mismatch method. | [optional] +**VpnOriginCountry** | **string** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | [optional] +**VpnMethods** | [**VpnMethods**](VpnMethods.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/models/EventSearch.md b/docs/models/EventSearch.md new file mode 100644 index 0000000..2bb3e88 --- /dev/null +++ b/docs/models/EventSearch.md @@ -0,0 +1,13 @@ +# Fingerprint.ServerSdk.Model.EventSearch +Contains a list of all identification events matching the specified search criteria. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Events** | [**List<Event>**](Event.md) | | +**PaginationKey** | **string** | Use this value in the `pagination_key` parameter to request the next page of search results. | [optional] +**TotalHits** | **long** | This value represents the total number of events matching the search query, up to the limit provided in the `total_hits` query parameter. Only present if the `total_hits` query parameter was provided. | [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/models/EventUpdate.md b/docs/models/EventUpdate.md new file mode 100644 index 0000000..95f01b9 --- /dev/null +++ b/docs/models/EventUpdate.md @@ -0,0 +1,12 @@ +# Fingerprint.ServerSdk.Model.EventUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LinkedId** | **string** | Linked Id value to assign to the existing event | [optional] +**Tags** | **Dictionary<string, Object>** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] +**Suspect** | **bool** | Suspect flag indicating observed suspicious or fraudulent event | [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/models/Geolocation.md b/docs/models/Geolocation.md new file mode 100644 index 0000000..f5d7ee5 --- /dev/null +++ b/docs/models/Geolocation.md @@ -0,0 +1,20 @@ +# Fingerprint.ServerSdk.Model.Geolocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccuracyRadius** | **int** | The IP address is likely to be within this radius (in km) of the specified location. | [optional] +**Latitude** | **double** | | [optional] +**Longitude** | **double** | | [optional] +**PostalCode** | **string** | | [optional] +**Timezone** | **string** | | [optional] +**CityName** | **string** | | [optional] +**CountryCode** | **string** | | [optional] +**CountryName** | **string** | | [optional] +**ContinentCode** | **string** | | [optional] +**ContinentName** | **string** | | [optional] +**Subdivisions** | [**List<GeolocationSubdivisionsInner>**](GeolocationSubdivisionsInner.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/models/GeolocationSubdivisionsInner.md b/docs/models/GeolocationSubdivisionsInner.md new file mode 100644 index 0000000..2019a39 --- /dev/null +++ b/docs/models/GeolocationSubdivisionsInner.md @@ -0,0 +1,11 @@ +# Fingerprint.ServerSdk.Model.GeolocationSubdivisionsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsoCode** | **string** | | +**Name** | **string** | | + +[[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/models/IPBlockList.md b/docs/models/IPBlockList.md new file mode 100644 index 0000000..bacc9ef --- /dev/null +++ b/docs/models/IPBlockList.md @@ -0,0 +1,12 @@ +# Fingerprint.ServerSdk.Model.IPBlockList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailSpam** | **bool** | IP address was part of a known email spam attack (SMTP). | [optional] +**AttackSource** | **bool** | IP address was part of a known network attack (SSH/HTTPS). | [optional] +**TorNode** | **bool** | IP address was part of known TOR network activity. | [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/IPInfo.md b/docs/models/IPInfo.md similarity index 60% rename from docs/IPInfo.md rename to docs/models/IPInfo.md index cffb68c..217e07c 100644 --- a/docs/IPInfo.md +++ b/docs/models/IPInfo.md @@ -1,4 +1,4 @@ -# FingerprintPro.ServerSdk.Model.IPInfo +# Fingerprint.ServerSdk.Model.IPInfo Details about the request IP address. Has separate fields for v4 and v6 IP address versions. ## Properties @@ -8,5 +8,5 @@ Name | Type | Description | Notes **V4** | [**IPInfoV4**](IPInfoV4.md) | | [optional] **V6** | [**IPInfoV6**](IPInfoV6.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) +[[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/models/IPInfoV4.md b/docs/models/IPInfoV4.md new file mode 100644 index 0000000..35b7180 --- /dev/null +++ b/docs/models/IPInfoV4.md @@ -0,0 +1,16 @@ +# Fingerprint.ServerSdk.Model.IPInfoV4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**Geolocation** | [**Geolocation**](Geolocation.md) | | [optional] +**Asn** | **string** | | [optional] +**AsnName** | **string** | | [optional] +**AsnNetwork** | **string** | | [optional] +**DatacenterResult** | **bool** | | [optional] +**DatacenterName** | **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/models/IPInfoV6.md b/docs/models/IPInfoV6.md new file mode 100644 index 0000000..8537cb3 --- /dev/null +++ b/docs/models/IPInfoV6.md @@ -0,0 +1,16 @@ +# Fingerprint.ServerSdk.Model.IPInfoV6 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**Geolocation** | [**Geolocation**](Geolocation.md) | | [optional] +**Asn** | **string** | | [optional] +**AsnName** | **string** | | [optional] +**AsnNetwork** | **string** | | [optional] +**DatacenterResult** | **bool** | | [optional] +**DatacenterName** | **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/models/Identification.md b/docs/models/Identification.md new file mode 100644 index 0000000..a3d3eaf --- /dev/null +++ b/docs/models/Identification.md @@ -0,0 +1,14 @@ +# Fingerprint.ServerSdk.Model.Identification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VisitorId** | **string** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | +**VisitorFound** | **bool** | Attribute represents if a visitor had been identified before. | +**Confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] +**FirstSeenAt** | **long** | Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [optional] +**LastSeenAt** | **long** | Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [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/models/IdentificationConfidence.md b/docs/models/IdentificationConfidence.md new file mode 100644 index 0000000..72ff749 --- /dev/null +++ b/docs/models/IdentificationConfidence.md @@ -0,0 +1,12 @@ +# Fingerprint.ServerSdk.Model.IdentificationConfidence + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Score** | **double** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. | +**VarVersion** | **string** | The version name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [optional] +**Comment** | **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/models/Integration.md b/docs/models/Integration.md new file mode 100644 index 0000000..2c6eedf --- /dev/null +++ b/docs/models/Integration.md @@ -0,0 +1,12 @@ +# Fingerprint.ServerSdk.Model.Integration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the specific integration, e.g. \"fingerprint-pro-react\". | [optional] +**VarVersion** | **string** | The version of the specific integration, e.g. \"3.11.10\". | [optional] +**Subintegration** | [**IntegrationSubintegration**](IntegrationSubintegration.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/models/IntegrationSubintegration.md b/docs/models/IntegrationSubintegration.md new file mode 100644 index 0000000..ba14707 --- /dev/null +++ b/docs/models/IntegrationSubintegration.md @@ -0,0 +1,11 @@ +# Fingerprint.ServerSdk.Model.IntegrationSubintegration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the specific subintegration, e.g. \"preact\". | [optional] +**VarVersion** | **string** | The version of the specific subintegration, e.g. \"10.21.0\". | [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/models/Proximity.md b/docs/models/Proximity.md new file mode 100644 index 0000000..025b458 --- /dev/null +++ b/docs/models/Proximity.md @@ -0,0 +1,14 @@ +# Fingerprint.ServerSdk.Model.Proximity +Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A stable privacy-preserving identifier for a given proximity zone. | +**PrecisionRadius** | **int** | The radius of the proximity zone’s precision level, in meters. | +**Confidence** | **float** | A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. | + +[[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/models/ProxyConfidence.md b/docs/models/ProxyConfidence.md new file mode 100644 index 0000000..96b496a --- /dev/null +++ b/docs/models/ProxyConfidence.md @@ -0,0 +1,3 @@ +# Fingerprint.ServerSdk.Model.ProxyConfidence +Confidence level of the proxy detection. If a proxy is not detected, confidence is "high". If it's detected, can be "low", "medium", or "high". + diff --git a/docs/models/ProxyDetails.md b/docs/models/ProxyDetails.md new file mode 100644 index 0000000..0662e87 --- /dev/null +++ b/docs/models/ProxyDetails.md @@ -0,0 +1,12 @@ +# Fingerprint.ServerSdk.Model.ProxyDetails +Proxy detection details (present if `proxy` is `true`) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProxyType** | **string** | Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers | +**LastSeenAt** | **long** | Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy | [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/models/SDK.md b/docs/models/SDK.md new file mode 100644 index 0000000..f2da259 --- /dev/null +++ b/docs/models/SDK.md @@ -0,0 +1,13 @@ +# Fingerprint.ServerSdk.Model.SDK +Contains information about the SDK used to perform the request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Platform** | **string** | Platform of the SDK used for the identification request. | +**VarVersion** | **string** | Version string of the SDK used for the identification request. For example: `\"3.12.1\"` | +**Integrations** | [**List<Integration>**](Integration.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/models/SupplementaryIDHighRecall.md b/docs/models/SupplementaryIDHighRecall.md new file mode 100644 index 0000000..1889063 --- /dev/null +++ b/docs/models/SupplementaryIDHighRecall.md @@ -0,0 +1,15 @@ +# Fingerprint.ServerSdk.Model.SupplementaryIDHighRecall +A supplementary browser identifier that prioritizes coverage over precision. The High Recall ID algorithm matches more generously, i.e., this identifier will remain the same even when there are subtle differences between two requests. This algorithm does not create as many new visitor IDs as the standard algorithms do, but there could be an increase in false-positive identification. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VisitorId** | **string** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | +**VisitorFound** | **bool** | Attribute represents if a visitor had been identified before. | +**Confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] +**FirstSeenAt** | **long** | Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [optional] +**LastSeenAt** | **long** | Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [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/models/TamperingDetails.md b/docs/models/TamperingDetails.md new file mode 100644 index 0000000..271de82 --- /dev/null +++ b/docs/models/TamperingDetails.md @@ -0,0 +1,11 @@ +# Fingerprint.ServerSdk.Model.TamperingDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnomalyScore** | **double** | Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. | [optional] +**AntiDetectBrowser** | **bool** | True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. | [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/models/TriggeredByInner.md b/docs/models/TriggeredByInner.md new file mode 100644 index 0000000..42c7e25 --- /dev/null +++ b/docs/models/TriggeredByInner.md @@ -0,0 +1,12 @@ +# Fingerprint.ServerSdk.Model.TriggeredByInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | **string** | | +**Description** | **string** | | + +[[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/models/Velocity.md b/docs/models/Velocity.md new file mode 100644 index 0000000..d1cd57f --- /dev/null +++ b/docs/models/Velocity.md @@ -0,0 +1,35 @@ +# Fingerprint.ServerSdk.Model.Velocity +Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time +intervals: 5 minutes, 1 hour, and 24 hours as follows: + +- Number of distinct IP addresses associated to the visitor Id. +- Number of distinct linked Ids associated with the visitor Id. +- Number of distinct countries associated with the visitor Id. +- Number of identification events associated with the visitor Id. +- Number of identification events associated with the detected IP address. +- Number of distinct IP addresses associated with the provided linked Id. +- Number of distinct visitor Ids associated with the provided linked Id. + +The `24h` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, +`distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted +if the number of `events` for the visitor Id in the last 24 +hours (`events.['24h']`) is higher than 20.000. + +All will not necessarily be returned in a response, some may be omitted if the +associated event does not have the required data, such as a linked_id. + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DistinctIp** | [**VelocityData**](VelocityData.md) | | [optional] +**DistinctLinkedId** | [**VelocityData**](VelocityData.md) | | [optional] +**DistinctCountry** | [**VelocityData**](VelocityData.md) | | [optional] +**Events** | [**VelocityData**](VelocityData.md) | | [optional] +**IpEvents** | [**VelocityData**](VelocityData.md) | | [optional] +**DistinctIpByLinkedId** | [**VelocityData**](VelocityData.md) | | [optional] +**DistinctVisitorIdByLinkedId** | [**VelocityData**](VelocityData.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/models/VelocityData.md b/docs/models/VelocityData.md new file mode 100644 index 0000000..15f6592 --- /dev/null +++ b/docs/models/VelocityData.md @@ -0,0 +1,14 @@ +# Fingerprint.ServerSdk.Model.VelocityData +Is absent if the velocity data could not be generated for the visitor Id. + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var5Minutes** | **int** | Count for the last 5 minutes of velocity data, from the time of the event. | +**Var1Hour** | **int** | Count for the last 1 hour of velocity data, from the time of the event. | +**Var24Hours** | **int** | The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. | [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/VPNConfidence.md b/docs/models/VpnConfidence.md similarity index 76% rename from docs/VPNConfidence.md rename to docs/models/VpnConfidence.md index d5ca103..c60f8f2 100644 --- a/docs/VPNConfidence.md +++ b/docs/models/VpnConfidence.md @@ -1,3 +1,2 @@ -# FingerprintPro.ServerSdk.Model.VPNConfidence +# Fingerprint.ServerSdk.Model.VpnConfidence A confidence rating for the VPN detection result — "low", "medium", or "high". Depends on the combination of results returned from all VPN detection methods. - diff --git a/docs/models/VpnMethods.md b/docs/models/VpnMethods.md new file mode 100644 index 0000000..81fe777 --- /dev/null +++ b/docs/models/VpnMethods.md @@ -0,0 +1,14 @@ +# Fingerprint.ServerSdk.Model.VpnMethods + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TimezoneMismatch** | **bool** | The browser timezone doesn't match the timezone inferred from the request IP address. | [optional] +**PublicVpn** | **bool** | Request IP address is owned and used by a public VPN service provider. | [optional] +**AuxiliaryMobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | [optional] +**OsMismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. | [optional] +**Relay** | **bool** | Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. | [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/generate.sh b/generate.sh index 72a4ca4..c4f1171 100644 --- a/generate.sh +++ b/generate.sh @@ -1,37 +1,27 @@ #!/bin/bash -# clean models and docs before generating -find ./src/FingerprintPro.ServerSdk/Model -type f ! -name "DictionaryModel.cs" -exec rm {} + -find ./docs -type f ! -name "DecryptionKey.md" ! -name "Sealed.md" ! -name "WebhookValidation.md" -exec rm {} + - -# jar was downloaded from here https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.34/ - -java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l csharp -i ./res/fingerprint-server-api.yaml -o ./ -c config.json -dotnet format - -platform=$(uname) - -# Fix for codegen generating override in ToJson for models that extend Dictionary -declare -a files=("./src/FingerprintPro.ServerSdk/Model/RawDeviceAttributes.cs" "./src/FingerprintPro.ServerSdk/Model/WebhookRawDeviceAttributes.cs" "./src/FingerprintPro.ServerSdk/Model/Tag.cs") - -for i in "${files[@]}" -do - ( - # Model file fix - if [ "$platform" = "Darwin" ]; then - sed -i '' 's/public override string ToJson()/public string ToJson()/' "$i" - sed -i '' 's/: Dictionary/: DictionaryModel/' "$i" - else - sed -i 's/public override string ToJson()/public string ToJson()/' "$i" - sed -i 's/: Dictionary/: DictionaryModel/' "$i" - fi - ) -done - -# Fix for empty type in RawDeviceAttribute docs -if [ "$platform" = "Darwin" ]; then -sed -i '' 's/\[\*\*\*\*\](\.md)/**JsonElement**/g' docs/RawDeviceAttribute.md -else -sed -i 's/\[\*\*\*\*\](\.md)/**JsonElement**/g' docs/RawDeviceAttribute.md +# Cleanup +rm -Rf ./docs +rm -Rf ./src/Fingerprint.ServerSdk + +# Prepare OpenAPI Generator CLI +OPENAPI_GENERATOR_FILE="./bin/openapi-generator-cli.jar" +OPENAPI_GENERATOR_URL="https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar" + +if [[ ! -e "$OPENAPI_GENERATOR_FILE" ]]; then + echo "Downloading $OPENAPI_GENERATOR_URL..." + mkdir -p "$(dirname "$OPENAPI_GENERATOR_FILE")" + curl -fSL -o "$OPENAPI_GENERATOR_FILE" "$OPENAPI_GENERATOR_URL" fi +# Generate +export LANG=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +java -Duser.language=en -Duser.country=US -Duser.variant="" \ + -jar "$OPENAPI_GENERATOR_FILE" generate \ + -t ./template -g csharp \ + -i ./res/fingerprint-server-api.yaml -o ./ -c config.json + +# Fix api doc +mv ./docs/apis/FingerprintApi.md ./docs/FingerprintApi.md +rmdir ./docs/apis diff --git a/mono_nunit_test.sh b/mono_nunit_test.sh deleted file mode 100644 index d80fb29..0000000 --- a/mono_nunit_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -mozroots --import --sync - -echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" -rm src/FingerprintPro.ServerSdk.Test/bin/Debug/FingerprintPro.ServerSdk.Test.dll 2> /dev/null - -echo "[INFO] install NUnit runners via NuGet" -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -mozroots --import --sync -mono nuget.exe install src/FingerprintPro.ServerSdk.Test/packages.config -o packages - -echo "[INFO] Install NUnit runners via NuGet" -mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages - -echo "[INFO] Build the solution and run the unit test" -xbuild FingerprintPro.ServerSdk.sln && \ - mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/FingerprintPro.ServerSdk.Test/bin/Debug/FingerprintPro.ServerSdk.Test.dll diff --git a/package.json b/package.json index 1990c23..c713831 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "fingerprint-pro-server-api-dotnet-sdk", + "name": "fingerprint-server-dotnet-sdk", "version": "7.9.0", "private": true, "devDependencies": { diff --git a/publish.mjs b/publish.mjs index 65893ae..3b3279a 100644 --- a/publish.mjs +++ b/publish.mjs @@ -5,7 +5,7 @@ import { fileURLToPath } from "url"; const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(filename); -const sdkPath = path.resolve(dirname, './src/FingerprintPro.ServerSdk'); +const sdkPath = path.resolve(dirname, './src/Fingerprint.ServerSdk'); const paths = { sdk: sdkPath, @@ -48,7 +48,7 @@ cp.execSync('dotnet pack --configuration Release --no-restore', { cwd: paths.sdk }) -const fileName = `FingerprintPro.ServerSdk.${version}.nupkg`; +const fileName = `Fingerprint.ServerSdk.${version}.nupkg`; console.info(`Publishing ${fileName}...`); diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 71a4fa7..9ac04ea 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -1,14 +1,14 @@ -openapi: 3.0.3 +openapi: 3.1.1 info: - title: Fingerprint Server API + title: Server API description: > - Fingerprint Server API allows you to search, update, and delete - identification events in a server environment. It can be used for data - exports, decision-making, and data analysis scenarios. + # Overview Fingerprint Server API allows you to get, search, and update + Events in a server environment. It can be used for data exports, + decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - version: '3' + version: '4' contact: name: Fingerprint Support email: support@fingerprint.com @@ -25,37 +25,30 @@ tags: description: API documentation url: https://dev.fingerprint.com/reference/pro-server-api servers: - - url: https://api.fpjs.io + - url: https://api.fpjs.io/v4 description: Global - - url: https://eu.api.fpjs.io + - url: https://eu.api.fpjs.io/v4 description: EU - - url: https://ap.api.fpjs.io + - url: https://ap.api.fpjs.io/v4 description: Asia (Mumbai) security: - - ApiKeyHeader: [] - - ApiKeyQuery: [] + - bearerAuth: [] paths: - /events/{request_id}: + /events/{event_id}: get: tags: - Fingerprint operationId: getEvent - summary: Get event by request ID + summary: Get an event by event ID description: > Get a detailed analysis of an individual identification event, including - Smart Signals. + Smart Signals. - 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`. + Use `event_id` as the URL path parameter. This API method is scoped to a + request, i.e. all returned information is by `event_id`. parameters: - - name: request_id + - name: event_id in: path required: true schema: @@ -63,14 +56,21 @@ paths: description: >- The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) - of each identification request. + of each identification request (`requestId` can be used in its + place). responses: '200': description: OK. content: application/json: schema: - $ref: '#/components/schemas/EventsGetResponse' + $ref: '#/components/schemas/Event' + '400': + description: Bad request. The event Id provided is not valid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden. Access to this API is denied. content: @@ -78,45 +78,58 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: >- - Not found. The request ID cannot be found in this application's - data. + description: Not found. The event Id cannot be found in this application's data. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Application error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - put: + patch: tags: - Fingerprint operationId: updateEvent - summary: Update an event with a given request ID + summary: Update an event description: > - Change information in existing events specified by `requestId` or *flag + Change information in existing events specified by `event_id` or *flag suspicious events*. - When an event is created, it is assigned `linkedId` and `tag` submitted - through the JS agent parameters. This information might not be available - on the client so the Server API allows for updating the attributes after - the fact. + When an event is created, it can be assigned `linked_id` and `tags` + submitted through the JS agent parameters. + + This information might not have been available on the client initially, + so the Server API permits updating these attributes after the fact. + + + **Warning** It's not possible to update events older than one month. - **Warning** It's not possible to update events older than 10 days. + **Warning** Trying to update an event immediately after creation may + temporarily result in an + + error (HTTP 409 Conflict. The event is not mutable yet.) as the event is + fully propagated across our systems. In such a case, simply retry the + request. parameters: - - name: request_id + - name: event_id in: path required: true schema: type: string description: >- The unique event - [identifier](https://dev.fingerprint.com/reference/get-function#requestid). + [identifier](https://dev.fingerprint.com/reference/get-function#event_id). requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/EventsUpdateRequest' + $ref: '#/components/schemas/EventUpdate' responses: '200': description: OK. @@ -133,9 +146,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: >- - Not found. The request ID cannot be found in this application's - data. + description: Not found. The event Id cannot be found in this application's data. content: application/json: schema: @@ -146,29 +157,68 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /events/search: + /events: get: tags: - Fingerprint operationId: searchEvents - summary: Get events via search + summary: Search events description: > - Search for identification events, including Smart Signals, using - multiple filtering criteria. If you don't provide `start` or `end` - parameters, the default search range is the last 7 days. + ## Search + + + The `/v4/events` endpoint provides a convenient way to search for past + events based on specific parameters. Typical use cases and queries + include: + + + - Searching for events associated with a single `visitor_id` within a + time range to get historical behavior of a visitor. + + - Searching for events associated with a single `linked_id` within a + time range to get all events associated with your internal account + identifier. + + - Excluding all bot traffic from the query (`good` and `bad` bots) + + + If you don't provide `start` or `end` parameters, the default search + range is the **last 7 days**. + + + ### Filtering events with the`suspect` flag + + + The `/v4/events` endpoint unlocks a powerful method for fraud protection + analytics. The `suspect` flag is exposed in all events where it was + previously set by the update API. - Please note that events include mobile signals (e.g. `rootApps`) even if - the request originated from a non-mobile platform. We recommend you - **ignore** mobile signals for such requests. + You can also apply the `suspect` query parameter as a filter to find all + potentially fraudulent activity that you previously marked as `suspect`. + This helps identify patterns of fraudulent behavior. + + + ### Environment scoping + + + If you use a secret key that is scoped to an environment, you will only + get events associated with the same environment. With a workspace-scoped + environment, you will get events from all environments. + + + Smart Signals not activated for your workspace or are not included in + the response. parameters: - name: limit in: query - required: true + required: false schema: type: integer format: int32 minimum: 1 + maximum: 100 + default: 10 example: 10 description: | Limit the number of events returned. @@ -177,24 +227,22 @@ paths: schema: type: string description: > - Use `pagination_key` to get the next page of results. + Use `pagination_key` to get the next page of results. - When more results are available (e.g., you requested up to 200 - results for your search using `limit`, but there are more than 200 - events total matching your request), the `paginationKey` top-level - attribute is added to the response. The key corresponds to the - `timestamp` of the last returned event. In the following request, - use that value in the `pagination_key` parameter to get the next - page of results: + When more results are available (e.g., you requested up to 100 + results for your query using `limit`, but there are more than 100 + events total matching your request), the `pagination_key` field is + added to the response. The key corresponds to the `timestamp` of the + last returned event. In the following request, use that value in the + `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET - api-base-url/events/search?limit=200` + api-base-url/events?limit=100` - 2. Use `response.paginationKey` to get the next page of results: - `GET - api-base-url/events/search?limit=200&pagination_key=1740815825085` + 2. Use `response.pagination_key` to get the next page of results: + `GET api-base-url/events?limit=100&pagination_key=1740815825085` - name: visitor_id in: query schema: @@ -202,7 +250,7 @@ paths: description: > Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) - issued by Fingerprint Pro. + issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. - name: bot @@ -215,39 +263,51 @@ paths: - bad - none description: > - Filter events by the Bot Detection result, specifically: + Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. - > Note: When using this parameter, only events with the - `products.botd.data.bot.result` property set to a valid value are - returned. Events without a `products.botd` Smart Signal result are - left out of the response. + > Note: When using this parameter, only events with the `botd.bot` + property set to a valid value are returned. Events without a `botd` + Smart Signal result are left out of the response. - name: ip_address in: query schema: type: string description: > - Filter events by IP address range. The range can be as specific as a - single IP (/32 for IPv4 or /128 for IPv6) + Filter events by IP address or IP range (if CIDR notation is used). + If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is + assumed. - All ip_address filters must use CIDR notation, for example, - 10.0.0.0/24, 192.168.0.1/32 + Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 - name: linked_id in: query schema: type: string description: > - Filter events by your custom identifier. + Filter events by your custom identifier. You can use [linked - IDs](https://dev.fingerprint.com/reference/get-function#linkedid) to + Ids](https://dev.fingerprint.com/reference/get-function#linkedid) to associate identification requests with your own identifier, for - example, session ID, purchase ID, or transaction ID. You can then + 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. + - name: url + in: query + schema: + type: string + description: | + Filter events by the URL (`url` property) associated with the event. + - name: origin + in: query + schema: + type: string + description: > + Filter events by the origin field of the event. Origin could be the + website domain or mobile app bundle ID (eg: com.foo.bar) - name: start in: query schema: @@ -276,7 +336,7 @@ paths: type: boolean description: > Filter events previously tagged as suspicious via the [Update - API](https://dev.fingerprint.com/reference/updateevent). + API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events @@ -286,143 +346,135 @@ paths: schema: type: boolean description: > - Filter events by VPN Detection result. + Filter events by VPN Detection result. - > Note: When using this parameter, only events with the - `products.vpn.data.result` property set to `true` or `false` are - returned. Events without a `products.vpn` Smart Signal result are - left out of the response. + > Note: When using this parameter, only events with the `vpn` + property set to `true` or `false` are returned. Events without a + `vpn` Smart Signal result are left out of the response. - name: virtual_machine in: query schema: type: boolean description: > - Filter events by Virtual Machine Detection result. + Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the - `products.virtualMachine.data.result` property set to `true` or - `false` are returned. Events without a `products.virtualMachine` - Smart Signal result are left out of the response. + `virtual_machine` property set to `true` or `false` are returned. + Events without a `virtual_machine` Smart Signal result are left out + of the response. - name: tampering in: query schema: type: boolean description: > - Filter events by Tampering Detection result. + Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the - `products.tampering.data.result` property set to `true` or `false` - are returned. Events without a `products.tampering` Smart Signal - result are left out of the response. + `tampering.result` property set to `true` or `false` are returned. + Events without a `tampering` Smart Signal result are left out of the + response. - name: anti_detect_browser in: query schema: type: boolean description: > - Filter events by Anti-detect Browser Detection result. + Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the - `products.tampering.data.antiDetectBrowser` property set to `true` - or `false` are returned. Events without a `products.tampering` Smart - Signal result are left out of the response. + `tampering.anti_detect_browser` property set to `true` or `false` + are returned. Events without a `tampering` Smart Signal result are + left out of the response. - name: incognito in: query schema: type: boolean description: > - Filter events by Browser Incognito Detection result. + Filter events by Browser Incognito Detection result. - > Note: When using this parameter, only events with the - `products.incognito.data.result` property set to `true` or `false` - are returned. Events without a `products.incognito` Smart Signal - result are left out of the response. + > Note: When using this parameter, only events with the `incognito` + property set to `true` or `false` are returned. Events without an + `incognito` Smart Signal result are left out of the response. - name: privacy_settings in: query schema: type: boolean description: > - Filter events by Privacy Settings Detection result. + Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the - `products.privacySettings.data.result` property set to `true` or - `false` are returned. Events without a `products.privacySettings` - Smart Signal result are left out of the response. + `privacy_settings` property set to `true` or `false` are returned. + Events without a `privacy_settings` Smart Signal result are left out + of the response. - name: jailbroken in: query schema: type: boolean description: > - Filter events by Jailbroken Device Detection result. + Filter events by Jailbroken Device Detection result. - > Note: When using this parameter, only events with the - `products.jailbroken.data.result` property set to `true` or `false` - are returned. Events without a `products.jailbroken` Smart Signal - result are left out of the response. + > Note: When using this parameter, only events with the `jailbroken` + property set to `true` or `false` are returned. Events without a + `jailbroken` Smart Signal result are left out of the response. - name: frida in: query schema: type: boolean description: > - Filter events by Frida Detection result. + Filter events by Frida Detection result. - > Note: When using this parameter, only events with the - `products.frida.data.result` property set to `true` or `false` are - returned. Events without a `products.frida` Smart Signal result are - left out of the response. + > Note: When using this parameter, only events with the `frida` + property set to `true` or `false` are returned. Events without a + `frida` Smart Signal result are left out of the response. - name: factory_reset in: query schema: type: boolean description: > - Filter events by Factory Reset Detection result. + Filter events by Factory Reset Detection result. - > Note: When using this parameter, only events with the - `products.factoryReset.data.result` property set to `true` or - `false` are returned. Events without a `products.factoryReset` Smart - Signal result are left out of the response. + > Note: When using this parameter, only events with a + `factory_reset` time. Events without a `factory_reset` Smart Signal + result are left out of the response. - name: cloned_app in: query schema: type: boolean description: > - Filter events by Cloned App Detection result. + Filter events by Cloned App Detection result. - > Note: When using this parameter, only events with the - `products.clonedApp.data.result` property set to `true` or `false` - are returned. Events without a `products.clonedApp` Smart Signal - result are left out of the response. + > Note: When using this parameter, only events with the `cloned_app` + property set to `true` or `false` are returned. Events without a + `cloned_app` Smart Signal result are left out of the response. - name: emulator in: query schema: type: boolean description: > - Filter events by Android Emulator Detection result. + Filter events by Android Emulator Detection result. - > Note: When using this parameter, only events with the - `products.emulator.data.result` property set to `true` or `false` - are returned. Events without a `products.emulator` Smart Signal - result are left out of the response. + > Note: When using this parameter, only events with the `emulator` + property set to `true` or `false` are returned. Events without an + `emulator` Smart Signal result are left out of the response. - name: root_apps in: query schema: type: boolean description: > - Filter events by Rooted Device Detection result. + Filter events by Rooted Device Detection result. - > Note: When using this parameter, only events with the - `products.rootApps.data.result` property set to `true` or `false` - are returned. Events without a `products.rootApps` Smart Signal - result are left out of the response. + > Note: When using this parameter, only events with the `root_apps` + property set to `true` or `false` are returned. Events without a + `root_apps` Smart Signal result are left out of the response. - name: vpn_confidence in: query schema: type: string enum: - - high + - high, - medium - low description: > - Filter events by VPN Detection result confidence level. + Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. @@ -431,9 +483,8 @@ paths: `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the - `products.vpn.data.confidence` property set to a valid value are - returned. Events without a `products.vpn` Smart Signal result are - left out of the response. + `vpn.confidence` property set to a valid value are returned. Events + without a `vpn` Smart Signal result are left out of the response. - name: min_suspect_score in: query schema: @@ -444,33 +495,9 @@ paths: threshold. > Note: When using this parameter, only events where the - `products.suspectScore.data.result` property set to a value - exceeding your threshold are returned. Events without a - `products.suspectScore` Smart Signal result are left out of the - response. - - name: ip_blocklist - in: query - schema: - type: boolean - description: > - Filter events by IP Blocklist Detection result. - - > Note: When using this parameter, only events with the - `products.ipBlocklist.data.result` property set to `true` or `false` - are returned. Events without a `products.ipBlocklist` Smart Signal - result are left out of the response. - - name: datacenter - in: query - schema: - type: boolean - description: > - Filter events by Datacenter Detection result. - - > Note: When using this parameter, only events with the - `products.ipInfo.data.v4.datacenter.result` or - `products.ipInfo.data.v6.datacenter.result` property set to `true` - or `false` are returned. Events without a `products.ipInfo` Smart - Signal result are left out of the response. + `suspect_score` property set to a value exceeding your threshold are + returned. Events without a `suspect_score` Smart Signal result are + left out of the response. - name: developer_tools in: query schema: @@ -479,9 +506,9 @@ paths: Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the - `products.developerTools.data.result` property set to `true` or - `false` are returned. Events without a `products.developerTools` - Smart Signal result are left out of the response. + `developer_tools` property set to `true` or `false` are returned. + Events without a `developer_tools` Smart Signal result are left out + of the response. - name: location_spoofing in: query schema: @@ -490,9 +517,9 @@ paths: Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the - `products.locationSpoofing.data.result` property set to `true` or - `false` are returned. Events without a `products.locationSpoofing` - Smart Signal result are left out of the response. + `location_spoofing` property set to `true` or `false` are returned. + Events without a `location_spoofing` Smart Signal result are left + out of the response. - name: mitm_attack in: query schema: @@ -501,9 +528,9 @@ paths: Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the - `products.mitmAttack.data.result` property set to `true` or `false` - are returned. Events without a `products.mitmAttack` Smart Signal - result are left out of the response. + `mitm_attack` property set to `true` or `false` are returned. Events + without a `mitm_attack` Smart Signal result are left out of the + response. - name: proxy in: query schema: @@ -511,17 +538,16 @@ paths: description: > Filter events by Proxy detection result. - > Note: When using this parameter, only events with the - `products.proxy.data.result` property set to `true` or `false` are - returned. Events without a `products.proxy` Smart Signal result are - left out of the response. + > Note: When using this parameter, only events with the `proxy` + property set to `true` or `false` are returned. Events without a + `proxy` Smart Signal result are left out of the response. - name: sdk_version in: query schema: type: string description: > Filter events by a specific SDK version associated with the - identification event. Example: `3.11.14` + identification event (`sdk.version` property). Example: `3.11.14` - name: sdk_platform in: query schema: @@ -532,64 +558,42 @@ paths: - ios description: > Filter events by the SDK Platform associated with the identification - event. + event (`sdk.platform` property) . - `js` - JavaScript agent (Web). + `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. - name: environment in: query - description: | - Filter for events by providing one or more environment IDs. + description: > + Filter for events by providing one or more environment IDs + (`environment_id` property). required: false schema: type: array items: type: string style: form - explode: true - - name: proximity_id - in: query - schema: - type: string - description: > - Filter events by the most precise Proximity ID provided by default. - - > Note: When using this parameter, only events with the - `products.proximity.id` property matching the provided ID are - returned. Events without a `products.proximity` result are left out - of the response. - - name: proximity_precision_radius + - name: total_hits in: query schema: type: integer - format: int32 - enum: - - 10 - - 25 - - 65 - - 175 - - 450 - - 1200 - - 3300 - - 8500 - - 22500 + format: int64 + minimum: 1 + maximum: 1000 description: > - Filter events by Proximity Radius. - - > Note: When using this parameter, only events with the - `products.proximity.precisionRadius` property set to a valid value - are returned. Events without a `products.proximity` result are left - out of the response. + When set, the response will include a `total_hits` property with a + count of total query matches across all pages, up to the specified + limit. responses: '200': description: Events matching the filter(s). content: application/json: schema: - $ref: '#/components/schemas/SearchEventsResponse' + $ref: '#/components/schemas/EventSearch' '400': description: >- Bad request. One or more supplied search parameters are invalid, or @@ -604,162 +608,13 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /visitors/{visitor_id}: - get: - tags: - - Fingerprint - operationId: getVisits - summary: Get visits by visitor ID - description: > - Get a history of visits (identification events) 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. - x-flatten-optional-params: true - parameters: - - name: visitor_id - in: path - required: true - schema: - type: string - description: >- - Unique [visitor - identifier](https://dev.fingerprint.com/reference/get-function#visitorid) - issued by Fingerprint Pro. - - name: request_id - in: query - schema: - type: string - description: > - 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/reference/get-function#requestid). - When you filter visits by `requestId`, only one visit will be - returned. - x-go-skip-pointer: true - - name: linked_id - in: query - schema: - type: string - description: > - Filter visits by your custom identifier. - - - You can use - [`linkedId`](https://dev.fingerprint.com/reference/get-function#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. - x-go-skip-pointer: true - - name: limit - in: query - schema: - type: integer - format: int32 - minimum: 0 - description: > - 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. - x-go-skip-pointer: true - - name: paginationKey - in: query - schema: - type: string - description: > - 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. - x-go-skip-pointer: true - - name: before - in: query - deprecated: true - schema: - type: integer - format: int64 - minimum: 0 - description: > - ⚠️ Deprecated pagination method, please use `paginationKey` instead. - Timestamp (in milliseconds since epoch) used to paginate results. - x-go-skip-pointer: true - responses: - '200': - description: OK. - content: - application/json: - schema: - $ref: '#/components/schemas/VisitorsGetResponse' - '400': - description: >- - Bad request. The visitor ID or query parameters are missing or in - the wrong format. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPlainResponse' - '403': - description: Forbidden. Access to this API is denied. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPlainResponse' - '429': - description: Too Many Requests. The request is throttled. - headers: - Retry-After: - description: >- - Indicates how many seconds you should wait before attempting the - next request. - schema: - type: integer - format: int32 - minimum: 0 + '500': + description: Application error. content: application/json: schema: - $ref: '#/components/schemas/ErrorPlainResponse' + $ref: '#/components/schemas/ErrorResponse' + /visitors/{visitor_id}: delete: tags: - Fingerprint @@ -769,6 +624,7 @@ paths: Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. + ### Which data is deleted? - Browser (or device) properties @@ -806,16 +662,11 @@ paths: - If the same browser (or device) requests to identify, it will receive a different visitor ID. - - If you request [`/events` - API](https://dev.fingerprint.com/reference/getevent) with a `request_id` + - If you request [`/v4/events` + API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. - - If you request [`/visitors` - API](https://dev.fingerprint.com/reference/getvisits) for the deleted - visitor ID, the response will include identification requests that were - made outside of those 10 days. - ### Interested? @@ -862,243 +713,125 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /related-visitors: - get: - tags: - - Fingerprint - operationId: getRelatedVisitors - summary: Get Related Visitors - description: > - Related visitors API lets you link web visits and in-app browser visits - that originated from the same mobile device. - - It searches the past 6 months of identification events to find the - visitor IDs that belong to the same mobile device as the given visitor - ID. - - - ⚠️ Please note that this API is not enabled by default and is billable - separately. ⚠️ - - - If you would like to use Related visitors API, please contact our - [support team](https://fingerprint.com/support). - - To learn more, see [Related visitors API - reference](https://dev.fingerprint.com/reference/related-visitors-api). - parameters: - - name: visitor_id - in: query - required: true - schema: - type: string - description: >- - The [visitor - ID](https://dev.fingerprint.com/reference/get-function#visitorid) - for which you want to find the other visitor IDs that originated - from the same mobile device. - responses: - '200': - description: OK. - content: - application/json: - schema: - $ref: '#/components/schemas/RelatedVisitorsResponse' - '400': - description: >- - Bad request. The visitor ID parameter is missing or in the wrong - format. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '403': - description: Forbidden. Access to this API is denied. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '404': - description: >- - Not found. The visitor ID cannot be found in this application's - data. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '429': - description: Too Many Requests. The request is throttled. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /webhook: - trace: - summary: Dummy path to describe webhook format. - tags: - - Fingerprint - description: >- - Fake path to describe webhook format. More information about webhooks - can be found in the - [documentation](https://dev.fingerprint.com/docs/webhooks) - x-flatten-optional-params: true +webhooks: + event: + post: + operationId: postEventWebhook + summary: Webhook requestBody: + required: true + description: > + If configured, a Webhook event will be posted to the provided + endpoint. The webhook has the same data as our `/v4/events` endpoint. content: application/json: schema: - $ref: '#/components/schemas/Webhook' + $ref: '#/components/schemas/Event' responses: - default: - description: Dummy for the schema - callbacks: - webhook: - webhook: - post: - summary: Webhook example - description: >- - You can use HTTP basic authentication and set up credentials in - your [Fingerprint - account](https://dashboard.fingerprint.com/login) - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Webhook' - responses: - default: - description: The server doesn't validate the answer. -components: + '200': + description: >- + Return a 200 status to indicate that the data was received + successfully +components: securitySchemes: - ApiKeyHeader: - type: apiKey - in: header - name: Auth-API-Key - ApiKeyQuery: - type: apiKey - in: query - name: api_key + bearerAuth: + type: http + scheme: bearer + bearerFormat: string + description: >- + Add your Secret API Key to the Authorization header using the standard + Bearer format: `Authorization: Bearer ` schemas: - BrowserDetails: - type: object - additionalProperties: false - required: - - browserName - - browserFullVersion - - browserMajorVersion - - os - - osVersion - - device - - userAgent - properties: - browserName: - type: string - browserMajorVersion: - type: string - browserFullVersion: - type: string - os: - type: string - osVersion: - type: string - device: - type: string - userAgent: - type: string - GeolocationCity: - type: object - additionalProperties: false - required: - - name - properties: - name: - type: string - GeolocationCountry: + EventId: + type: string + description: > + Unique identifier of the user's request. The first portion of the + event_id is a unix epoch milliseconds timestamp For example: + `1758130560902.8tRtrH` + Timestamp: + description: Timestamp of the event with millisecond precision in Unix time. + type: integer + format: int64 + LinkedId: + type: string + description: A customer-provided id that was sent with the request. + EnvironmentId: + type: string + description: | + Environment Id of the event. For example: `ae_47abaca3db2c7c43` + Suspect: + type: boolean + description: >- + Field is `true` if you have previously set the `suspect` flag for this + event using the [Server API Update event + endpoint](https://dev.fingerprint.com/reference/updateevent). + Integration: type: object additionalProperties: false - required: - - code - - name properties: - code: - type: string - minLength: 2 - maxLength: 2 name: type: string - GeolocationContinent: - type: object - additionalProperties: false - required: - - code - - name - properties: - code: - type: string - minLength: 2 - maxLength: 2 - name: + description: The name of the specific integration, e.g. "fingerprint-pro-react". + version: type: string - GeolocationSubdivision: + description: The version of the specific integration, e.g. "3.11.10". + subintegration: + type: object + additionalProperties: false + properties: + name: + type: string + description: The name of the specific subintegration, e.g. "preact". + version: + type: string + description: The version of the specific subintegration, e.g. "10.21.0". + SDK: type: object + description: Contains information about the SDK used to perform the request. additionalProperties: false required: - - isoCode - - name + - platform + - version properties: - isoCode: + platform: type: string - name: + enum: + - js + - android + - ios + - unknown + description: Platform of the SDK used for the identification request. + version: type: string - GeolocationSubdivisions: + description: > + Version string of the SDK used for the identification request. For + example: `"3.12.1"` + integrations: + type: array + items: + $ref: '#/components/schemas/Integration' + Replayed: + type: boolean + description: > + `true` if we determined that this payload was replayed, `false` + otherwise. + TriggeredBy: type: array + description: The rule(s) associated with triggering the webhook via rule engine. items: - $ref: '#/components/schemas/GeolocationSubdivision' - DeprecatedGeolocation: - deprecated: true - type: object - description: >- - This field is **deprecated** and will not return a result for - **applications created after January 23rd, 2024**. Please use the [IP - Geolocation Smart - signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) - for geolocation information. - additionalProperties: false - properties: - accuracyRadius: - type: integer - minimum: 0 - description: >- - The IP address is likely to be within this radius (in km) of the - specified location. - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: - type: string - timezone: - type: string - format: timezone - city: - $ref: '#/components/schemas/GeolocationCity' - country: - $ref: '#/components/schemas/GeolocationCountry' - continent: - $ref: '#/components/schemas/GeolocationContinent' - subdivisions: - $ref: '#/components/schemas/GeolocationSubdivisions' - Tag: - type: object - description: >- - A customer-provided value or an object that was sent with identification - request. - additionalProperties: true + type: object + additionalProperties: false + required: + - id + - name + - description + properties: + id: + type: string + name: + type: string + description: + type: string IdentificationConfidence: type: object additionalProperties: false @@ -1113,1076 +846,135 @@ components: description: >- The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. - revision: + version: type: string description: >- - The revision name of the method used to calculate the Confidence + The version name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. comment: type: string - IdentificationSeenAt: - type: object - additionalProperties: false - required: - - global - - subscription - properties: - global: - type: string - nullable: true - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 - subscription: - type: string - nullable: true - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 - RawDeviceAttributeError: - type: object - additionalProperties: false - properties: - name: - type: string - message: - type: string - RawDeviceAttribute: - type: object - additionalProperties: false - properties: - value: - title: value - error: - $ref: '#/components/schemas/RawDeviceAttributeError' - RawDeviceAttributes: - type: object - description: > - It includes 35+ raw browser identification attributes to provide - Fingerprint users with even more information than our standard visitor - ID provides. This enables Fingerprint users to not have to run our - open-source product in conjunction with Fingerprint Pro Plus and - Enterprise to get those additional attributes. - - Warning: The raw signals data can change at any moment as we improve the - product. We cannot guarantee the internal shape of raw device attributes - to be stable, so typical semantic versioning rules do not apply here. - Use this data with caution without assuming a specific structure beyond - the generic type provided here. - additionalProperties: - $ref: '#/components/schemas/RawDeviceAttribute' - SDK: - type: object - description: Contains information about the SDK used to perform the request. - additionalProperties: false - required: - - platform - - version - properties: - platform: - type: string - description: Platform of the SDK. - version: - type: string - description: SDK version string. Identification: type: object additionalProperties: false required: - - visitorId - - requestId - - browserDetails - - incognito - - ip - - timestamp - - time - - url - - tag - - visitorFound - - firstSeenAt - - lastSeenAt - - replayed + - visitor_id + - visitor_found properties: - visitorId: + visitor_id: type: string description: >- String of 20 characters that uniquely identifies the visitor's browser or mobile device. - requestId: - type: string - description: Unique identifier of the user's request. - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - description: Flag if user used incognito session. - type: boolean - ip: - type: string - description: IP address of the requesting browser or bot. - ipLocation: - $ref: '#/components/schemas/DeprecatedGeolocation' - linkedId: - type: string - description: A customer-provided id that was sent with the request. - suspect: - description: >- - Field is `true` if you have previously set the `suspect` flag for - this event using the [Server API Update event - endpoint](https://dev.fingerprint.com/reference/updateevent). - type: boolean - timestamp: - description: Timestamp of the event with millisecond precision in Unix time. - type: integer - format: int64 - time: - type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05Z07:00 - description: >- - Time expressed according to ISO 8601 in UTC format, when the request - from the JS agent was made. We recommend to treat requests that are - older than 2 minutes as malicious. Otherwise, request replay attacks - are possible. - url: - type: string - description: Page URL from which the request was sent. - tag: - $ref: '#/components/schemas/Tag' confidence: $ref: '#/components/schemas/IdentificationConfidence' - visitorFound: + visitor_found: type: boolean description: Attribute represents if a visitor had been identified before. - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - components: - $ref: '#/components/schemas/RawDeviceAttributes' - replayed: - type: boolean + first_seen_at: + type: integer + format: int64 description: > - `true` if we determined that this payload was replayed, `false` - otherwise. - sdk: - $ref: '#/components/schemas/SDK' - environmentId: - type: string - description: Environment ID associated with the event - ErrorCode: - type: string - enum: - - RequestCannotBeParsed - - TokenRequired - - TokenNotFound - - SubscriptionNotActive - - WrongRegion - - FeatureNotEnabled - - RequestNotFound - - VisitorNotFound - - TooManyRequests - - 429 Too Many Requests - - StateNotReady - - Failed - description: | - Error code: - * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors - that prevented us from parsing it (wrong type/surpassed limits). - * `TokenRequired` - `Auth-API-Key` header is missing or empty. - * `TokenNotFound` - no Fingerprint application found for specified secret key. - * `SubscriptionNotActive` - Fingerprint application is not active. - * `WrongRegion` - server and application region differ. - * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application. - * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. - * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. - * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. - * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. - * `StateNotReady` - The event specified with request id is - not ready for updates yet. Try again. - This error happens in rare cases when update API is called immediately - after receiving the request id on the client. In case you need to send - information right away, we recommend using the JS agent API instead. - * `Failed` - internal server error. - Error: - type: object - additionalProperties: false - required: - - code - - message - properties: - code: - $ref: '#/components/schemas/ErrorCode' - message: - type: string - ProductIdentification: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Identification' - error: - $ref: '#/components/schemas/Error' - BotdBotResult: - type: string - enum: - - notDetected - - good - - bad - description: | - Bot detection result: - * `notDetected` - the visitor is not a bot - * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on - * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - BotdBot: - type: object - description: Stores bot detection result - additionalProperties: false - required: - - result - properties: - result: - $ref: '#/components/schemas/BotdBotResult' - type: - type: string - Botd: + Unix epoch time milliseconds timestamp indicating the time at which + this visitor ID was first seen. example: `1758069706642` - + Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + last_seen_at: + type: integer + format: int64 + description: > + Unix epoch time milliseconds timestamp indicating the time at which + this visitor ID was last seen. example: `1758069706642` - + Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + SupplementaryIDHighRecall: type: object - description: Contains all the information from Bot Detection product additionalProperties: false + description: >- + A supplementary browser identifier that prioritizes coverage over + precision. The High Recall ID algorithm matches more generously, i.e., + this identifier will remain the same even when there are subtle + differences between two requests. This algorithm does not create as many + new visitor IDs as the standard algorithms do, but there could be an + increase in false-positive identification. required: - - bot - - url - - ip - - time - - userAgent - - requestId + - visitor_id + - visitor_found properties: - bot: - $ref: '#/components/schemas/BotdBot' - meta: - $ref: '#/components/schemas/Tag' - linkedId: - type: string - description: A customer-provided id that was sent with the request. - url: + visitor_id: type: string - description: Page URL from which the request was sent. - ip: - type: string - description: IP address of the requesting browser or bot. - time: - type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 description: >- - Time in UTC when the request from the JS agent was made. We - recommend to treat requests that are older than 2 minutes as - malicious. Otherwise, request replay attacks are possible. - userAgent: - type: string - requestId: - type: string - description: Unique identifier of the user's request. - ProductBotd: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Botd' - error: - $ref: '#/components/schemas/Error' - RootApps: - type: object - additionalProperties: false - required: - - result - properties: - result: + String of 20 characters that uniquely identifies the visitor's + browser or mobile device. + visitor_found: type: boolean + description: Attribute represents if a visitor had been identified before. + confidence: + $ref: '#/components/schemas/IdentificationConfidence' + first_seen_at: + type: integer + format: int64 + description: > + Unix epoch time milliseconds timestamp indicating the time at which + this ID was first seen. example: `1758069706642` - Corresponding to + Wed Sep 17 2025 00:41:46 GMT+0000 + last_seen_at: + type: integer + format: int64 description: > - Android specific root management apps detection. There are 2 - values: - * `true` - Root Management Apps detected (e.g. Magisk). - * `false` - No Root Management Apps detected or the client isn't Android. - ProductRootApps: + Unix epoch time milliseconds timestamp indicating the time at which + this ID was last seen. example: `1758069706642` - Corresponding to + Wed Sep 17 2025 00:41:46 GMT+0000 + Tags: type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RootApps' - error: - $ref: '#/components/schemas/Error' - Emulator: + description: >- + A customer-provided value or an object that was sent with the + identification request or updated later. + additionalProperties: true + Url: + type: string + description: > + Page URL from which the request was sent. For example + `https://example.com/` + BundleId: + type: string + description: > + Bundle Id of the iOS application integrated with the Fingerprint SDK for + the event. For example: `com.foo.app` + PackageName: + type: string + description: > + Package name of the Android application integrated with the Fingerprint + SDK for the event. For example: `com.foo.app` + IpAddress: + type: string + description: IP address of the requesting browser or bot. + UserAgent: + type: string + description: > + User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; + Win64; x64) ....` + BrowserDetails: type: object additionalProperties: false required: - - result - properties: - result: - type: boolean - description: | - Android specific emulator detection. There are 2 values: - * `true` - Emulated environment detected (e.g. launch inside of AVD). - * `false` - No signs of emulated environment detected or the client is not Android. - ProductEmulator: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Emulator' - error: - $ref: '#/components/schemas/Error' - Geolocation: - type: object - additionalProperties: false - properties: - accuracyRadius: - type: integer - minimum: 0 - description: >- - The IP address is likely to be within this radius (in km) of the - specified location. - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: - type: string - timezone: - type: string - format: timezone - city: - $ref: '#/components/schemas/GeolocationCity' - country: - $ref: '#/components/schemas/GeolocationCountry' - continent: - $ref: '#/components/schemas/GeolocationContinent' - subdivisions: - $ref: '#/components/schemas/GeolocationSubdivisions' - IPInfoASN: - type: object - additionalProperties: false - required: - - asn - - name - - network - properties: - asn: - type: string - name: - type: string - network: - type: string - IPInfoDataCenter: - type: object - additionalProperties: false - required: - - result - - name - properties: - result: - type: boolean - name: - type: string - IPInfoV4: - type: object - additionalProperties: false - required: - - address - - geolocation - properties: - address: - type: string - format: ipv4 - geolocation: - $ref: '#/components/schemas/Geolocation' - asn: - $ref: '#/components/schemas/IPInfoASN' - datacenter: - $ref: '#/components/schemas/IPInfoDataCenter' - IPInfoV6: - type: object - additionalProperties: false - required: - - address - - geolocation - properties: - address: - type: string - format: ipv6 - geolocation: - $ref: '#/components/schemas/Geolocation' - asn: - $ref: '#/components/schemas/IPInfoASN' - datacenter: - $ref: '#/components/schemas/IPInfoDataCenter' - IPInfo: - type: object - description: >- - Details about the request IP address. Has separate fields for v4 and v6 - IP address versions. - additionalProperties: false - properties: - v4: - $ref: '#/components/schemas/IPInfoV4' - v6: - $ref: '#/components/schemas/IPInfoV6' - ProductIPInfo: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IPInfo' - error: - $ref: '#/components/schemas/Error' - IPBlocklistDetails: - type: object - additionalProperties: false - required: - - emailSpam - - attackSource - properties: - emailSpam: - type: boolean - description: IP address was part of a known email spam attack (SMTP). - attackSource: - type: boolean - description: IP address was part of a known network attack (SSH/HTTPS). - IPBlocklist: - type: object - additionalProperties: false - required: - - result - - details - properties: - result: - type: boolean - description: > - `true` if request IP address is part of any database that we use to - search for known malicious actors, `false` otherwise. - details: - $ref: '#/components/schemas/IPBlocklistDetails' - ProductIPBlocklist: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IPBlocklist' - error: - $ref: '#/components/schemas/Error' - Tor: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request IP address is a known tor exit node, `false` - otherwise. - ProductTor: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Tor' - error: - $ref: '#/components/schemas/Error' - VPNConfidence: - type: string - enum: - - low - - medium - - high - description: >- - A confidence rating for the VPN detection result — "low", "medium", or - "high". Depends on the combination of results returned from all VPN - detection methods. - VPNMethods: - type: object - additionalProperties: false - required: - - timezoneMismatch - - publicVPN - - auxiliaryMobile - - osMismatch - - relay - properties: - timezoneMismatch: - type: boolean - description: >- - The browser timezone doesn't match the timezone inferred from the - request IP address. - publicVPN: - type: boolean - description: >- - Request IP address is owned and used by a public VPN service - provider. - auxiliaryMobile: - type: boolean - description: >- - This method applies to mobile devices only. Indicates the result of - additional methods used to detect a VPN in mobile devices. - osMismatch: - type: boolean - description: >- - The browser runs on a different operating system than the operating - system inferred from the request network signature. - relay: - type: boolean - description: > - Request IP address belongs to a relay service provider, indicating - the use of relay services like [Apple Private - relay](https://support.apple.com/en-us/102602) or [Cloudflare - Warp](https://developers.cloudflare.com/warp-client/). - - - * Like VPNs, relay services anonymize the visitor's true IP address. - - * Unlike traditional VPNs, relay services don't let visitors spoof - their location by choosing an exit node in a different country. - - - This field allows you to differentiate VPN users and relay service - users in your fraud prevention logic. - VPN: - type: object - additionalProperties: false - required: - - result - - confidence - - originTimezone - - originCountry - - methods - properties: - result: - type: boolean - description: >- - VPN or other anonymizing service has been used when sending the - request. - confidence: - $ref: '#/components/schemas/VPNConfidence' - originTimezone: - type: string - description: Local timezone which is used in timezoneMismatch method. - originCountry: - type: string - description: >- - Country of the request (only for Android SDK version >= 2.4.0, ISO - 3166 format or unknown). - methods: - $ref: '#/components/schemas/VPNMethods' - ProductVPN: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VPN' - error: - $ref: '#/components/schemas/Error' - ProxyConfidence: - type: string - enum: - - low - - medium - - high - description: | - Confidence level of the proxy detection. - If a proxy is not detected, confidence is "high". - If it's detected, can be "low", "medium", or "high". - ProxyDetails: - type: object - nullable: true - additionalProperties: false - description: Proxy detection details (present if proxy is detected) - required: - - proxyType - properties: - proxyType: - type: string - enum: - - residential - - data_center - description: > - Residential proxies use real user IP addresses to appear as - legitimate traffic, - - while data center proxies are public proxies hosted in data centers - lastSeenAt: - type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:00:00.000Z - description: | - ISO 8601 formatted timestamp in UTC with hourly resolution - of when this IP was last seen as a proxy when available. - Proxy: - type: object - additionalProperties: false - required: - - result - - confidence - properties: - result: - type: boolean - description: > - IP address was used by a public proxy provider or belonged to a - known recent residential proxy - confidence: - $ref: '#/components/schemas/ProxyConfidence' - details: - $ref: '#/components/schemas/ProxyDetails' - ProductProxy: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Proxy' - error: - $ref: '#/components/schemas/Error' - Incognito: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if we detected incognito mode used in the browser, `false` - otherwise. - ProductIncognito: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Incognito' - error: - $ref: '#/components/schemas/Error' - Tampering: - type: object - additionalProperties: false - required: - - result - - anomalyScore - - antiDetectBrowser - properties: - result: - type: boolean - description: > - Indicates if an identification request from a browser or an Android - SDK has been tampered with. Not supported in the iOS SDK, is always - `false` for iOS requests. - * `true` - If the request meets either of the following conditions: - * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). - * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). - * `false` - If the request is considered genuine or was generated by the iOS SDK. - anomalyScore: - type: number - format: double - minimum: 0 - maximum: 1 - description: > - A score that indicates the extent of anomalous data in the request. - This field applies to requests originating from **both** browsers - and Android SDKs. - * Values above `0.5` indicate that the request has been tampered with. - * Values below `0.5` indicate that the request is genuine. - antiDetectBrowser: - type: boolean - description: > - Anti-detect browsers try to evade identification by masking or - manipulating their fingerprint to imitate legitimate browser - configurations. This field does not apply to requests originating - from mobile SDKs. - * `true` - The browser resembles a known anti-detect browser, for example, Incognition. - * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - ProductTampering: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Tampering' - error: - $ref: '#/components/schemas/Error' - ClonedApp: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: | - Android specific cloned application detection. There are 2 values: - * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). - * `false` - No signs of cloned application detected or the client is not Android. - ProductClonedApp: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/ClonedApp' - error: - $ref: '#/components/schemas/Error' - FactoryReset: - type: object - additionalProperties: false - required: - - time - - timestamp - properties: - time: - type: string - format: date-time - description: > - Indicates the time (in UTC) of the most recent factory reset that - happened on the **mobile device**. - - When a factory reset cannot be detected on the mobile device or when - the request is initiated from a browser, this field will correspond - to the *epoch* time (i.e 1 Jan 1970 UTC). - - See [Factory Reset - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) - to learn more about this Smart Signal. - timestamp: - type: integer - format: int64 - description: > - This field is just another representation of the value in the `time` - field. - - The time of the most recent factory reset that happened on the - **mobile device** is expressed as Unix epoch time. - ProductFactoryReset: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/FactoryReset' - error: - $ref: '#/components/schemas/Error' - Jailbroken: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: | - iOS specific jailbreak detection. There are 2 values: - * `true` - Jailbreak detected. - * `false` - No signs of jailbreak or the client is not iOS. - ProductJailbroken: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Jailbroken' - error: - $ref: '#/components/schemas/Error' - Frida: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - [Frida](https://frida.re/docs/) detection for Android and iOS - devices. There are 2 values: - * `true` - Frida detected - * `false` - No signs of Frida or the client is not a mobile device. - ProductFrida: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Frida' - error: - $ref: '#/components/schemas/Error' - PrivacySettings: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request is from a privacy aware browser (e.g. Tor) or - from a browser in which fingerprinting is blocked. Otherwise - `false`. - ProductPrivacySettings: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/PrivacySettings' - error: - $ref: '#/components/schemas/Error' - VirtualMachine: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request came from a browser running inside a virtual - machine (e.g. VMWare), `false` otherwise. - ProductVirtualMachine: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VirtualMachine' - error: - $ref: '#/components/schemas/Error' - ProductRawDeviceAttributes: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RawDeviceAttributes' - error: - $ref: '#/components/schemas/Error' - HighActivity: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: Flag indicating if the request came from a high-activity visitor. - dailyRequests: - type: integer - format: int64 - minimum: 1 - description: Number of requests from the same visitor in the previous day. - ProductHighActivity: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/HighActivity' - error: - $ref: '#/components/schemas/Error' - LocationSpoofing: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: >- - Flag indicating whether the request came from a mobile device with - location spoofing enabled. - ProductLocationSpoofing: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/LocationSpoofing' - error: - $ref: '#/components/schemas/Error' - SuspectScore: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: integer - description: > - Suspect Score is an easy way to integrate Smart Signals into your - fraud protection work flow. It is a weighted representation of all - Smart Signals present in the payload that helps identify suspicious - activity. The value range is [0; S] where S is sum of all Smart - Signals weights. See more details here: - https://dev.fingerprint.com/docs/suspect-score - ProductSuspectScore: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/SuspectScore' - error: - $ref: '#/components/schemas/Error' - RemoteControl: - type: object - deprecated: true - description: | - This signal is deprecated. - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request came from a machine being remotely controlled - (e.g. TeamViewer), `false` otherwise. - ProductRemoteControl: - type: object - deprecated: true - description: | - This product is deprecated. - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RemoteControl' - error: - $ref: '#/components/schemas/Error' - VelocityIntervals: - type: object - description: > - Is absent if the velocity data could not be generated for the visitor - ID. - additionalProperties: false - required: - - 5m - - 1h - properties: - 5m: - type: integer - 1h: - type: integer - 24h: - type: integer - description: > - The `24h` interval of `distinctIp`, `distinctLinkedId`, - `distinctCountry`, `distinctIpByLinkedId` and - `distinctVisitorIdByLinkedId` will be omitted if the number of - `events`` for the visitor ID in the last 24 hours - (`events.intervals.['24h']`) is higher than 20.000. - VelocityData: - type: object - additionalProperties: false - properties: - intervals: - $ref: '#/components/schemas/VelocityIntervals' - Velocity: - type: object - description: > - Sums key data points for a specific `visitorId`, `ipAddress` and - `linkedId` at three distinct time - - intervals: 5 minutes, 1 hour, and 24 hours as follows: - - - - Number of distinct IP addresses associated to the visitor ID. - - - Number of distinct linked IDs associated with the visitor ID. - - - Number of distinct countries associated with the visitor ID. - - - Number of identification events associated with the visitor ID. - - - Number of identification events associated with the detected IP - address. - - - Number of distinct IP addresses associated with the provided linked - ID. - - - Number of distinct visitor IDs associated with the provided linked ID. - - - The `24h` interval of `distinctIp`, `distinctLinkedId`, - `distinctCountry`, - - `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be - omitted - - if the number of `events` for the visitor ID in the last 24 - - hours (`events.intervals.['24h']`) is higher than 20.000. - additionalProperties: false - required: - - distinctIp - - distinctLinkedId - - distinctCountry - - events - - ipEvents - - distinctIpByLinkedId - - distinctVisitorIdByLinkedId - properties: - distinctIp: - $ref: '#/components/schemas/VelocityData' - distinctLinkedId: - $ref: '#/components/schemas/VelocityData' - distinctCountry: - $ref: '#/components/schemas/VelocityData' - events: - $ref: '#/components/schemas/VelocityData' - ipEvents: - $ref: '#/components/schemas/VelocityData' - distinctIpByLinkedId: - $ref: '#/components/schemas/VelocityData' - distinctVisitorIdByLinkedId: - $ref: '#/components/schemas/VelocityData' - ProductVelocity: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Velocity' - error: - $ref: '#/components/schemas/Error' - DeveloperTools: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the browser is Chrome with DevTools open or Firefox with - Developer Tools open, `false` otherwise. - ProductDeveloperTools: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/DeveloperTools' - error: - $ref: '#/components/schemas/Error' - MitMAttack: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - * `true` - When requests made from your users' mobile devices to - Fingerprint servers have been intercepted and potentially modified. - - * `false` - Otherwise or when the request originated from a browser. - - See [MitM Attack - Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) - to learn more about this Smart Signal. - ProductMitMAttack: - type: object - additionalProperties: false + - browser_name + - browser_full_version + - browser_major_version + - os + - os_version + - device properties: - data: - $ref: '#/components/schemas/MitMAttack' - error: - $ref: '#/components/schemas/Error' + browser_name: + type: string + browser_major_version: + type: string + browser_full_version: + type: string + os: + type: string + os_version: + type: string + device: + type: string Proximity: type: object description: > @@ -2191,14 +983,14 @@ components: additionalProperties: false required: - id - - precisionRadius + - precision_radius - confidence properties: id: type: string description: | A stable privacy-preserving identifier for a given proximity zone. - precisionRadius: + precision_radius: type: integer format: int32 enum: @@ -2223,268 +1015,171 @@ components: true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - ProductProximity: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Proximity' - error: - $ref: '#/components/schemas/Error' - Products: - type: object - description: >- - Contains all information about the request identified by `requestId`, - depending on the pricing plan (Pro, Pro Plus, Enterprise) - additionalProperties: false - properties: - identification: - $ref: '#/components/schemas/ProductIdentification' - botd: - $ref: '#/components/schemas/ProductBotd' - rootApps: - $ref: '#/components/schemas/ProductRootApps' - emulator: - $ref: '#/components/schemas/ProductEmulator' - ipInfo: - $ref: '#/components/schemas/ProductIPInfo' - ipBlocklist: - $ref: '#/components/schemas/ProductIPBlocklist' - tor: - $ref: '#/components/schemas/ProductTor' - vpn: - $ref: '#/components/schemas/ProductVPN' - proxy: - $ref: '#/components/schemas/ProductProxy' - incognito: - $ref: '#/components/schemas/ProductIncognito' - tampering: - $ref: '#/components/schemas/ProductTampering' - clonedApp: - $ref: '#/components/schemas/ProductClonedApp' - factoryReset: - $ref: '#/components/schemas/ProductFactoryReset' - jailbroken: - $ref: '#/components/schemas/ProductJailbroken' - frida: - $ref: '#/components/schemas/ProductFrida' - privacySettings: - $ref: '#/components/schemas/ProductPrivacySettings' - virtualMachine: - $ref: '#/components/schemas/ProductVirtualMachine' - rawDeviceAttributes: - $ref: '#/components/schemas/ProductRawDeviceAttributes' - highActivity: - $ref: '#/components/schemas/ProductHighActivity' - locationSpoofing: - $ref: '#/components/schemas/ProductLocationSpoofing' - suspectScore: - $ref: '#/components/schemas/ProductSuspectScore' - remoteControl: - $ref: '#/components/schemas/ProductRemoteControl' - velocity: - $ref: '#/components/schemas/ProductVelocity' - developerTools: - $ref: '#/components/schemas/ProductDeveloperTools' - mitmAttack: - $ref: '#/components/schemas/ProductMitMAttack' - proximity: - $ref: '#/components/schemas/ProductProximity' - EventsGetResponse: - type: object - description: >- - Contains results from all activated products - Fingerprint Pro, Bot - Detection, and others. - additionalProperties: false - required: - - products - properties: - products: - $ref: '#/components/schemas/Products' - ErrorResponse: + BotResult: + type: string + enum: + - not_detected + - good + - bad + description: | + Bot detection result: + * `not_detected` - the visitor is not a bot + * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on + * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on + BotType: + type: string + description: | + Additional classification of the bot type if detected. + ClonedApp: + type: boolean + description: > + Android specific cloned application detection. There are 2 values: * + `true` - Presence of app cloners work detected (e.g. fully cloned + application found or launch of it inside of a not main working profile + detected). * `false` - No signs of cloned application detected or the + client is not Android. + DeveloperTools: + type: boolean + description: > + `true` if the browser is Chrome with DevTools open or Firefox with + Developer Tools open, `false` otherwise. + Emulator: + type: boolean + description: > + Android specific emulator detection. There are 2 values: + + * `true` - Emulated environment detected (e.g. launch inside of AVD). + + * `false` - No signs of emulated environment detected or the client is + not Android. + FactoryReset: + type: integer + format: int64 + description: > + The time of the most recent factory reset that happened on the **mobile + device** is expressed as Unix epoch time. When a factory reset cannot be + detected on the mobile device or when the request is initiated from a + browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 + UTC) as a value of 0. See [Factory Reset + Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) + to learn more about this Smart Signal. + Frida: + type: boolean + description: > + [Frida](https://frida.re/docs/) detection for Android and iOS devices. + There are 2 values: + + * `true` - Frida detected + + * `false` - No signs of Frida or the client is not a mobile device. + IPBlockList: type: object additionalProperties: false - required: - - error properties: - error: - $ref: '#/components/schemas/Error' - EventsUpdateRequest: - type: object - properties: - linkedId: - type: string - description: LinkedID value to assign to the existing event - tag: - $ref: '#/components/schemas/Tag' - suspect: + email_spam: type: boolean - description: Suspect flag indicating observed suspicious or fraudulent event - x-go-force-pointer: true - SearchEventsResponse: + description: IP address was part of a known email spam attack (SMTP). + attack_source: + type: boolean + description: IP address was part of a known network attack (SSH/HTTPS). + tor_node: + type: boolean + description: IP address was part of known TOR network activity. + Geolocation: type: object - description: >- - Contains a list of all identification events matching the specified - search criteria. additionalProperties: false properties: - events: + accuracy_radius: + type: integer + minimum: 0 + description: >- + The IP address is likely to be within this radius (in km) of the + specified location. + latitude: + type: number + format: double + minimum: -90 + maximum: 90 + longitude: + type: number + format: double + minimum: -180 + maximum: 180 + postal_code: + type: string + timezone: + type: string + format: timezone + city_name: + type: string + country_code: + type: string + minLength: 2 + maxLength: 2 + country_name: + type: string + continent_code: + type: string + minLength: 2 + maxLength: 2 + continent_name: + type: string + subdivisions: type: array items: type: object - description: Device intelligence results for the identification event. + additionalProperties: false required: - - products + - iso_code + - name properties: - products: - $ref: '#/components/schemas/Products' - paginationKey: - type: string - description: >- - Use this value in the `pagination_key` parameter to request the next - page of search results. - Visit: + iso_code: + type: string + name: + type: string + IPInfoV4: type: object additionalProperties: false required: - - requestId - - browserDetails - - incognito - - ip - - timestamp - - time - - url - - tag - - visitorFound - - firstSeenAt - - lastSeenAt + - address properties: - requestId: - type: string - description: Unique identifier of the user's request. - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - type: boolean - description: Flag if user used incognito session. - ip: + address: type: string - description: IP address of the requesting browser or bot. - ipLocation: - $ref: '#/components/schemas/DeprecatedGeolocation' - linkedId: + format: ipv4 + geolocation: + $ref: '#/components/schemas/Geolocation' + asn: type: string - description: A customer-provided id that was sent with the request. - timestamp: - type: integer - format: int64 - description: Timestamp of the event with millisecond precision in Unix time. - time: + asn_name: type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05Z07:00 - description: >- - Time expressed according to ISO 8601 in UTC format, when the request - from the client agent was made. We recommend to treat requests that - are older than 2 minutes as malicious. Otherwise, request replay - attacks are possible. - url: + asn_network: type: string - description: Page URL from which the request was sent. - tag: - $ref: '#/components/schemas/Tag' - confidence: - $ref: '#/components/schemas/IdentificationConfidence' - visitorFound: + datacenter_result: type: boolean - description: Attribute represents if a visitor had been identified before. - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - components: - $ref: '#/components/schemas/RawDeviceAttributes' - VisitorsGetResponse: + datacenter_name: + type: string + IPInfoV6: type: object - description: >- - Pagination-related fields `lastTimestamp` and `paginationKey` are - included if you use a pagination parameter like `limit` or `before` and - there is more data available on the next page. additionalProperties: false required: - - visitorId - - visits + - address properties: - visitorId: + address: type: string - visits: - type: array - items: - $ref: '#/components/schemas/Visit' - lastTimestamp: - deprecated: true - type: integer - format: int64 - description: > - ⚠️ Deprecated paging attribute, please use `paginationKey` instead. - Timestamp of the last visit in the current page of results. - paginationKey: + format: ipv6 + geolocation: + $ref: '#/components/schemas/Geolocation' + asn: type: string - description: >- - Request ID of the last visit in the current page of results. Use - this value in the following request as the `paginationKey` parameter - to get the next page of results. - ErrorPlainResponse: - type: object - additionalProperties: false - required: - - error - properties: - error: + asn_name: type: string - RelatedVisitor: - type: object - additionalProperties: false - required: - - visitorId - properties: - visitorId: + asn_network: type: string - description: >- - Visitor ID of a browser that originates from the same mobile device - as the input visitor ID. - RelatedVisitorsResponse: - type: object - additionalProperties: false - required: - - relatedVisitors - properties: - relatedVisitors: - type: array - items: - $ref: '#/components/schemas/RelatedVisitor' - WebhookRootApps: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - Android specific root management apps detection. There are 2 - values: - * `true` - Root Management Apps detected (e.g. Magisk). - * `false` - No Root Management Apps detected or the client isn't Android. - WebhookEmulator: - type: object - additionalProperties: false - properties: - result: + datacenter_result: type: boolean - description: | - Android specific emulator detection. There are 2 values: - * `true` - Emulated environment detected (e.g. launch inside of AVD). - * `false` - No signs of emulated environment detected or the client is not Android. - WebhookIPInfo: + datacenter_name: + type: string + IPInfo: type: object description: >- Details about the request IP address. Has separate fields for v4 and v6 @@ -2495,500 +1190,670 @@ components: $ref: '#/components/schemas/IPInfoV4' v6: $ref: '#/components/schemas/IPInfoV6' - WebhookIPBlocklist: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if request IP address is part of any database that we use to - search for known malicious actors, `false` otherwise. - details: - $ref: '#/components/schemas/IPBlocklistDetails' - WebhookTor: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if the request IP address is a known tor exit node, `false` - otherwise. - WebhookVPN: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: >- - VPN or other anonymizing service has been used when sending the - request. - confidence: - $ref: '#/components/schemas/VPNConfidence' - originTimezone: - type: string - description: Local timezone which is used in timezoneMismatch method. - originCountry: - type: string - description: >- - Country of the request (only for Android SDK version >= 2.4.0, ISO - 3166 format or unknown). - methods: - $ref: '#/components/schemas/VPNMethods' - WebhookProxy: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - IP address was used by a public proxy provider or belonged to a - known recent residential proxy - confidence: - $ref: '#/components/schemas/ProxyConfidence' - details: - $ref: '#/components/schemas/ProxyDetails' - WebhookTampering: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - Indicates if an identification request from a browser or an Android - SDK has been tampered with. Not supported in the iOS SDK, is always - `false` for iOS requests. - * `true` - If the request meets either of the following conditions: - * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). - * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). - * `false` - If the request is considered genuine or was generated by the iOS SDK. - anomalyScore: - type: number - format: double - minimum: 0 - maximum: 1 - description: > - A score that indicates the extent of anomalous data in the request. - This field applies to requests originating from **both** browsers - and Android SDKs. - * Values above `0.5` indicate that the request has been tampered with. - * Values below `0.5` indicate that the request is genuine. - antiDetectBrowser: - type: boolean - description: > - Anti-detect browsers try to evade identification by masking or - manipulating their fingerprint to imitate legitimate browser - configurations. This field does not apply to requests originating - from mobile SDKs. - * `true` - The browser resembles a known anti-detect browser, for example, Incognition. - * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - WebhookClonedApp: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: | - Android specific cloned application detection. There are 2 values: - * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). - * `false` - No signs of cloned application detected or the client is not Android. - WebhookFactoryReset: + Proxy: + type: boolean + description: > + IP address was used by a public proxy provider or belonged to a known + recent residential proxy + ProxyConfidence: + type: string + enum: + - low + - medium + - high + description: > + Confidence level of the proxy detection. If a proxy is not detected, + confidence is "high". If it's detected, can be "low", "medium", or + "high". + ProxyDetails: type: object additionalProperties: false + description: Proxy detection details (present if `proxy` is `true`) + required: + - proxy_type properties: - time: + proxy_type: type: string - format: date-time + enum: + - residential + - data_center description: > - Indicates the time (in UTC) of the most recent factory reset that - happened on the **mobile device**. - - When a factory reset cannot be detected on the mobile device or when - the request is initiated from a browser, this field will correspond - to the *epoch* time (i.e 1 Jan 1970 UTC). + Residential proxies use real user IP addresses to appear as + legitimate traffic, - See [Factory Reset - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) - to learn more about this Smart Signal. - timestamp: + while data center proxies are public proxies hosted in data centers + last_seen_at: type: integer format: int64 description: > - This field is just another representation of the value in the `time` - field. + Unix millisecond timestamp with hourly resolution of when this IP + was last seen as a proxy + Incognito: + type: boolean + description: > + `true` if we detected incognito mode used in the browser, `false` + otherwise. + Jailbroken: + type: boolean + description: | + iOS specific jailbreak detection. There are 2 values: + * `true` - Jailbreak detected. + * `false` - No signs of jailbreak or the client is not iOS. + LocationSpoofing: + type: boolean + description: >- + Flag indicating whether the request came from a mobile device with + location spoofing enabled. + MitMAttack: + type: boolean + description: > + * `true` - When requests made from your users' mobile devices to + Fingerprint servers have been intercepted and potentially modified. - The time of the most recent factory reset that happened on the - **mobile device** is expressed as Unix epoch time. - WebhookJailbroken: + * `false` - Otherwise or when the request originated from a browser. + + See [MitM Attack + Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) + to learn more about this Smart Signal. + PrivacySettings: + type: boolean + description: > + `true` if the request is from a privacy aware browser (e.g. Tor) or from + a browser in which fingerprinting is blocked. Otherwise `false`. + RootApps: + type: boolean + description: > + Android specific root management apps detection. There are 2 values: + + * `true` - Root Management Apps detected (e.g. Magisk). + + * `false` - No Root Management Apps detected or the client isn't + Android. + SuspectScore: + type: integer + description: > + Suspect Score is an easy way to integrate Smart Signals into your fraud + protection work flow. It is a weighted representation of all Smart + Signals present in the payload that helps identify suspicious activity. + The value range is [0; S] where S is sum of all Smart Signals weights. + See more details here: https://dev.fingerprint.com/docs/suspect-score + Tampering: + type: boolean + description: > + Flag indicating browser tampering was detected. This happens when + either: + * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). + * The browser signature resembles an "anti-detect" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). + TamperingDetails: type: object additionalProperties: false properties: - result: - type: boolean + anomaly_score: + type: number + format: double + minimum: 0 + maximum: 1 + x-platforms: + - android + - ios + - browser description: | - iOS specific jailbreak detection. There are 2 values: - * `true` - Jailbreak detected. - * `false` - No signs of jailbreak or the client is not iOS. - WebhookFrida: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - [Frida](https://frida.re/docs/) detection for Android and iOS - devices. There are 2 values: - * `true` - Frida detected - * `false` - No signs of Frida or the client is not a mobile device. - WebhookPrivacySettings: - type: object - additionalProperties: false - properties: - result: + Confidence score (`0.0 - 1.0`) for tampering detection: + * Values above `0.5` indicate tampering. + * Values below `0.5` indicate genuine browsers. + anti_detect_browser: type: boolean + x-platforms: + - browser description: > - `true` if the request is from a privacy aware browser (e.g. Tor) or - from a browser in which fingerprinting is blocked. Otherwise - `false`. - WebhookVirtualMachine: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if the request came from a browser running inside a virtual - machine (e.g. VMWare), `false` otherwise. - WebhookRawDeviceAttributes: + True if the identified browser resembles an "anti-detect" browser, + such as Incognition, which attempts to evade identification by + manipulating its fingerprint. + VelocityData: type: object description: > - It includes 35+ raw browser identification attributes to provide - Fingerprint users with even more information than our standard visitor - ID provides. This enables Fingerprint users to not have to run our - open-source product in conjunction with Fingerprint Pro Plus and - Enterprise to get those additional attributes. - - Warning: The raw signals data can change at any moment as we improve the - product. We cannot guarantee the internal shape of raw device attributes - to be stable, so typical semantic versioning rules do not apply here. - Use this data with caution without assuming a specific structure beyond - the generic type provided here. - additionalProperties: - $ref: '#/components/schemas/RawDeviceAttribute' - WebhookHighActivity: - type: object + Is absent if the velocity data could not be generated for the visitor + Id. additionalProperties: false required: - - result + - 5_minutes + - 1_hour properties: - result: - type: boolean - description: Flag indicating if the request came from a high-activity visitor. - dailyRequests: + 5_minutes: type: integer - format: int64 - minimum: 1 - description: Number of requests from the same visitor in the previous day. - WebhookLocationSpoofing: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: >- - Flag indicating whether the request came from a mobile device with - location spoofing enabled. - WebhookSuspectScore: - type: object - additionalProperties: false - properties: - result: + description: > + Count for the last 5 minutes of velocity data, from the time of the + event. + 1_hour: type: integer description: > - Suspect Score is an easy way to integrate Smart Signals into your - fraud protection work flow. It is a weighted representation of all - Smart Signals present in the payload that helps identify suspicious - activity. The value range is [0; S] where S is sum of all Smart - Signals weights. See more details here: - https://dev.fingerprint.com/docs/suspect-score - WebhookRemoteControl: - type: object - deprecated: true - description: | - This signal is deprecated. - additionalProperties: false - properties: - result: - type: boolean + Count for the last 1 hour of velocity data, from the time of the + event. + 24_hours: + type: integer description: > - `true` if the request came from a machine being remotely controlled - (e.g. TeamViewer), `false` otherwise. - WebhookVelocity: + The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, + `distinct_country`, `distinct_ip_by_linked_id` and + `distinct_visitor_id_by_linked_id` will be omitted if the number of + `events` for the visitor Id in the last 24 hours + (`events.['24_hours']`) is higher than 20.000. + Velocity: type: object description: > - Sums key data points for a specific `visitorId`, `ipAddress` and - `linkedId` at three distinct time + Sums key data points for a specific `visitor_id`, `ip_address` and + `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - - Number of distinct IP addresses associated to the visitor ID. + - Number of distinct IP addresses associated to the visitor Id. - - Number of distinct linked IDs associated with the visitor ID. + - Number of distinct linked Ids associated with the visitor Id. - - Number of distinct countries associated with the visitor ID. + - Number of distinct countries associated with the visitor Id. - - Number of identification events associated with the visitor ID. + - Number of identification events associated with the visitor Id. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked - ID. + Id. - - Number of distinct visitor IDs associated with the provided linked ID. + - Number of distinct visitor Ids associated with the provided linked Id. - The `24h` interval of `distinctIp`, `distinctLinkedId`, - `distinctCountry`, + The `24h` interval of `distinct_ip`, `distinct_linked_id`, + `distinct_country`, - `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be - omitted + `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will + be omitted - if the number of `events` for the visitor ID in the last 24 + if the number of `events` for the visitor Id in the last 24 - hours (`events.intervals.['24h']`) is higher than 20.000. + hours (`events.['24h']`) is higher than 20.000. + + + All will not necessarily be returned in a response, some may be omitted + if the + + associated event does not have the required data, such as a linked_id. additionalProperties: false properties: - distinctIp: + distinct_ip: $ref: '#/components/schemas/VelocityData' - distinctLinkedId: + distinct_linked_id: $ref: '#/components/schemas/VelocityData' - distinctCountry: + distinct_country: $ref: '#/components/schemas/VelocityData' events: $ref: '#/components/schemas/VelocityData' - ipEvents: + ip_events: $ref: '#/components/schemas/VelocityData' - distinctIpByLinkedId: + distinct_ip_by_linked_id: $ref: '#/components/schemas/VelocityData' - distinctVisitorIdByLinkedId: + distinct_visitor_id_by_linked_id: $ref: '#/components/schemas/VelocityData' - WebhookDeveloperTools: + VirtualMachine: + type: boolean + description: > + `true` if the request came from a browser running inside a virtual + machine (e.g. VMWare), `false` otherwise. + Vpn: + type: boolean + description: | + VPN or other anonymizing service has been used when sending the request. + VpnConfidence: + type: string + enum: + - low + - medium + - high + description: >- + A confidence rating for the VPN detection result — "low", "medium", or + "high". Depends on the combination of results returned from all VPN + detection methods. + VpnOriginTimezone: + type: string + description: | + Local timezone which is used in timezone_mismatch method. + VpnOriginCountry: + type: string + description: > + Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 + format or unknown). + VpnMethods: type: object additionalProperties: false properties: - result: + timezone_mismatch: + type: boolean + x-platforms: + - android + - ios + - browser + description: >- + The browser timezone doesn't match the timezone inferred from the + request IP address. + public_vpn: + type: boolean + x-platforms: + - android + - ios + - browser + description: >- + Request IP address is owned and used by a public VPN service + provider. + auxiliary_mobile: + type: boolean + x-platforms: + - android + - ios + - browser + description: >- + This method applies to mobile devices only. Indicates the result of + additional methods used to detect a VPN in mobile devices. + os_mismatch: + type: boolean + x-platforms: + - browser + description: >- + The browser runs on a different operating system than the operating + system inferred from the request network signature. + relay: type: boolean + x-platforms: + - android + - ios + - browser description: > - `true` if the browser is Chrome with DevTools open or Firefox with - Developer Tools open, `false` otherwise. - WebhookMitMAttack: + Request IP address belongs to a relay service provider, indicating + the use of relay services like [Apple Private + relay](https://support.apple.com/en-us/102602) or [Cloudflare + Warp](https://developers.cloudflare.com/warp-client/). + + + * Like VPNs, relay services anonymize the visitor's true IP address. + + * Unlike traditional VPNs, relay services don't let visitors spoof + their location by choosing an exit node in a different country. + + + This field allows you to differentiate VPN users and relay service + users in your fraud prevention logic. + Event: type: object + description: >- + Contains results from Fingerprint Identification and all active Smart + Signals. additionalProperties: false + required: + - event_id + - timestamp properties: - result: - type: boolean - description: > - * `true` - When requests made from your users' mobile devices to - Fingerprint servers have been intercepted and potentially modified. + event_id: + $ref: '#/components/schemas/EventId' + x-platforms: + - android + - ios + - browser + timestamp: + $ref: '#/components/schemas/Timestamp' + x-platforms: + - android + - ios + - browser + linked_id: + $ref: '#/components/schemas/LinkedId' + x-platforms: + - android + - ios + - browser + environment_id: + $ref: '#/components/schemas/EnvironmentId' + x-platforms: + - android + - ios + - browser + suspect: + $ref: '#/components/schemas/Suspect' + x-platforms: + - android + - ios + - browser + sdk: + $ref: '#/components/schemas/SDK' + x-platforms: + - android + - ios + - browser + replayed: + $ref: '#/components/schemas/Replayed' + x-platforms: + - android + - ios + - browser + identification: + $ref: '#/components/schemas/Identification' + x-platforms: + - android + - ios + - browser + supplementary_id_high_recall: + $ref: '#/components/schemas/SupplementaryIDHighRecall' + x-platforms: + - android + - ios + - browser + tags: + $ref: '#/components/schemas/Tags' + x-platforms: + - android + - ios + - browser + url: + $ref: '#/components/schemas/Url' + x-platforms: + - browser + bundle_id: + $ref: '#/components/schemas/BundleId' + x-platforms: + - ios + package_name: + $ref: '#/components/schemas/PackageName' + x-platforms: + - android + ip_address: + $ref: '#/components/schemas/IpAddress' + x-platforms: + - android + - ios + - browser + user_agent: + $ref: '#/components/schemas/UserAgent' + x-platforms: + - android + - ios + - browser + browser_details: + $ref: '#/components/schemas/BrowserDetails' + x-platforms: + - browser + proximity: + $ref: '#/components/schemas/Proximity' + x-platforms: + - android + - ios + - browser + bot: + $ref: '#/components/schemas/BotResult' + x-platforms: + - browser + bot_type: + $ref: '#/components/schemas/BotType' + x-platforms: + - browser + cloned_app: + $ref: '#/components/schemas/ClonedApp' + x-platforms: + - android + developer_tools: + $ref: '#/components/schemas/DeveloperTools' + x-platforms: + - browser + emulator: + $ref: '#/components/schemas/Emulator' + x-platforms: + - android + factory_reset_timestamp: + $ref: '#/components/schemas/FactoryReset' + x-platforms: + - android + - ios + frida: + $ref: '#/components/schemas/Frida' + x-platforms: + - android + - ios + ip_blocklist: + $ref: '#/components/schemas/IPBlockList' + x-platforms: + - android + - ios + - browser + ip_info: + $ref: '#/components/schemas/IPInfo' + x-platforms: + - android + - ios + - browser + proxy: + $ref: '#/components/schemas/Proxy' + x-platforms: + - android + - ios + - browser + proxy_confidence: + $ref: '#/components/schemas/ProxyConfidence' + x-platforms: + - android + - ios + - browser + proxy_details: + $ref: '#/components/schemas/ProxyDetails' + x-platforms: + - android + - ios + - browser + incognito: + $ref: '#/components/schemas/Incognito' + x-platforms: + - browser + jailbroken: + $ref: '#/components/schemas/Jailbroken' + x-platforms: + - ios + location_spoofing: + $ref: '#/components/schemas/LocationSpoofing' + x-platforms: + - android + - ios + mitm_attack: + $ref: '#/components/schemas/MitMAttack' + x-platforms: + - android + - ios + privacy_settings: + $ref: '#/components/schemas/PrivacySettings' + x-platforms: + - browser + root_apps: + $ref: '#/components/schemas/RootApps' + x-platforms: + - android + suspect_score: + $ref: '#/components/schemas/SuspectScore' + x-platforms: + - android + - ios + - browser + tampering: + $ref: '#/components/schemas/Tampering' + x-platforms: + - android + - ios + - browser + tampering_details: + $ref: '#/components/schemas/TamperingDetails' + x-platforms: + - android + - ios + - browser + velocity: + $ref: '#/components/schemas/Velocity' + x-platforms: + - android + - ios + - browser + virtual_machine: + $ref: '#/components/schemas/VirtualMachine' + x-platforms: + - browser + vpn: + $ref: '#/components/schemas/Vpn' + x-platforms: + - android + - ios + - browser + vpn_confidence: + $ref: '#/components/schemas/VpnConfidence' + x-platforms: + - android + - ios + - browser + vpn_origin_timezone: + $ref: '#/components/schemas/VpnOriginTimezone' + x-platforms: + - android + - ios + - browser + vpn_origin_country: + $ref: '#/components/schemas/VpnOriginCountry' + x-platforms: + - android + - ios + vpn_methods: + $ref: '#/components/schemas/VpnMethods' + x-platforms: + - android + - ios + - browser + ErrorCode: + type: string + enum: + - request_cannot_be_parsed + - secret_api_key_required + - secret_api_key_not_found + - public_api_key_required + - public_api_key_not_found + - subscription_not_active + - wrong_region + - feature_not_enabled + - request_not_found + - visitor_not_found + - too_many_requests + - state_not_ready + - failed + - event_not_found + - missing_module + - payload_too_large + description: > + Error code: + + * `request_cannot_be_parsed` - The query parameters or JSON payload + contains some errors + that prevented us from parsing it (wrong type/surpassed limits). + * `secret_api_key_required` - secret API key in header is missing or + empty. + + * `secret_api_key_not_found` - No Fingerprint application found for + specified secret API key. - * `false` - Otherwise or when the request originated from a browser. + * `public_api_key_required` - public API key in header is missing or + empty. - See [MitM Attack - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) - to learn more about this Smart Signal. - SupplementaryID: + * `public_api_key_not_found` - No Fingerprint application found for + specified public API key. + + * `subscription_not_active` - Fingerprint application is not active. + + * `wrong_region` - Server and application region differ. + + * `feature_not_enabled` - This feature (for example, Delete API) is not + enabled for your application. + + * `request_not_found` - The specified event ID was not found. It never + existed, expired, or it has been deleted. + + * `visitor_not_found` - The specified visitor ID was not found. It never + existed or it may have already been deleted. + + * `too_many_requests` - The limit on secret API key requests per second + has been exceeded. + + * `state_not_ready` - The event specified with event ID is + not ready for updates yet. Try again. + This error happens in rare cases when update API is called immediately + after receiving the event ID on the client. In case you need to send + information right away, we recommend using the JS agent API instead. + * `failed` - Internal server error. + + * `event_not_found` - The specified event ID was not found. It never + existed, expired, or it has been deleted. + + * `missing_module` - The request is invalid because it is missing a + required module. + + * `payload_too_large` - The request payload is too large and cannot be + processed. + Error: type: object additionalProperties: false + required: + - code + - message properties: - visitorId: + code: + $ref: '#/components/schemas/ErrorCode' + message: type: string - description: >- - String of 20 characters that uniquely identifies the visitor's - browser or mobile device. - visitorFound: - type: boolean - description: Attribute represents if a visitor had been identified before. - confidence: - $ref: '#/components/schemas/IdentificationConfidence' - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - WebhookSupplementaryIDs: + ErrorResponse: type: object - description: Other identities that have been established for a given Visitor. + additionalProperties: false required: - - standard - - highRecall + - error properties: - standard: - $ref: '#/components/schemas/SupplementaryID' - highRecall: - $ref: '#/components/schemas/SupplementaryID' - WebhookProximity: + error: + $ref: '#/components/schemas/Error' + EventUpdate: type: object - description: > - Proximity ID represents a fixed geographical zone in a discrete global - grid within which the device is observed. - additionalProperties: false - required: - - id - - precisionRadius - - confidence properties: - id: + linked_id: type: string - description: | - A stable privacy-preserving identifier for a given proximity zone. - precisionRadius: - type: integer - format: int32 - enum: - - 10 - - 25 - - 65 - - 175 - - 450 - - 1200 - - 3300 - - 8500 - - 22500 - description: | - The radius of the proximity zone’s precision level, in meters. - confidence: - type: number - format: float - minimum: 0 - maximum: 1 - description: > - A value between `0` and `1` representing the likelihood that the - true device location lies within the mapped proximity zone. - * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. - * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - Webhook: + description: Linked Id value to assign to the existing event + tags: + type: object + description: >- + A customer-provided value or an object that was sent with the + identification request or updated later. + additionalProperties: + nullable: true + suspect: + type: boolean + description: Suspect flag indicating observed suspicious or fraudulent event + x-go-force-pointer: true + EventSearch: type: object + description: >- + Contains a list of all identification events matching the specified + search criteria. + additionalProperties: false required: - - requestId - - url - - ip - - time - - timestamp - - sdk + - events properties: - requestId: - type: string - description: Unique identifier of the user's request. - url: - type: string - description: Page URL from which the request was sent. - ip: - type: string - description: IP address of the requesting browser or bot. - environmentId: - type: string - description: Environment ID of the event. - tag: - $ref: '#/components/schemas/Tag' - time: + events: + type: array + items: + $ref: '#/components/schemas/Event' + pagination_key: type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 description: >- - Time expressed according to ISO 8601 in UTC format, when the request - from the JS agent was made. We recommend to treat requests that are - older than 2 minutes as malicious. Otherwise, request replay attacks - are possible. - timestamp: + Use this value in the `pagination_key` parameter to request the next + page of search results. + total_hits: type: integer format: int64 - description: Timestamp of the event with millisecond precision in Unix time. - ipLocation: - $ref: '#/components/schemas/DeprecatedGeolocation' - linkedId: - type: string - description: A customer-provided id that was sent with the request. - visitorId: - type: string description: >- - String of 20 characters that uniquely identifies the visitor's - browser or mobile device. - visitorFound: - type: boolean - description: Attribute represents if a visitor had been identified before. - confidence: - $ref: '#/components/schemas/IdentificationConfidence' - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - type: boolean - description: Flag if user used incognito session. - clientReferrer: - type: string - components: - $ref: '#/components/schemas/RawDeviceAttributes' - bot: - $ref: '#/components/schemas/BotdBot' - userAgent: - type: string - rootApps: - $ref: '#/components/schemas/WebhookRootApps' - emulator: - $ref: '#/components/schemas/WebhookEmulator' - ipInfo: - $ref: '#/components/schemas/WebhookIPInfo' - ipBlocklist: - $ref: '#/components/schemas/WebhookIPBlocklist' - tor: - $ref: '#/components/schemas/WebhookTor' - vpn: - $ref: '#/components/schemas/WebhookVPN' - proxy: - $ref: '#/components/schemas/WebhookProxy' - tampering: - $ref: '#/components/schemas/WebhookTampering' - clonedApp: - $ref: '#/components/schemas/WebhookClonedApp' - factoryReset: - $ref: '#/components/schemas/WebhookFactoryReset' - jailbroken: - $ref: '#/components/schemas/WebhookJailbroken' - frida: - $ref: '#/components/schemas/WebhookFrida' - privacySettings: - $ref: '#/components/schemas/WebhookPrivacySettings' - virtualMachine: - $ref: '#/components/schemas/WebhookVirtualMachine' - rawDeviceAttributes: - $ref: '#/components/schemas/WebhookRawDeviceAttributes' - highActivity: - $ref: '#/components/schemas/WebhookHighActivity' - locationSpoofing: - $ref: '#/components/schemas/WebhookLocationSpoofing' - suspectScore: - $ref: '#/components/schemas/WebhookSuspectScore' - remoteControl: - $ref: '#/components/schemas/WebhookRemoteControl' - velocity: - $ref: '#/components/schemas/WebhookVelocity' - developerTools: - $ref: '#/components/schemas/WebhookDeveloperTools' - mitmAttack: - $ref: '#/components/schemas/WebhookMitMAttack' - replayed: - type: boolean - description: > - `true` if we determined that this payload was replayed, `false` - otherwise. - sdk: - $ref: '#/components/schemas/SDK' - supplementaryIds: - $ref: '#/components/schemas/WebhookSupplementaryIDs' - proximity: - $ref: '#/components/schemas/WebhookProximity' + This value represents the total number of events matching the search + query, up to the limit provided in the `total_hits` query parameter. + Only present if the `total_hits` query parameter was provided. diff --git a/src/Fingerprint.ServerSdk.Examples/ExampleException.cs b/src/Fingerprint.ServerSdk.Examples/ExampleException.cs new file mode 100644 index 0000000..6580438 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Examples/ExampleException.cs @@ -0,0 +1,8 @@ +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Examples; + +public class ExampleException(string message, IApiResponse response) : Exception(message) +{ + public IApiResponse Response = response; +} diff --git a/src/FingerprintPro.ServerSdk.Examples/FingerprintPro.ServerSdk.Examples.csproj b/src/Fingerprint.ServerSdk.Examples/Fingerprint.ServerSdk.Examples.csproj similarity index 72% rename from src/FingerprintPro.ServerSdk.Examples/FingerprintPro.ServerSdk.Examples.csproj rename to src/Fingerprint.ServerSdk.Examples/Fingerprint.ServerSdk.Examples.csproj index 507e53a..08720a2 100644 --- a/src/FingerprintPro.ServerSdk.Examples/FingerprintPro.ServerSdk.Examples.csproj +++ b/src/Fingerprint.ServerSdk.Examples/Fingerprint.ServerSdk.Examples.csproj @@ -3,7 +3,7 @@ Exe net8.0 - examples + Fingerprint.ServerSdk.Examples enable enable @@ -12,7 +12,7 @@ 4 - + diff --git a/src/Fingerprint.ServerSdk.Examples/Program.cs b/src/Fingerprint.ServerSdk.Examples/Program.cs new file mode 100644 index 0000000..1725eb0 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Examples/Program.cs @@ -0,0 +1,113 @@ +using System.Text.Json; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Fingerprint.ServerSdk.Model; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace Fingerprint.ServerSdk.Examples; + +public static class Program +{ + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + + await SearchEventsExample(api); + + var eventId = Environment.GetEnvironmentVariable("EVENT_ID"); + if (!string.IsNullOrWhiteSpace(eventId)) + { + await GetEventExample(api, eventId); + } + + var updateEventId = Environment.GetEnvironmentVariable("UPDATE_EVENT_ID"); + if (!string.IsNullOrWhiteSpace(updateEventId)) + { + await UpdateEventExample(api, updateEventId); + } + + var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID"); + if (!string.IsNullOrWhiteSpace(visitorId)) + { + await DeleteVisitorDataExample(api, visitorId); + } + } + + private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((_, _, options) => + { + var token = Environment.GetEnvironmentVariable("SECRET_API_KEY"); + if (string.IsNullOrWhiteSpace(token)) + { + throw new InvalidOperationException("SECRET_API_KEY is missing"); + } + + var region = Environment.GetEnvironmentVariable("REGION"); + if (!string.IsNullOrWhiteSpace(region)) + { + options.Region = Regions.Parse(region); + } + + var bearerToken = new BearerToken(token); + options.AddTokens(bearerToken); + }); + + private static async Task SearchEventsExample(IFingerprintApi api) + { + var events = await api.SearchEventsAsync(limit: 2, bot: "bad"); + + if (! events.IsOk) + { + throw new ExampleException("SearchEventsAsync failed", events); + } + + Console.WriteLine("SearchEventsAsync result:"); + Console.WriteLine(JsonSerializer.Serialize(events.Ok())); + } + + private static async Task GetEventExample(IFingerprintApi api, string eventId) + { + var model = await api.GetEventAsync(eventId: eventId); + + if (!model.IsOk) + { + throw new ExampleException("GetEventAsync failed", model); + } + + Console.WriteLine("GetEventAsync result:"); + Console.WriteLine(JsonSerializer.Serialize(model.Ok())); + } + + private static async Task UpdateEventExample(IFingerprintApi api, string eventId) + { + var tags = new Dictionary + { + { "sdk", "dotnet" } + }; + + var body = new EventUpdate(linkedId: "", tags: tags, suspect: false); + var updateEvent = await api.UpdateEventAsync(eventId: eventId, eventUpdate: body); + + if (! updateEvent.IsOk) + { + throw new ExampleException("UpdateEventAsync failed", updateEvent); + } + + Console.WriteLine("Event updated"); + } + + private static async Task DeleteVisitorDataExample(IFingerprintApi api, string visitorId) + { + var deleteVisitorData = await api.DeleteVisitorDataAsync(visitorId: visitorId); + + if (! deleteVisitorData.IsOk) + { + throw new ExampleException("DeleteVisitorDataAsync failed", deleteVisitorData); + } + + Console.WriteLine("Scheduled visitor data removal"); + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk.FunctionalTest/ApiTests.cs b/src/Fingerprint.ServerSdk.FunctionalTest/ApiTests.cs new file mode 100644 index 0000000..e9f090e --- /dev/null +++ b/src/Fingerprint.ServerSdk.FunctionalTest/ApiTests.cs @@ -0,0 +1,145 @@ +using System.Net; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Fingerprint.ServerSdk.Model; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Xunit; + +namespace Fingerprint.ServerSdk.FunctionalTest; + +public class ApiTests : IAsyncLifetime +{ + private readonly IHost _host; + private readonly IFingerprintApi _api; + private readonly long _start; + private readonly long _end; + private string? _eventId; + private string? _paginationKey; + + public async Task InitializeAsync() + { + var eventsResponse = await _api.SearchEventsAsync(2, start: _start, end: _end); + + Assert.True(eventsResponse.IsOk); + + var events = eventsResponse.Ok(); + + Assert.NotEmpty(events.Events); + + var first = events.Events.First(); + _eventId = first.EventId; + _paginationKey = events.PaginationKey; + } + + public ApiTests() + { + _host = CreateHostBuilder().Build(); + _api = _host.Services.GetRequiredService(); + + var now = DateTimeOffset.UtcNow; + _end = now.ToUnixTimeMilliseconds(); + _start = now.AddDays(-90).ToUnixTimeMilliseconds(); + } + + private static IHostBuilder CreateHostBuilder() => Host.CreateDefaultBuilder() + .ConfigureApi((_, _, options) => + { + var token = Environment.GetEnvironmentVariable("SECRET_API_KEY"); + if (string.IsNullOrWhiteSpace(token)) + { + throw new InvalidOperationException("SECRET_API_KEY is missing"); + } + + var region = Environment.GetEnvironmentVariable("REGION"); + if (!string.IsNullOrWhiteSpace(region)) + { + options.Region = Regions.Parse(region); + } + + var bearerToken = new BearerToken(token); + options.AddTokens(bearerToken); + }); + + [Fact] + public async Task GetEvent_ReturnsExpectedFields() + { + Assert.NotNull(_eventId); + + var eventResponse = await _api.GetEventAsync(_eventId); + Assert.True(eventResponse.IsOk); + var model = eventResponse.Ok(); + + Assert.Multiple(() => + { + Assert.NotNull(model); + Assert.IsType(model.Bot); + Assert.Equal(_eventId, model.EventId); + }); + } + + [Fact] + public async Task GetEvent_WrongRequestId_Throws404() + { + var wrongRequest = await _api.GetEventAsync("1662542583652.pLBzes"); + + Assert.Multiple(() => + { + Assert.True(wrongRequest.IsNotFound); + var notFound = wrongRequest.NotFound(); + Assert.Equal(HttpStatusCode.NotFound, wrongRequest.StatusCode); + Assert.Equal(ErrorCode.RequestNotFound, notFound.Error.Code); + }); + } + + [Fact] + public async Task SearchEvents_Returns() + { + var start = DateTime.UtcNow.Subtract(TimeSpan.FromDays(365)); + var end = DateTime.UtcNow.Add(TimeSpan.FromDays(365)); + + var response = await _api.SearchEventsAsync( + limit: 2, + start: new DateTimeOffset(start, TimeSpan.Zero).ToUnixTimeMilliseconds(), + end: new DateTimeOffset(end, TimeSpan.Zero).ToUnixTimeMilliseconds() + ); + + Assert.True(response.IsOk); + Assert.NotEmpty(response.Ok().Events); + } + + [Fact] + public async Task SearchEvents_Pagination() + { + Assert.NotNull(_paginationKey); + + var response = await _api.SearchEventsAsync(2, start: _start, end: _end, paginationKey: _paginationKey); + Assert.True(response.IsOk); + Assert.NotEmpty(response.Ok().Events); + } + + [Fact] + public async Task SearchEvents_ReverseWorks() + { + var response = await _api.SearchEventsAsync(limit: 2, start: _start, end: _end, reverse: true); + Assert.True(response.IsOk); + var eventSearch = response.Ok(); + Assert.Equal(2, eventSearch.Events.Count); + + var oldestEvent = eventSearch.Events.First(); + var newestEvent = eventSearch.Events.Last(); + + Assert.True(oldestEvent.Timestamp < newestEvent.Timestamp); + + // Try to request old events to check if they still could be deserialized + await _api.GetEventAsync(oldestEvent.EventId); + await _api.SearchEventsAsync(visitorId: oldestEvent.Identification.VisitorId); + } + + public Task DisposeAsync() + { + _host.Dispose(); + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk.FunctionalTest/Fingerprint.ServerSdk.FunctionalTest.csproj b/src/Fingerprint.ServerSdk.FunctionalTest/Fingerprint.ServerSdk.FunctionalTest.csproj new file mode 100644 index 0000000..60ae7ba --- /dev/null +++ b/src/Fingerprint.ServerSdk.FunctionalTest/Fingerprint.ServerSdk.FunctionalTest.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + enable + enable + + false + + Fingerprint.ServerSdk.FunctionalTest + + + + + + + + + + + + + diff --git a/src/FingerprintPro.ServerSdk.SealedResultExample/FingerprintPro.ServerSdk.SealedResultExample.csproj b/src/Fingerprint.ServerSdk.SealedResultExample/Fingerprint.ServerSdk.SealedResultExample.csproj similarity index 70% rename from src/FingerprintPro.ServerSdk.SealedResultExample/FingerprintPro.ServerSdk.SealedResultExample.csproj rename to src/Fingerprint.ServerSdk.SealedResultExample/Fingerprint.ServerSdk.SealedResultExample.csproj index f5f9739..497bd76 100644 --- a/src/FingerprintPro.ServerSdk.SealedResultExample/FingerprintPro.ServerSdk.SealedResultExample.csproj +++ b/src/Fingerprint.ServerSdk.SealedResultExample/Fingerprint.ServerSdk.SealedResultExample.csproj @@ -5,13 +5,13 @@ net8.0 enable enable - FingerprintPro.ServerSdk.SealedResultExample + Fingerprint.ServerSdk.SealedResultExample 4 - + diff --git a/src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs b/src/Fingerprint.ServerSdk.SealedResultExample/Program.cs similarity index 56% rename from src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs rename to src/Fingerprint.ServerSdk.SealedResultExample/Program.cs index 97a77dd..096a96b 100644 --- a/src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs +++ b/src/Fingerprint.ServerSdk.SealedResultExample/Program.cs @@ -1,11 +1,11 @@ -using FingerprintPro.ServerSdk; +using System.Text.Json; +using Fingerprint.ServerSdk; var sealedResult = Environment.GetEnvironmentVariable("BASE64_SEALED_RESULT")!; var sealedKey = Environment.GetEnvironmentVariable("BASE64_KEY")!; -var events = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), new[] -{ +var model = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), [ new Sealed.DecryptionKey(Convert.FromBase64String(sealedKey), Sealed.DecryptionAlgorithm.Aes256Gcm) -}); +]); -Console.WriteLine(events.ToJson()); \ No newline at end of file +Console.WriteLine(JsonSerializer.Serialize(model)); \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk.Test/Api/ApiTestsBase.cs b/src/Fingerprint.ServerSdk.Test/Api/ApiTestsBase.cs new file mode 100644 index 0000000..a753593 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/Api/ApiTestsBase.cs @@ -0,0 +1,157 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Extensions; +using Microsoft.Extensions.DependencyInjection; + +namespace Fingerprint.ServerSdk.Test.Api +{ + public class ApiRequest + { + public HttpListenerRequest Request; + + public string Body; + } + + /// + /// Base class for API tests + /// + public class ApiTestsBase : IDisposable + { + protected readonly IHost Host; + + private HttpListener _mockServer; + private WebHeaderCollection _mockResponseHeaders; + protected int MockResponseStatusCode = (int)HttpStatusCode.OK; + private byte[] _mockResponseBytes; + + protected const string ServerUrl = "http://127.0.0.1:8081/"; + + protected readonly List Requests = new List(); + + protected ApiTestsBase(string[] args) + { + Host = CreateHostBuilder(args).Build(); + StartServer(); + } + + private static IHostBuilder CreateHostBuilder(string[] args) => Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args) + .ConfigureApi((context, _, options) => + { + options.BaseUrl = ServerUrl; + + var bearerToken1 = new BearerToken("", timeout: null); + options.AddTokens(bearerToken1); + }); + + private void StartServer() + { + _mockServer = new HttpListener(); + _mockServer.Prefixes.Add(ServerUrl); + _mockServer.Start(); + + _mockResponseHeaders = new WebHeaderCollection(); + MockResponseStatusCode = (int)HttpStatusCode.OK; + + HandleConnection().GetAwaiter(); + Console.WriteLine("Started server"); + } + + protected T GetMockResponse() + { + return JsonSerializer.Deserialize(Encoding.UTF8.GetString(_mockResponseBytes), Host.Services.GetService()); + } + + protected void SetupMockResponse(string fileName) + { + var path = Path.Combine(AppContext.BaseDirectory, "mocks", fileName); + var mockResponse = File.ReadAllText(path); + _mockResponseBytes = Encoding.UTF8.GetBytes(mockResponse); + } + + private async Task HandleConnection() + { + while (_mockServer != null) + { + var ctx = await _mockServer.GetContextAsync(); + + // Peel out the requests and response objects + var req = ctx.Request; + var resp = ctx.Response; + + var body = ""; + + if (req.HasEntityBody) + { + using (var reader = new StreamReader(req.InputStream, req.ContentEncoding)) + { + body = await reader.ReadToEndAsync(); + } + } + + Requests.Add(new ApiRequest() + { + Request = req, + Body = body + }); + + // Print out some info about the request + Console.WriteLine(req.Url?.ToString()); + Console.WriteLine(req.HttpMethod); + Console.WriteLine(req.UserHostName); + Console.WriteLine(req.UserAgent); + Console.WriteLine(); + + resp.StatusCode = MockResponseStatusCode; + + if (_mockResponseHeaders != null) + { + foreach (var key in _mockResponseHeaders.AllKeys) + { + var value = _mockResponseHeaders[key]; + + if (value != null) + { + resp.AddHeader(key, value); + } + } + } + + if (_mockResponseBytes != null) + { + resp.ContentType = "application/json"; + resp.ContentEncoding = Encoding.UTF8; + resp.ContentLength64 = _mockResponseBytes.LongLength; + + await resp.OutputStream.WriteAsync(_mockResponseBytes, 0, _mockResponseBytes.Length); + } + + resp.Close(); + } + } + + public void Dispose() + { + Console.WriteLine("Closing server..."); + Requests.Clear(); + _mockServer?.Close(); + Host?.Dispose(); + } + } +} diff --git a/src/Fingerprint.ServerSdk.Test/Api/DependencyInjectionTests.cs b/src/Fingerprint.ServerSdk.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 0000000..356e018 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,139 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Linq; +using System.Net.Http.Headers; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Extensions; +using Xunit; + +namespace Fingerprint.ServerSdk.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private const string Token = ""; + + private const string CustomUserAgentProduct = "custom-user-agent"; + private const string CustomUserAgentVersion = "1.0.0"; + + private const string CustomUserAgent = $"{CustomUserAgentProduct}/{CustomUserAgentVersion}"; + + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder([]).ConfigureApi((_, _, options) => + { + var bearerToken1 = new BearerToken(Token); + options.AddTokens(bearerToken1); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder([]).ConfigureApi((_, _, options) => + { + var bearerToken1 = new BearerToken(Token); + options.AddTokens(bearerToken1); + options.AddApiHttpClients(client => client.BaseAddress = ClientUtils.GetBaseUri(Region.Us)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder([]).ConfigureServices((_, services) => + { + services.AddApi(options => + { + var bearerToken1 = new BearerToken(Token); + options.AddTokens(bearerToken1); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder([]).ConfigureServices((_, services) => + { + services.AddApi(options => + { + var bearerToken1 = new BearerToken(Token); + options.AddTokens(bearerToken1); + options.AddApiHttpClients(client => client.BaseAddress = ClientUtils.GetBaseUri(Region.Us)); + }); + }) + .Build(); + + private readonly IHost _hostUsingDifferentUserAgent = + Host.CreateDefaultBuilder([]).ConfigureServices((_, services) => + { + services.AddApi(options => + { + options.UserAgent = CustomUserAgent; + + var bearerToken1 = new BearerToken(Token); + options.AddTokens(bearerToken1); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var fingerprintApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fingerprintApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var fingerprintApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fingerprintApi.HttpClient.BaseAddress != null); + } + + /// + /// Test custom user agent + /// + [Fact] + public void ConfigureApiWithCustomUserAgentTest() + { + var fingerprintApi = _hostUsingDifferentUserAgent.Services.GetRequiredService(); + var userAgentCollection = fingerprintApi.HttpClient.DefaultRequestHeaders.UserAgent; + Assert.Single(userAgentCollection); + var userAgent = userAgentCollection.First(); + Assert.Equal(new ProductInfoHeaderValue(CustomUserAgentProduct, CustomUserAgentVersion), userAgent); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var fingerprintApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fingerprintApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var fingerprintApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fingerprintApi.HttpClient.BaseAddress != null); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk.Test/Api/FingerprintApiTests.cs b/src/Fingerprint.ServerSdk.Test/Api/FingerprintApiTests.cs new file mode 100644 index 0000000..94c6010 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/Api/FingerprintApiTests.cs @@ -0,0 +1,563 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Text.Json; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Model; + + +namespace Fingerprint.ServerSdk.Test.Api +{ + /// + /// Class for testing FingerprintApi + /// + public sealed class FingerprintApiTests : ApiTestsBase + { + private readonly IFingerprintApi _instance; + + public FingerprintApiTests() : base(Array.Empty()) + { + _instance = Host.Services.GetRequiredService(); + } + + /// + /// Test DeleteVisitorData + /// + [Fact] + public async Task DeleteVisitorDataAsyncTest() + { + const string visitorId = "AcxioeQKffpXF8iGQK3P"; + + var response = await _instance.DeleteVisitorDataAsync(visitorId); + Assert.Multiple(() => + { + Assert.Single(Requests); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var request = Requests.First().Request; + Assert.Equal($"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}", request.Headers.Get("User-Agent")); + Assert.Equal($"{ServerUrl}visitors/{visitorId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{ClientUtils.ClientVersion}", request.Url.ToString()); + Assert.Equal("DELETE", request.HttpMethod); + }); + } + + [Fact] + public async Task DeleteVisitorDataAsync403ErrorTest() + { + SetupMockResponse("errors/403_feature_not_enabled.json"); + MockResponseStatusCode = 403; + + const string visitorId = "AcxioeQKffpXF8iGQK3P"; + + var response = await _instance.DeleteVisitorDataAsync(visitorId); + Assert.Multiple(() => + { + Assert.True(response.IsForbidden); + var errorResponse = response.Forbidden(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.FeatureNotEnabled, errorResponse.Error.Code); + }); + } + + [Fact] + public async Task DeleteVisitorDataAsync400ErrorTest() + { + SetupMockResponse("errors/400_request_body_invalid.json"); + MockResponseStatusCode = 400; + + const string visitorId = "AcxioeQKffpXF8iGQK3P"; + + var response = await _instance.DeleteVisitorDataAsync(visitorId); + Assert.Multiple(() => + { + Assert.True(response.IsBadRequest); + var errorResponse = response.BadRequest(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.RequestCannotBeParsed, errorResponse.Error.Code); + }); + } + + [Fact] + public async Task DeleteVisitorDataAsync429ErrorTest() + { + SetupMockResponse("errors/429_too_many_requests.json"); + MockResponseStatusCode = 429; + + const string visitorId = "AcxioeQKffpXF8iGQK3P"; + + var response = await _instance.DeleteVisitorDataAsync(visitorId); + Assert.Multiple(() => + { + Assert.True(response.IsTooManyRequests); + var errorResponse = response.TooManyRequests(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.TooManyRequests, errorResponse.Error.Code); + }); + } + + [Fact] + public async Task DeleteVisitorDataAsync404ErrorTest() + { + SetupMockResponse("errors/404_visitor_not_found.json"); + MockResponseStatusCode = 404; + + const string visitorId = "AcxioeQKffpXF8iGQK3P"; + + var response = await _instance.DeleteVisitorDataAsync(visitorId); + Assert.Multiple(() => + { + Assert.True(response.IsNotFound); + var errorResponse = response.NotFound(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.VisitorNotFound, errorResponse.Error.Code); + }); + } + + /// + /// Test GetEvent + /// + [Fact] + public async Task GetEventAsyncTest() + { + SetupMockResponse("events/get_event_200.json"); + + const string eventId = "1708102555327.NLOjmg"; + var response = await _instance.GetEventAsync(eventId); + + Assert.Multiple(() => + { + Assert.Single(Requests); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var request = Requests.First().Request; + Assert.Equal($"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}", request.Headers.Get("User-Agent")); + Assert.Equal($"{ServerUrl}events/{eventId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{ClientUtils.ClientVersion}", request.Url.ToString()); + Assert.Equal("GET", request.HttpMethod); + + var model = response.Ok(); + Assert.IsType(model); + Assert.Equal(eventId, model.EventId); + Assert.Equal("94.142.239.124", model.IpInfo.V4.Address); + Assert.False(model.ClonedApp); + Assert.Equal(0, model.FactoryResetTimestamp); + Assert.False(model.Frida); + Assert.False(model.Incognito); + Assert.False(model.IpBlocklist.TorNode); + Assert.False(model.IpBlocklist.AttackSource); + Assert.False(model.IpBlocklist.EmailSpam); + Assert.False(model.Jailbroken); + Assert.False(model.PrivacySettings); + Assert.True(model.Proxy); + Assert.Equal(ProxyDetails.ProxyTypeEnum.Residential, model.ProxyDetails.ProxyType); + Assert.IsType(model.ProxyDetails.LastSeenAt); + Assert.False(model.RootApps); + Assert.False(model.Tampering); + Assert.False(model.VirtualMachine); + Assert.False(model.Vpn); + Assert.False(model.ClonedApp); + Assert.IsType(model.FactoryResetTimestamp); + var factoryResetExpectedTime = DateTime.Parse("1970-01-01T00:00:00Z", CultureInfo.InvariantCulture, + DateTimeStyles.AdjustToUniversal); + Assert.Equal(new DateTimeOffset(factoryResetExpectedTime).ToUnixTimeMilliseconds(), model.FactoryResetTimestamp); + }); + + } + + [Fact] + public async Task SearchEventsAsyncTest() + { + SetupMockResponse("events/search/get_event_search_200.json"); + + const int limit = 1; + + var response = await _instance.SearchEventsAsync(limit); + + Assert.Multiple(() => + { + Assert.Single(Requests); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var request = Requests.First().Request; + Assert.Equal($"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}", request.Headers.Get("User-Agent")); + Assert.Equal($"{ServerUrl}events?ii=fingerprint-pro-server-api-dotnet-sdk%2f{ClientUtils.ClientVersion}&limit={limit}", request.Url.ToString()); + Assert.Equal("GET", request.HttpMethod); + + var eventSearch = response.Ok(); + Assert.IsType(eventSearch); + Assert.Single(eventSearch.Events); + var firstEvent = eventSearch.Events.First(); + + Assert.IsType(firstEvent); + Assert.Equal("1708102555327.NLOjmg", firstEvent.EventId); + Assert.Equal("94.142.239.124", firstEvent.IpInfo.V4.Address); + Assert.False(firstEvent.ClonedApp); + Assert.False(firstEvent.Emulator); + Assert.Equal(0, firstEvent.FactoryResetTimestamp); + Assert.False(firstEvent.Frida); + Assert.False(firstEvent.Incognito); + Assert.False(firstEvent.IpBlocklist.TorNode); + Assert.False(firstEvent.IpBlocklist.AttackSource); + Assert.False(firstEvent.IpBlocklist.EmailSpam); + Assert.False(firstEvent.Jailbroken); + Assert.False(firstEvent.PrivacySettings); + Assert.True(firstEvent.Proxy); + Assert.Equal(ProxyDetails.ProxyTypeEnum.Residential, firstEvent.ProxyDetails.ProxyType); + Assert.IsType(firstEvent.ProxyDetails.LastSeenAt); + Assert.False(firstEvent.RootApps); + Assert.False(firstEvent.Tampering); + Assert.False(firstEvent.VirtualMachine); + Assert.False(firstEvent.Vpn); + Assert.False(firstEvent.ClonedApp); + Assert.IsType(firstEvent.FactoryResetTimestamp); + var factoryResetExpectedTime = DateTime.Parse("1970-01-01T00:00:00Z", CultureInfo.InvariantCulture, + DateTimeStyles.AdjustToUniversal); + Assert.Equal(new DateTimeOffset(factoryResetExpectedTime).ToUnixTimeMilliseconds(), firstEvent.FactoryResetTimestamp); + }); + } + + /// + /// Test SearchEvents + /// + [Fact] + public async Task SearchEventsAsyncParamsTest() + { + SetupMockResponse("events/search/get_event_search_200.json"); + + const int limit = 1; + const string paginationKey = "pagination"; + const string visitorId = "AcxioeQKffpXF8iGQK3P"; + const string bot = "good"; + const string ipAddress = "10.0.0.0/24"; + const string linkedId = "some_linked_id"; + const string url = "https://www.example.com/login?hope{this{works[!"; + const string origin = "com.foo.bar"; + const long start = 1582299576511; + const long end = 1582299576513; + const bool reverse = true; + const bool suspect = false; + const bool vpn = true; + const bool virtualMachine = false; + const bool tampering = false; + const bool antiDetectBrowser = false; + const bool incognito = false; + const bool privacySettings = false; + const bool jailbroken = false; + const bool frida = false; + const bool factoryReset = false; + const bool clonedApp = false; + const bool emulator = false; + const bool rootApps = false; + const string vpnConfidence = "high"; + const float minSuspectScore = .7f; + const bool developerTools = true; + const bool locationSpoofing = true; + const bool mitmAttack = true; + const bool proxy = true; + const string sdkVersion = "testSdkVersion"; + const string sdkPlatform = "testSdkPlatform"; + var environment = new List { "env1", "env2" }; + const long totalHits = 1; + + var uriBuilder = new UriBuilder + { + Host = _instance.HttpClient.BaseAddress.Host, + Port = _instance.HttpClient.BaseAddress.Port, + Scheme = _instance.HttpClient.BaseAddress.Scheme, + Path = _instance.HttpClient.BaseAddress.AbsolutePath == "/" + ? "/events" + : string.Concat(_instance.HttpClient.BaseAddress.AbsolutePath, "/events") + }; + var parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + parseQueryString["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ClientUtils.ClientVersion}"; + parseQueryString["limit"] = ClientUtils.ParameterToString(limit); + parseQueryString["pagination_key"] = ClientUtils.ParameterToString(paginationKey); + parseQueryString["visitor_id"] = ClientUtils.ParameterToString(visitorId); + parseQueryString["bot"] = ClientUtils.ParameterToString(bot); + parseQueryString["ip_address"] = ClientUtils.ParameterToString(ipAddress); + parseQueryString["linked_id"] = ClientUtils.ParameterToString(linkedId); + parseQueryString["url"] = ClientUtils.ParameterToString(url); + parseQueryString["origin"] = ClientUtils.ParameterToString(origin); + parseQueryString["start"] = ClientUtils.ParameterToString(start); + parseQueryString["end"] = ClientUtils.ParameterToString(end); + parseQueryString["reverse"] = ClientUtils.ParameterToString(reverse); + parseQueryString["suspect"] = ClientUtils.ParameterToString(suspect); + parseQueryString["vpn"] = ClientUtils.ParameterToString(vpn); + parseQueryString["virtual_machine"] = ClientUtils.ParameterToString(virtualMachine); + parseQueryString["tampering"] = ClientUtils.ParameterToString(tampering); + parseQueryString["anti_detect_browser"] = ClientUtils.ParameterToString(antiDetectBrowser); + parseQueryString["incognito"] = ClientUtils.ParameterToString(incognito); + parseQueryString["privacy_settings"] = ClientUtils.ParameterToString(privacySettings); + parseQueryString["jailbroken"] = ClientUtils.ParameterToString(jailbroken); + parseQueryString["frida"] = ClientUtils.ParameterToString(frida); + parseQueryString["factory_reset"] = ClientUtils.ParameterToString(factoryReset); + parseQueryString["cloned_app"] = ClientUtils.ParameterToString(clonedApp); + parseQueryString["emulator"] = ClientUtils.ParameterToString(emulator); + parseQueryString["root_apps"] = ClientUtils.ParameterToString(rootApps); + parseQueryString["vpn_confidence"] = ClientUtils.ParameterToString(vpnConfidence); + parseQueryString["min_suspect_score"] = ClientUtils.ParameterToString(minSuspectScore); + parseQueryString["developer_tools"] = ClientUtils.ParameterToString(developerTools); + parseQueryString["location_spoofing"] = ClientUtils.ParameterToString(locationSpoofing); + parseQueryString["mitm_attack"] = ClientUtils.ParameterToString(mitmAttack); + parseQueryString["proxy"] = ClientUtils.ParameterToString(proxy); + parseQueryString["sdk_version"] = ClientUtils.ParameterToString(sdkVersion); + parseQueryString["sdk_platform"] = ClientUtils.ParameterToString(sdkPlatform); + parseQueryString["environment"] = ClientUtils.ParameterToString(environment); + parseQueryString["total_hits"] = ClientUtils.ParameterToString(totalHits); + uriBuilder.Query = parseQueryString.ToString(); + + var response = await _instance.SearchEventsAsync(limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits); + + Assert.Multiple(() => + { + Assert.Single(Requests); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var request = Requests.First().Request; + Assert.Equal($"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}", request.Headers.Get("User-Agent")); + + Assert.Equal(uriBuilder.Uri.ToString(), request.Url.ToString()); + Assert.Equal("GET", request.HttpMethod); + + var eventSearch = response.Ok(); + Assert.IsType(eventSearch); + Assert.Single(eventSearch.Events); + var firstEvent = eventSearch.Events.First(); + + Assert.IsType(firstEvent); + Assert.Equal("1708102555327.NLOjmg", firstEvent.EventId); + Assert.Equal("94.142.239.124", firstEvent.IpInfo.V4.Address); + Assert.False(firstEvent.ClonedApp); + Assert.False(firstEvent.Emulator); + Assert.Equal(0, firstEvent.FactoryResetTimestamp); + Assert.False(firstEvent.Frida); + Assert.False(firstEvent.Incognito); + Assert.False(firstEvent.IpBlocklist.TorNode); + Assert.False(firstEvent.IpBlocklist.AttackSource); + Assert.False(firstEvent.IpBlocklist.EmailSpam); + Assert.False(firstEvent.Jailbroken); + Assert.False(firstEvent.PrivacySettings); + Assert.True(firstEvent.Proxy); + Assert.Equal(ProxyDetails.ProxyTypeEnum.Residential, firstEvent.ProxyDetails.ProxyType); + Assert.IsType(firstEvent.ProxyDetails.LastSeenAt); + Assert.False(firstEvent.RootApps); + Assert.False(firstEvent.Tampering); + Assert.False(firstEvent.VirtualMachine); + Assert.False(firstEvent.Vpn); + Assert.False(firstEvent.ClonedApp); + Assert.IsType(firstEvent.FactoryResetTimestamp); + var factoryResetExpectedTime = DateTime.Parse("1970-01-01T00:00:00Z", CultureInfo.InvariantCulture, + DateTimeStyles.AdjustToUniversal); + Assert.Equal(new DateTimeOffset(factoryResetExpectedTime).ToUnixTimeMilliseconds(), firstEvent.FactoryResetTimestamp); + }); + } + + [Fact] + public async Task SearchEventsAsync400ErrorTest() + { + SetupMockResponse("errors/400_ip_address_invalid.json"); + MockResponseStatusCode = 400; + + const int limit = 1; + const string ipAddress = "01234"; + + var response = await _instance.SearchEventsAsync(limit, ipAddress: ipAddress); + Assert.Multiple(() => + { + Assert.True(response.IsBadRequest); + var errorResponse = response.BadRequest(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.RequestCannotBeParsed, errorResponse.Error.Code); + }); + } + + [Fact] + public async Task SearchEventsAsync403ErrorTest() + { + SetupMockResponse("errors/403_feature_not_enabled.json"); + MockResponseStatusCode = 403; + + const int limit = 1; + + var response = await _instance.SearchEventsAsync(limit); + Assert.Multiple(() => + { + Assert.True(response.IsForbidden); + var errorResponse = response.Forbidden(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.FeatureNotEnabled, errorResponse.Error.Code); + }); + } + + /// + /// Test UpdateEvent + /// + [Fact] + public async Task UpdateEventAsyncTest() + { + const string eventId = "1708102555327.NLOjmg"; + var eventUpdate = new EventUpdate + { + Suspect = false, + LinkedId = "new_linked_id", + Tags = new Dictionary + { + { "foo", "bar" }, + { "baz", true } + } + }; + + var response = await _instance.UpdateEventAsync(eventId, eventUpdate); + Assert.Multiple(() => + { + Assert.Single(Requests); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var firstRequest = Requests.First(); + var request = firstRequest.Request; + var body = firstRequest.Body; + + Assert.Equal($"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}", request.Headers.Get("User-Agent")); + Assert.Equal($"{ServerUrl}events/{eventId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{ClientUtils.ClientVersion}", request.Url.ToString()); + Assert.Equal("PATCH", request.HttpMethod); + Assert.Equal("application/json", request.ContentType); + Assert.Equal(JsonSerializer.Serialize(eventUpdate, Host.Services.GetService()), body); + }); + } + + /// + /// + [Fact] + public async Task UpdateEventAsync400ErrorTest() + { + SetupMockResponse("errors/400_request_body_invalid.json"); + MockResponseStatusCode = 400; + + const string eventId = "1708102555327.NLOjmg"; + var eventUpdate = new EventUpdate + { + Suspect = false, + LinkedId = "new_linked_id", + Tags = new Dictionary + { + { "foo", "bar" }, + { "baz", true } + } + }; + + var response = await _instance.UpdateEventAsync(eventId, eventUpdate); + Assert.Multiple(() => + { + Assert.True(response.IsBadRequest); + var errorResponse = response.BadRequest(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.RequestCannotBeParsed, errorResponse.Error.Code); + }); + } + + /// + /// + [Fact] + public async Task UpdateEventAsync403ErrorTest() + { + SetupMockResponse("errors/403_feature_not_enabled.json"); + MockResponseStatusCode = 403; + + const string eventId = "1708102555327.NLOjmg"; + var eventUpdate = new EventUpdate + { + Suspect = false, + LinkedId = "new_linked_id", + Tags = new Dictionary + { + { "foo", "bar" }, + { "baz", true } + } + }; + + var response = await _instance.UpdateEventAsync(eventId, eventUpdate); + Assert.Multiple(() => + { + Assert.True(response.IsForbidden); + var errorResponse = response.Forbidden(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.FeatureNotEnabled, errorResponse.Error.Code); + }); + } + + /// + /// + [Fact] + public async Task UpdateEventAsync404ErrorTest() + { + SetupMockResponse("errors/404_event_not_found.json"); + MockResponseStatusCode = 404; + + const string eventId = "1708102555327.NLOjmg"; + var eventUpdate = new EventUpdate + { + Suspect = false, + LinkedId = "new_linked_id", + Tags = new Dictionary + { + { "foo", "bar" }, + { "baz", true } + } + }; + + var response = await _instance.UpdateEventAsync(eventId, eventUpdate); + Assert.Multiple(() => + { + Assert.True(response.IsNotFound); + var errorResponse = response.NotFound(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.EventNotFound, errorResponse.Error.Code); + }); + } + + /// + /// + [Fact] + public async Task UpdateEventAsync409ErrorTest() + { + SetupMockResponse("errors/409_state_not_ready.json"); + MockResponseStatusCode = 409; + + const string eventId = "1708102555327.NLOjmg"; + var eventUpdate = new EventUpdate + { + Suspect = false, + LinkedId = "new_linked_id", + Tags = new Dictionary + { + { "foo", "bar" }, + { "baz", true } + } + }; + + var response = await _instance.UpdateEventAsync(eventId, eventUpdate); + Assert.Multiple(() => + { + Assert.True(response.IsConflict); + var errorResponse = response.Conflict(); + Assert.IsType(errorResponse); + Assert.Equal(ErrorCode.StateNotReady, errorResponse.Error.Code); + }); + } + } +} diff --git a/src/Fingerprint.ServerSdk.Test/Fingerprint.ServerSdk.Test.csproj b/src/Fingerprint.ServerSdk.Test/Fingerprint.ServerSdk.Test.csproj new file mode 100644 index 0000000..f63c448 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/Fingerprint.ServerSdk.Test.csproj @@ -0,0 +1,25 @@ + + + + Fingerprint.ServerSdk.Test + Fingerprint.ServerSdk.Test + net8.0 + false + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/src/Fingerprint.ServerSdk.Test/SealedTests.cs b/src/Fingerprint.ServerSdk.Test/SealedTests.cs new file mode 100644 index 0000000..efe83b3 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/SealedTests.cs @@ -0,0 +1,201 @@ +using System; +using System.IO; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Model; +using Org.BouncyCastle.Crypto; +using Xunit; + +namespace Fingerprint.ServerSdk.Test +{ + public class SealedTests + { + private readonly JsonSerializerOptions _jsonOptions = new(); + + public SealedTests() + { + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new BotResultJsonConverter()); + _jsonOptions.Converters.Add(new BotResultNullableJsonConverter()); + _jsonOptions.Converters.Add(new BrowserDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ErrorJsonConverter()); + _jsonOptions.Converters.Add(new ErrorCodeJsonConverter()); + _jsonOptions.Converters.Add(new ErrorCodeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ErrorResponseJsonConverter()); + _jsonOptions.Converters.Add(new EventJsonConverter()); + _jsonOptions.Converters.Add(new EventSearchJsonConverter()); + _jsonOptions.Converters.Add(new EventUpdateJsonConverter()); + _jsonOptions.Converters.Add(new GeolocationJsonConverter()); + _jsonOptions.Converters.Add(new GeolocationSubdivisionsInnerJsonConverter()); + _jsonOptions.Converters.Add(new IPBlockListJsonConverter()); + _jsonOptions.Converters.Add(new IPInfoJsonConverter()); + _jsonOptions.Converters.Add(new IPInfoV4JsonConverter()); + _jsonOptions.Converters.Add(new IPInfoV6JsonConverter()); + _jsonOptions.Converters.Add(new IdentificationJsonConverter()); + _jsonOptions.Converters.Add(new IdentificationConfidenceJsonConverter()); + _jsonOptions.Converters.Add(new IntegrationJsonConverter()); + _jsonOptions.Converters.Add(new IntegrationSubintegrationJsonConverter()); + _jsonOptions.Converters.Add(new ProximityJsonConverter()); + _jsonOptions.Converters.Add(new ProxyConfidenceJsonConverter()); + _jsonOptions.Converters.Add(new ProxyConfidenceNullableJsonConverter()); + _jsonOptions.Converters.Add(new ProxyDetailsJsonConverter()); + _jsonOptions.Converters.Add(new SDKJsonConverter()); + _jsonOptions.Converters.Add(new SupplementaryIDHighRecallJsonConverter()); + _jsonOptions.Converters.Add(new TamperingDetailsJsonConverter()); + _jsonOptions.Converters.Add(new TriggeredByInnerJsonConverter()); + _jsonOptions.Converters.Add(new VelocityJsonConverter()); + _jsonOptions.Converters.Add(new VelocityDataJsonConverter()); + _jsonOptions.Converters.Add(new VpnConfidenceJsonConverter()); + _jsonOptions.Converters.Add(new VpnConfidenceNullableJsonConverter()); + _jsonOptions.Converters.Add(new VpnMethodsJsonConverter()); + } + + [Fact] + public void UnsealEventResponseTest() + { + var sealedResult = Convert.FromBase64String( + "noXc7Xu7PIKu1tbMkMxLbQG4XU46Bv5dED98hqTkPYZnmb8PG81Q83Kpg541Vt4NQdkzfezDSVk8FP9ZzJ08L0MMb4S8bT78c10Op1LyKwZU6DGr1e3V+ZWcNzHVG1rPoL+eUHN6yR9MQp8/CmSUBQUPOOAUXdoqWohbfIGxoQIuQ5BtfpSJuYD6kTyswSi56wxzY/s24dMwgS2KnA81Y1pdi3ZVJKBdwGYGg4T5Dvcqu0GWv3sScKD9b4Tagfbe2m8nbXY/QtN770c7J1xo/TNXXdq4lyqaMyqIayHOwRBP58tNF8mACusm1pogOVIt456wIMetCGKxicPJr7m/Q02ONzhkMtzzXwgwriglGHfM7UbtTsCytCBP7J2vp0tEkHiq/X3qtuvSLJqNyRzwFJhgisKGftc5CIaT2VxVKKxkL/6Ws6FPm4sQB1UGtMCMftKpyb1lFzG9lwFkKvYN9+FGtvRM50mbrzz7ONDxbwykkxihAab36MIuk7dfhvnVLFAjrpuCkEFdWrtjVyWmM0xVeXpEUtP6Ijk5P+VuPZ1alV/JV1q4WvfrGMizEZbwbp6eQZg9mwKe4IX+FVi7sPF2S/CCLI/d90S5Yz6bBP9uiQ3pCVlYbVOkpwS0YQxnR+h5J50qodY7LuswNO5VlEgI0ztkjPQBr8koT4SM54X2z14tA2tKCxSv1psEL5HOk4IWN+9f3RVfDKBDruDiDd+BtZquhYLmOFat9K4h41NrPGAqv5tKmmJtx3llMs6LFHPKBlNlI5zgqE7T47xv2AWw5nqWM107t8lpRETIgJx+YN/Jv6byJSQm7afaeDtHXGceMPOKMziH1XgsiQiS56OsmyyRgaq5YCmMuaPw8gcgVa7RNZSafkP34aQBAuJOA3JFs5xcYcubKutD3h1mk697A8vwdtR/Gj0zTvuUnQ/9o3qHSLseAEIiY9/dS6WJnKXRKTonQi2F6DV9NTzFVQl99AH22jq6lIsjbEEKcq/ydFDUpgAq4lyp9nPBHuPXSojdG+1BWuUyjYykaqnLzzqKgRalGzeWmRHd2qeNw8Bz5OWYBw82C3gHRS2BB9VquIgEYktDvgJ5yRfDYkp8qgxHoYeR88ijccWgdvk+WH78OPdwqA7rqdAYcWqn9KNozoxuYddc0fnrHbgaWpanCmPp0gNEeb4r+i9FDGPSkgYBdyrEPHblsDN/Ad1dhLIHEDEtQyv13s6tDRgLVvhowrzqIM+5cm/abyTDhXzSYDfCw2Wf90cBOMsbQBB2N2YRqnrpA50PGp+0IwlPL7qZj1N4JGhvQD0ux8Ood6AiXpdguj7DMP+T0laHIjWee5/xGZB6g3EsCdOZJjVj7hSE/L3eV4No0WcLqJ5DPOgw+FnvQpxndCTc8DW83tNm624lm7scu0A499vEFj1dhtq5gUxsGcqzm09+Vk2V/d0sa77Xocqe3bcfS5lXc/pHrOc1qKlK8kTr2AYNwjeJJ14euuin361WBETd1I6n8eIs02HyBas09o9lT7Nq05jsnbxej6d0q6GH7IYusiBFTJaAZ6UXOV5i1NOcw9jaGyHms3M2N/b2cmXFYTIFZSjSfbqoI6YZF73sMPhEZqfZ5Jjq+ZLMC3A+yFPFJOW/0oolUGbcC8TBVmLi37Z9Wgc338w2Jf+I94SdViku"); + var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + const string exampleJson = "{\"linked_id\":\"somelinkedId\",\"tags\":{},\"timestamp\":1708102555327,\"event_id\":\"1708102555327.NLOjmg\",\"url\":\"https://www.example.com/login?hope{this{works[!\",\"ip_address\":\"61.127.217.15\",\"user_agent\":\"Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....\",\"browser_details\":{\"browser_name\":\"Chrome\",\"browser_major_version\":\"74\",\"browser_full_version\":\"74.0.3729\",\"os\":\"Windows\",\"os_version\":\"7\",\"device\":\"Other\"},\"identification\":{\"visitor_id\":\"Ibk1527CUFmcnjLwIs4A9\",\"confidence\":{\"score\":0.97,\"version\":\"1.1\"},\"visitor_found\":false,\"first_seen_at\":1708102555327,\"last_seen_at\":1708102555327},\"supplementary_id_high_recall\":{\"visitor_id\":\"3HNey93AkBW6CRbxV6xP\",\"visitor_found\":true,\"confidence\":{\"score\":0.97,\"version\":\"1.1\"},\"first_seen_at\":1708102555327,\"last_seen_at\":1708102555327},\"bot\":\"not_detected\",\"root_apps\":false,\"emulator\":false,\"ip_info\":{\"v4\":{\"address\":\"94.142.239.124\",\"geolocation\":{\"accuracy_radius\":20,\"latitude\":50.05,\"longitude\":14.4,\"postal_code\":\"150 00\",\"timezone\":\"Europe/Prague\",\"city_name\":\"Prague\",\"country_code\":\"CZ\",\"country_name\":\"Czechia\",\"continent_code\":\"EU\",\"continent_name\":\"Europe\",\"subdivisions\":[{\"iso_code\":\"10\",\"name\":\"Hlavni mesto Praha\"}]},\"asn\":\"7922\",\"asn_name\":\"COMCAST-7922\",\"asn_network\":\"73.136.0.0/13\",\"datacenter_result\":true,\"datacenter_name\":\"DediPath\"},\"v6\":{\"address\":\"2001:db8:3333:4444:5555:6666:7777:8888\",\"geolocation\":{\"accuracy_radius\":5,\"latitude\":49.982,\"longitude\":36.2566,\"postal_code\":\"10112\",\"timezone\":\"Europe/Berlin\",\"city_name\":\"Berlin\",\"country_code\":\"DE\",\"country_name\":\"Germany\",\"continent_code\":\"EU\",\"continent_name\":\"Europe\",\"subdivisions\":[{\"iso_code\":\"BE\",\"name\":\"Land Berlin\"}]},\"asn\":\"6805\",\"asn_name\":\"Telefonica Germany\",\"asn_network\":\"2a02:3100::/24\",\"datacenter_result\":false,\"datacenter_name\":\"\"}},\"ip_blocklist\":{\"email_spam\":false,\"attack_source\":false,\"tor_node\":false},\"proxy\":true,\"proxy_confidence\":\"low\",\"proxy_details\":{\"proxy_type\":\"residential\",\"last_seen_at\":1708102555327},\"vpn\":false,\"vpn_confidence\":\"high\",\"vpn_origin_timezone\":\"Europe/Berlin\",\"vpn_origin_country\":\"unknown\",\"vpn_methods\":{\"timezone_mismatch\":false,\"public_vpn\":false,\"auxiliary_mobile\":false,\"os_mismatch\":false,\"relay\":false},\"incognito\":false,\"tampering\":false,\"tampering_details\":{\"anomaly_score\":0.1955,\"anti_detect_browser\":false},\"cloned_app\":false,\"factory_reset_timestamp\":0,\"jailbroken\":false,\"frida\":false,\"privacy_settings\":false,\"virtual_machine\":false,\"location_spoofing\":false,\"velocity\":{\"distinct_ip\":{\"5_minutes\":1,\"1_hour\":1,\"24_hours\":1},\"distinct_country\":{\"5_minutes\":1,\"1_hour\":2,\"24_hours\":2},\"events\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"ip_events\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"distinct_ip_by_linked_id\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"distinct_visitor_id_by_linked_id\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5}},\"developer_tools\":false,\"mitm_attack\":false,\"sdk\":{\"platform\":\"js\",\"version\":\"3.11.10\"},\"replayed\":false}"; + + var expectedResponse = JsonSerializer.Deserialize(exampleJson, _jsonOptions); + + var actualResponse = Sealed.UnsealEventResponse( + sealedResult, + [ + // Invalid key + new Sealed.DecryptionKey(Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.Aes256Gcm) + ]); + + Assert.Equal(expectedResponse.ToString(), actualResponse.ToString()); + } + + [Fact] + public void UnsealEventResponseWithInvalidSealedResultTest() + { + // "{\"invalid\":true}" + var sealedResult = + Convert.FromBase64String("noXc7VOpBstjjcavDKSKr4HTavt4mdq8h6NC32T0hUtw9S0jXT8lPjZiWL8SyHxmrF3uTGqO+g=="); + var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Assert.Throws(() => + { + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.Aes256Gcm) + ]); + }); + } + + [Fact] + public void UnsealEventResponseWithInvalidJsonSealedResultTest() + { + var sealedResult = Convert.FromBase64String( + "noXc7VE/iOGp4qw5etO5BigT7Gq3Grr3vFf4O+kB+JGQFDBDPAy7afWfhz/AhDRiY86mH7GSfOhBbNL4Q/xAvJPLepFFFs2YKYKGH5KLLvTfTX9/MPR4xACLJTbBRk1oLrz7KvyUh8wJzRH15MFryFIgTprKQEAURxSxVfkwKFc/lQvth9A/VD+qfrfQPPfOevGydBSuwhInuOWXsrtT+Oy036o+sf3uR2sGSAVwqMkORNu1s4jvCvT+v5fQH0SVHp2E24tscteOEUNhYcfsWInoDKl2vFR04YX8TSXqC9/YWJDRv4rSV2H806HvKJguElS7Bk4PVGELNg6bYKTV+QVq70UM/X9aABbOy/maYVE1Cv2fV7lOsKj58i4XXMnBoHf6HSrdLBMuelcEbqmILlnouZr9EusGJw9s3bVFihC1ZJMBVkwuUn93eicqg2YjTN+pUevEyQuSYJ9UZ6sRPOGp8OwQNBEYJiMN7M5/5cO4jAB5W7Sgsn+tN5khUDevrXaAdj/q/a6Sq9sGTImySH6IWm8LY+TA13JRTztQne3aD0XmWT2QkTHZ9MP67zaRl5wcJaKWHMYuDcRXu8DJNHQS3IC7RMOKboJPSTrIgmCEeNP4ctdqV+piBC0AEX1zEO/tms3XmoLqGtflHxP/h20XVRlX5YAPyRWJju5gFdXNyLRU6IS2/crJiPocgyTJXtS8/Ffg6ksyg7NSO0Z3232cv1uAszeBsQmBxz6/kwpq5fiNDGTsQouS5g8GqePB34Dduasi/Hn9oHKnDOOpYUnCkIUSJrwJSwqh6Z6kWbZywdqhS6paGeYW+bcVo/zdBhIdS6OH8AAf+5NaZpqmUweTpRcI3/2BYRMhn5KNbVJMG0Egq986V9G0g2o3+7pkpFyHMBuMN4txwLmonU5Thgg="); + var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Assert.Throws(() => + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.Aes256Gcm) + ])); + } + + [Fact] + public void UnsealEventResponseWithNotCompressedSealedResultTest() + { + var sealedResult = Convert.FromBase64String( + "noXc7dtuk0smGE+ZbaoXzrp6Rq8ySxLepejTsu7+jUXlPhV1w+WuHx9gbPhaENJnOQo8BcGmsaRhL5k2NVj+DRNzYO9cQD7wHxmXKCyTbl/dvSYOMoHziUZ2VbQ7tmaorFny26v8jROr/UBGfvPE0dLKC36IN9ZlJ3X0NZJO8SY+8bCr4mTrkVZsv/hpvZp+OjC4h7e5vxcpmnBWXzxfaO79Lq3aMRIEf9XfK7/bVIptHaEqtPKCTwl9rz1KUpUUNQSHTPM0NlqJe9bjYf5mr1uYvWHhcJoXSyRyVMxIv/quRiw3SKJzAMOTBiAvFICpWuRFa+T/xIMHK0g96w/IMQo0jdY1E067ZEvBUOBmsJnGJg1LllS3rbJVe+E2ClFNL8SzFphyvtlcfvYB+SVSD4bzI0w/YCldv5Sq42BFt5bn4n4aE5A6658DYsfSRYWqP6OpqPJx96cY34W7H1t/ZG0ulez6zF5NvWhc1HDQ1gMtXd+K/ogt1n+FyFtn8xzvtSGkmrc2jJgYNI5Pd0Z0ent73z0MKbJx9v2ta/emPEzPr3cndN5amdr6TmRkDU4bq0vyhAh87DJrAnJQLdrvYLddnrr8xTdeXxj1i1Yug6SGncPh9sbTYkdOfuamPAYOuiJVBAMcfYsYEiQndZe8mOQ4bpCr+hxAAqixhZ16pQ8CeUwa247+D2scRymLB8qJXlaERuFZtWGVAZ8VP/GS/9EXjrzpjGX9vlrIPeJP8fh2S5QPzw55cGNJ7JfAdOyManXnoEw2/QzDhSZQARVl+akFgSO0Y13YmbiL7H6HcKWGcJ2ipDKIaj2fJ7GE0Vzyt+CBEezSQR99Igd8x3p2JtvsVKp35iLPksjS1VqtSCTbuIRUlINlfQHNjeQiE/B/61jo3Mf7SmjYjqtvXt5e9RKb+CQku2qH4ZU8xN3DSg+4mLom3BgKBkm/MoyGBpMK41c96d2tRp3tp4hV0F6ac02Crg7P2lw8IUct+i2VJ8VUjcbRfTIPQs0HjNjM6/gLfLCkWOHYrlFjwusXWQCJz91Kq+hVxj7M9LtplPO4AUq6RUMNhlPGUmyOI2tcUMrjq9vMLXGlfdkH185zM4Mk+O7DRLC8683lXZFZvcBEmxr855PqLLH/9SpYKHBoGRatDRdQe3oRp6gHS0jpQ1SW/si4kvLKiUNjiBExvbQVOUV7/VFXvG1RpM9wbzSoOd40gg7ZzD/72QshUC/25DkM/Pm7RBzwtjgmnRKjT+mROeC/7VQLoz3amv09O8Mvbt+h/lX5+51Q834F7NgIGagbB20WtWcMtrmKrvCEZlaoiZrmYVSbi1RfknRK7CTPJkopw9IjO7Ut2EhKZ+jL4rwk6TlVm6EC6Kuj7KNqp6wB/UNe9eM2Eym/aiHAcja8XN4YQhSIuJD2Wxb0n3LkKnAjK1/GY65c8K6rZsVYQ0MQL1j4lMl0UZPjG/vzKyetIsVDyXc4J9ZhOEMYnt/LaxEeSt4EMJGBA9wpTmz33X4h3ij0Y3DY/rH7lrEScUknw20swTZRm5T6q1bnimj7M1OiOkebdI09MZ0nyaTWRHdB7B52C/moh89Q7qa2Fulp5h8Us1FYRkWBLt37a5rGI1IfVeP38KaPbagND+XzWpNqX4HVrAVPLQVK5EwUvGamED3ooJ0FMieTc0IH0N+IeUYG7Q8XmrRVBcw32W8pEfYLO9L71An/J0jQZCIP8DuQnUG0mOvunOuloBGvP/9LvkBlkamh68F0a5f5ny1jloyIFJhRh5dt2SBlbsXS9AKqUwARYSSsA9Ao4WJWOZMyjp8A+qIBAfW65MdhhUDKYMBgIAbMCc3uiptzElQQopE5TT5xIhwfYxa503jVzQbz1Q=="); + var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + var ex = Assert.Throws(() => + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.Aes256Gcm) + ])); + + var lastError = ex.UnsealExceptions.Last(); + + Assert.IsType(lastError.InnerException); + } + + [Fact] + public void UnsealEventResponseWithInvalidHeaderTest() + { + var sealedResult = Convert.FromBase64String( + "noXc7xXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNxlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); + var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Assert.Throws(() => + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.Aes256Gcm) + ])); + } + + [Fact] + public void UnsealEventResponseWithEmptyData() + { + var sealedResult = Array.Empty(); + var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Assert.Throws(() => + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.Aes256Gcm) + ])); + } + + [Fact] + public void UnsealEventResponseWithInvalidKeys() + { + var sealedResult = Convert.FromBase64String( + "noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); + + Assert.Throws(() => + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.Aes256Gcm) + ])); + } + + [Fact] + public void UnsealEventResponseWithInvalidNonce() + { + byte[] sealedResult = [0x9E, 0x85, 0xDC, 0xED, 0xAA, 0xBB, 0xCC]; + + var ex = Assert.Throws(() => + Sealed.UnsealEventResponse( + sealedResult, + [ + new Sealed.DecryptionKey(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), + new Sealed.DecryptionKey(Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.Aes256Gcm) + ])); + + var lastError = ex.UnsealExceptions.Last(); + Assert.IsType(lastError.InnerException); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk.Test/WebhookValidationTests.cs b/src/Fingerprint.ServerSdk.Test/WebhookValidationTests.cs new file mode 100644 index 0000000..2decd56 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/WebhookValidationTests.cs @@ -0,0 +1,36 @@ +using System.Text; +using Xunit; + +namespace Fingerprint.ServerSdk.Test +{ + public class WebhookValidationTests + { + private const string ValidHeader = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; + private const string Secret = "secret"; + private static readonly byte[] Data = Encoding.UTF8.GetBytes("data"); + + [Fact] + public void ValidHeaderTest() => + Assert.True(WebhookValidation.IsValidSignature(ValidHeader, Data, Secret)); + + [Fact] + public void InvalidHeaderTest() => + Assert.False(WebhookValidation.IsValidSignature("v2=invalid", Data, Secret)); + + [Fact] + public void HeaderWithoutVersionTest() => + Assert.False(WebhookValidation.IsValidSignature("invalid", Data, Secret)); + + [Fact] + public void EmptyHeaderTest() => + Assert.False(WebhookValidation.IsValidSignature("invalid", Data, Secret)); + + [Fact] + public void EmptySecretTest() => + Assert.False(WebhookValidation.IsValidSignature("invalid", Data, "")); + + [Fact] + public void EmptyDataTest() => + Assert.False(WebhookValidation.IsValidSignature(ValidHeader, Encoding.UTF8.GetBytes(""), Secret)); + } +} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_ip_address_invalid.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/400_ip_address_invalid.json similarity index 58% rename from src/FingerprintPro.ServerSdk.Test/mocks/errors/400_ip_address_invalid.json rename to src/Fingerprint.ServerSdk.Test/mocks/errors/400_ip_address_invalid.json index 5969bab..8f6ab37 100644 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_ip_address_invalid.json +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/400_ip_address_invalid.json @@ -1,6 +1,6 @@ { "error": { - "code": "RequestCannotBeParsed", + "code": "request_cannot_be_parsed", "message": "invalid ip address" } } \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_request_body_invalid.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/400_request_body_invalid.json similarity index 61% rename from src/FingerprintPro.ServerSdk.Test/mocks/errors/400_request_body_invalid.json rename to src/Fingerprint.ServerSdk.Test/mocks/errors/400_request_body_invalid.json index ce56def..c71fae9 100644 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_request_body_invalid.json +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/400_request_body_invalid.json @@ -1,6 +1,6 @@ { "error": { - "code": "RequestCannotBeParsed", + "code": "request_cannot_be_parsed", "message": "request body is not valid" } } diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_feature_not_enabled.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/403_feature_not_enabled.json similarity index 62% rename from src/FingerprintPro.ServerSdk.Test/mocks/errors/403_feature_not_enabled.json rename to src/Fingerprint.ServerSdk.Test/mocks/errors/403_feature_not_enabled.json index 9820a56..1478d51 100644 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_feature_not_enabled.json +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/403_feature_not_enabled.json @@ -1,6 +1,6 @@ { "error": { - "code": "FeatureNotEnabled", + "code": "feature_not_enabled", "message": "feature not enabled" } } diff --git a/src/Fingerprint.ServerSdk.Test/mocks/errors/404_event_not_found.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/404_event_not_found.json new file mode 100644 index 0000000..f7f7e54 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/404_event_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "event_not_found", + "message": "event id not found" + } +} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/404_visitor_not_found.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/404_visitor_not_found.json similarity index 62% rename from src/FingerprintPro.ServerSdk.Test/mocks/errors/404_visitor_not_found.json rename to src/Fingerprint.ServerSdk.Test/mocks/errors/404_visitor_not_found.json index 11da4f3..e4076f4 100644 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/404_visitor_not_found.json +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/404_visitor_not_found.json @@ -1,6 +1,6 @@ { "error": { - "code": "VisitorNotFound", + "code": "visitor_not_found", "message": "visitor not found" } } diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/409_state_not_ready.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/409_state_not_ready.json similarity index 71% rename from src/FingerprintPro.ServerSdk.Test/mocks/errors/409_state_not_ready.json rename to src/Fingerprint.ServerSdk.Test/mocks/errors/409_state_not_ready.json index 36e6dde..4ba3ac5 100644 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/409_state_not_ready.json +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/409_state_not_ready.json @@ -1,6 +1,6 @@ { "error": { - "code": "StateNotReady", + "code": "state_not_ready", "message": "resource is not mutable yet, try again" } } diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/429_too_many_requests.json b/src/Fingerprint.ServerSdk.Test/mocks/errors/429_too_many_requests.json similarity index 62% rename from src/FingerprintPro.ServerSdk.Test/mocks/errors/429_too_many_requests.json rename to src/Fingerprint.ServerSdk.Test/mocks/errors/429_too_many_requests.json index e38639a..bbbc7c4 100644 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/429_too_many_requests.json +++ b/src/Fingerprint.ServerSdk.Test/mocks/errors/429_too_many_requests.json @@ -1,6 +1,6 @@ { "error": { - "code": "TooManyRequests", + "code": "too_many_requests", "message": "too many requests" } } diff --git a/src/Fingerprint.ServerSdk.Test/mocks/events/get_event_200.json b/src/Fingerprint.ServerSdk.Test/mocks/events/get_event_200.json new file mode 100644 index 0000000..5cb733e --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/mocks/events/get_event_200.json @@ -0,0 +1,178 @@ +{ + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327 + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details" : { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false +} diff --git a/src/Fingerprint.ServerSdk.Test/mocks/events/search/get_event_search_200.json b/src/Fingerprint.ServerSdk.Test/mocks/events/search/get_event_search_200.json new file mode 100644 index 0000000..f72e99d --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/mocks/events/search/get_event_search_200.json @@ -0,0 +1,183 @@ +{ + "events": [ + { + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327 + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false + } + ], + "pagination_key": "1708102555327" +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk.Test/mocks/webhook/webhook_event.json b/src/Fingerprint.ServerSdk.Test/mocks/webhook/webhook_event.json new file mode 100644 index 0000000..09c1538 --- /dev/null +++ b/src/Fingerprint.ServerSdk.Test/mocks/webhook/webhook_event.json @@ -0,0 +1,178 @@ +{ + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327 + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false +} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.WebhookExample/FingerprintPro.ServerSdk.WebhookExample.csproj b/src/Fingerprint.ServerSdk.WebhookExample/Fingerprint.ServerSdk.WebhookExample.csproj similarity index 62% rename from src/FingerprintPro.ServerSdk.WebhookExample/FingerprintPro.ServerSdk.WebhookExample.csproj rename to src/Fingerprint.ServerSdk.WebhookExample/Fingerprint.ServerSdk.WebhookExample.csproj index 2f35dda..b7c88b5 100644 --- a/src/FingerprintPro.ServerSdk.WebhookExample/FingerprintPro.ServerSdk.WebhookExample.csproj +++ b/src/Fingerprint.ServerSdk.WebhookExample/Fingerprint.ServerSdk.WebhookExample.csproj @@ -5,9 +5,9 @@ net8.0 enable enable - FingerprintPro.ServerSdk.WebhookExample + Fingerprint.ServerSdk.WebhookExample - + diff --git a/src/FingerprintPro.ServerSdk.WebhookExample/Program.cs b/src/Fingerprint.ServerSdk.WebhookExample/Program.cs similarity index 90% rename from src/FingerprintPro.ServerSdk.WebhookExample/Program.cs rename to src/Fingerprint.ServerSdk.WebhookExample/Program.cs index 76a0a6b..46660a8 100644 --- a/src/FingerprintPro.ServerSdk.WebhookExample/Program.cs +++ b/src/Fingerprint.ServerSdk.WebhookExample/Program.cs @@ -1,4 +1,4 @@ -using FingerprintPro.ServerSdk; +using Fingerprint.ServerSdk; const string header = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; const string secret = "secret"; diff --git a/src/Fingerprint.ServerSdk/Api/FingerprintApi.cs b/src/Fingerprint.ServerSdk/Api/FingerprintApi.cs new file mode 100644 index 0000000..874a3dc --- /dev/null +++ b/src/Fingerprint.ServerSdk/Api/FingerprintApi.cs @@ -0,0 +1,2396 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Model; + +namespace Fingerprint.ServerSdk.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFingerprintApi : IApi + { + /// + /// The class containing the events + /// + FingerprintApiEvents Events { get; } + + /// + /// Delete data by visitor ID + /// + /// + /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + /// + /// Thrown when fails to make API call + /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. + /// Cancellation Token to cancel the request. + /// <> + Task DeleteVisitorDataAsync(string visitorId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete data by visitor ID + /// + /// + /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + /// + /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. + /// Cancellation Token to cancel the request. + /// <> + Task DeleteVisitorDataOrDefaultAsync(string visitorId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get an event by event ID + /// + /// + /// Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + /// + /// Thrown when fails to make API call + /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). + /// Cancellation Token to cancel the request. + /// <> + Task GetEventAsync(string eventId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get an event by event ID + /// + /// + /// Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + /// + /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). + /// Cancellation Token to cancel the request. + /// <> + Task GetEventOrDefaultAsync(string eventId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Search events + /// + /// + /// ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the`suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + /// + /// Thrown when fails to make API call + /// Limit the number of events returned. (optional, default to 10) + /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` (optional) + /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. (optional) + /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. (optional) + /// Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) + /// Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/get-function#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) + /// Filter events by the URL (`url` property) associated with the event. (optional) + /// Filter events by the origin field of the event. Origin could be the website domain or mobile app bundle ID (eg: com.foo.bar) (optional) + /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + /// Sort events in reverse timestamp order. (optional) + /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) + /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. (optional) + /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. (optional) + /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. (optional) + /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. (optional) + /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. (optional) + /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. (optional) + /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. (optional) + /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. (optional) + /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. (optional) + /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. (optional) + /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. (optional) + /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. (optional) + /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. (optional) + /// Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` (optional) + /// Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) + /// Filter for events by providing one or more environment IDs (`environment_id` property). (optional) + /// When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. (optional) + /// Cancellation Token to cancel the request. + /// <> + Task SearchEventsAsync(Option limit = default, Option paginationKey = default, Option visitorId = default, Option bot = default, Option ipAddress = default, Option linkedId = default, Option url = default, Option origin = default, Option start = default, Option end = default, Option reverse = default, Option suspect = default, Option vpn = default, Option virtualMachine = default, Option tampering = default, Option antiDetectBrowser = default, Option incognito = default, Option privacySettings = default, Option jailbroken = default, Option frida = default, Option factoryReset = default, Option clonedApp = default, Option emulator = default, Option rootApps = default, Option vpnConfidence = default, Option minSuspectScore = default, Option developerTools = default, Option locationSpoofing = default, Option mitmAttack = default, Option proxy = default, Option sdkVersion = default, Option sdkPlatform = default, Option> environment = default, Option totalHits = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Search events + /// + /// + /// ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the`suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + /// + /// Limit the number of events returned. (optional, default to 10) + /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` (optional) + /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. (optional) + /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. (optional) + /// Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) + /// Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/get-function#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) + /// Filter events by the URL (`url` property) associated with the event. (optional) + /// Filter events by the origin field of the event. Origin could be the website domain or mobile app bundle ID (eg: com.foo.bar) (optional) + /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + /// Sort events in reverse timestamp order. (optional) + /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) + /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. (optional) + /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. (optional) + /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. (optional) + /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. (optional) + /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. (optional) + /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. (optional) + /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. (optional) + /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. (optional) + /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. (optional) + /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. (optional) + /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. (optional) + /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. (optional) + /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. (optional) + /// Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` (optional) + /// Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) + /// Filter for events by providing one or more environment IDs (`environment_id` property). (optional) + /// When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. (optional) + /// Cancellation Token to cancel the request. + /// <> + Task SearchEventsOrDefaultAsync(Option limit = default, Option paginationKey = default, Option visitorId = default, Option bot = default, Option ipAddress = default, Option linkedId = default, Option url = default, Option origin = default, Option start = default, Option end = default, Option reverse = default, Option suspect = default, Option vpn = default, Option virtualMachine = default, Option tampering = default, Option antiDetectBrowser = default, Option incognito = default, Option privacySettings = default, Option jailbroken = default, Option frida = default, Option factoryReset = default, Option clonedApp = default, Option emulator = default, Option rootApps = default, Option vpnConfidence = default, Option minSuspectScore = default, Option developerTools = default, Option locationSpoofing = default, Option mitmAttack = default, Option proxy = default, Option sdkVersion = default, Option sdkPlatform = default, Option> environment = default, Option totalHits = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an event + /// + /// + /// Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + /// + /// Thrown when fails to make API call + /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + /// + /// Cancellation Token to cancel the request. + /// <> + Task UpdateEventAsync(string eventId, EventUpdate eventUpdate, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an event + /// + /// + /// Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + /// + /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + /// + /// Cancellation Token to cancel the request. + /// <> + Task UpdateEventOrDefaultAsync(string eventId, EventUpdate eventUpdate, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDeleteVisitorDataApiResponse : Fingerprint.ServerSdk.Client.IApiResponse, IBadRequest, IForbidden, INotFound, ITooManyRequests + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 429 TooManyRequests + /// + /// + bool IsTooManyRequests { get; } + } + + /// + /// The + /// + public interface IGetEventApiResponse : Fingerprint.ServerSdk.Client.IApiResponse, IOk, IBadRequest, IForbidden, INotFound, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface ISearchEventsApiResponse : Fingerprint.ServerSdk.Client.IApiResponse, IOk, IBadRequest, IForbidden, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IUpdateEventApiResponse : Fingerprint.ServerSdk.Client.IApiResponse, IBadRequest, IForbidden, INotFound, IConflict + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 409 Conflict + /// + /// + bool IsConflict { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FingerprintApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteVisitorData; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteVisitorData; + + internal void ExecuteOnDeleteVisitorData(FingerprintApi.DeleteVisitorDataApiResponse apiResponse) + { + OnDeleteVisitorData?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteVisitorData(Exception exception) + { + OnErrorDeleteVisitorData?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetEvent; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetEvent; + + internal void ExecuteOnGetEvent(FingerprintApi.GetEventApiResponse apiResponse) + { + OnGetEvent?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetEvent(Exception exception) + { + OnErrorGetEvent?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnSearchEvents; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorSearchEvents; + + internal void ExecuteOnSearchEvents(FingerprintApi.SearchEventsApiResponse apiResponse) + { + OnSearchEvents?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorSearchEvents(Exception exception) + { + OnErrorSearchEvents?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdateEvent; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdateEvent; + + internal void ExecuteOnUpdateEvent(FingerprintApi.UpdateEventApiResponse apiResponse) + { + OnUpdateEvent?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdateEvent(Exception exception) + { + OnErrorUpdateEvent?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FingerprintApi : IFingerprintApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FingerprintApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FingerprintApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FingerprintApiEvents fingerprintApiEvents, + TokenProvider bearerTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fingerprintApiEvents; + BearerTokenProvider = bearerTokenProvider; + } + + partial void FormatDeleteVisitorData(ref string visitorId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteVisitorData(string visitorId) + { + if (visitorId == null) + throw new ArgumentNullException(nameof(visitorId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteVisitorDataDefaultImplementation(IDeleteVisitorDataApiResponse apiResponseLocalVar, string visitorId) + { + bool suppressDefaultLog = false; + AfterDeleteVisitorData(ref suppressDefaultLog, apiResponseLocalVar, visitorId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteVisitorData(ref bool suppressDefaultLog, IDeleteVisitorDataApiResponse apiResponseLocalVar, string visitorId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteVisitorDataDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string visitorId) + { + bool suppressDefaultLogLocalVar = false; + OnErrorDeleteVisitorData(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, visitorId); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteVisitorData(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string visitorId); + + /// + /// Delete data by visitor ID Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + /// + /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteVisitorDataOrDefaultAsync(string visitorId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteVisitorDataAsync(visitorId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete data by visitor ID + /// + /// + /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + /// + /// Thrown when fails to make API call + /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteVisitorDataAsync(string visitorId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteVisitorData(visitorId); + + FormatDeleteVisitorData(ref visitorId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/visitors/{visitor_id}" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/visitors/{visitor_id}"); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Bvisitor_id%7D", Uri.EscapeDataString(visitorId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + parseQueryStringLocalVar["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ClientUtils.ClientVersion}"; + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + DeleteVisitorDataApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) + { + default: + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + apiResponseLocalVar = new DeleteVisitorDataApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/visitors/{visitor_id}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } + + AfterDeleteVisitorDataDefaultImplementation(apiResponseLocalVar, visitorId); + + Events.ExecuteOnDeleteVisitorData(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode)429) + foreach (TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch (Exception e) + { + OnErrorDeleteVisitorDataDefaultImplementation(e, "/visitors/{visitor_id}", uriBuilderLocalVar.Path, visitorId); + Events.ExecuteOnErrorDeleteVisitorData(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteVisitorDataApiResponse : Fingerprint.ServerSdk.Client.ApiResponse, IDeleteVisitorDataApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteVisitorDataApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteVisitorDataApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = BadRequest(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = Forbidden(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 404 NotFound + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse NotFound() + { + // This logic may be modified with the AsModel.mustache template + return IsNotFound + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 404 NotFound and the deserialized response is not null + /// + /// + /// + public bool TryNotFound(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = NotFound(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)404); + } + + return result != null; + } + + /// + /// Returns true if the response is 429 TooManyRequests + /// + /// + public bool IsTooManyRequests => 429 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 429 TooManyRequests + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse TooManyRequests() + { + // This logic may be modified with the AsModel.mustache template + return IsTooManyRequests + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 429 TooManyRequests and the deserialized response is not null + /// + /// + /// + public bool TryTooManyRequests(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = TooManyRequests(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)429); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetEvent(ref string eventId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetEvent(string eventId) + { + if (eventId == null) + throw new ArgumentNullException(nameof(eventId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetEventDefaultImplementation(IGetEventApiResponse apiResponseLocalVar, string eventId) + { + bool suppressDefaultLog = false; + AfterGetEvent(ref suppressDefaultLog, apiResponseLocalVar, eventId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetEvent(ref bool suppressDefaultLog, IGetEventApiResponse apiResponseLocalVar, string eventId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetEventDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string eventId) + { + bool suppressDefaultLogLocalVar = false; + OnErrorGetEvent(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, eventId); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetEvent(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string eventId); + + /// + /// Get an event by event ID Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + /// + /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). + /// Cancellation Token to cancel the request. + /// <> + public async Task GetEventOrDefaultAsync(string eventId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetEventAsync(eventId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get an event by event ID + /// + /// + /// Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + /// + /// Thrown when fails to make API call + /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). + /// Cancellation Token to cancel the request. + /// <> + public async Task GetEventAsync(string eventId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetEvent(eventId); + + FormatGetEvent(ref eventId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/events/{event_id}" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/events/{event_id}"); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Bevent_id%7D", Uri.EscapeDataString(eventId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + parseQueryStringLocalVar["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ClientUtils.ClientVersion}"; + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + GetEventApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) + { + default: + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + apiResponseLocalVar = new GetEventApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/events/{event_id}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } + + AfterGetEventDefaultImplementation(apiResponseLocalVar, eventId); + + Events.ExecuteOnGetEvent(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode)429) + foreach (TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch (Exception e) + { + OnErrorGetEventDefaultImplementation(e, "/events/{event_id}", uriBuilderLocalVar.Path, eventId); + Events.ExecuteOnErrorGetEvent(e); + throw; + } + } + + /// + /// The + /// + public partial class GetEventApiResponse : Fingerprint.ServerSdk.Client.ApiResponse, IGetEventApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetEventApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetEventApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Fingerprint.ServerSdk.Model.Event Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Fingerprint.ServerSdk.Model.Event result) + { + result = null; + + try + { + result = Ok(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = BadRequest(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = Forbidden(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 404 NotFound + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse NotFound() + { + // This logic may be modified with the AsModel.mustache template + return IsNotFound + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 404 NotFound and the deserialized response is not null + /// + /// + /// + public bool TryNotFound(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = NotFound(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)404); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = InternalServerError(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatSearchEvents(ref Option limit, ref Option paginationKey, ref Option visitorId, ref Option bot, ref Option ipAddress, ref Option linkedId, ref Option url, ref Option origin, ref Option start, ref Option end, ref Option reverse, ref Option suspect, ref Option vpn, ref Option virtualMachine, ref Option tampering, ref Option antiDetectBrowser, ref Option incognito, ref Option privacySettings, ref Option jailbroken, ref Option frida, ref Option factoryReset, ref Option clonedApp, ref Option emulator, ref Option rootApps, ref Option vpnConfidence, ref Option minSuspectScore, ref Option developerTools, ref Option locationSpoofing, ref Option mitmAttack, ref Option proxy, ref Option sdkVersion, ref Option sdkPlatform, Option> environment, ref Option totalHits); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateSearchEvents(Option paginationKey, Option visitorId, Option bot, Option ipAddress, Option linkedId, Option url, Option origin, Option vpnConfidence, Option sdkVersion, Option sdkPlatform, Option> environment) + { + if (paginationKey.IsSet && paginationKey.Value == null) + throw new ArgumentNullException(nameof(paginationKey)); + + if (visitorId.IsSet && visitorId.Value == null) + throw new ArgumentNullException(nameof(visitorId)); + + if (bot.IsSet && bot.Value == null) + throw new ArgumentNullException(nameof(bot)); + + if (ipAddress.IsSet && ipAddress.Value == null) + throw new ArgumentNullException(nameof(ipAddress)); + + if (linkedId.IsSet && linkedId.Value == null) + throw new ArgumentNullException(nameof(linkedId)); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url)); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin)); + + if (vpnConfidence.IsSet && vpnConfidence.Value == null) + throw new ArgumentNullException(nameof(vpnConfidence)); + + if (sdkVersion.IsSet && sdkVersion.Value == null) + throw new ArgumentNullException(nameof(sdkVersion)); + + if (sdkPlatform.IsSet && sdkPlatform.Value == null) + throw new ArgumentNullException(nameof(sdkPlatform)); + + if (environment.IsSet && environment.Value == null) + throw new ArgumentNullException(nameof(environment)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterSearchEventsDefaultImplementation(ISearchEventsApiResponse apiResponseLocalVar, Option limit, Option paginationKey, Option visitorId, Option bot, Option ipAddress, Option linkedId, Option url, Option origin, Option start, Option end, Option reverse, Option suspect, Option vpn, Option virtualMachine, Option tampering, Option antiDetectBrowser, Option incognito, Option privacySettings, Option jailbroken, Option frida, Option factoryReset, Option clonedApp, Option emulator, Option rootApps, Option vpnConfidence, Option minSuspectScore, Option developerTools, Option locationSpoofing, Option mitmAttack, Option proxy, Option sdkVersion, Option sdkPlatform, Option> environment, Option totalHits) + { + bool suppressDefaultLog = false; + AfterSearchEvents(ref suppressDefaultLog, apiResponseLocalVar, limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterSearchEvents(ref bool suppressDefaultLog, ISearchEventsApiResponse apiResponseLocalVar, Option limit, Option paginationKey, Option visitorId, Option bot, Option ipAddress, Option linkedId, Option url, Option origin, Option start, Option end, Option reverse, Option suspect, Option vpn, Option virtualMachine, Option tampering, Option antiDetectBrowser, Option incognito, Option privacySettings, Option jailbroken, Option frida, Option factoryReset, Option clonedApp, Option emulator, Option rootApps, Option vpnConfidence, Option minSuspectScore, Option developerTools, Option locationSpoofing, Option mitmAttack, Option proxy, Option sdkVersion, Option sdkPlatform, Option> environment, Option totalHits); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorSearchEventsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, Option limit, Option paginationKey, Option visitorId, Option bot, Option ipAddress, Option linkedId, Option url, Option origin, Option start, Option end, Option reverse, Option suspect, Option vpn, Option virtualMachine, Option tampering, Option antiDetectBrowser, Option incognito, Option privacySettings, Option jailbroken, Option frida, Option factoryReset, Option clonedApp, Option emulator, Option rootApps, Option vpnConfidence, Option minSuspectScore, Option developerTools, Option locationSpoofing, Option mitmAttack, Option proxy, Option sdkVersion, Option sdkPlatform, Option> environment, Option totalHits) + { + bool suppressDefaultLogLocalVar = false; + OnErrorSearchEvents(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorSearchEvents(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, Option limit, Option paginationKey, Option visitorId, Option bot, Option ipAddress, Option linkedId, Option url, Option origin, Option start, Option end, Option reverse, Option suspect, Option vpn, Option virtualMachine, Option tampering, Option antiDetectBrowser, Option incognito, Option privacySettings, Option jailbroken, Option frida, Option factoryReset, Option clonedApp, Option emulator, Option rootApps, Option vpnConfidence, Option minSuspectScore, Option developerTools, Option locationSpoofing, Option mitmAttack, Option proxy, Option sdkVersion, Option sdkPlatform, Option> environment, Option totalHits); + + /// + /// Search events ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the`suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + /// + /// Limit the number of events returned. (optional, default to 10) + /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` (optional) + /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. (optional) + /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. (optional) + /// Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) + /// Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/get-function#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) + /// Filter events by the URL (`url` property) associated with the event. (optional) + /// Filter events by the origin field of the event. Origin could be the website domain or mobile app bundle ID (eg: com.foo.bar) (optional) + /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + /// Sort events in reverse timestamp order. (optional) + /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) + /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. (optional) + /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. (optional) + /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. (optional) + /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. (optional) + /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. (optional) + /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. (optional) + /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. (optional) + /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. (optional) + /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. (optional) + /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. (optional) + /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. (optional) + /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. (optional) + /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. (optional) + /// Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` (optional) + /// Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) + /// Filter for events by providing one or more environment IDs (`environment_id` property). (optional) + /// When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task SearchEventsOrDefaultAsync(Option limit = default, Option paginationKey = default, Option visitorId = default, Option bot = default, Option ipAddress = default, Option linkedId = default, Option url = default, Option origin = default, Option start = default, Option end = default, Option reverse = default, Option suspect = default, Option vpn = default, Option virtualMachine = default, Option tampering = default, Option antiDetectBrowser = default, Option incognito = default, Option privacySettings = default, Option jailbroken = default, Option frida = default, Option factoryReset = default, Option clonedApp = default, Option emulator = default, Option rootApps = default, Option vpnConfidence = default, Option minSuspectScore = default, Option developerTools = default, Option locationSpoofing = default, Option mitmAttack = default, Option proxy = default, Option sdkVersion = default, Option sdkPlatform = default, Option> environment = default, Option totalHits = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await SearchEventsAsync(limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Search events + /// + /// + /// ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the`suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + /// + /// Thrown when fails to make API call + /// Limit the number of events returned. (optional, default to 10) + /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` (optional) + /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. (optional) + /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. (optional) + /// Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) + /// Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/get-function#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) + /// Filter events by the URL (`url` property) associated with the event. (optional) + /// Filter events by the origin field of the event. Origin could be the website domain or mobile app bundle ID (eg: com.foo.bar) (optional) + /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + /// Sort events in reverse timestamp order. (optional) + /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) + /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) + /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. (optional) + /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. (optional) + /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. (optional) + /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. (optional) + /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. (optional) + /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. (optional) + /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. (optional) + /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. (optional) + /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) + /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. (optional) + /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. (optional) + /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. (optional) + /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. (optional) + /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. (optional) + /// Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` (optional) + /// Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) + /// Filter for events by providing one or more environment IDs (`environment_id` property). (optional) + /// When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task SearchEventsAsync(Option limit = default, Option paginationKey = default, Option visitorId = default, Option bot = default, Option ipAddress = default, Option linkedId = default, Option url = default, Option origin = default, Option start = default, Option end = default, Option reverse = default, Option suspect = default, Option vpn = default, Option virtualMachine = default, Option tampering = default, Option antiDetectBrowser = default, Option incognito = default, Option privacySettings = default, Option jailbroken = default, Option frida = default, Option factoryReset = default, Option clonedApp = default, Option emulator = default, Option rootApps = default, Option vpnConfidence = default, Option minSuspectScore = default, Option developerTools = default, Option locationSpoofing = default, Option mitmAttack = default, Option proxy = default, Option sdkVersion = default, Option sdkPlatform = default, Option> environment = default, Option totalHits = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateSearchEvents(paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, vpnConfidence, sdkVersion, sdkPlatform, environment); + + FormatSearchEvents(ref limit, ref paginationKey, ref visitorId, ref bot, ref ipAddress, ref linkedId, ref url, ref origin, ref start, ref end, ref reverse, ref suspect, ref vpn, ref virtualMachine, ref tampering, ref antiDetectBrowser, ref incognito, ref privacySettings, ref jailbroken, ref frida, ref factoryReset, ref clonedApp, ref emulator, ref rootApps, ref vpnConfidence, ref minSuspectScore, ref developerTools, ref locationSpoofing, ref mitmAttack, ref proxy, ref sdkVersion, ref sdkPlatform, environment, ref totalHits); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/events" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/events"); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + parseQueryStringLocalVar["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ClientUtils.ClientVersion}"; + + if (limit.IsSet) + parseQueryStringLocalVar["limit"] = ClientUtils.ParameterToString(limit.Value); + + if (paginationKey.IsSet) + parseQueryStringLocalVar["pagination_key"] = ClientUtils.ParameterToString(paginationKey.Value); + + if (visitorId.IsSet) + parseQueryStringLocalVar["visitor_id"] = ClientUtils.ParameterToString(visitorId.Value); + + if (bot.IsSet) + parseQueryStringLocalVar["bot"] = ClientUtils.ParameterToString(bot.Value); + + if (ipAddress.IsSet) + parseQueryStringLocalVar["ip_address"] = ClientUtils.ParameterToString(ipAddress.Value); + + if (linkedId.IsSet) + parseQueryStringLocalVar["linked_id"] = ClientUtils.ParameterToString(linkedId.Value); + + if (url.IsSet) + parseQueryStringLocalVar["url"] = ClientUtils.ParameterToString(url.Value); + + if (origin.IsSet) + parseQueryStringLocalVar["origin"] = ClientUtils.ParameterToString(origin.Value); + + if (start.IsSet) + parseQueryStringLocalVar["start"] = ClientUtils.ParameterToString(start.Value); + + if (end.IsSet) + parseQueryStringLocalVar["end"] = ClientUtils.ParameterToString(end.Value); + + if (reverse.IsSet) + parseQueryStringLocalVar["reverse"] = ClientUtils.ParameterToString(reverse.Value); + + if (suspect.IsSet) + parseQueryStringLocalVar["suspect"] = ClientUtils.ParameterToString(suspect.Value); + + if (vpn.IsSet) + parseQueryStringLocalVar["vpn"] = ClientUtils.ParameterToString(vpn.Value); + + if (virtualMachine.IsSet) + parseQueryStringLocalVar["virtual_machine"] = ClientUtils.ParameterToString(virtualMachine.Value); + + if (tampering.IsSet) + parseQueryStringLocalVar["tampering"] = ClientUtils.ParameterToString(tampering.Value); + + if (antiDetectBrowser.IsSet) + parseQueryStringLocalVar["anti_detect_browser"] = ClientUtils.ParameterToString(antiDetectBrowser.Value); + + if (incognito.IsSet) + parseQueryStringLocalVar["incognito"] = ClientUtils.ParameterToString(incognito.Value); + + if (privacySettings.IsSet) + parseQueryStringLocalVar["privacy_settings"] = ClientUtils.ParameterToString(privacySettings.Value); + + if (jailbroken.IsSet) + parseQueryStringLocalVar["jailbroken"] = ClientUtils.ParameterToString(jailbroken.Value); + + if (frida.IsSet) + parseQueryStringLocalVar["frida"] = ClientUtils.ParameterToString(frida.Value); + + if (factoryReset.IsSet) + parseQueryStringLocalVar["factory_reset"] = ClientUtils.ParameterToString(factoryReset.Value); + + if (clonedApp.IsSet) + parseQueryStringLocalVar["cloned_app"] = ClientUtils.ParameterToString(clonedApp.Value); + + if (emulator.IsSet) + parseQueryStringLocalVar["emulator"] = ClientUtils.ParameterToString(emulator.Value); + + if (rootApps.IsSet) + parseQueryStringLocalVar["root_apps"] = ClientUtils.ParameterToString(rootApps.Value); + + if (vpnConfidence.IsSet) + parseQueryStringLocalVar["vpn_confidence"] = ClientUtils.ParameterToString(vpnConfidence.Value); + + if (minSuspectScore.IsSet) + parseQueryStringLocalVar["min_suspect_score"] = ClientUtils.ParameterToString(minSuspectScore.Value); + + if (developerTools.IsSet) + parseQueryStringLocalVar["developer_tools"] = ClientUtils.ParameterToString(developerTools.Value); + + if (locationSpoofing.IsSet) + parseQueryStringLocalVar["location_spoofing"] = ClientUtils.ParameterToString(locationSpoofing.Value); + + if (mitmAttack.IsSet) + parseQueryStringLocalVar["mitm_attack"] = ClientUtils.ParameterToString(mitmAttack.Value); + + if (proxy.IsSet) + parseQueryStringLocalVar["proxy"] = ClientUtils.ParameterToString(proxy.Value); + + if (sdkVersion.IsSet) + parseQueryStringLocalVar["sdk_version"] = ClientUtils.ParameterToString(sdkVersion.Value); + + if (sdkPlatform.IsSet) + parseQueryStringLocalVar["sdk_platform"] = ClientUtils.ParameterToString(sdkPlatform.Value); + + if (environment.IsSet) + parseQueryStringLocalVar["environment"] = ClientUtils.ParameterToString(environment.Value); + + if (totalHits.IsSet) + parseQueryStringLocalVar["total_hits"] = ClientUtils.ParameterToString(totalHits.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + SearchEventsApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) + { + default: + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + apiResponseLocalVar = new SearchEventsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/events", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } + + AfterSearchEventsDefaultImplementation(apiResponseLocalVar, limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits); + + Events.ExecuteOnSearchEvents(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode)429) + foreach (TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch (Exception e) + { + OnErrorSearchEventsDefaultImplementation(e, "/events", uriBuilderLocalVar.Path, limit, paginationKey, visitorId, bot, ipAddress, linkedId, url, origin, start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, totalHits); + Events.ExecuteOnErrorSearchEvents(e); + throw; + } + } + + /// + /// The + /// + public partial class SearchEventsApiResponse : Fingerprint.ServerSdk.Client.ApiResponse, ISearchEventsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public SearchEventsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public SearchEventsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Fingerprint.ServerSdk.Model.EventSearch Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Fingerprint.ServerSdk.Model.EventSearch result) + { + result = null; + + try + { + result = Ok(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = BadRequest(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = Forbidden(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = InternalServerError(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdateEvent(ref string eventId, EventUpdate eventUpdate); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdateEvent(string eventId, EventUpdate eventUpdate) + { + if (eventId == null) + throw new ArgumentNullException(nameof(eventId)); + + if (eventUpdate == null) + throw new ArgumentNullException(nameof(eventUpdate)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdateEventDefaultImplementation(IUpdateEventApiResponse apiResponseLocalVar, string eventId, EventUpdate eventUpdate) + { + bool suppressDefaultLog = false; + AfterUpdateEvent(ref suppressDefaultLog, apiResponseLocalVar, eventId, eventUpdate); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdateEvent(ref bool suppressDefaultLog, IUpdateEventApiResponse apiResponseLocalVar, string eventId, EventUpdate eventUpdate); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdateEventDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string eventId, EventUpdate eventUpdate) + { + bool suppressDefaultLogLocalVar = false; + OnErrorUpdateEvent(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, eventId, eventUpdate); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdateEvent(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string eventId, EventUpdate eventUpdate); + + /// + /// Update an event Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + /// + /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateEventOrDefaultAsync(string eventId, EventUpdate eventUpdate, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdateEventAsync(eventId, eventUpdate, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Update an event + /// + /// + /// Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + /// + /// Thrown when fails to make API call + /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateEventAsync(string eventId, EventUpdate eventUpdate, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdateEvent(eventId, eventUpdate); + + FormatUpdateEvent(ref eventId, eventUpdate); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/events/{event_id}" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/events/{event_id}"); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Bevent_id%7D", Uri.EscapeDataString(eventId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + parseQueryStringLocalVar["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ClientUtils.ClientVersion}"; + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.Content = (eventUpdate as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(eventUpdate, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + UpdateEventApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) + { + default: + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + apiResponseLocalVar = new UpdateEventApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/events/{event_id}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } + + AfterUpdateEventDefaultImplementation(apiResponseLocalVar, eventId, eventUpdate); + + Events.ExecuteOnUpdateEvent(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode)429) + foreach (TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch (Exception e) + { + OnErrorUpdateEventDefaultImplementation(e, "/events/{event_id}", uriBuilderLocalVar.Path, eventId, eventUpdate); + Events.ExecuteOnErrorUpdateEvent(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdateEventApiResponse : Fingerprint.ServerSdk.Client.ApiResponse, IUpdateEventApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateEventApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateEventApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = BadRequest(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = Forbidden(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 404 NotFound + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse NotFound() + { + // This logic may be modified with the AsModel.mustache template + return IsNotFound + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 404 NotFound and the deserialized response is not null + /// + /// + /// + public bool TryNotFound(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = NotFound(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)404); + } + + return result != null; + } + + /// + /// Returns true if the response is 409 Conflict + /// + /// + public bool IsConflict => 409 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 409 Conflict + /// + /// + public Fingerprint.ServerSdk.Model.ErrorResponse Conflict() + { + // This logic may be modified with the AsModel.mustache template + return IsConflict + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 409 Conflict and the deserialized response is not null + /// + /// + /// + public bool TryConflict(out Fingerprint.ServerSdk.Model.ErrorResponse result) + { + result = null; + + try + { + result = Conflict(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)409); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Api/IApi.cs b/src/Fingerprint.ServerSdk/Api/IApi.cs new file mode 100644 index 0000000..768fdbc --- /dev/null +++ b/src/Fingerprint.ServerSdk/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Fingerprint.ServerSdk.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/ApiException.cs b/src/Fingerprint.ServerSdk/Client/ApiException.cs new file mode 100644 index 0000000..cb9f22e --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/src/Fingerprint.ServerSdk/Client/ApiFactory.cs b/src/Fingerprint.ServerSdk/Client/ApiFactory.cs new file mode 100644 index 0000000..be248d1 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type TResult + /// + /// + /// + TResult Create() where TResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public TResult Create() where TResult : IApi + { + return Services.GetRequiredService(); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/ApiResponseEventArgs.cs b/src/Fingerprint.ServerSdk/Client/ApiResponseEventArgs.cs new file mode 100644 index 0000000..cabf7c4 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/src/Fingerprint.ServerSdk/Client/ApiResponse`1.cs b/src/Fingerprint.ServerSdk/Client/ApiResponse`1.cs new file mode 100644 index 0000000..86b35fe --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/ApiResponse`1.cs @@ -0,0 +1,323 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Net; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The raw binary stream (only set for binary responses) + /// + System.IO.Stream ContentStream { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The raw binary stream (only set for binary responses) + /// + public System.IO.Stream ContentStream { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + ContentStream = contentStream; + RawContent = string.Empty; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IBadRequest : IApiResponse + { + /// + /// Deserializes the response if the response is BadRequest + /// + /// + TType BadRequest(); + + /// + /// Returns true if the response is BadRequest and the deserialized response is not null + /// + /// + /// + bool TryBadRequest(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IConflict : IApiResponse + { + /// + /// Deserializes the response if the response is Conflict + /// + /// + TType Conflict(); + + /// + /// Returns true if the response is Conflict and the deserialized response is not null + /// + /// + /// + bool TryConflict(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface ITooManyRequests : IApiResponse + { + /// + /// Deserializes the response if the response is TooManyRequests + /// + /// + TType TooManyRequests(); + + /// + /// Returns true if the response is TooManyRequests and the deserialized response is not null + /// + /// + /// + bool TryTooManyRequests(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IForbidden : IApiResponse + { + /// + /// Deserializes the response if the response is Forbidden + /// + /// + TType Forbidden(); + + /// + /// Returns true if the response is Forbidden and the deserialized response is not null + /// + /// + /// + bool TryForbidden(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IInternalServerError : IApiResponse + { + /// + /// Deserializes the response if the response is InternalServerError + /// + /// + TType InternalServerError(); + + /// + /// Returns true if the response is InternalServerError and the deserialized response is not null + /// + /// + /// + bool TryInternalServerError(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface INotFound : IApiResponse + { + /// + /// Deserializes the response if the response is NotFound + /// + /// + TType NotFound(); + + /// + /// Returns true if the response is NotFound and the deserialized response is not null + /// + /// + /// + bool TryNotFound(out TType result); + } +} diff --git a/src/Fingerprint.ServerSdk/Client/BearerToken.cs b/src/Fingerprint.ServerSdk/Client/BearerToken.cs new file mode 100644 index 0000000..88a7cc9 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/BearerToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/ClientUtils.cs b/src/Fingerprint.ServerSdk/Client/ClientUtils.cs new file mode 100644 index 0000000..693d7b9 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/ClientUtils.cs @@ -0,0 +1,309 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Fingerprint.ServerSdk.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Fingerprint.ServerSdk.Test")] + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// .NET SDK Client Version + /// + public const string ClientVersion = "7.9.0"; + + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is BotResult botResult) + return BotResultValueConverter.ToJsonValue(botResult); + if (obj is ErrorCode errorCode) + return ErrorCodeValueConverter.ToJsonValue(errorCode); + if (obj is Proximity.PrecisionRadiusEnum proximityPrecisionRadiusEnum) + return Proximity.PrecisionRadiusEnumToJsonValue(proximityPrecisionRadiusEnum).ToString(); + if (obj is ProxyConfidence proxyConfidence) + return ProxyConfidenceValueConverter.ToJsonValue(proxyConfidence); + if (obj is ProxyDetails.ProxyTypeEnum proxyDetailsProxyTypeEnum) + return ProxyDetails.ProxyTypeEnumToJsonValue(proxyDetailsProxyTypeEnum); + if (obj is SDK.PlatformEnum sDKPlatformEnum) + return SDK.PlatformEnumToJsonValue(sDKPlatformEnum); + if (obj is VpnConfidence vpnConfidence) + return VpnConfidenceValueConverter.ToJsonValue(vpnConfidence); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + private static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + + /// + /// Get base URI for the client. + /// + /// Which region to use for base URI + /// Uri for sending requests + public static Uri GetBaseUri(Region region) => region.GetBaseUri(); + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/CookieContainer.cs b/src/Fingerprint.ServerSdk/Client/CookieContainer.cs new file mode 100644 index 0000000..4e711dc --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/DateTimeJsonConverter.cs b/src/Fingerprint.ServerSdk/Client/DateTimeJsonConverter.cs new file mode 100644 index 0000000..75745a7 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/DateTimeJsonConverter.cs @@ -0,0 +1,78 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach (string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/src/Fingerprint.ServerSdk/Client/DateTimeNullableJsonConverter.cs b/src/Fingerprint.ServerSdk/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 0000000..4867c93 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,83 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach (string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/ExceptionEventArgs.cs b/src/Fingerprint.ServerSdk/Client/ExceptionEventArgs.cs new file mode 100644 index 0000000..b308565 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExceptionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/src/Fingerprint.ServerSdk/Client/HostConfiguration.cs b/src/Fingerprint.ServerSdk/Client/HostConfiguration.cs new file mode 100644 index 0000000..95ab4e8 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/HostConfiguration.cs @@ -0,0 +1,233 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using System.Net.Http.Headers; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Api; +using Fingerprint.ServerSdk.Model; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Provides hosting configuration for Fingerprint.ServerSdk + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new(); + + /// + /// Indicates whether at least one API token has been registered + /// + private bool TokenAdded { get; set; } + + /// + /// Indicates whether HTTP clients for the SDK have been added to the service collection. + /// + internal bool HttpClientsAdded { get; private set; } + + /// + /// The User-Agent header value sent with SDK HTTP requests. + /// Defaults to fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}. + /// + public string UserAgent { get; set; } = $"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}"; + + /// + /// The API region used to resolve the default base URL when is not provided. + /// Defaults to . + /// + public Region Region { get; set; } = Region.Us; + + /// + /// Optional absolute base URL that overrides region resolution. + /// When set, is ignored for base URL calculation. + /// + public string BaseUrl { get; set; } + + /// + /// Creates a new and registers core SDK singletons. + /// + /// Application service collection used for registration. + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new BotResultJsonConverter()); + _jsonOptions.Converters.Add(new BotResultNullableJsonConverter()); + _jsonOptions.Converters.Add(new BrowserDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ErrorJsonConverter()); + _jsonOptions.Converters.Add(new ErrorCodeJsonConverter()); + _jsonOptions.Converters.Add(new ErrorCodeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ErrorResponseJsonConverter()); + _jsonOptions.Converters.Add(new EventJsonConverter()); + _jsonOptions.Converters.Add(new EventSearchJsonConverter()); + _jsonOptions.Converters.Add(new EventUpdateJsonConverter()); + _jsonOptions.Converters.Add(new GeolocationJsonConverter()); + _jsonOptions.Converters.Add(new GeolocationSubdivisionsInnerJsonConverter()); + _jsonOptions.Converters.Add(new IPBlockListJsonConverter()); + _jsonOptions.Converters.Add(new IPInfoJsonConverter()); + _jsonOptions.Converters.Add(new IPInfoV4JsonConverter()); + _jsonOptions.Converters.Add(new IPInfoV6JsonConverter()); + _jsonOptions.Converters.Add(new IdentificationJsonConverter()); + _jsonOptions.Converters.Add(new IdentificationConfidenceJsonConverter()); + _jsonOptions.Converters.Add(new IntegrationJsonConverter()); + _jsonOptions.Converters.Add(new IntegrationSubintegrationJsonConverter()); + _jsonOptions.Converters.Add(new ProximityJsonConverter()); + _jsonOptions.Converters.Add(new ProxyConfidenceJsonConverter()); + _jsonOptions.Converters.Add(new ProxyConfidenceNullableJsonConverter()); + _jsonOptions.Converters.Add(new ProxyDetailsJsonConverter()); + _jsonOptions.Converters.Add(new SDKJsonConverter()); + _jsonOptions.Converters.Add(new SupplementaryIDHighRecallJsonConverter()); + _jsonOptions.Converters.Add(new TamperingDetailsJsonConverter()); + _jsonOptions.Converters.Add(new TriggeredByInnerJsonConverter()); + _jsonOptions.Converters.Add(new VelocityJsonConverter()); + _jsonOptions.Converters.Add(new VelocityDataJsonConverter()); + _jsonOptions.Converters.Add(new VpnConfidenceJsonConverter()); + _jsonOptions.Converters.Add(new VpnConfidenceNullableJsonConverter()); + _jsonOptions.Converters.Add(new VpnMethodsJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + } + + /// + /// Registers and configures the SDK instances used by . + /// Requires tokens to be added beforehand. + /// + /// Optional per-client configuration + /// Optional hook to customize the created + /// The current for chaining. + /// Thrown when no API tokens were added prior to calling this method. + public HostConfiguration AddApiHttpClients(Action client = null, Action builder = null) + { + if (!TokenAdded) + { + throw new InvalidOperationException( + "No API tokens provided. Call options.AddTokens(new BearerToken(\"\")) before AddApiHttpClients." + ); + } + + if (client == null) + { + client = c => + { + c.BaseAddress = ResolveBaseUri(); + c.DefaultRequestHeaders.UserAgent.Add(ProductInfoHeaderValue.Parse(UserAgent)); + }; + } + else + { + // Override custom client's base address if it's empty. + var customClient = client; + client = c => + { + customClient(c); + if (c.BaseAddress is null) + { + c.BaseAddress = ResolveBaseUri(); + c.DefaultRequestHeaders.UserAgent.Add(ProductInfoHeaderValue.Parse(UserAgent)); + } + }; + } + + var builders = new List + { + _services.AddHttpClient(client) + }; + + if (builder != null) + foreach (var instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Allows customizing the JSON serialization options used by the SDK. + /// + /// A delegate that mutates the instance. + /// The current for chaining. + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds a single token to the service collection (e.g. ) + /// + /// Token base type. + /// The token instance to register. + /// The current for chaining. + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + TokenAdded = true; + return AddTokens(new[] { token }); + } + + /// + /// Adds multiple tokens to the service collection. + /// + /// Token base type. + /// A sequence of tokens to register. + /// The current for chaining. + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + var container = new TokenContainer(tokens); + _services.AddSingleton(_ => container); + + if (container.Tokens.Count > 0) + { + TokenAdded = true; + } + + return this; + } + + /// + /// Registers a token provider in the service collection. + /// + /// Provider type. + /// Token base type produced by the provider. + /// The current for chaining. + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + + /// + /// Resolves the base API URI using if provided; otherwise by . + /// + /// + /// If is non-empty, it is used directly. + /// Otherwise, the default URL for is returned. + /// + /// The resolved . + private Uri ResolveBaseUri() + { + return !string.IsNullOrWhiteSpace(BaseUrl) ? new Uri(BaseUrl) : Region.GetBaseUri(); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/JsonSerializerOptionsProvider.cs b/src/Fingerprint.ServerSdk/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 0000000..4df56ba --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/Option.cs b/src/Fingerprint.ServerSdk/Client/Option.cs new file mode 100644 index 0000000..cf097e3 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/RateLimitProvider`1.cs b/src/Fingerprint.ServerSdk/Client/RateLimitProvider`1.cs new file mode 100644 index 0000000..6e2705a --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/RateLimitProvider`1.cs @@ -0,0 +1,56 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); + + foreach (var availableToken in AvailableTokens) + foreach(TTokenBase token in _tokens) + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Client/Region.cs b/src/Fingerprint.ServerSdk/Client/Region.cs new file mode 100644 index 0000000..5b17f7f --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/Region.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// TODO: Region summary + /// + public enum Region + { + /// + /// TODO: US summary + /// + Us = 1, + /// + /// TODO: EU summary + /// + Eu = 2, + /// + /// TODO: Asia summary + /// + Asia = 3, + } + + /// + /// TODO: RegionConfig summary + /// + public sealed class RegionConfig + { + /// + /// TODO: Scheme summary + /// + public string Scheme { get; } + + /// + /// TODO: Host summary + /// + public string Host { get; } + + /// + /// TODO: ContextPath summary + /// + public string ContextPath { get; } + + /// + /// TODO: RegionConfig docs + /// + /// + /// + /// + public RegionConfig(string scheme, string host, string contextPath) + { + Scheme = scheme; + Host = host; + ContextPath = contextPath; + } + + /// + /// TODO: BaseUri summary + /// + public Uri BaseUri => new Uri(Scheme + "://" + Host + ContextPath); + + /// + /// TODO: BaseAddress summary + /// + public string BaseAddress => Scheme + "://" + Host + ContextPath; + } + + /// + /// TODO: Regions summary + /// + public static class Regions + { + private const string DefaultContextPath = "/v4"; + + private static readonly IReadOnlyDictionary Map = + new Dictionary + { + [Region.Us] = new RegionConfig("https", "api.fpjs.io", DefaultContextPath), + [Region.Eu] = new RegionConfig("https", "eu.api.fpjs.io", DefaultContextPath), + [Region.Asia] = new RegionConfig("https", "ap.api.fpjs.io", DefaultContextPath), + }; + + /// + /// + /// + /// + /// + public static RegionConfig GetConfig(this Region r) => Map[r]; + + /// + /// + /// + /// + /// + public static Uri GetBaseUri(this Region r) => Map[r].BaseUri; + + /// + /// + /// + /// + /// + public static string GetHost(this Region r) => Map[r].Host; + + /// + /// + /// + /// + /// + public static string GetScheme(this Region r) => Map[r].Scheme; + + /// + /// + /// + /// + /// + public static string GetContextPath(this Region r) => Map[r].ContextPath; + + /// + /// + /// + /// + /// + /// + public static Region Parse(string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return Region.Us; + } + + switch (value.Trim().ToLowerInvariant()) + { + case "us": + case "global": + return Region.Us; + case "eu": + return Region.Eu; + case "asia": + case "ap": + return Region.Asia; + default: + throw new ArgumentException($"Unknown region: '{value}'. Allowed: us/global, eu, ap/asia."); + } + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/TokenBase.cs b/src/Fingerprint.ServerSdk/Client/TokenBase.cs new file mode 100644 index 0000000..88f7b16 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/TokenContainer`1.cs b/src/Fingerprint.ServerSdk/Client/TokenContainer`1.cs new file mode 100644 index 0000000..4167796 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Fingerprint.ServerSdk.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Client/TokenProvider`1.cs b/src/Fingerprint.ServerSdk/Client/TokenProvider`1.cs new file mode 100644 index 0000000..fa14686 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Linq; +using System.Collections.Generic; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Extensions/IHostBuilderExtensions.cs b/src/Fingerprint.ServerSdk/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 0000000..b6ba642 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,41 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Extensions/IHttpClientBuilderExtensions.cs b/src/Fingerprint.ServerSdk/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 0000000..c4b4be0 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Fingerprint.ServerSdk.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/src/Fingerprint.ServerSdk/Extensions/IServiceCollectionExtensions.cs b/src/Fingerprint.ServerSdk/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 0000000..90d0d6c --- /dev/null +++ b/src/Fingerprint.ServerSdk/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,61 @@ +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach (var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Fingerprint.ServerSdk.csproj b/src/Fingerprint.ServerSdk/Fingerprint.ServerSdk.csproj new file mode 100644 index 0000000..8d68d6a --- /dev/null +++ b/src/Fingerprint.ServerSdk/Fingerprint.ServerSdk.csproj @@ -0,0 +1,50 @@ + + + + Fingerprint.ServerSdk + browser,detection,fingerprint,identification,fingerprinting,browser-fingerprinting,fraud-detection,fraud,audio-fingerprinting,fingerprintjs,fingerprintjs-pro,visitor-identification + 7.9.0 + Fingerprint + Fingerprint + https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk + https://fingerprint.com/ + true + README.md + LICENSE + logo.png + net8.0;netstandard2.0;netstandard2.1;net48 + 10.0 + Fingerprint.ServerSdk + Library + Fingerprint Server API Dotnet SDK + Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + Copyright (c) 2023 FingerprintJS + Fingerprint.ServerSdk + bin\$(Configuration)\$(TargetFramework)\Fingerprint.ServerSdk.xml + git + false + true + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Model/BotResult.cs b/src/Fingerprint.ServerSdk/Model/BotResult.cs new file mode 100644 index 0000000..a82c6d3 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/BotResult.cs @@ -0,0 +1,188 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Bot detection result: * `not_detected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on + /// + /// Bot detection result: * `not_detected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on + public enum BotResult + { + /// + /// Enum NotDetected for value: not_detected + /// + NotDetected = 1, + + /// + /// Enum Good for value: good + /// + Good = 2, + + /// + /// Enum Bad for value: bad + /// + Bad = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class BotResultValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static BotResult FromString(string value) + { + if (value.Equals("not_detected")) + return BotResult.NotDetected; + + if (value.Equals("good")) + return BotResult.Good; + + if (value.Equals("bad")) + return BotResult.Bad; + + throw new NotImplementedException($"Could not convert value to type BotResult: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static BotResult? FromStringOrDefault(string value) + { + if (value.Equals("not_detected")) + return BotResult.NotDetected; + + if (value.Equals("good")) + return BotResult.Good; + + if (value.Equals("bad")) + return BotResult.Bad; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(BotResult value) + { + if (value == BotResult.NotDetected) + return "not_detected"; + + if (value == BotResult.Good) + return "good"; + + if (value == BotResult.Bad) + return "bad"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class BotResultJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override BotResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + BotResult? result = rawValue == null + ? null + : BotResultValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the BotResult to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BotResult botResult, JsonSerializerOptions options) + { + writer.WriteStringValue(BotResultValueConverter.ToJsonValue(botResult).ToString()); + } + } + + /// + /// A Json converter for type + /// + public class BotResultNullableJsonConverter : JsonConverter + { + /// + /// Returns a BotResult from the Json object + /// + /// + /// + /// + /// + public override BotResult? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + BotResult? result = rawValue == null + ? null + : BotResultValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the BotResult to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BotResult? botResult, JsonSerializerOptions options) + { + writer.WriteStringValue(botResult.HasValue ? BotResultValueConverter.ToJsonValue(botResult.Value).ToString() : "null"); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/BrowserDetails.cs b/src/Fingerprint.ServerSdk/Model/BrowserDetails.cs new file mode 100644 index 0000000..e7aeca8 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/BrowserDetails.cs @@ -0,0 +1,281 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// BrowserDetails + /// + public partial class BrowserDetails : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// browserName + /// browserMajorVersion + /// browserFullVersion + /// os + /// osVersion + /// device + [JsonConstructor] + public BrowserDetails(string browserName, string browserMajorVersion, string browserFullVersion, string os, string osVersion, string device) + { + BrowserName = browserName; + BrowserMajorVersion = browserMajorVersion; + BrowserFullVersion = browserFullVersion; + Os = os; + OsVersion = osVersion; + Device = device; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets BrowserName + /// + [JsonPropertyName("browser_name")] + public string BrowserName { get; set; } + + /// + /// Gets or Sets BrowserMajorVersion + /// + [JsonPropertyName("browser_major_version")] + public string BrowserMajorVersion { get; set; } + + /// + /// Gets or Sets BrowserFullVersion + /// + [JsonPropertyName("browser_full_version")] + public string BrowserFullVersion { get; set; } + + /// + /// Gets or Sets Os + /// + [JsonPropertyName("os")] + public string Os { get; set; } + + /// + /// Gets or Sets OsVersion + /// + [JsonPropertyName("os_version")] + public string OsVersion { get; set; } + + /// + /// Gets or Sets Device + /// + [JsonPropertyName("device")] + public string Device { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BrowserDetails {\n"); + sb.Append(" BrowserName: ").Append(BrowserName).Append("\n"); + sb.Append(" BrowserMajorVersion: ").Append(BrowserMajorVersion).Append("\n"); + sb.Append(" BrowserFullVersion: ").Append(BrowserFullVersion).Append("\n"); + sb.Append(" Os: ").Append(Os).Append("\n"); + sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); + sb.Append(" Device: ").Append(Device).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class BrowserDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BrowserDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option browserName = default; + Option browserMajorVersion = default; + Option browserFullVersion = default; + Option os = default; + Option osVersion = default; + Option device = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "browser_name": + browserName = new Option(utf8JsonReader.GetString()); + break; + case "browser_major_version": + browserMajorVersion = new Option(utf8JsonReader.GetString()); + break; + case "browser_full_version": + browserFullVersion = new Option(utf8JsonReader.GetString()); + break; + case "os": + os = new Option(utf8JsonReader.GetString()); + break; + case "os_version": + osVersion = new Option(utf8JsonReader.GetString()); + break; + case "device": + device = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!browserName.IsSet) + throw new ArgumentException("Property is required for class BrowserDetails.", nameof(browserName)); + + if (!browserMajorVersion.IsSet) + throw new ArgumentException("Property is required for class BrowserDetails.", nameof(browserMajorVersion)); + + if (!browserFullVersion.IsSet) + throw new ArgumentException("Property is required for class BrowserDetails.", nameof(browserFullVersion)); + + if (!os.IsSet) + throw new ArgumentException("Property is required for class BrowserDetails.", nameof(os)); + + if (!osVersion.IsSet) + throw new ArgumentException("Property is required for class BrowserDetails.", nameof(osVersion)); + + if (!device.IsSet) + throw new ArgumentException("Property is required for class BrowserDetails.", nameof(device)); + + if (browserName.IsSet && browserName.Value == null) + throw new ArgumentNullException(nameof(browserName), "Property is not nullable for class BrowserDetails."); + + if (browserMajorVersion.IsSet && browserMajorVersion.Value == null) + throw new ArgumentNullException(nameof(browserMajorVersion), "Property is not nullable for class BrowserDetails."); + + if (browserFullVersion.IsSet && browserFullVersion.Value == null) + throw new ArgumentNullException(nameof(browserFullVersion), "Property is not nullable for class BrowserDetails."); + + if (os.IsSet && os.Value == null) + throw new ArgumentNullException(nameof(os), "Property is not nullable for class BrowserDetails."); + + if (osVersion.IsSet && osVersion.Value == null) + throw new ArgumentNullException(nameof(osVersion), "Property is not nullable for class BrowserDetails."); + + if (device.IsSet && device.Value == null) + throw new ArgumentNullException(nameof(device), "Property is not nullable for class BrowserDetails."); + + return new BrowserDetails(browserName.Value, browserMajorVersion.Value, browserFullVersion.Value, os.Value, osVersion.Value, device.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BrowserDetails browserDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, browserDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BrowserDetails browserDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (browserDetails.BrowserName == null) + throw new ArgumentNullException(nameof(browserDetails.BrowserName), "Property is required for class BrowserDetails."); + + if (browserDetails.BrowserMajorVersion == null) + throw new ArgumentNullException(nameof(browserDetails.BrowserMajorVersion), "Property is required for class BrowserDetails."); + + if (browserDetails.BrowserFullVersion == null) + throw new ArgumentNullException(nameof(browserDetails.BrowserFullVersion), "Property is required for class BrowserDetails."); + + if (browserDetails.Os == null) + throw new ArgumentNullException(nameof(browserDetails.Os), "Property is required for class BrowserDetails."); + + if (browserDetails.OsVersion == null) + throw new ArgumentNullException(nameof(browserDetails.OsVersion), "Property is required for class BrowserDetails."); + + if (browserDetails.Device == null) + throw new ArgumentNullException(nameof(browserDetails.Device), "Property is required for class BrowserDetails."); + + writer.WriteString("browser_name", browserDetails.BrowserName); + + writer.WriteString("browser_major_version", browserDetails.BrowserMajorVersion); + + writer.WriteString("browser_full_version", browserDetails.BrowserFullVersion); + + writer.WriteString("os", browserDetails.Os); + + writer.WriteString("os_version", browserDetails.OsVersion); + + writer.WriteString("device", browserDetails.Device); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Error.cs b/src/Fingerprint.ServerSdk/Model/Error.cs new file mode 100644 index 0000000..e9b93aa --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Error.cs @@ -0,0 +1,185 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Error + /// + public partial class Error : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code + /// message + [JsonConstructor] + public Error(ErrorCode code, string message) + { + Code = code; + Message = message; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Code + /// + [JsonPropertyName("code")] + public ErrorCode Code { get; set; } + + /// + /// Gets or Sets Message + /// + [JsonPropertyName("message")] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Error {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ErrorJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Error Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option code = default; + Option message = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "code": + string codeRawValue = utf8JsonReader.GetString(); + if (codeRawValue != null) + code = new Option(ErrorCodeValueConverter.FromStringOrDefault(codeRawValue)); + break; + case "message": + message = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!code.IsSet) + throw new ArgumentException("Property is required for class Error.", nameof(code)); + + if (!message.IsSet) + throw new ArgumentException("Property is required for class Error.", nameof(message)); + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class Error."); + + if (message.IsSet && message.Value == null) + throw new ArgumentNullException(nameof(message), "Property is not nullable for class Error."); + + return new Error(code.Value.Value, message.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Error error, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, error, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Error error, JsonSerializerOptions jsonSerializerOptions) + { + if (error.Message == null) + throw new ArgumentNullException(nameof(error.Message), "Property is required for class Error."); + + var codeRawValue = ErrorCodeValueConverter.ToJsonValue(error.Code); + writer.WriteString("code", codeRawValue); + + writer.WriteString("message", error.Message); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/ErrorCode.cs b/src/Fingerprint.ServerSdk/Model/ErrorCode.cs new file mode 100644 index 0000000..8faccf4 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/ErrorCode.cs @@ -0,0 +1,370 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Error code: * `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `secret_api_key_required` - secret API key in header is missing or empty. * `secret_api_key_not_found` - No Fingerprint application found for specified secret API key. * `public_api_key_required` - public API key in header is missing or empty. * `public_api_key_not_found` - No Fingerprint application found for specified public API key. * `subscription_not_active` - Fingerprint application is not active. * `wrong_region` - Server and application region differ. * `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your application. * `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `too_many_requests` - The limit on secret API key requests per second has been exceeded. * `state_not_ready` - The event specified with event ID is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the event ID on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `failed` - Internal server error. * `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `missing_module` - The request is invalid because it is missing a required module. * `payload_too_large` - The request payload is too large and cannot be processed. + /// + /// Error code: * `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `secret_api_key_required` - secret API key in header is missing or empty. * `secret_api_key_not_found` - No Fingerprint application found for specified secret API key. * `public_api_key_required` - public API key in header is missing or empty. * `public_api_key_not_found` - No Fingerprint application found for specified public API key. * `subscription_not_active` - Fingerprint application is not active. * `wrong_region` - Server and application region differ. * `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your application. * `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `too_many_requests` - The limit on secret API key requests per second has been exceeded. * `state_not_ready` - The event specified with event ID is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the event ID on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `failed` - Internal server error. * `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `missing_module` - The request is invalid because it is missing a required module. * `payload_too_large` - The request payload is too large and cannot be processed. + public enum ErrorCode + { + /// + /// Enum RequestCannotBeParsed for value: request_cannot_be_parsed + /// + RequestCannotBeParsed = 1, + + /// + /// Enum SecretApiKeyRequired for value: secret_api_key_required + /// + SecretApiKeyRequired = 2, + + /// + /// Enum SecretApiKeyNotFound for value: secret_api_key_not_found + /// + SecretApiKeyNotFound = 3, + + /// + /// Enum PublicApiKeyRequired for value: public_api_key_required + /// + PublicApiKeyRequired = 4, + + /// + /// Enum PublicApiKeyNotFound for value: public_api_key_not_found + /// + PublicApiKeyNotFound = 5, + + /// + /// Enum SubscriptionNotActive for value: subscription_not_active + /// + SubscriptionNotActive = 6, + + /// + /// Enum WrongRegion for value: wrong_region + /// + WrongRegion = 7, + + /// + /// Enum FeatureNotEnabled for value: feature_not_enabled + /// + FeatureNotEnabled = 8, + + /// + /// Enum RequestNotFound for value: request_not_found + /// + RequestNotFound = 9, + + /// + /// Enum VisitorNotFound for value: visitor_not_found + /// + VisitorNotFound = 10, + + /// + /// Enum TooManyRequests for value: too_many_requests + /// + TooManyRequests = 11, + + /// + /// Enum StateNotReady for value: state_not_ready + /// + StateNotReady = 12, + + /// + /// Enum Failed for value: failed + /// + Failed = 13, + + /// + /// Enum EventNotFound for value: event_not_found + /// + EventNotFound = 14, + + /// + /// Enum MissingModule for value: missing_module + /// + MissingModule = 15, + + /// + /// Enum PayloadTooLarge for value: payload_too_large + /// + PayloadTooLarge = 16 + } + + /// + /// Converts to and from the JSON value + /// + public static class ErrorCodeValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ErrorCode FromString(string value) + { + if (value.Equals("request_cannot_be_parsed")) + return ErrorCode.RequestCannotBeParsed; + + if (value.Equals("secret_api_key_required")) + return ErrorCode.SecretApiKeyRequired; + + if (value.Equals("secret_api_key_not_found")) + return ErrorCode.SecretApiKeyNotFound; + + if (value.Equals("public_api_key_required")) + return ErrorCode.PublicApiKeyRequired; + + if (value.Equals("public_api_key_not_found")) + return ErrorCode.PublicApiKeyNotFound; + + if (value.Equals("subscription_not_active")) + return ErrorCode.SubscriptionNotActive; + + if (value.Equals("wrong_region")) + return ErrorCode.WrongRegion; + + if (value.Equals("feature_not_enabled")) + return ErrorCode.FeatureNotEnabled; + + if (value.Equals("request_not_found")) + return ErrorCode.RequestNotFound; + + if (value.Equals("visitor_not_found")) + return ErrorCode.VisitorNotFound; + + if (value.Equals("too_many_requests")) + return ErrorCode.TooManyRequests; + + if (value.Equals("state_not_ready")) + return ErrorCode.StateNotReady; + + if (value.Equals("failed")) + return ErrorCode.Failed; + + if (value.Equals("event_not_found")) + return ErrorCode.EventNotFound; + + if (value.Equals("missing_module")) + return ErrorCode.MissingModule; + + if (value.Equals("payload_too_large")) + return ErrorCode.PayloadTooLarge; + + throw new NotImplementedException($"Could not convert value to type ErrorCode: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ErrorCode? FromStringOrDefault(string value) + { + if (value.Equals("request_cannot_be_parsed")) + return ErrorCode.RequestCannotBeParsed; + + if (value.Equals("secret_api_key_required")) + return ErrorCode.SecretApiKeyRequired; + + if (value.Equals("secret_api_key_not_found")) + return ErrorCode.SecretApiKeyNotFound; + + if (value.Equals("public_api_key_required")) + return ErrorCode.PublicApiKeyRequired; + + if (value.Equals("public_api_key_not_found")) + return ErrorCode.PublicApiKeyNotFound; + + if (value.Equals("subscription_not_active")) + return ErrorCode.SubscriptionNotActive; + + if (value.Equals("wrong_region")) + return ErrorCode.WrongRegion; + + if (value.Equals("feature_not_enabled")) + return ErrorCode.FeatureNotEnabled; + + if (value.Equals("request_not_found")) + return ErrorCode.RequestNotFound; + + if (value.Equals("visitor_not_found")) + return ErrorCode.VisitorNotFound; + + if (value.Equals("too_many_requests")) + return ErrorCode.TooManyRequests; + + if (value.Equals("state_not_ready")) + return ErrorCode.StateNotReady; + + if (value.Equals("failed")) + return ErrorCode.Failed; + + if (value.Equals("event_not_found")) + return ErrorCode.EventNotFound; + + if (value.Equals("missing_module")) + return ErrorCode.MissingModule; + + if (value.Equals("payload_too_large")) + return ErrorCode.PayloadTooLarge; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ErrorCode value) + { + if (value == ErrorCode.RequestCannotBeParsed) + return "request_cannot_be_parsed"; + + if (value == ErrorCode.SecretApiKeyRequired) + return "secret_api_key_required"; + + if (value == ErrorCode.SecretApiKeyNotFound) + return "secret_api_key_not_found"; + + if (value == ErrorCode.PublicApiKeyRequired) + return "public_api_key_required"; + + if (value == ErrorCode.PublicApiKeyNotFound) + return "public_api_key_not_found"; + + if (value == ErrorCode.SubscriptionNotActive) + return "subscription_not_active"; + + if (value == ErrorCode.WrongRegion) + return "wrong_region"; + + if (value == ErrorCode.FeatureNotEnabled) + return "feature_not_enabled"; + + if (value == ErrorCode.RequestNotFound) + return "request_not_found"; + + if (value == ErrorCode.VisitorNotFound) + return "visitor_not_found"; + + if (value == ErrorCode.TooManyRequests) + return "too_many_requests"; + + if (value == ErrorCode.StateNotReady) + return "state_not_ready"; + + if (value == ErrorCode.Failed) + return "failed"; + + if (value == ErrorCode.EventNotFound) + return "event_not_found"; + + if (value == ErrorCode.MissingModule) + return "missing_module"; + + if (value == ErrorCode.PayloadTooLarge) + return "payload_too_large"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ErrorCodeJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ErrorCode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ErrorCode? result = rawValue == null + ? null + : ErrorCodeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ErrorCode to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ErrorCode errorCode, JsonSerializerOptions options) + { + writer.WriteStringValue(ErrorCodeValueConverter.ToJsonValue(errorCode).ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ErrorCodeNullableJsonConverter : JsonConverter + { + /// + /// Returns a ErrorCode from the Json object + /// + /// + /// + /// + /// + public override ErrorCode? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ErrorCode? result = rawValue == null + ? null + : ErrorCodeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ErrorCode to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ErrorCode? errorCode, JsonSerializerOptions options) + { + writer.WriteStringValue(errorCode.HasValue ? ErrorCodeValueConverter.ToJsonValue(errorCode.Value).ToString() : "null"); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/ErrorResponse.cs b/src/Fingerprint.ServerSdk/Model/ErrorResponse.cs new file mode 100644 index 0000000..1dc0309 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/ErrorResponse.cs @@ -0,0 +1,162 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// ErrorResponse + /// + public partial class ErrorResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// error + [JsonConstructor] + public ErrorResponse(Error error) + { + Error = error; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Error + /// + [JsonPropertyName("error")] + public Error Error { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ErrorResponse {\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ErrorResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ErrorResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option error = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "error": + error = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!error.IsSet) + throw new ArgumentException("Property is required for class ErrorResponse.", nameof(error)); + + if (error.IsSet && error.Value == null) + throw new ArgumentNullException(nameof(error), "Property is not nullable for class ErrorResponse."); + + return new ErrorResponse(error.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ErrorResponse errorResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, errorResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ErrorResponse errorResponse, JsonSerializerOptions jsonSerializerOptions) + { + if (errorResponse.Error == null) + throw new ArgumentNullException(nameof(errorResponse.Error), "Property is required for class ErrorResponse."); + + writer.WritePropertyName("error"); + JsonSerializer.Serialize(writer, errorResponse.Error, jsonSerializerOptions); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Event.cs b/src/Fingerprint.ServerSdk/Model/Event.cs new file mode 100644 index 0000000..e345242 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Event.cs @@ -0,0 +1,1434 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Contains results from Fingerprint Identification and all active Smart Signals. + /// + public partial class Event : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` + /// Timestamp of the event with millisecond precision in Unix time. + /// A customer-provided id that was sent with the request. + /// Environment Id of the event. For example: `ae_47abaca3db2c7c43` + /// Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). + /// sdk + /// `true` if we determined that this payload was replayed, `false` otherwise. + /// identification + /// supplementaryIdHighRecall + /// A customer-provided value or an object that was sent with the identification request or updated later. + /// Page URL from which the request was sent. For example `https://example.com/` + /// Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + /// Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + /// IP address of the requesting browser or bot. + /// User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` + /// browserDetails + /// proximity + /// bot + /// Additional classification of the bot type if detected. + /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. + /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. + /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. + /// The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. + /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. + /// ipBlocklist + /// ipInfo + /// IP address was used by a public proxy provider or belonged to a known recent residential proxy + /// proxyConfidence + /// proxyDetails + /// `true` if we detected incognito mode used in the browser, `false` otherwise. + /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. + /// Flag indicating whether the request came from a mobile device with location spoofing enabled. + /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. + /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. + /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score + /// Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). + /// tamperingDetails + /// velocity + /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + /// VPN or other anonymizing service has been used when sending the request. + /// vpnConfidence + /// Local timezone which is used in timezone_mismatch method. + /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). + /// vpnMethods + [JsonConstructor] + public Event(string eventId, long timestamp, Option linkedId = default, Option environmentId = default, Option suspect = default, Option sdk = default, Option replayed = default, Option identification = default, Option supplementaryIdHighRecall = default, Option tags = default, Option url = default, Option bundleId = default, Option packageName = default, Option ipAddress = default, Option userAgent = default, Option browserDetails = default, Option proximity = default, Option bot = default, Option botType = default, Option clonedApp = default, Option developerTools = default, Option emulator = default, Option factoryResetTimestamp = default, Option frida = default, Option ipBlocklist = default, Option ipInfo = default, Option proxy = default, Option proxyConfidence = default, Option proxyDetails = default, Option incognito = default, Option jailbroken = default, Option locationSpoofing = default, Option mitmAttack = default, Option privacySettings = default, Option rootApps = default, Option suspectScore = default, Option tampering = default, Option tamperingDetails = default, Option velocity = default, Option virtualMachine = default, Option vpn = default, Option vpnConfidence = default, Option vpnOriginTimezone = default, Option vpnOriginCountry = default, Option vpnMethods = default) + { + EventId = eventId; + Timestamp = timestamp; + LinkedIdOption = linkedId; + EnvironmentIdOption = environmentId; + SuspectOption = suspect; + SdkOption = sdk; + ReplayedOption = replayed; + IdentificationOption = identification; + SupplementaryIdHighRecallOption = supplementaryIdHighRecall; + TagsOption = tags; + UrlOption = url; + BundleIdOption = bundleId; + PackageNameOption = packageName; + IpAddressOption = ipAddress; + UserAgentOption = userAgent; + BrowserDetailsOption = browserDetails; + ProximityOption = proximity; + BotOption = bot; + BotTypeOption = botType; + ClonedAppOption = clonedApp; + DeveloperToolsOption = developerTools; + EmulatorOption = emulator; + FactoryResetTimestampOption = factoryResetTimestamp; + FridaOption = frida; + IpBlocklistOption = ipBlocklist; + IpInfoOption = ipInfo; + ProxyOption = proxy; + ProxyConfidenceOption = proxyConfidence; + ProxyDetailsOption = proxyDetails; + IncognitoOption = incognito; + JailbrokenOption = jailbroken; + LocationSpoofingOption = locationSpoofing; + MitmAttackOption = mitmAttack; + PrivacySettingsOption = privacySettings; + RootAppsOption = rootApps; + SuspectScoreOption = suspectScore; + TamperingOption = tampering; + TamperingDetailsOption = tamperingDetails; + VelocityOption = velocity; + VirtualMachineOption = virtualMachine; + VpnOption = vpn; + VpnConfidenceOption = vpnConfidence; + VpnOriginTimezoneOption = vpnOriginTimezone; + VpnOriginCountryOption = vpnOriginCountry; + VpnMethodsOption = vpnMethods; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bot + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BotOption { get; private set; } + + /// + /// Gets or Sets Bot + /// + [JsonPropertyName("bot")] + public BotResult? Bot { get { return this.BotOption; } set { this.BotOption = new Option(value); } } + + /// + /// Used to track the state of ProxyConfidence + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProxyConfidenceOption { get; private set; } + + /// + /// Gets or Sets ProxyConfidence + /// + [JsonPropertyName("proxy_confidence")] + public ProxyConfidence? ProxyConfidence { get { return this.ProxyConfidenceOption; } set { this.ProxyConfidenceOption = new Option(value); } } + + /// + /// Used to track the state of VpnConfidence + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VpnConfidenceOption { get; private set; } + + /// + /// Gets or Sets VpnConfidence + /// + [JsonPropertyName("vpn_confidence")] + public VpnConfidence? VpnConfidence { get { return this.VpnConfidenceOption; } set { this.VpnConfidenceOption = new Option(value); } } + + /// + /// Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` + /// + /// Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` + [JsonPropertyName("event_id")] + public string EventId { get; set; } + + /// + /// Timestamp of the event with millisecond precision in Unix time. + /// + /// Timestamp of the event with millisecond precision in Unix time. + [JsonPropertyName("timestamp")] + public long Timestamp { get; set; } + + /// + /// Used to track the state of LinkedId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LinkedIdOption { get; private set; } + + /// + /// A customer-provided id that was sent with the request. + /// + /// A customer-provided id that was sent with the request. + [JsonPropertyName("linked_id")] + public string LinkedId { get { return this.LinkedIdOption; } set { this.LinkedIdOption = new Option(value); } } + + /// + /// Used to track the state of EnvironmentId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnvironmentIdOption { get; private set; } + + /// + /// Environment Id of the event. For example: `ae_47abaca3db2c7c43` + /// + /// Environment Id of the event. For example: `ae_47abaca3db2c7c43` + [JsonPropertyName("environment_id")] + public string EnvironmentId { get { return this.EnvironmentIdOption; } set { this.EnvironmentIdOption = new Option(value); } } + + /// + /// Used to track the state of Suspect + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SuspectOption { get; private set; } + + /// + /// Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). + /// + /// Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). + [JsonPropertyName("suspect")] + public bool? Suspect { get { return this.SuspectOption; } set { this.SuspectOption = new Option(value); } } + + /// + /// Used to track the state of Sdk + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkOption { get; private set; } + + /// + /// Gets or Sets Sdk + /// + [JsonPropertyName("sdk")] + public SDK Sdk { get { return this.SdkOption; } set { this.SdkOption = new Option(value); } } + + /// + /// Used to track the state of Replayed + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReplayedOption { get; private set; } + + /// + /// `true` if we determined that this payload was replayed, `false` otherwise. + /// + /// `true` if we determined that this payload was replayed, `false` otherwise. + [JsonPropertyName("replayed")] + public bool? Replayed { get { return this.ReplayedOption; } set { this.ReplayedOption = new Option(value); } } + + /// + /// Used to track the state of Identification + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdentificationOption { get; private set; } + + /// + /// Gets or Sets Identification + /// + [JsonPropertyName("identification")] + public Identification Identification { get { return this.IdentificationOption; } set { this.IdentificationOption = new Option(value); } } + + /// + /// Used to track the state of SupplementaryIdHighRecall + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SupplementaryIdHighRecallOption { get; private set; } + + /// + /// Gets or Sets SupplementaryIdHighRecall + /// + [JsonPropertyName("supplementary_id_high_recall")] + public SupplementaryIDHighRecall SupplementaryIdHighRecall { get { return this.SupplementaryIdHighRecallOption; } set { this.SupplementaryIdHighRecallOption = new Option(value); } } + + /// + /// Used to track the state of Tags + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TagsOption { get; private set; } + + /// + /// A customer-provided value or an object that was sent with the identification request or updated later. + /// + /// A customer-provided value or an object that was sent with the identification request or updated later. + [JsonPropertyName("tags")] + public Object Tags { get { return this.TagsOption; } set { this.TagsOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } + + /// + /// Page URL from which the request was sent. For example `https://example.com/` + /// + /// Page URL from which the request was sent. For example `https://example.com/` + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + + /// + /// Used to track the state of BundleId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BundleIdOption { get; private set; } + + /// + /// Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + /// + /// Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + [JsonPropertyName("bundle_id")] + public string BundleId { get { return this.BundleIdOption; } set { this.BundleIdOption = new Option(value); } } + + /// + /// Used to track the state of PackageName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PackageNameOption { get; private set; } + + /// + /// Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + /// + /// Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + [JsonPropertyName("package_name")] + public string PackageName { get { return this.PackageNameOption; } set { this.PackageNameOption = new Option(value); } } + + /// + /// Used to track the state of IpAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IpAddressOption { get; private set; } + + /// + /// IP address of the requesting browser or bot. + /// + /// IP address of the requesting browser or bot. + [JsonPropertyName("ip_address")] + public string IpAddress { get { return this.IpAddressOption; } set { this.IpAddressOption = new Option(value); } } + + /// + /// Used to track the state of UserAgent + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UserAgentOption { get; private set; } + + /// + /// User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` + /// + /// User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` + [JsonPropertyName("user_agent")] + public string UserAgent { get { return this.UserAgentOption; } set { this.UserAgentOption = new Option(value); } } + + /// + /// Used to track the state of BrowserDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrowserDetailsOption { get; private set; } + + /// + /// Gets or Sets BrowserDetails + /// + [JsonPropertyName("browser_details")] + public BrowserDetails BrowserDetails { get { return this.BrowserDetailsOption; } set { this.BrowserDetailsOption = new Option(value); } } + + /// + /// Used to track the state of Proximity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProximityOption { get; private set; } + + /// + /// Gets or Sets Proximity + /// + [JsonPropertyName("proximity")] + public Proximity Proximity { get { return this.ProximityOption; } set { this.ProximityOption = new Option(value); } } + + /// + /// Used to track the state of BotType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BotTypeOption { get; private set; } + + /// + /// Additional classification of the bot type if detected. + /// + /// Additional classification of the bot type if detected. + [JsonPropertyName("bot_type")] + public string BotType { get { return this.BotTypeOption; } set { this.BotTypeOption = new Option(value); } } + + /// + /// Used to track the state of ClonedApp + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ClonedAppOption { get; private set; } + + /// + /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. + /// + /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. + [JsonPropertyName("cloned_app")] + public bool? ClonedApp { get { return this.ClonedAppOption; } set { this.ClonedAppOption = new Option(value); } } + + /// + /// Used to track the state of DeveloperTools + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeveloperToolsOption { get; private set; } + + /// + /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. + /// + /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. + [JsonPropertyName("developer_tools")] + public bool? DeveloperTools { get { return this.DeveloperToolsOption; } set { this.DeveloperToolsOption = new Option(value); } } + + /// + /// Used to track the state of Emulator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EmulatorOption { get; private set; } + + /// + /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. + /// + /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. + [JsonPropertyName("emulator")] + public bool? Emulator { get { return this.EmulatorOption; } set { this.EmulatorOption = new Option(value); } } + + /// + /// Used to track the state of FactoryResetTimestamp + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FactoryResetTimestampOption { get; private set; } + + /// + /// The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. + /// + /// The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. + [JsonPropertyName("factory_reset_timestamp")] + public long? FactoryResetTimestamp { get { return this.FactoryResetTimestampOption; } set { this.FactoryResetTimestampOption = new Option(value); } } + + /// + /// Used to track the state of Frida + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FridaOption { get; private set; } + + /// + /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. + /// + /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. + [JsonPropertyName("frida")] + public bool? Frida { get { return this.FridaOption; } set { this.FridaOption = new Option(value); } } + + /// + /// Used to track the state of IpBlocklist + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IpBlocklistOption { get; private set; } + + /// + /// Gets or Sets IpBlocklist + /// + [JsonPropertyName("ip_blocklist")] + public IPBlockList IpBlocklist { get { return this.IpBlocklistOption; } set { this.IpBlocklistOption = new Option(value); } } + + /// + /// Used to track the state of IpInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IpInfoOption { get; private set; } + + /// + /// Gets or Sets IpInfo + /// + [JsonPropertyName("ip_info")] + public IPInfo IpInfo { get { return this.IpInfoOption; } set { this.IpInfoOption = new Option(value); } } + + /// + /// Used to track the state of Proxy + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProxyOption { get; private set; } + + /// + /// IP address was used by a public proxy provider or belonged to a known recent residential proxy + /// + /// IP address was used by a public proxy provider or belonged to a known recent residential proxy + [JsonPropertyName("proxy")] + public bool? Proxy { get { return this.ProxyOption; } set { this.ProxyOption = new Option(value); } } + + /// + /// Used to track the state of ProxyDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProxyDetailsOption { get; private set; } + + /// + /// Gets or Sets ProxyDetails + /// + [JsonPropertyName("proxy_details")] + public ProxyDetails ProxyDetails { get { return this.ProxyDetailsOption; } set { this.ProxyDetailsOption = new Option(value); } } + + /// + /// Used to track the state of Incognito + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IncognitoOption { get; private set; } + + /// + /// `true` if we detected incognito mode used in the browser, `false` otherwise. + /// + /// `true` if we detected incognito mode used in the browser, `false` otherwise. + [JsonPropertyName("incognito")] + public bool? Incognito { get { return this.IncognitoOption; } set { this.IncognitoOption = new Option(value); } } + + /// + /// Used to track the state of Jailbroken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option JailbrokenOption { get; private set; } + + /// + /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. + /// + /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. + [JsonPropertyName("jailbroken")] + public bool? Jailbroken { get { return this.JailbrokenOption; } set { this.JailbrokenOption = new Option(value); } } + + /// + /// Used to track the state of LocationSpoofing + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LocationSpoofingOption { get; private set; } + + /// + /// Flag indicating whether the request came from a mobile device with location spoofing enabled. + /// + /// Flag indicating whether the request came from a mobile device with location spoofing enabled. + [JsonPropertyName("location_spoofing")] + public bool? LocationSpoofing { get { return this.LocationSpoofingOption; } set { this.LocationSpoofingOption = new Option(value); } } + + /// + /// Used to track the state of MitmAttack + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MitmAttackOption { get; private set; } + + /// + /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. + /// + /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. + [JsonPropertyName("mitm_attack")] + public bool? MitmAttack { get { return this.MitmAttackOption; } set { this.MitmAttackOption = new Option(value); } } + + /// + /// Used to track the state of PrivacySettings + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PrivacySettingsOption { get; private set; } + + /// + /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + /// + /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + [JsonPropertyName("privacy_settings")] + public bool? PrivacySettings { get { return this.PrivacySettingsOption; } set { this.PrivacySettingsOption = new Option(value); } } + + /// + /// Used to track the state of RootApps + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RootAppsOption { get; private set; } + + /// + /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. + /// + /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. + [JsonPropertyName("root_apps")] + public bool? RootApps { get { return this.RootAppsOption; } set { this.RootAppsOption = new Option(value); } } + + /// + /// Used to track the state of SuspectScore + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SuspectScoreOption { get; private set; } + + /// + /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score + /// + /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score + [JsonPropertyName("suspect_score")] + public int? SuspectScore { get { return this.SuspectScoreOption; } set { this.SuspectScoreOption = new Option(value); } } + + /// + /// Used to track the state of Tampering + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TamperingOption { get; private set; } + + /// + /// Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). + /// + /// Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). + [JsonPropertyName("tampering")] + public bool? Tampering { get { return this.TamperingOption; } set { this.TamperingOption = new Option(value); } } + + /// + /// Used to track the state of TamperingDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TamperingDetailsOption { get; private set; } + + /// + /// Gets or Sets TamperingDetails + /// + [JsonPropertyName("tampering_details")] + public TamperingDetails TamperingDetails { get { return this.TamperingDetailsOption; } set { this.TamperingDetailsOption = new Option(value); } } + + /// + /// Used to track the state of Velocity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VelocityOption { get; private set; } + + /// + /// Gets or Sets Velocity + /// + [JsonPropertyName("velocity")] + public Velocity Velocity { get { return this.VelocityOption; } set { this.VelocityOption = new Option(value); } } + + /// + /// Used to track the state of VirtualMachine + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VirtualMachineOption { get; private set; } + + /// + /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + /// + /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + [JsonPropertyName("virtual_machine")] + public bool? VirtualMachine { get { return this.VirtualMachineOption; } set { this.VirtualMachineOption = new Option(value); } } + + /// + /// Used to track the state of Vpn + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VpnOption { get; private set; } + + /// + /// VPN or other anonymizing service has been used when sending the request. + /// + /// VPN or other anonymizing service has been used when sending the request. + [JsonPropertyName("vpn")] + public bool? Vpn { get { return this.VpnOption; } set { this.VpnOption = new Option(value); } } + + /// + /// Used to track the state of VpnOriginTimezone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VpnOriginTimezoneOption { get; private set; } + + /// + /// Local timezone which is used in timezone_mismatch method. + /// + /// Local timezone which is used in timezone_mismatch method. + [JsonPropertyName("vpn_origin_timezone")] + public string VpnOriginTimezone { get { return this.VpnOriginTimezoneOption; } set { this.VpnOriginTimezoneOption = new Option(value); } } + + /// + /// Used to track the state of VpnOriginCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VpnOriginCountryOption { get; private set; } + + /// + /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). + /// + /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). + [JsonPropertyName("vpn_origin_country")] + public string VpnOriginCountry { get { return this.VpnOriginCountryOption; } set { this.VpnOriginCountryOption = new Option(value); } } + + /// + /// Used to track the state of VpnMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VpnMethodsOption { get; private set; } + + /// + /// Gets or Sets VpnMethods + /// + [JsonPropertyName("vpn_methods")] + public VpnMethods VpnMethods { get { return this.VpnMethodsOption; } set { this.VpnMethodsOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Event {\n"); + sb.Append(" EventId: ").Append(EventId).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); + sb.Append(" EnvironmentId: ").Append(EnvironmentId).Append("\n"); + sb.Append(" Suspect: ").Append(Suspect).Append("\n"); + sb.Append(" Sdk: ").Append(Sdk).Append("\n"); + sb.Append(" Replayed: ").Append(Replayed).Append("\n"); + sb.Append(" Identification: ").Append(Identification).Append("\n"); + sb.Append(" SupplementaryIdHighRecall: ").Append(SupplementaryIdHighRecall).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" PackageName: ").Append(PackageName).Append("\n"); + sb.Append(" IpAddress: ").Append(IpAddress).Append("\n"); + sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); + sb.Append(" BrowserDetails: ").Append(BrowserDetails).Append("\n"); + sb.Append(" Proximity: ").Append(Proximity).Append("\n"); + sb.Append(" Bot: ").Append(Bot).Append("\n"); + sb.Append(" BotType: ").Append(BotType).Append("\n"); + sb.Append(" ClonedApp: ").Append(ClonedApp).Append("\n"); + sb.Append(" DeveloperTools: ").Append(DeveloperTools).Append("\n"); + sb.Append(" Emulator: ").Append(Emulator).Append("\n"); + sb.Append(" FactoryResetTimestamp: ").Append(FactoryResetTimestamp).Append("\n"); + sb.Append(" Frida: ").Append(Frida).Append("\n"); + sb.Append(" IpBlocklist: ").Append(IpBlocklist).Append("\n"); + sb.Append(" IpInfo: ").Append(IpInfo).Append("\n"); + sb.Append(" Proxy: ").Append(Proxy).Append("\n"); + sb.Append(" ProxyConfidence: ").Append(ProxyConfidence).Append("\n"); + sb.Append(" ProxyDetails: ").Append(ProxyDetails).Append("\n"); + sb.Append(" Incognito: ").Append(Incognito).Append("\n"); + sb.Append(" Jailbroken: ").Append(Jailbroken).Append("\n"); + sb.Append(" LocationSpoofing: ").Append(LocationSpoofing).Append("\n"); + sb.Append(" MitmAttack: ").Append(MitmAttack).Append("\n"); + sb.Append(" PrivacySettings: ").Append(PrivacySettings).Append("\n"); + sb.Append(" RootApps: ").Append(RootApps).Append("\n"); + sb.Append(" SuspectScore: ").Append(SuspectScore).Append("\n"); + sb.Append(" Tampering: ").Append(Tampering).Append("\n"); + sb.Append(" TamperingDetails: ").Append(TamperingDetails).Append("\n"); + sb.Append(" Velocity: ").Append(Velocity).Append("\n"); + sb.Append(" VirtualMachine: ").Append(VirtualMachine).Append("\n"); + sb.Append(" Vpn: ").Append(Vpn).Append("\n"); + sb.Append(" VpnConfidence: ").Append(VpnConfidence).Append("\n"); + sb.Append(" VpnOriginTimezone: ").Append(VpnOriginTimezone).Append("\n"); + sb.Append(" VpnOriginCountry: ").Append(VpnOriginCountry).Append("\n"); + sb.Append(" VpnMethods: ").Append(VpnMethods).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class EventJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Event Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option eventId = default; + Option timestamp = default; + Option linkedId = default; + Option environmentId = default; + Option suspect = default; + Option sdk = default; + Option replayed = default; + Option identification = default; + Option supplementaryIdHighRecall = default; + Option tags = default; + Option url = default; + Option bundleId = default; + Option packageName = default; + Option ipAddress = default; + Option userAgent = default; + Option browserDetails = default; + Option proximity = default; + Option bot = default; + Option botType = default; + Option clonedApp = default; + Option developerTools = default; + Option emulator = default; + Option factoryResetTimestamp = default; + Option frida = default; + Option ipBlocklist = default; + Option ipInfo = default; + Option proxy = default; + Option proxyConfidence = default; + Option proxyDetails = default; + Option incognito = default; + Option jailbroken = default; + Option locationSpoofing = default; + Option mitmAttack = default; + Option privacySettings = default; + Option rootApps = default; + Option suspectScore = default; + Option tampering = default; + Option tamperingDetails = default; + Option velocity = default; + Option virtualMachine = default; + Option vpn = default; + Option vpnConfidence = default; + Option vpnOriginTimezone = default; + Option vpnOriginCountry = default; + Option vpnMethods = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "event_id": + eventId = new Option(utf8JsonReader.GetString()); + break; + case "timestamp": + timestamp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + case "linked_id": + linkedId = new Option(utf8JsonReader.GetString()); + break; + case "environment_id": + environmentId = new Option(utf8JsonReader.GetString()); + break; + case "suspect": + suspect = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "sdk": + sdk = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "replayed": + replayed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "identification": + identification = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "supplementary_id_high_recall": + supplementaryIdHighRecall = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "tags": + tags = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + case "bundle_id": + bundleId = new Option(utf8JsonReader.GetString()); + break; + case "package_name": + packageName = new Option(utf8JsonReader.GetString()); + break; + case "ip_address": + ipAddress = new Option(utf8JsonReader.GetString()); + break; + case "user_agent": + userAgent = new Option(utf8JsonReader.GetString()); + break; + case "browser_details": + browserDetails = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "proximity": + proximity = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "bot": + string botRawValue = utf8JsonReader.GetString(); + if (botRawValue != null) + bot = new Option(BotResultValueConverter.FromStringOrDefault(botRawValue)); + break; + case "bot_type": + botType = new Option(utf8JsonReader.GetString()); + break; + case "cloned_app": + clonedApp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "developer_tools": + developerTools = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "emulator": + emulator = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "factory_reset_timestamp": + factoryResetTimestamp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + case "frida": + frida = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "ip_blocklist": + ipBlocklist = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "ip_info": + ipInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "proxy": + proxy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "proxy_confidence": + string proxyConfidenceRawValue = utf8JsonReader.GetString(); + if (proxyConfidenceRawValue != null) + proxyConfidence = new Option(ProxyConfidenceValueConverter.FromStringOrDefault(proxyConfidenceRawValue)); + break; + case "proxy_details": + proxyDetails = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "incognito": + incognito = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "jailbroken": + jailbroken = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "location_spoofing": + locationSpoofing = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "mitm_attack": + mitmAttack = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "privacy_settings": + privacySettings = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "root_apps": + rootApps = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "suspect_score": + suspectScore = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); + break; + case "tampering": + tampering = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "tampering_details": + tamperingDetails = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "velocity": + velocity = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "virtual_machine": + virtualMachine = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "vpn": + vpn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "vpn_confidence": + string vpnConfidenceRawValue = utf8JsonReader.GetString(); + if (vpnConfidenceRawValue != null) + vpnConfidence = new Option(VpnConfidenceValueConverter.FromStringOrDefault(vpnConfidenceRawValue)); + break; + case "vpn_origin_timezone": + vpnOriginTimezone = new Option(utf8JsonReader.GetString()); + break; + case "vpn_origin_country": + vpnOriginCountry = new Option(utf8JsonReader.GetString()); + break; + case "vpn_methods": + vpnMethods = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!eventId.IsSet) + throw new ArgumentException("Property is required for class Event.", nameof(eventId)); + + if (!timestamp.IsSet) + throw new ArgumentException("Property is required for class Event.", nameof(timestamp)); + + if (eventId.IsSet && eventId.Value == null) + throw new ArgumentNullException(nameof(eventId), "Property is not nullable for class Event."); + + if (timestamp.IsSet && timestamp.Value == null) + throw new ArgumentNullException(nameof(timestamp), "Property is not nullable for class Event."); + + if (linkedId.IsSet && linkedId.Value == null) + throw new ArgumentNullException(nameof(linkedId), "Property is not nullable for class Event."); + + if (environmentId.IsSet && environmentId.Value == null) + throw new ArgumentNullException(nameof(environmentId), "Property is not nullable for class Event."); + + if (suspect.IsSet && suspect.Value == null) + throw new ArgumentNullException(nameof(suspect), "Property is not nullable for class Event."); + + if (sdk.IsSet && sdk.Value == null) + throw new ArgumentNullException(nameof(sdk), "Property is not nullable for class Event."); + + if (replayed.IsSet && replayed.Value == null) + throw new ArgumentNullException(nameof(replayed), "Property is not nullable for class Event."); + + if (identification.IsSet && identification.Value == null) + throw new ArgumentNullException(nameof(identification), "Property is not nullable for class Event."); + + if (supplementaryIdHighRecall.IsSet && supplementaryIdHighRecall.Value == null) + throw new ArgumentNullException(nameof(supplementaryIdHighRecall), "Property is not nullable for class Event."); + + if (tags.IsSet && tags.Value == null) + throw new ArgumentNullException(nameof(tags), "Property is not nullable for class Event."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class Event."); + + if (bundleId.IsSet && bundleId.Value == null) + throw new ArgumentNullException(nameof(bundleId), "Property is not nullable for class Event."); + + if (packageName.IsSet && packageName.Value == null) + throw new ArgumentNullException(nameof(packageName), "Property is not nullable for class Event."); + + if (ipAddress.IsSet && ipAddress.Value == null) + throw new ArgumentNullException(nameof(ipAddress), "Property is not nullable for class Event."); + + if (userAgent.IsSet && userAgent.Value == null) + throw new ArgumentNullException(nameof(userAgent), "Property is not nullable for class Event."); + + if (browserDetails.IsSet && browserDetails.Value == null) + throw new ArgumentNullException(nameof(browserDetails), "Property is not nullable for class Event."); + + if (proximity.IsSet && proximity.Value == null) + throw new ArgumentNullException(nameof(proximity), "Property is not nullable for class Event."); + + if (bot.IsSet && bot.Value == null) + throw new ArgumentNullException(nameof(bot), "Property is not nullable for class Event."); + + if (botType.IsSet && botType.Value == null) + throw new ArgumentNullException(nameof(botType), "Property is not nullable for class Event."); + + if (clonedApp.IsSet && clonedApp.Value == null) + throw new ArgumentNullException(nameof(clonedApp), "Property is not nullable for class Event."); + + if (developerTools.IsSet && developerTools.Value == null) + throw new ArgumentNullException(nameof(developerTools), "Property is not nullable for class Event."); + + if (emulator.IsSet && emulator.Value == null) + throw new ArgumentNullException(nameof(emulator), "Property is not nullable for class Event."); + + if (factoryResetTimestamp.IsSet && factoryResetTimestamp.Value == null) + throw new ArgumentNullException(nameof(factoryResetTimestamp), "Property is not nullable for class Event."); + + if (frida.IsSet && frida.Value == null) + throw new ArgumentNullException(nameof(frida), "Property is not nullable for class Event."); + + if (ipBlocklist.IsSet && ipBlocklist.Value == null) + throw new ArgumentNullException(nameof(ipBlocklist), "Property is not nullable for class Event."); + + if (ipInfo.IsSet && ipInfo.Value == null) + throw new ArgumentNullException(nameof(ipInfo), "Property is not nullable for class Event."); + + if (proxy.IsSet && proxy.Value == null) + throw new ArgumentNullException(nameof(proxy), "Property is not nullable for class Event."); + + if (proxyConfidence.IsSet && proxyConfidence.Value == null) + throw new ArgumentNullException(nameof(proxyConfidence), "Property is not nullable for class Event."); + + if (proxyDetails.IsSet && proxyDetails.Value == null) + throw new ArgumentNullException(nameof(proxyDetails), "Property is not nullable for class Event."); + + if (incognito.IsSet && incognito.Value == null) + throw new ArgumentNullException(nameof(incognito), "Property is not nullable for class Event."); + + if (jailbroken.IsSet && jailbroken.Value == null) + throw new ArgumentNullException(nameof(jailbroken), "Property is not nullable for class Event."); + + if (locationSpoofing.IsSet && locationSpoofing.Value == null) + throw new ArgumentNullException(nameof(locationSpoofing), "Property is not nullable for class Event."); + + if (mitmAttack.IsSet && mitmAttack.Value == null) + throw new ArgumentNullException(nameof(mitmAttack), "Property is not nullable for class Event."); + + if (privacySettings.IsSet && privacySettings.Value == null) + throw new ArgumentNullException(nameof(privacySettings), "Property is not nullable for class Event."); + + if (rootApps.IsSet && rootApps.Value == null) + throw new ArgumentNullException(nameof(rootApps), "Property is not nullable for class Event."); + + if (suspectScore.IsSet && suspectScore.Value == null) + throw new ArgumentNullException(nameof(suspectScore), "Property is not nullable for class Event."); + + if (tampering.IsSet && tampering.Value == null) + throw new ArgumentNullException(nameof(tampering), "Property is not nullable for class Event."); + + if (tamperingDetails.IsSet && tamperingDetails.Value == null) + throw new ArgumentNullException(nameof(tamperingDetails), "Property is not nullable for class Event."); + + if (velocity.IsSet && velocity.Value == null) + throw new ArgumentNullException(nameof(velocity), "Property is not nullable for class Event."); + + if (virtualMachine.IsSet && virtualMachine.Value == null) + throw new ArgumentNullException(nameof(virtualMachine), "Property is not nullable for class Event."); + + if (vpn.IsSet && vpn.Value == null) + throw new ArgumentNullException(nameof(vpn), "Property is not nullable for class Event."); + + if (vpnConfidence.IsSet && vpnConfidence.Value == null) + throw new ArgumentNullException(nameof(vpnConfidence), "Property is not nullable for class Event."); + + if (vpnOriginTimezone.IsSet && vpnOriginTimezone.Value == null) + throw new ArgumentNullException(nameof(vpnOriginTimezone), "Property is not nullable for class Event."); + + if (vpnOriginCountry.IsSet && vpnOriginCountry.Value == null) + throw new ArgumentNullException(nameof(vpnOriginCountry), "Property is not nullable for class Event."); + + if (vpnMethods.IsSet && vpnMethods.Value == null) + throw new ArgumentNullException(nameof(vpnMethods), "Property is not nullable for class Event."); + + return new Event(eventId.Value, timestamp.Value.Value, linkedId, environmentId, suspect, sdk, replayed, identification, supplementaryIdHighRecall, tags, url, bundleId, packageName, ipAddress, userAgent, browserDetails, proximity, bot, botType, clonedApp, developerTools, emulator, factoryResetTimestamp, frida, ipBlocklist, ipInfo, proxy, proxyConfidence, proxyDetails, incognito, jailbroken, locationSpoofing, mitmAttack, privacySettings, rootApps, suspectScore, tampering, tamperingDetails, velocity, virtualMachine, vpn, vpnConfidence, vpnOriginTimezone, vpnOriginCountry, vpnMethods); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Event varEvent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, varEvent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Event varEvent, JsonSerializerOptions jsonSerializerOptions) + { + if (varEvent.EventId == null) + throw new ArgumentNullException(nameof(varEvent.EventId), "Property is required for class Event."); + + if (varEvent.LinkedIdOption.IsSet && varEvent.LinkedId == null) + throw new ArgumentNullException(nameof(varEvent.LinkedId), "Property is required for class Event."); + + if (varEvent.EnvironmentIdOption.IsSet && varEvent.EnvironmentId == null) + throw new ArgumentNullException(nameof(varEvent.EnvironmentId), "Property is required for class Event."); + + if (varEvent.SdkOption.IsSet && varEvent.Sdk == null) + throw new ArgumentNullException(nameof(varEvent.Sdk), "Property is required for class Event."); + + if (varEvent.IdentificationOption.IsSet && varEvent.Identification == null) + throw new ArgumentNullException(nameof(varEvent.Identification), "Property is required for class Event."); + + if (varEvent.SupplementaryIdHighRecallOption.IsSet && varEvent.SupplementaryIdHighRecall == null) + throw new ArgumentNullException(nameof(varEvent.SupplementaryIdHighRecall), "Property is required for class Event."); + + if (varEvent.TagsOption.IsSet && varEvent.Tags == null) + throw new ArgumentNullException(nameof(varEvent.Tags), "Property is required for class Event."); + + if (varEvent.UrlOption.IsSet && varEvent.Url == null) + throw new ArgumentNullException(nameof(varEvent.Url), "Property is required for class Event."); + + if (varEvent.BundleIdOption.IsSet && varEvent.BundleId == null) + throw new ArgumentNullException(nameof(varEvent.BundleId), "Property is required for class Event."); + + if (varEvent.PackageNameOption.IsSet && varEvent.PackageName == null) + throw new ArgumentNullException(nameof(varEvent.PackageName), "Property is required for class Event."); + + if (varEvent.IpAddressOption.IsSet && varEvent.IpAddress == null) + throw new ArgumentNullException(nameof(varEvent.IpAddress), "Property is required for class Event."); + + if (varEvent.UserAgentOption.IsSet && varEvent.UserAgent == null) + throw new ArgumentNullException(nameof(varEvent.UserAgent), "Property is required for class Event."); + + if (varEvent.BrowserDetailsOption.IsSet && varEvent.BrowserDetails == null) + throw new ArgumentNullException(nameof(varEvent.BrowserDetails), "Property is required for class Event."); + + if (varEvent.ProximityOption.IsSet && varEvent.Proximity == null) + throw new ArgumentNullException(nameof(varEvent.Proximity), "Property is required for class Event."); + + if (varEvent.BotTypeOption.IsSet && varEvent.BotType == null) + throw new ArgumentNullException(nameof(varEvent.BotType), "Property is required for class Event."); + + if (varEvent.IpBlocklistOption.IsSet && varEvent.IpBlocklist == null) + throw new ArgumentNullException(nameof(varEvent.IpBlocklist), "Property is required for class Event."); + + if (varEvent.IpInfoOption.IsSet && varEvent.IpInfo == null) + throw new ArgumentNullException(nameof(varEvent.IpInfo), "Property is required for class Event."); + + if (varEvent.ProxyDetailsOption.IsSet && varEvent.ProxyDetails == null) + throw new ArgumentNullException(nameof(varEvent.ProxyDetails), "Property is required for class Event."); + + if (varEvent.TamperingDetailsOption.IsSet && varEvent.TamperingDetails == null) + throw new ArgumentNullException(nameof(varEvent.TamperingDetails), "Property is required for class Event."); + + if (varEvent.VelocityOption.IsSet && varEvent.Velocity == null) + throw new ArgumentNullException(nameof(varEvent.Velocity), "Property is required for class Event."); + + if (varEvent.VpnOriginTimezoneOption.IsSet && varEvent.VpnOriginTimezone == null) + throw new ArgumentNullException(nameof(varEvent.VpnOriginTimezone), "Property is required for class Event."); + + if (varEvent.VpnOriginCountryOption.IsSet && varEvent.VpnOriginCountry == null) + throw new ArgumentNullException(nameof(varEvent.VpnOriginCountry), "Property is required for class Event."); + + if (varEvent.VpnMethodsOption.IsSet && varEvent.VpnMethods == null) + throw new ArgumentNullException(nameof(varEvent.VpnMethods), "Property is required for class Event."); + + writer.WriteString("event_id", varEvent.EventId); + + writer.WriteNumber("timestamp", varEvent.Timestamp); + + if (varEvent.LinkedIdOption.IsSet) + writer.WriteString("linked_id", varEvent.LinkedId); + + if (varEvent.EnvironmentIdOption.IsSet) + writer.WriteString("environment_id", varEvent.EnvironmentId); + + if (varEvent.SuspectOption.IsSet) + writer.WriteBoolean("suspect", varEvent.SuspectOption.Value.Value); + + if (varEvent.SdkOption.IsSet) + { + writer.WritePropertyName("sdk"); + JsonSerializer.Serialize(writer, varEvent.Sdk, jsonSerializerOptions); + } + if (varEvent.ReplayedOption.IsSet) + writer.WriteBoolean("replayed", varEvent.ReplayedOption.Value.Value); + + if (varEvent.IdentificationOption.IsSet) + { + writer.WritePropertyName("identification"); + JsonSerializer.Serialize(writer, varEvent.Identification, jsonSerializerOptions); + } + if (varEvent.SupplementaryIdHighRecallOption.IsSet) + { + writer.WritePropertyName("supplementary_id_high_recall"); + JsonSerializer.Serialize(writer, varEvent.SupplementaryIdHighRecall, jsonSerializerOptions); + } + if (varEvent.TagsOption.IsSet) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, varEvent.Tags, jsonSerializerOptions); + } + if (varEvent.UrlOption.IsSet) + writer.WriteString("url", varEvent.Url); + + if (varEvent.BundleIdOption.IsSet) + writer.WriteString("bundle_id", varEvent.BundleId); + + if (varEvent.PackageNameOption.IsSet) + writer.WriteString("package_name", varEvent.PackageName); + + if (varEvent.IpAddressOption.IsSet) + writer.WriteString("ip_address", varEvent.IpAddress); + + if (varEvent.UserAgentOption.IsSet) + writer.WriteString("user_agent", varEvent.UserAgent); + + if (varEvent.BrowserDetailsOption.IsSet) + { + writer.WritePropertyName("browser_details"); + JsonSerializer.Serialize(writer, varEvent.BrowserDetails, jsonSerializerOptions); + } + if (varEvent.ProximityOption.IsSet) + { + writer.WritePropertyName("proximity"); + JsonSerializer.Serialize(writer, varEvent.Proximity, jsonSerializerOptions); + } + if (varEvent.BotOption.IsSet) + { + var botRawValue = BotResultValueConverter.ToJsonValue(varEvent.Bot.Value); + writer.WriteString("bot", botRawValue); + } + if (varEvent.BotTypeOption.IsSet) + writer.WriteString("bot_type", varEvent.BotType); + + if (varEvent.ClonedAppOption.IsSet) + writer.WriteBoolean("cloned_app", varEvent.ClonedAppOption.Value.Value); + + if (varEvent.DeveloperToolsOption.IsSet) + writer.WriteBoolean("developer_tools", varEvent.DeveloperToolsOption.Value.Value); + + if (varEvent.EmulatorOption.IsSet) + writer.WriteBoolean("emulator", varEvent.EmulatorOption.Value.Value); + + if (varEvent.FactoryResetTimestampOption.IsSet) + writer.WriteNumber("factory_reset_timestamp", varEvent.FactoryResetTimestampOption.Value.Value); + + if (varEvent.FridaOption.IsSet) + writer.WriteBoolean("frida", varEvent.FridaOption.Value.Value); + + if (varEvent.IpBlocklistOption.IsSet) + { + writer.WritePropertyName("ip_blocklist"); + JsonSerializer.Serialize(writer, varEvent.IpBlocklist, jsonSerializerOptions); + } + if (varEvent.IpInfoOption.IsSet) + { + writer.WritePropertyName("ip_info"); + JsonSerializer.Serialize(writer, varEvent.IpInfo, jsonSerializerOptions); + } + if (varEvent.ProxyOption.IsSet) + writer.WriteBoolean("proxy", varEvent.ProxyOption.Value.Value); + + if (varEvent.ProxyConfidenceOption.IsSet) + { + var proxyConfidenceRawValue = ProxyConfidenceValueConverter.ToJsonValue(varEvent.ProxyConfidence.Value); + writer.WriteString("proxy_confidence", proxyConfidenceRawValue); + } + if (varEvent.ProxyDetailsOption.IsSet) + { + writer.WritePropertyName("proxy_details"); + JsonSerializer.Serialize(writer, varEvent.ProxyDetails, jsonSerializerOptions); + } + if (varEvent.IncognitoOption.IsSet) + writer.WriteBoolean("incognito", varEvent.IncognitoOption.Value.Value); + + if (varEvent.JailbrokenOption.IsSet) + writer.WriteBoolean("jailbroken", varEvent.JailbrokenOption.Value.Value); + + if (varEvent.LocationSpoofingOption.IsSet) + writer.WriteBoolean("location_spoofing", varEvent.LocationSpoofingOption.Value.Value); + + if (varEvent.MitmAttackOption.IsSet) + writer.WriteBoolean("mitm_attack", varEvent.MitmAttackOption.Value.Value); + + if (varEvent.PrivacySettingsOption.IsSet) + writer.WriteBoolean("privacy_settings", varEvent.PrivacySettingsOption.Value.Value); + + if (varEvent.RootAppsOption.IsSet) + writer.WriteBoolean("root_apps", varEvent.RootAppsOption.Value.Value); + + if (varEvent.SuspectScoreOption.IsSet) + writer.WriteNumber("suspect_score", varEvent.SuspectScoreOption.Value.Value); + + if (varEvent.TamperingOption.IsSet) + writer.WriteBoolean("tampering", varEvent.TamperingOption.Value.Value); + + if (varEvent.TamperingDetailsOption.IsSet) + { + writer.WritePropertyName("tampering_details"); + JsonSerializer.Serialize(writer, varEvent.TamperingDetails, jsonSerializerOptions); + } + if (varEvent.VelocityOption.IsSet) + { + writer.WritePropertyName("velocity"); + JsonSerializer.Serialize(writer, varEvent.Velocity, jsonSerializerOptions); + } + if (varEvent.VirtualMachineOption.IsSet) + writer.WriteBoolean("virtual_machine", varEvent.VirtualMachineOption.Value.Value); + + if (varEvent.VpnOption.IsSet) + writer.WriteBoolean("vpn", varEvent.VpnOption.Value.Value); + + if (varEvent.VpnConfidenceOption.IsSet) + { + var vpnConfidenceRawValue = VpnConfidenceValueConverter.ToJsonValue(varEvent.VpnConfidence.Value); + writer.WriteString("vpn_confidence", vpnConfidenceRawValue); + } + if (varEvent.VpnOriginTimezoneOption.IsSet) + writer.WriteString("vpn_origin_timezone", varEvent.VpnOriginTimezone); + + if (varEvent.VpnOriginCountryOption.IsSet) + writer.WriteString("vpn_origin_country", varEvent.VpnOriginCountry); + + if (varEvent.VpnMethodsOption.IsSet) + { + writer.WritePropertyName("vpn_methods"); + JsonSerializer.Serialize(writer, varEvent.VpnMethods, jsonSerializerOptions); + } + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/EventSearch.cs b/src/Fingerprint.ServerSdk/Model/EventSearch.cs new file mode 100644 index 0000000..f1d0e89 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/EventSearch.cs @@ -0,0 +1,218 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Contains a list of all identification events matching the specified search criteria. + /// + public partial class EventSearch : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// events + /// Use this value in the `pagination_key` parameter to request the next page of search results. + /// This value represents the total number of events matching the search query, up to the limit provided in the `total_hits` query parameter. Only present if the `total_hits` query parameter was provided. + [JsonConstructor] + public EventSearch(List events, Option paginationKey = default, Option totalHits = default) + { + Events = events; + PaginationKeyOption = paginationKey; + TotalHitsOption = totalHits; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Events + /// + [JsonPropertyName("events")] + public List Events { get; set; } + + /// + /// Used to track the state of PaginationKey + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaginationKeyOption { get; private set; } + + /// + /// Use this value in the `pagination_key` parameter to request the next page of search results. + /// + /// Use this value in the `pagination_key` parameter to request the next page of search results. + [JsonPropertyName("pagination_key")] + public string PaginationKey { get { return this.PaginationKeyOption; } set { this.PaginationKeyOption = new Option(value); } } + + /// + /// Used to track the state of TotalHits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalHitsOption { get; private set; } + + /// + /// This value represents the total number of events matching the search query, up to the limit provided in the `total_hits` query parameter. Only present if the `total_hits` query parameter was provided. + /// + /// This value represents the total number of events matching the search query, up to the limit provided in the `total_hits` query parameter. Only present if the `total_hits` query parameter was provided. + [JsonPropertyName("total_hits")] + public long? TotalHits { get { return this.TotalHitsOption; } set { this.TotalHitsOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EventSearch {\n"); + sb.Append(" Events: ").Append(Events).Append("\n"); + sb.Append(" PaginationKey: ").Append(PaginationKey).Append("\n"); + sb.Append(" TotalHits: ").Append(TotalHits).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class EventSearchJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EventSearch Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> events = default; + Option paginationKey = default; + Option totalHits = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "events": + events = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pagination_key": + paginationKey = new Option(utf8JsonReader.GetString()); + break; + case "total_hits": + totalHits = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (!events.IsSet) + throw new ArgumentException("Property is required for class EventSearch.", nameof(events)); + + if (events.IsSet && events.Value == null) + throw new ArgumentNullException(nameof(events), "Property is not nullable for class EventSearch."); + + if (paginationKey.IsSet && paginationKey.Value == null) + throw new ArgumentNullException(nameof(paginationKey), "Property is not nullable for class EventSearch."); + + if (totalHits.IsSet && totalHits.Value == null) + throw new ArgumentNullException(nameof(totalHits), "Property is not nullable for class EventSearch."); + + return new EventSearch(events.Value, paginationKey, totalHits); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EventSearch eventSearch, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, eventSearch, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EventSearch eventSearch, JsonSerializerOptions jsonSerializerOptions) + { + if (eventSearch.Events == null) + throw new ArgumentNullException(nameof(eventSearch.Events), "Property is required for class EventSearch."); + + if (eventSearch.PaginationKeyOption.IsSet && eventSearch.PaginationKey == null) + throw new ArgumentNullException(nameof(eventSearch.PaginationKey), "Property is required for class EventSearch."); + + writer.WritePropertyName("events"); + JsonSerializer.Serialize(writer, eventSearch.Events, jsonSerializerOptions); + if (eventSearch.PaginationKeyOption.IsSet) + writer.WriteString("pagination_key", eventSearch.PaginationKey); + + if (eventSearch.TotalHitsOption.IsSet) + writer.WriteNumber("total_hits", eventSearch.TotalHitsOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/EventUpdate.cs b/src/Fingerprint.ServerSdk/Model/EventUpdate.cs new file mode 100644 index 0000000..bf82886 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/EventUpdate.cs @@ -0,0 +1,226 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// EventUpdate + /// + public partial class EventUpdate : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Linked Id value to assign to the existing event + /// A customer-provided value or an object that was sent with the identification request or updated later. + /// Suspect flag indicating observed suspicious or fraudulent event + [JsonConstructor] + public EventUpdate(Option linkedId = default, Option> tags = default, Option suspect = default) + { + LinkedIdOption = linkedId; + TagsOption = tags; + SuspectOption = suspect; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of LinkedId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LinkedIdOption { get; private set; } + + /// + /// Linked Id value to assign to the existing event + /// + /// Linked Id value to assign to the existing event + [JsonPropertyName("linked_id")] + public string LinkedId { get { return this.LinkedIdOption; } set { this.LinkedIdOption = new Option(value); } } + + /// + /// Used to track the state of Tags + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> TagsOption { get; private set; } + + /// + /// A customer-provided value or an object that was sent with the identification request or updated later. + /// + /// A customer-provided value or an object that was sent with the identification request or updated later. + [JsonPropertyName("tags")] + public Dictionary Tags { get { return this.TagsOption; } set { this.TagsOption = new Option>(value); } } + + /// + /// Used to track the state of Suspect + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SuspectOption { get; private set; } + + /// + /// Suspect flag indicating observed suspicious or fraudulent event + /// + /// Suspect flag indicating observed suspicious or fraudulent event + [JsonPropertyName("suspect")] + public bool? Suspect { get { return this.SuspectOption; } set { this.SuspectOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EventUpdate {\n"); + sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Suspect: ").Append(Suspect).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class EventUpdateJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EventUpdate Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option linkedId = default; + Option> tags = default; + Option suspect = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "linked_id": + linkedId = new Option(utf8JsonReader.GetString()); + break; + case "tags": + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "suspect": + suspect = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (linkedId.IsSet && linkedId.Value == null) + throw new ArgumentNullException(nameof(linkedId), "Property is not nullable for class EventUpdate."); + + if (tags.IsSet && tags.Value == null) + throw new ArgumentNullException(nameof(tags), "Property is not nullable for class EventUpdate."); + + if (suspect.IsSet && suspect.Value == null) + throw new ArgumentNullException(nameof(suspect), "Property is not nullable for class EventUpdate."); + + return new EventUpdate(linkedId, tags, suspect); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EventUpdate eventUpdate, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, eventUpdate, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EventUpdate eventUpdate, JsonSerializerOptions jsonSerializerOptions) + { + if (eventUpdate.LinkedIdOption.IsSet && eventUpdate.LinkedId == null) + throw new ArgumentNullException(nameof(eventUpdate.LinkedId), "Property is required for class EventUpdate."); + + if (eventUpdate.TagsOption.IsSet && eventUpdate.Tags == null) + throw new ArgumentNullException(nameof(eventUpdate.Tags), "Property is required for class EventUpdate."); + + if (eventUpdate.LinkedIdOption.IsSet) + writer.WriteString("linked_id", eventUpdate.LinkedId); + + if (eventUpdate.TagsOption.IsSet) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, eventUpdate.Tags, jsonSerializerOptions); + } + if (eventUpdate.SuspectOption.IsSet) + writer.WriteBoolean("suspect", eventUpdate.SuspectOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Geolocation.cs b/src/Fingerprint.ServerSdk/Model/Geolocation.cs new file mode 100644 index 0000000..ca07f65 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Geolocation.cs @@ -0,0 +1,512 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Geolocation + /// + public partial class Geolocation : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The IP address is likely to be within this radius (in km) of the specified location. + /// latitude + /// longitude + /// postalCode + /// timezone + /// cityName + /// countryCode + /// countryName + /// continentCode + /// continentName + /// subdivisions + [JsonConstructor] + public Geolocation(Option accuracyRadius = default, Option latitude = default, Option longitude = default, Option postalCode = default, Option timezone = default, Option cityName = default, Option countryCode = default, Option countryName = default, Option continentCode = default, Option continentName = default, Option> subdivisions = default) + { + AccuracyRadiusOption = accuracyRadius; + LatitudeOption = latitude; + LongitudeOption = longitude; + PostalCodeOption = postalCode; + TimezoneOption = timezone; + CityNameOption = cityName; + CountryCodeOption = countryCode; + CountryNameOption = countryName; + ContinentCodeOption = continentCode; + ContinentNameOption = continentName; + SubdivisionsOption = subdivisions; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of AccuracyRadius + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccuracyRadiusOption { get; private set; } + + /// + /// The IP address is likely to be within this radius (in km) of the specified location. + /// + /// The IP address is likely to be within this radius (in km) of the specified location. + [JsonPropertyName("accuracy_radius")] + public int? AccuracyRadius { get { return this.AccuracyRadiusOption; } set { this.AccuracyRadiusOption = new Option(value); } } + + /// + /// Used to track the state of Latitude + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LatitudeOption { get; private set; } + + /// + /// Gets or Sets Latitude + /// + [JsonPropertyName("latitude")] + public double? Latitude { get { return this.LatitudeOption; } set { this.LatitudeOption = new Option(value); } } + + /// + /// Used to track the state of Longitude + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LongitudeOption { get; private set; } + + /// + /// Gets or Sets Longitude + /// + [JsonPropertyName("longitude")] + public double? Longitude { get { return this.LongitudeOption; } set { this.LongitudeOption = new Option(value); } } + + /// + /// Used to track the state of PostalCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PostalCodeOption { get; private set; } + + /// + /// Gets or Sets PostalCode + /// + [JsonPropertyName("postal_code")] + public string PostalCode { get { return this.PostalCodeOption; } set { this.PostalCodeOption = new Option(value); } } + + /// + /// Used to track the state of Timezone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TimezoneOption { get; private set; } + + /// + /// Gets or Sets Timezone + /// + [JsonPropertyName("timezone")] + public string Timezone { get { return this.TimezoneOption; } set { this.TimezoneOption = new Option(value); } } + + /// + /// Used to track the state of CityName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CityNameOption { get; private set; } + + /// + /// Gets or Sets CityName + /// + [JsonPropertyName("city_name")] + public string CityName { get { return this.CityNameOption; } set { this.CityNameOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } + + /// + /// Gets or Sets CountryCode + /// + [JsonPropertyName("country_code")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of CountryName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryNameOption { get; private set; } + + /// + /// Gets or Sets CountryName + /// + [JsonPropertyName("country_name")] + public string CountryName { get { return this.CountryNameOption; } set { this.CountryNameOption = new Option(value); } } + + /// + /// Used to track the state of ContinentCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ContinentCodeOption { get; private set; } + + /// + /// Gets or Sets ContinentCode + /// + [JsonPropertyName("continent_code")] + public string ContinentCode { get { return this.ContinentCodeOption; } set { this.ContinentCodeOption = new Option(value); } } + + /// + /// Used to track the state of ContinentName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ContinentNameOption { get; private set; } + + /// + /// Gets or Sets ContinentName + /// + [JsonPropertyName("continent_name")] + public string ContinentName { get { return this.ContinentNameOption; } set { this.ContinentNameOption = new Option(value); } } + + /// + /// Used to track the state of Subdivisions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SubdivisionsOption { get; private set; } + + /// + /// Gets or Sets Subdivisions + /// + [JsonPropertyName("subdivisions")] + public List Subdivisions { get { return this.SubdivisionsOption; } set { this.SubdivisionsOption = new Option>(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Geolocation {\n"); + sb.Append(" AccuracyRadius: ").Append(AccuracyRadius).Append("\n"); + sb.Append(" Latitude: ").Append(Latitude).Append("\n"); + sb.Append(" Longitude: ").Append(Longitude).Append("\n"); + sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); + sb.Append(" Timezone: ").Append(Timezone).Append("\n"); + sb.Append(" CityName: ").Append(CityName).Append("\n"); + sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); + sb.Append(" CountryName: ").Append(CountryName).Append("\n"); + sb.Append(" ContinentCode: ").Append(ContinentCode).Append("\n"); + sb.Append(" ContinentName: ").Append(ContinentName).Append("\n"); + sb.Append(" Subdivisions: ").Append(Subdivisions).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // AccuracyRadius (int) minimum + if (this.AccuracyRadiusOption.IsSet && this.AccuracyRadiusOption.Value < (int)0) + { + yield return new ValidationResult("Invalid value for AccuracyRadius, must be a value greater than or equal to 0.", new [] { "AccuracyRadius" }); + } + + // Latitude (double) maximum + if (this.LatitudeOption.IsSet && this.LatitudeOption.Value > (double)90) + { + yield return new ValidationResult("Invalid value for Latitude, must be a value less than or equal to 90.", new [] { "Latitude" }); + } + + // Latitude (double) minimum + if (this.LatitudeOption.IsSet && this.LatitudeOption.Value < (double)-90) + { + yield return new ValidationResult("Invalid value for Latitude, must be a value greater than or equal to -90.", new [] { "Latitude" }); + } + + // Longitude (double) maximum + if (this.LongitudeOption.IsSet && this.LongitudeOption.Value > (double)180) + { + yield return new ValidationResult("Invalid value for Longitude, must be a value less than or equal to 180.", new [] { "Longitude" }); + } + + // Longitude (double) minimum + if (this.LongitudeOption.IsSet && this.LongitudeOption.Value < (double)-180) + { + yield return new ValidationResult("Invalid value for Longitude, must be a value greater than or equal to -180.", new [] { "Longitude" }); + } + + // CountryCode (string) maxLength + if (this.CountryCode != null && this.CountryCode.Length > 2) + { + yield return new ValidationResult("Invalid value for CountryCode, length must be less than 2.", new [] { "CountryCode" }); + } + + // CountryCode (string) minLength + if (this.CountryCode != null && this.CountryCode.Length < 2) + { + yield return new ValidationResult("Invalid value for CountryCode, length must be greater than 2.", new [] { "CountryCode" }); + } + + // ContinentCode (string) maxLength + if (this.ContinentCode != null && this.ContinentCode.Length > 2) + { + yield return new ValidationResult("Invalid value for ContinentCode, length must be less than 2.", new [] { "ContinentCode" }); + } + + // ContinentCode (string) minLength + if (this.ContinentCode != null && this.ContinentCode.Length < 2) + { + yield return new ValidationResult("Invalid value for ContinentCode, length must be greater than 2.", new [] { "ContinentCode" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class GeolocationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Geolocation Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accuracyRadius = default; + Option latitude = default; + Option longitude = default; + Option postalCode = default; + Option timezone = default; + Option cityName = default; + Option countryCode = default; + Option countryName = default; + Option continentCode = default; + Option continentName = default; + Option> subdivisions = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "accuracy_radius": + accuracyRadius = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); + break; + case "latitude": + latitude = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); + break; + case "longitude": + longitude = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); + break; + case "postal_code": + postalCode = new Option(utf8JsonReader.GetString()); + break; + case "timezone": + timezone = new Option(utf8JsonReader.GetString()); + break; + case "city_name": + cityName = new Option(utf8JsonReader.GetString()); + break; + case "country_code": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "country_name": + countryName = new Option(utf8JsonReader.GetString()); + break; + case "continent_code": + continentCode = new Option(utf8JsonReader.GetString()); + break; + case "continent_name": + continentName = new Option(utf8JsonReader.GetString()); + break; + case "subdivisions": + subdivisions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (accuracyRadius.IsSet && accuracyRadius.Value == null) + throw new ArgumentNullException(nameof(accuracyRadius), "Property is not nullable for class Geolocation."); + + if (latitude.IsSet && latitude.Value == null) + throw new ArgumentNullException(nameof(latitude), "Property is not nullable for class Geolocation."); + + if (longitude.IsSet && longitude.Value == null) + throw new ArgumentNullException(nameof(longitude), "Property is not nullable for class Geolocation."); + + if (postalCode.IsSet && postalCode.Value == null) + throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class Geolocation."); + + if (timezone.IsSet && timezone.Value == null) + throw new ArgumentNullException(nameof(timezone), "Property is not nullable for class Geolocation."); + + if (cityName.IsSet && cityName.Value == null) + throw new ArgumentNullException(nameof(cityName), "Property is not nullable for class Geolocation."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class Geolocation."); + + if (countryName.IsSet && countryName.Value == null) + throw new ArgumentNullException(nameof(countryName), "Property is not nullable for class Geolocation."); + + if (continentCode.IsSet && continentCode.Value == null) + throw new ArgumentNullException(nameof(continentCode), "Property is not nullable for class Geolocation."); + + if (continentName.IsSet && continentName.Value == null) + throw new ArgumentNullException(nameof(continentName), "Property is not nullable for class Geolocation."); + + if (subdivisions.IsSet && subdivisions.Value == null) + throw new ArgumentNullException(nameof(subdivisions), "Property is not nullable for class Geolocation."); + + return new Geolocation(accuracyRadius, latitude, longitude, postalCode, timezone, cityName, countryCode, countryName, continentCode, continentName, subdivisions); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Geolocation geolocation, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, geolocation, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Geolocation geolocation, JsonSerializerOptions jsonSerializerOptions) + { + if (geolocation.PostalCodeOption.IsSet && geolocation.PostalCode == null) + throw new ArgumentNullException(nameof(geolocation.PostalCode), "Property is required for class Geolocation."); + + if (geolocation.TimezoneOption.IsSet && geolocation.Timezone == null) + throw new ArgumentNullException(nameof(geolocation.Timezone), "Property is required for class Geolocation."); + + if (geolocation.CityNameOption.IsSet && geolocation.CityName == null) + throw new ArgumentNullException(nameof(geolocation.CityName), "Property is required for class Geolocation."); + + if (geolocation.CountryCodeOption.IsSet && geolocation.CountryCode == null) + throw new ArgumentNullException(nameof(geolocation.CountryCode), "Property is required for class Geolocation."); + + if (geolocation.CountryNameOption.IsSet && geolocation.CountryName == null) + throw new ArgumentNullException(nameof(geolocation.CountryName), "Property is required for class Geolocation."); + + if (geolocation.ContinentCodeOption.IsSet && geolocation.ContinentCode == null) + throw new ArgumentNullException(nameof(geolocation.ContinentCode), "Property is required for class Geolocation."); + + if (geolocation.ContinentNameOption.IsSet && geolocation.ContinentName == null) + throw new ArgumentNullException(nameof(geolocation.ContinentName), "Property is required for class Geolocation."); + + if (geolocation.SubdivisionsOption.IsSet && geolocation.Subdivisions == null) + throw new ArgumentNullException(nameof(geolocation.Subdivisions), "Property is required for class Geolocation."); + + if (geolocation.AccuracyRadiusOption.IsSet) + writer.WriteNumber("accuracy_radius", geolocation.AccuracyRadiusOption.Value.Value); + + if (geolocation.LatitudeOption.IsSet) + writer.WriteNumber("latitude", geolocation.LatitudeOption.Value.Value); + + if (geolocation.LongitudeOption.IsSet) + writer.WriteNumber("longitude", geolocation.LongitudeOption.Value.Value); + + if (geolocation.PostalCodeOption.IsSet) + writer.WriteString("postal_code", geolocation.PostalCode); + + if (geolocation.TimezoneOption.IsSet) + writer.WriteString("timezone", geolocation.Timezone); + + if (geolocation.CityNameOption.IsSet) + writer.WriteString("city_name", geolocation.CityName); + + if (geolocation.CountryCodeOption.IsSet) + writer.WriteString("country_code", geolocation.CountryCode); + + if (geolocation.CountryNameOption.IsSet) + writer.WriteString("country_name", geolocation.CountryName); + + if (geolocation.ContinentCodeOption.IsSet) + writer.WriteString("continent_code", geolocation.ContinentCode); + + if (geolocation.ContinentNameOption.IsSet) + writer.WriteString("continent_name", geolocation.ContinentName); + + if (geolocation.SubdivisionsOption.IsSet) + { + writer.WritePropertyName("subdivisions"); + JsonSerializer.Serialize(writer, geolocation.Subdivisions, jsonSerializerOptions); + } + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/GeolocationSubdivisionsInner.cs b/src/Fingerprint.ServerSdk/Model/GeolocationSubdivisionsInner.cs new file mode 100644 index 0000000..547e5aa --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/GeolocationSubdivisionsInner.cs @@ -0,0 +1,185 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// GeolocationSubdivisionsInner + /// + public partial class GeolocationSubdivisionsInner : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// isoCode + /// name + [JsonConstructor] + public GeolocationSubdivisionsInner(string isoCode, string name) + { + IsoCode = isoCode; + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets IsoCode + /// + [JsonPropertyName("iso_code")] + public string IsoCode { get; set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GeolocationSubdivisionsInner {\n"); + sb.Append(" IsoCode: ").Append(IsoCode).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class GeolocationSubdivisionsInnerJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GeolocationSubdivisionsInner Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option isoCode = default; + Option name = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "iso_code": + isoCode = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!isoCode.IsSet) + throw new ArgumentException("Property is required for class GeolocationSubdivisionsInner.", nameof(isoCode)); + + if (!name.IsSet) + throw new ArgumentException("Property is required for class GeolocationSubdivisionsInner.", nameof(name)); + + if (isoCode.IsSet && isoCode.Value == null) + throw new ArgumentNullException(nameof(isoCode), "Property is not nullable for class GeolocationSubdivisionsInner."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class GeolocationSubdivisionsInner."); + + return new GeolocationSubdivisionsInner(isoCode.Value, name.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GeolocationSubdivisionsInner geolocationSubdivisionsInner, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, geolocationSubdivisionsInner, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GeolocationSubdivisionsInner geolocationSubdivisionsInner, JsonSerializerOptions jsonSerializerOptions) + { + if (geolocationSubdivisionsInner.IsoCode == null) + throw new ArgumentNullException(nameof(geolocationSubdivisionsInner.IsoCode), "Property is required for class GeolocationSubdivisionsInner."); + + if (geolocationSubdivisionsInner.Name == null) + throw new ArgumentNullException(nameof(geolocationSubdivisionsInner.Name), "Property is required for class GeolocationSubdivisionsInner."); + + writer.WriteString("iso_code", geolocationSubdivisionsInner.IsoCode); + + writer.WriteString("name", geolocationSubdivisionsInner.Name); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/IPBlockList.cs b/src/Fingerprint.ServerSdk/Model/IPBlockList.cs new file mode 100644 index 0000000..442a7a9 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/IPBlockList.cs @@ -0,0 +1,218 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// IPBlockList + /// + public partial class IPBlockList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// IP address was part of a known email spam attack (SMTP). + /// IP address was part of a known network attack (SSH/HTTPS). + /// IP address was part of known TOR network activity. + [JsonConstructor] + public IPBlockList(Option emailSpam = default, Option attackSource = default, Option torNode = default) + { + EmailSpamOption = emailSpam; + AttackSourceOption = attackSource; + TorNodeOption = torNode; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of EmailSpam + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EmailSpamOption { get; private set; } + + /// + /// IP address was part of a known email spam attack (SMTP). + /// + /// IP address was part of a known email spam attack (SMTP). + [JsonPropertyName("email_spam")] + public bool? EmailSpam { get { return this.EmailSpamOption; } set { this.EmailSpamOption = new Option(value); } } + + /// + /// Used to track the state of AttackSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AttackSourceOption { get; private set; } + + /// + /// IP address was part of a known network attack (SSH/HTTPS). + /// + /// IP address was part of a known network attack (SSH/HTTPS). + [JsonPropertyName("attack_source")] + public bool? AttackSource { get { return this.AttackSourceOption; } set { this.AttackSourceOption = new Option(value); } } + + /// + /// Used to track the state of TorNode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TorNodeOption { get; private set; } + + /// + /// IP address was part of known TOR network activity. + /// + /// IP address was part of known TOR network activity. + [JsonPropertyName("tor_node")] + public bool? TorNode { get { return this.TorNodeOption; } set { this.TorNodeOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IPBlockList {\n"); + sb.Append(" EmailSpam: ").Append(EmailSpam).Append("\n"); + sb.Append(" AttackSource: ").Append(AttackSource).Append("\n"); + sb.Append(" TorNode: ").Append(TorNode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IPBlockListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IPBlockList Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option emailSpam = default; + Option attackSource = default; + Option torNode = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "email_spam": + emailSpam = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "attack_source": + attackSource = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "tor_node": + torNode = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (emailSpam.IsSet && emailSpam.Value == null) + throw new ArgumentNullException(nameof(emailSpam), "Property is not nullable for class IPBlockList."); + + if (attackSource.IsSet && attackSource.Value == null) + throw new ArgumentNullException(nameof(attackSource), "Property is not nullable for class IPBlockList."); + + if (torNode.IsSet && torNode.Value == null) + throw new ArgumentNullException(nameof(torNode), "Property is not nullable for class IPBlockList."); + + return new IPBlockList(emailSpam, attackSource, torNode); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IPBlockList iPBlockList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, iPBlockList, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IPBlockList iPBlockList, JsonSerializerOptions jsonSerializerOptions) + { + if (iPBlockList.EmailSpamOption.IsSet) + writer.WriteBoolean("email_spam", iPBlockList.EmailSpamOption.Value.Value); + + if (iPBlockList.AttackSourceOption.IsSet) + writer.WriteBoolean("attack_source", iPBlockList.AttackSourceOption.Value.Value); + + if (iPBlockList.TorNodeOption.IsSet) + writer.WriteBoolean("tor_node", iPBlockList.TorNodeOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/IPInfo.cs b/src/Fingerprint.ServerSdk/Model/IPInfo.cs new file mode 100644 index 0000000..044e373 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/IPInfo.cs @@ -0,0 +1,200 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Details about the request IP address. Has separate fields for v4 and v6 IP address versions. + /// + public partial class IPInfo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// v4 + /// v6 + [JsonConstructor] + public IPInfo(Option v4 = default, Option v6 = default) + { + V4Option = v4; + V6Option = v6; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of V4 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option V4Option { get; private set; } + + /// + /// Gets or Sets V4 + /// + [JsonPropertyName("v4")] + public IPInfoV4 V4 { get { return this.V4Option; } set { this.V4Option = new Option(value); } } + + /// + /// Used to track the state of V6 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option V6Option { get; private set; } + + /// + /// Gets or Sets V6 + /// + [JsonPropertyName("v6")] + public IPInfoV6 V6 { get { return this.V6Option; } set { this.V6Option = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IPInfo {\n"); + sb.Append(" V4: ").Append(V4).Append("\n"); + sb.Append(" V6: ").Append(V6).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IPInfoJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IPInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option v4 = default; + Option v6 = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "v4": + v4 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "v6": + v6 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (v4.IsSet && v4.Value == null) + throw new ArgumentNullException(nameof(v4), "Property is not nullable for class IPInfo."); + + if (v6.IsSet && v6.Value == null) + throw new ArgumentNullException(nameof(v6), "Property is not nullable for class IPInfo."); + + return new IPInfo(v4, v6); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IPInfo iPInfo, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, iPInfo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IPInfo iPInfo, JsonSerializerOptions jsonSerializerOptions) + { + if (iPInfo.V4Option.IsSet && iPInfo.V4 == null) + throw new ArgumentNullException(nameof(iPInfo.V4), "Property is required for class IPInfo."); + + if (iPInfo.V6Option.IsSet && iPInfo.V6 == null) + throw new ArgumentNullException(nameof(iPInfo.V6), "Property is required for class IPInfo."); + + if (iPInfo.V4Option.IsSet) + { + writer.WritePropertyName("v4"); + JsonSerializer.Serialize(writer, iPInfo.V4, jsonSerializerOptions); + } + if (iPInfo.V6Option.IsSet) + { + writer.WritePropertyName("v6"); + JsonSerializer.Serialize(writer, iPInfo.V6, jsonSerializerOptions); + } + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/IPInfoV4.cs b/src/Fingerprint.ServerSdk/Model/IPInfoV4.cs new file mode 100644 index 0000000..722165f --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/IPInfoV4.cs @@ -0,0 +1,334 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// IPInfoV4 + /// + public partial class IPInfoV4 : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// address + /// geolocation + /// asn + /// asnName + /// asnNetwork + /// datacenterResult + /// datacenterName + [JsonConstructor] + public IPInfoV4(string address, Option geolocation = default, Option asn = default, Option asnName = default, Option asnNetwork = default, Option datacenterResult = default, Option datacenterName = default) + { + Address = address; + GeolocationOption = geolocation; + AsnOption = asn; + AsnNameOption = asnName; + AsnNetworkOption = asnNetwork; + DatacenterResultOption = datacenterResult; + DatacenterNameOption = datacenterName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Address + /// + [JsonPropertyName("address")] + public string Address { get; set; } + + /// + /// Used to track the state of Geolocation + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GeolocationOption { get; private set; } + + /// + /// Gets or Sets Geolocation + /// + [JsonPropertyName("geolocation")] + public Geolocation Geolocation { get { return this.GeolocationOption; } set { this.GeolocationOption = new Option(value); } } + + /// + /// Used to track the state of Asn + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AsnOption { get; private set; } + + /// + /// Gets or Sets Asn + /// + [JsonPropertyName("asn")] + public string Asn { get { return this.AsnOption; } set { this.AsnOption = new Option(value); } } + + /// + /// Used to track the state of AsnName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AsnNameOption { get; private set; } + + /// + /// Gets or Sets AsnName + /// + [JsonPropertyName("asn_name")] + public string AsnName { get { return this.AsnNameOption; } set { this.AsnNameOption = new Option(value); } } + + /// + /// Used to track the state of AsnNetwork + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AsnNetworkOption { get; private set; } + + /// + /// Gets or Sets AsnNetwork + /// + [JsonPropertyName("asn_network")] + public string AsnNetwork { get { return this.AsnNetworkOption; } set { this.AsnNetworkOption = new Option(value); } } + + /// + /// Used to track the state of DatacenterResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DatacenterResultOption { get; private set; } + + /// + /// Gets or Sets DatacenterResult + /// + [JsonPropertyName("datacenter_result")] + public bool? DatacenterResult { get { return this.DatacenterResultOption; } set { this.DatacenterResultOption = new Option(value); } } + + /// + /// Used to track the state of DatacenterName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DatacenterNameOption { get; private set; } + + /// + /// Gets or Sets DatacenterName + /// + [JsonPropertyName("datacenter_name")] + public string DatacenterName { get { return this.DatacenterNameOption; } set { this.DatacenterNameOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IPInfoV4 {\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" Geolocation: ").Append(Geolocation).Append("\n"); + sb.Append(" Asn: ").Append(Asn).Append("\n"); + sb.Append(" AsnName: ").Append(AsnName).Append("\n"); + sb.Append(" AsnNetwork: ").Append(AsnNetwork).Append("\n"); + sb.Append(" DatacenterResult: ").Append(DatacenterResult).Append("\n"); + sb.Append(" DatacenterName: ").Append(DatacenterName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IPInfoV4JsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IPInfoV4 Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option address = default; + Option geolocation = default; + Option asn = default; + Option asnName = default; + Option asnNetwork = default; + Option datacenterResult = default; + Option datacenterName = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "address": + address = new Option(utf8JsonReader.GetString()); + break; + case "geolocation": + geolocation = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "asn": + asn = new Option(utf8JsonReader.GetString()); + break; + case "asn_name": + asnName = new Option(utf8JsonReader.GetString()); + break; + case "asn_network": + asnNetwork = new Option(utf8JsonReader.GetString()); + break; + case "datacenter_result": + datacenterResult = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "datacenter_name": + datacenterName = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!address.IsSet) + throw new ArgumentException("Property is required for class IPInfoV4.", nameof(address)); + + if (address.IsSet && address.Value == null) + throw new ArgumentNullException(nameof(address), "Property is not nullable for class IPInfoV4."); + + if (geolocation.IsSet && geolocation.Value == null) + throw new ArgumentNullException(nameof(geolocation), "Property is not nullable for class IPInfoV4."); + + if (asn.IsSet && asn.Value == null) + throw new ArgumentNullException(nameof(asn), "Property is not nullable for class IPInfoV4."); + + if (asnName.IsSet && asnName.Value == null) + throw new ArgumentNullException(nameof(asnName), "Property is not nullable for class IPInfoV4."); + + if (asnNetwork.IsSet && asnNetwork.Value == null) + throw new ArgumentNullException(nameof(asnNetwork), "Property is not nullable for class IPInfoV4."); + + if (datacenterResult.IsSet && datacenterResult.Value == null) + throw new ArgumentNullException(nameof(datacenterResult), "Property is not nullable for class IPInfoV4."); + + if (datacenterName.IsSet && datacenterName.Value == null) + throw new ArgumentNullException(nameof(datacenterName), "Property is not nullable for class IPInfoV4."); + + return new IPInfoV4(address.Value, geolocation, asn, asnName, asnNetwork, datacenterResult, datacenterName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IPInfoV4 iPInfoV4, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, iPInfoV4, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IPInfoV4 iPInfoV4, JsonSerializerOptions jsonSerializerOptions) + { + if (iPInfoV4.Address == null) + throw new ArgumentNullException(nameof(iPInfoV4.Address), "Property is required for class IPInfoV4."); + + if (iPInfoV4.GeolocationOption.IsSet && iPInfoV4.Geolocation == null) + throw new ArgumentNullException(nameof(iPInfoV4.Geolocation), "Property is required for class IPInfoV4."); + + if (iPInfoV4.AsnOption.IsSet && iPInfoV4.Asn == null) + throw new ArgumentNullException(nameof(iPInfoV4.Asn), "Property is required for class IPInfoV4."); + + if (iPInfoV4.AsnNameOption.IsSet && iPInfoV4.AsnName == null) + throw new ArgumentNullException(nameof(iPInfoV4.AsnName), "Property is required for class IPInfoV4."); + + if (iPInfoV4.AsnNetworkOption.IsSet && iPInfoV4.AsnNetwork == null) + throw new ArgumentNullException(nameof(iPInfoV4.AsnNetwork), "Property is required for class IPInfoV4."); + + if (iPInfoV4.DatacenterNameOption.IsSet && iPInfoV4.DatacenterName == null) + throw new ArgumentNullException(nameof(iPInfoV4.DatacenterName), "Property is required for class IPInfoV4."); + + writer.WriteString("address", iPInfoV4.Address); + + if (iPInfoV4.GeolocationOption.IsSet) + { + writer.WritePropertyName("geolocation"); + JsonSerializer.Serialize(writer, iPInfoV4.Geolocation, jsonSerializerOptions); + } + if (iPInfoV4.AsnOption.IsSet) + writer.WriteString("asn", iPInfoV4.Asn); + + if (iPInfoV4.AsnNameOption.IsSet) + writer.WriteString("asn_name", iPInfoV4.AsnName); + + if (iPInfoV4.AsnNetworkOption.IsSet) + writer.WriteString("asn_network", iPInfoV4.AsnNetwork); + + if (iPInfoV4.DatacenterResultOption.IsSet) + writer.WriteBoolean("datacenter_result", iPInfoV4.DatacenterResultOption.Value.Value); + + if (iPInfoV4.DatacenterNameOption.IsSet) + writer.WriteString("datacenter_name", iPInfoV4.DatacenterName); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/IPInfoV6.cs b/src/Fingerprint.ServerSdk/Model/IPInfoV6.cs new file mode 100644 index 0000000..dc512c9 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/IPInfoV6.cs @@ -0,0 +1,334 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// IPInfoV6 + /// + public partial class IPInfoV6 : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// address + /// geolocation + /// asn + /// asnName + /// asnNetwork + /// datacenterResult + /// datacenterName + [JsonConstructor] + public IPInfoV6(string address, Option geolocation = default, Option asn = default, Option asnName = default, Option asnNetwork = default, Option datacenterResult = default, Option datacenterName = default) + { + Address = address; + GeolocationOption = geolocation; + AsnOption = asn; + AsnNameOption = asnName; + AsnNetworkOption = asnNetwork; + DatacenterResultOption = datacenterResult; + DatacenterNameOption = datacenterName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Address + /// + [JsonPropertyName("address")] + public string Address { get; set; } + + /// + /// Used to track the state of Geolocation + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GeolocationOption { get; private set; } + + /// + /// Gets or Sets Geolocation + /// + [JsonPropertyName("geolocation")] + public Geolocation Geolocation { get { return this.GeolocationOption; } set { this.GeolocationOption = new Option(value); } } + + /// + /// Used to track the state of Asn + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AsnOption { get; private set; } + + /// + /// Gets or Sets Asn + /// + [JsonPropertyName("asn")] + public string Asn { get { return this.AsnOption; } set { this.AsnOption = new Option(value); } } + + /// + /// Used to track the state of AsnName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AsnNameOption { get; private set; } + + /// + /// Gets or Sets AsnName + /// + [JsonPropertyName("asn_name")] + public string AsnName { get { return this.AsnNameOption; } set { this.AsnNameOption = new Option(value); } } + + /// + /// Used to track the state of AsnNetwork + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AsnNetworkOption { get; private set; } + + /// + /// Gets or Sets AsnNetwork + /// + [JsonPropertyName("asn_network")] + public string AsnNetwork { get { return this.AsnNetworkOption; } set { this.AsnNetworkOption = new Option(value); } } + + /// + /// Used to track the state of DatacenterResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DatacenterResultOption { get; private set; } + + /// + /// Gets or Sets DatacenterResult + /// + [JsonPropertyName("datacenter_result")] + public bool? DatacenterResult { get { return this.DatacenterResultOption; } set { this.DatacenterResultOption = new Option(value); } } + + /// + /// Used to track the state of DatacenterName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DatacenterNameOption { get; private set; } + + /// + /// Gets or Sets DatacenterName + /// + [JsonPropertyName("datacenter_name")] + public string DatacenterName { get { return this.DatacenterNameOption; } set { this.DatacenterNameOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IPInfoV6 {\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" Geolocation: ").Append(Geolocation).Append("\n"); + sb.Append(" Asn: ").Append(Asn).Append("\n"); + sb.Append(" AsnName: ").Append(AsnName).Append("\n"); + sb.Append(" AsnNetwork: ").Append(AsnNetwork).Append("\n"); + sb.Append(" DatacenterResult: ").Append(DatacenterResult).Append("\n"); + sb.Append(" DatacenterName: ").Append(DatacenterName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IPInfoV6JsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IPInfoV6 Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option address = default; + Option geolocation = default; + Option asn = default; + Option asnName = default; + Option asnNetwork = default; + Option datacenterResult = default; + Option datacenterName = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "address": + address = new Option(utf8JsonReader.GetString()); + break; + case "geolocation": + geolocation = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "asn": + asn = new Option(utf8JsonReader.GetString()); + break; + case "asn_name": + asnName = new Option(utf8JsonReader.GetString()); + break; + case "asn_network": + asnNetwork = new Option(utf8JsonReader.GetString()); + break; + case "datacenter_result": + datacenterResult = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "datacenter_name": + datacenterName = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!address.IsSet) + throw new ArgumentException("Property is required for class IPInfoV6.", nameof(address)); + + if (address.IsSet && address.Value == null) + throw new ArgumentNullException(nameof(address), "Property is not nullable for class IPInfoV6."); + + if (geolocation.IsSet && geolocation.Value == null) + throw new ArgumentNullException(nameof(geolocation), "Property is not nullable for class IPInfoV6."); + + if (asn.IsSet && asn.Value == null) + throw new ArgumentNullException(nameof(asn), "Property is not nullable for class IPInfoV6."); + + if (asnName.IsSet && asnName.Value == null) + throw new ArgumentNullException(nameof(asnName), "Property is not nullable for class IPInfoV6."); + + if (asnNetwork.IsSet && asnNetwork.Value == null) + throw new ArgumentNullException(nameof(asnNetwork), "Property is not nullable for class IPInfoV6."); + + if (datacenterResult.IsSet && datacenterResult.Value == null) + throw new ArgumentNullException(nameof(datacenterResult), "Property is not nullable for class IPInfoV6."); + + if (datacenterName.IsSet && datacenterName.Value == null) + throw new ArgumentNullException(nameof(datacenterName), "Property is not nullable for class IPInfoV6."); + + return new IPInfoV6(address.Value, geolocation, asn, asnName, asnNetwork, datacenterResult, datacenterName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IPInfoV6 iPInfoV6, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, iPInfoV6, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IPInfoV6 iPInfoV6, JsonSerializerOptions jsonSerializerOptions) + { + if (iPInfoV6.Address == null) + throw new ArgumentNullException(nameof(iPInfoV6.Address), "Property is required for class IPInfoV6."); + + if (iPInfoV6.GeolocationOption.IsSet && iPInfoV6.Geolocation == null) + throw new ArgumentNullException(nameof(iPInfoV6.Geolocation), "Property is required for class IPInfoV6."); + + if (iPInfoV6.AsnOption.IsSet && iPInfoV6.Asn == null) + throw new ArgumentNullException(nameof(iPInfoV6.Asn), "Property is required for class IPInfoV6."); + + if (iPInfoV6.AsnNameOption.IsSet && iPInfoV6.AsnName == null) + throw new ArgumentNullException(nameof(iPInfoV6.AsnName), "Property is required for class IPInfoV6."); + + if (iPInfoV6.AsnNetworkOption.IsSet && iPInfoV6.AsnNetwork == null) + throw new ArgumentNullException(nameof(iPInfoV6.AsnNetwork), "Property is required for class IPInfoV6."); + + if (iPInfoV6.DatacenterNameOption.IsSet && iPInfoV6.DatacenterName == null) + throw new ArgumentNullException(nameof(iPInfoV6.DatacenterName), "Property is required for class IPInfoV6."); + + writer.WriteString("address", iPInfoV6.Address); + + if (iPInfoV6.GeolocationOption.IsSet) + { + writer.WritePropertyName("geolocation"); + JsonSerializer.Serialize(writer, iPInfoV6.Geolocation, jsonSerializerOptions); + } + if (iPInfoV6.AsnOption.IsSet) + writer.WriteString("asn", iPInfoV6.Asn); + + if (iPInfoV6.AsnNameOption.IsSet) + writer.WriteString("asn_name", iPInfoV6.AsnName); + + if (iPInfoV6.AsnNetworkOption.IsSet) + writer.WriteString("asn_network", iPInfoV6.AsnNetwork); + + if (iPInfoV6.DatacenterResultOption.IsSet) + writer.WriteBoolean("datacenter_result", iPInfoV6.DatacenterResultOption.Value.Value); + + if (iPInfoV6.DatacenterNameOption.IsSet) + writer.WriteString("datacenter_name", iPInfoV6.DatacenterName); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Identification.cs b/src/Fingerprint.ServerSdk/Model/Identification.cs new file mode 100644 index 0000000..6d4dd95 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Identification.cs @@ -0,0 +1,269 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Identification + /// + public partial class Identification : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. + /// Attribute represents if a visitor had been identified before. + /// confidence + /// Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + /// Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + [JsonConstructor] + public Identification(string visitorId, bool visitorFound, Option confidence = default, Option firstSeenAt = default, Option lastSeenAt = default) + { + VisitorId = visitorId; + VisitorFound = visitorFound; + ConfidenceOption = confidence; + FirstSeenAtOption = firstSeenAt; + LastSeenAtOption = lastSeenAt; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. + /// + /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. + [JsonPropertyName("visitor_id")] + public string VisitorId { get; set; } + + /// + /// Attribute represents if a visitor had been identified before. + /// + /// Attribute represents if a visitor had been identified before. + [JsonPropertyName("visitor_found")] + public bool VisitorFound { get; set; } + + /// + /// Used to track the state of Confidence + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ConfidenceOption { get; private set; } + + /// + /// Gets or Sets Confidence + /// + [JsonPropertyName("confidence")] + public IdentificationConfidence Confidence { get { return this.ConfidenceOption; } set { this.ConfidenceOption = new Option(value); } } + + /// + /// Used to track the state of FirstSeenAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstSeenAtOption { get; private set; } + + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + [JsonPropertyName("first_seen_at")] + public long? FirstSeenAt { get { return this.FirstSeenAtOption; } set { this.FirstSeenAtOption = new Option(value); } } + + /// + /// Used to track the state of LastSeenAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastSeenAtOption { get; private set; } + + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + [JsonPropertyName("last_seen_at")] + public long? LastSeenAt { get { return this.LastSeenAtOption; } set { this.LastSeenAtOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Identification {\n"); + sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); + sb.Append(" VisitorFound: ").Append(VisitorFound).Append("\n"); + sb.Append(" Confidence: ").Append(Confidence).Append("\n"); + sb.Append(" FirstSeenAt: ").Append(FirstSeenAt).Append("\n"); + sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IdentificationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Identification Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option visitorId = default; + Option visitorFound = default; + Option confidence = default; + Option firstSeenAt = default; + Option lastSeenAt = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "visitor_id": + visitorId = new Option(utf8JsonReader.GetString()); + break; + case "visitor_found": + visitorFound = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "confidence": + confidence = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "first_seen_at": + firstSeenAt = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + case "last_seen_at": + lastSeenAt = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (!visitorId.IsSet) + throw new ArgumentException("Property is required for class Identification.", nameof(visitorId)); + + if (!visitorFound.IsSet) + throw new ArgumentException("Property is required for class Identification.", nameof(visitorFound)); + + if (visitorId.IsSet && visitorId.Value == null) + throw new ArgumentNullException(nameof(visitorId), "Property is not nullable for class Identification."); + + if (visitorFound.IsSet && visitorFound.Value == null) + throw new ArgumentNullException(nameof(visitorFound), "Property is not nullable for class Identification."); + + if (confidence.IsSet && confidence.Value == null) + throw new ArgumentNullException(nameof(confidence), "Property is not nullable for class Identification."); + + if (firstSeenAt.IsSet && firstSeenAt.Value == null) + throw new ArgumentNullException(nameof(firstSeenAt), "Property is not nullable for class Identification."); + + if (lastSeenAt.IsSet && lastSeenAt.Value == null) + throw new ArgumentNullException(nameof(lastSeenAt), "Property is not nullable for class Identification."); + + return new Identification(visitorId.Value, visitorFound.Value.Value, confidence, firstSeenAt, lastSeenAt); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Identification identification, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, identification, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Identification identification, JsonSerializerOptions jsonSerializerOptions) + { + if (identification.VisitorId == null) + throw new ArgumentNullException(nameof(identification.VisitorId), "Property is required for class Identification."); + + if (identification.ConfidenceOption.IsSet && identification.Confidence == null) + throw new ArgumentNullException(nameof(identification.Confidence), "Property is required for class Identification."); + + writer.WriteString("visitor_id", identification.VisitorId); + + writer.WriteBoolean("visitor_found", identification.VisitorFound); + + if (identification.ConfidenceOption.IsSet) + { + writer.WritePropertyName("confidence"); + JsonSerializer.Serialize(writer, identification.Confidence, jsonSerializerOptions); + } + if (identification.FirstSeenAtOption.IsSet) + writer.WriteNumber("first_seen_at", identification.FirstSeenAtOption.Value.Value); + + if (identification.LastSeenAtOption.IsSet) + writer.WriteNumber("last_seen_at", identification.LastSeenAtOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/IdentificationConfidence.cs b/src/Fingerprint.ServerSdk/Model/IdentificationConfidence.cs new file mode 100644 index 0000000..43948cc --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/IdentificationConfidence.cs @@ -0,0 +1,230 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// IdentificationConfidence + /// + public partial class IdentificationConfidence : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. + /// The version name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. + /// comment + [JsonConstructor] + public IdentificationConfidence(double score, Option varVersion = default, Option comment = default) + { + Score = score; + VarVersionOption = varVersion; + CommentOption = comment; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. + /// + /// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. + [JsonPropertyName("score")] + public double Score { get; set; } + + /// + /// Used to track the state of VarVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VarVersionOption { get; private set; } + + /// + /// The version name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. + /// + /// The version name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. + [JsonPropertyName("version")] + public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } + + /// + /// Used to track the state of Comment + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CommentOption { get; private set; } + + /// + /// Gets or Sets Comment + /// + [JsonPropertyName("comment")] + public string Comment { get { return this.CommentOption; } set { this.CommentOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IdentificationConfidence {\n"); + sb.Append(" Score: ").Append(Score).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Score (double) maximum + if (this.Score > (double)1) + { + yield return new ValidationResult("Invalid value for Score, must be a value less than or equal to 1.", new [] { "Score" }); + } + + // Score (double) minimum + if (this.Score < (double)0) + { + yield return new ValidationResult("Invalid value for Score, must be a value greater than or equal to 0.", new [] { "Score" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IdentificationConfidenceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IdentificationConfidence Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option score = default; + Option varVersion = default; + Option comment = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "score": + score = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); + break; + case "version": + varVersion = new Option(utf8JsonReader.GetString()); + break; + case "comment": + comment = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!score.IsSet) + throw new ArgumentException("Property is required for class IdentificationConfidence.", nameof(score)); + + if (score.IsSet && score.Value == null) + throw new ArgumentNullException(nameof(score), "Property is not nullable for class IdentificationConfidence."); + + if (varVersion.IsSet && varVersion.Value == null) + throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class IdentificationConfidence."); + + if (comment.IsSet && comment.Value == null) + throw new ArgumentNullException(nameof(comment), "Property is not nullable for class IdentificationConfidence."); + + return new IdentificationConfidence(score.Value.Value, varVersion, comment); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IdentificationConfidence identificationConfidence, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, identificationConfidence, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IdentificationConfidence identificationConfidence, JsonSerializerOptions jsonSerializerOptions) + { + if (identificationConfidence.VarVersionOption.IsSet && identificationConfidence.VarVersion == null) + throw new ArgumentNullException(nameof(identificationConfidence.VarVersion), "Property is required for class IdentificationConfidence."); + + if (identificationConfidence.CommentOption.IsSet && identificationConfidence.Comment == null) + throw new ArgumentNullException(nameof(identificationConfidence.Comment), "Property is required for class IdentificationConfidence."); + + writer.WriteNumber("score", identificationConfidence.Score); + + if (identificationConfidence.VarVersionOption.IsSet) + writer.WriteString("version", identificationConfidence.VarVersion); + + if (identificationConfidence.CommentOption.IsSet) + writer.WriteString("comment", identificationConfidence.Comment); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Integration.cs b/src/Fingerprint.ServerSdk/Model/Integration.cs new file mode 100644 index 0000000..4ae6355 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Integration.cs @@ -0,0 +1,236 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Integration + /// + public partial class Integration : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The name of the specific integration, e.g. \"fingerprint-pro-react\". + /// The version of the specific integration, e.g. \"3.11.10\". + /// subintegration + [JsonConstructor] + public Integration(Option name = default, Option varVersion = default, Option subintegration = default) + { + NameOption = name; + VarVersionOption = varVersion; + SubintegrationOption = subintegration; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// The name of the specific integration, e.g. \"fingerprint-pro-react\". + /// + /// The name of the specific integration, e.g. \"fingerprint-pro-react\". + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of VarVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VarVersionOption { get; private set; } + + /// + /// The version of the specific integration, e.g. \"3.11.10\". + /// + /// The version of the specific integration, e.g. \"3.11.10\". + [JsonPropertyName("version")] + public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } + + /// + /// Used to track the state of Subintegration + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubintegrationOption { get; private set; } + + /// + /// Gets or Sets Subintegration + /// + [JsonPropertyName("subintegration")] + public IntegrationSubintegration Subintegration { get { return this.SubintegrationOption; } set { this.SubintegrationOption = new Option(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Integration {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append(" Subintegration: ").Append(Subintegration).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IntegrationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Integration Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option name = default; + Option varVersion = default; + Option subintegration = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "version": + varVersion = new Option(utf8JsonReader.GetString()); + break; + case "subintegration": + subintegration = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Integration."); + + if (varVersion.IsSet && varVersion.Value == null) + throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class Integration."); + + if (subintegration.IsSet && subintegration.Value == null) + throw new ArgumentNullException(nameof(subintegration), "Property is not nullable for class Integration."); + + return new Integration(name, varVersion, subintegration); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Integration integration, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, integration, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Integration integration, JsonSerializerOptions jsonSerializerOptions) + { + if (integration.NameOption.IsSet && integration.Name == null) + throw new ArgumentNullException(nameof(integration.Name), "Property is required for class Integration."); + + if (integration.VarVersionOption.IsSet && integration.VarVersion == null) + throw new ArgumentNullException(nameof(integration.VarVersion), "Property is required for class Integration."); + + if (integration.SubintegrationOption.IsSet && integration.Subintegration == null) + throw new ArgumentNullException(nameof(integration.Subintegration), "Property is required for class Integration."); + + if (integration.NameOption.IsSet) + writer.WriteString("name", integration.Name); + + if (integration.VarVersionOption.IsSet) + writer.WriteString("version", integration.VarVersion); + + if (integration.SubintegrationOption.IsSet) + { + writer.WritePropertyName("subintegration"); + JsonSerializer.Serialize(writer, integration.Subintegration, jsonSerializerOptions); + } + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/IntegrationSubintegration.cs b/src/Fingerprint.ServerSdk/Model/IntegrationSubintegration.cs new file mode 100644 index 0000000..811e632 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/IntegrationSubintegration.cs @@ -0,0 +1,197 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// IntegrationSubintegration + /// + public partial class IntegrationSubintegration : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The name of the specific subintegration, e.g. \"preact\". + /// The version of the specific subintegration, e.g. \"10.21.0\". + [JsonConstructor] + public IntegrationSubintegration(Option name = default, Option varVersion = default) + { + NameOption = name; + VarVersionOption = varVersion; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// The name of the specific subintegration, e.g. \"preact\". + /// + /// The name of the specific subintegration, e.g. \"preact\". + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of VarVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VarVersionOption { get; private set; } + + /// + /// The version of the specific subintegration, e.g. \"10.21.0\". + /// + /// The version of the specific subintegration, e.g. \"10.21.0\". + [JsonPropertyName("version")] + public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IntegrationSubintegration {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class IntegrationSubintegrationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IntegrationSubintegration Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option name = default; + Option varVersion = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "version": + varVersion = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class IntegrationSubintegration."); + + if (varVersion.IsSet && varVersion.Value == null) + throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class IntegrationSubintegration."); + + return new IntegrationSubintegration(name, varVersion); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IntegrationSubintegration integrationSubintegration, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, integrationSubintegration, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IntegrationSubintegration integrationSubintegration, JsonSerializerOptions jsonSerializerOptions) + { + if (integrationSubintegration.NameOption.IsSet && integrationSubintegration.Name == null) + throw new ArgumentNullException(nameof(integrationSubintegration.Name), "Property is required for class IntegrationSubintegration."); + + if (integrationSubintegration.VarVersionOption.IsSet && integrationSubintegration.VarVersion == null) + throw new ArgumentNullException(nameof(integrationSubintegration.VarVersion), "Property is required for class IntegrationSubintegration."); + + if (integrationSubintegration.NameOption.IsSet) + writer.WriteString("name", integrationSubintegration.Name); + + if (integrationSubintegration.VarVersionOption.IsSet) + writer.WriteString("version", integrationSubintegration.VarVersion); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Proximity.cs b/src/Fingerprint.ServerSdk/Model/Proximity.cs new file mode 100644 index 0000000..07f834e --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Proximity.cs @@ -0,0 +1,355 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. + /// + public partial class Proximity : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// A stable privacy-preserving identifier for a given proximity zone. + /// The radius of the proximity zone’s precision level, in meters. + /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. + [JsonConstructor] + public Proximity(string id, PrecisionRadiusEnum precisionRadius, float confidence) + { + Id = id; + PrecisionRadius = precisionRadius; + Confidence = confidence; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The radius of the proximity zone’s precision level, in meters. + /// + /// The radius of the proximity zone’s precision level, in meters. + public enum PrecisionRadiusEnum + { + /// + /// Enum NUMBER_10 for value: 10 + /// + NUMBER_10 = 10, + + /// + /// Enum NUMBER_25 for value: 25 + /// + NUMBER_25 = 25, + + /// + /// Enum NUMBER_65 for value: 65 + /// + NUMBER_65 = 65, + + /// + /// Enum NUMBER_175 for value: 175 + /// + NUMBER_175 = 175, + + /// + /// Enum NUMBER_450 for value: 450 + /// + NUMBER_450 = 450, + + /// + /// Enum NUMBER_1200 for value: 1200 + /// + NUMBER_1200 = 1200, + + /// + /// Enum NUMBER_3300 for value: 3300 + /// + NUMBER_3300 = 3300, + + /// + /// Enum NUMBER_8500 for value: 8500 + /// + NUMBER_8500 = 8500, + + /// + /// Enum NUMBER_22500 for value: 22500 + /// + NUMBER_22500 = 22500 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PrecisionRadiusEnum PrecisionRadiusEnumFromString(string value) + { + if (value.Equals((10).ToString())) + return PrecisionRadiusEnum.NUMBER_10; + + if (value.Equals((25).ToString())) + return PrecisionRadiusEnum.NUMBER_25; + + if (value.Equals((65).ToString())) + return PrecisionRadiusEnum.NUMBER_65; + + if (value.Equals((175).ToString())) + return PrecisionRadiusEnum.NUMBER_175; + + if (value.Equals((450).ToString())) + return PrecisionRadiusEnum.NUMBER_450; + + if (value.Equals((1200).ToString())) + return PrecisionRadiusEnum.NUMBER_1200; + + if (value.Equals((3300).ToString())) + return PrecisionRadiusEnum.NUMBER_3300; + + if (value.Equals((8500).ToString())) + return PrecisionRadiusEnum.NUMBER_8500; + + if (value.Equals((22500).ToString())) + return PrecisionRadiusEnum.NUMBER_22500; + + throw new NotImplementedException($"Could not convert value to type PrecisionRadiusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static PrecisionRadiusEnum? PrecisionRadiusEnumFromStringOrDefault(string value) + { + if (value.Equals((10).ToString())) + return PrecisionRadiusEnum.NUMBER_10; + + if (value.Equals((25).ToString())) + return PrecisionRadiusEnum.NUMBER_25; + + if (value.Equals((65).ToString())) + return PrecisionRadiusEnum.NUMBER_65; + + if (value.Equals((175).ToString())) + return PrecisionRadiusEnum.NUMBER_175; + + if (value.Equals((450).ToString())) + return PrecisionRadiusEnum.NUMBER_450; + + if (value.Equals((1200).ToString())) + return PrecisionRadiusEnum.NUMBER_1200; + + if (value.Equals((3300).ToString())) + return PrecisionRadiusEnum.NUMBER_3300; + + if (value.Equals((8500).ToString())) + return PrecisionRadiusEnum.NUMBER_8500; + + if (value.Equals((22500).ToString())) + return PrecisionRadiusEnum.NUMBER_22500; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int PrecisionRadiusEnumToJsonValue(PrecisionRadiusEnum value) + { + return (int) value; + } + + /// + /// The radius of the proximity zone’s precision level, in meters. + /// + /// The radius of the proximity zone’s precision level, in meters. + [JsonPropertyName("precision_radius")] + public PrecisionRadiusEnum PrecisionRadius { get; set; } + + /// + /// A stable privacy-preserving identifier for a given proximity zone. + /// + /// A stable privacy-preserving identifier for a given proximity zone. + [JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. + /// + /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. + [JsonPropertyName("confidence")] + public float Confidence { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Proximity {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PrecisionRadius: ").Append(PrecisionRadius).Append("\n"); + sb.Append(" Confidence: ").Append(Confidence).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Confidence (float) maximum + if (this.Confidence > (float)1) + { + yield return new ValidationResult("Invalid value for Confidence, must be a value less than or equal to 1.", new [] { "Confidence" }); + } + + // Confidence (float) minimum + if (this.Confidence < (float)0) + { + yield return new ValidationResult("Invalid value for Confidence, must be a value greater than or equal to 0.", new [] { "Confidence" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ProximityJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Proximity Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option id = default; + Option precisionRadius = default; + Option confidence = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "precision_radius": + precisionRadius = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Proximity.PrecisionRadiusEnum?)null : (Proximity.PrecisionRadiusEnum)utf8JsonReader.GetInt32()); + break; + case "confidence": + confidence = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); + break; + default: + break; + } + } + } + + if (!id.IsSet) + throw new ArgumentException("Property is required for class Proximity.", nameof(id)); + + if (!precisionRadius.IsSet) + throw new ArgumentException("Property is required for class Proximity.", nameof(precisionRadius)); + + if (!confidence.IsSet) + throw new ArgumentException("Property is required for class Proximity.", nameof(confidence)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Proximity."); + + if (precisionRadius.IsSet && precisionRadius.Value == null) + throw new ArgumentNullException(nameof(precisionRadius), "Property is not nullable for class Proximity."); + + if (confidence.IsSet && confidence.Value == null) + throw new ArgumentNullException(nameof(confidence), "Property is not nullable for class Proximity."); + + return new Proximity(id.Value, precisionRadius.Value.Value, confidence.Value.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Proximity proximity, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, proximity, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Proximity proximity, JsonSerializerOptions jsonSerializerOptions) + { + if (proximity.Id == null) + throw new ArgumentNullException(nameof(proximity.Id), "Property is required for class Proximity."); + + writer.WriteString("id", proximity.Id); + + writer.WriteNumber("precision_radius", Proximity.PrecisionRadiusEnumToJsonValue(proximity.PrecisionRadius)); + + writer.WriteNumber("confidence", proximity.Confidence); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/ProxyConfidence.cs b/src/Fingerprint.ServerSdk/Model/ProxyConfidence.cs new file mode 100644 index 0000000..239fe3b --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/ProxyConfidence.cs @@ -0,0 +1,188 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". + /// + /// Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". + public enum ProxyConfidence + { + /// + /// Enum Low for value: low + /// + Low = 1, + + /// + /// Enum Medium for value: medium + /// + Medium = 2, + + /// + /// Enum High for value: high + /// + High = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class ProxyConfidenceValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ProxyConfidence FromString(string value) + { + if (value.Equals("low")) + return ProxyConfidence.Low; + + if (value.Equals("medium")) + return ProxyConfidence.Medium; + + if (value.Equals("high")) + return ProxyConfidence.High; + + throw new NotImplementedException($"Could not convert value to type ProxyConfidence: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ProxyConfidence? FromStringOrDefault(string value) + { + if (value.Equals("low")) + return ProxyConfidence.Low; + + if (value.Equals("medium")) + return ProxyConfidence.Medium; + + if (value.Equals("high")) + return ProxyConfidence.High; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ProxyConfidence value) + { + if (value == ProxyConfidence.Low) + return "low"; + + if (value == ProxyConfidence.Medium) + return "medium"; + + if (value == ProxyConfidence.High) + return "high"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ProxyConfidenceJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ProxyConfidence Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ProxyConfidence? result = rawValue == null + ? null + : ProxyConfidenceValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ProxyConfidence to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ProxyConfidence proxyConfidence, JsonSerializerOptions options) + { + writer.WriteStringValue(ProxyConfidenceValueConverter.ToJsonValue(proxyConfidence).ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ProxyConfidenceNullableJsonConverter : JsonConverter + { + /// + /// Returns a ProxyConfidence from the Json object + /// + /// + /// + /// + /// + public override ProxyConfidence? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ProxyConfidence? result = rawValue == null + ? null + : ProxyConfidenceValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ProxyConfidence to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ProxyConfidence? proxyConfidence, JsonSerializerOptions options) + { + writer.WriteStringValue(proxyConfidence.HasValue ? ProxyConfidenceValueConverter.ToJsonValue(proxyConfidence.Value).ToString() : "null"); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/ProxyDetails.cs b/src/Fingerprint.ServerSdk/Model/ProxyDetails.cs new file mode 100644 index 0000000..1a4d6e3 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/ProxyDetails.cs @@ -0,0 +1,255 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Proxy detection details (present if `proxy` is `true`) + /// + public partial class ProxyDetails : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + /// Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy + [JsonConstructor] + public ProxyDetails(ProxyTypeEnum proxyType, Option lastSeenAt = default) + { + ProxyType = proxyType; + LastSeenAtOption = lastSeenAt; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + /// + /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + public enum ProxyTypeEnum + { + /// + /// Enum Residential for value: residential + /// + Residential = 1, + + /// + /// Enum DataCenter for value: data_center + /// + DataCenter = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ProxyTypeEnum ProxyTypeEnumFromString(string value) + { + if (value.Equals("residential")) + return ProxyTypeEnum.Residential; + + if (value.Equals("data_center")) + return ProxyTypeEnum.DataCenter; + + throw new NotImplementedException($"Could not convert value to type ProxyTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ProxyTypeEnum? ProxyTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("residential")) + return ProxyTypeEnum.Residential; + + if (value.Equals("data_center")) + return ProxyTypeEnum.DataCenter; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ProxyTypeEnumToJsonValue(ProxyTypeEnum value) + { + if (value == ProxyTypeEnum.Residential) + return "residential"; + + if (value == ProxyTypeEnum.DataCenter) + return "data_center"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + /// + /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + [JsonPropertyName("proxy_type")] + public ProxyTypeEnum ProxyType { get; set; } + + /// + /// Used to track the state of LastSeenAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastSeenAtOption { get; private set; } + + /// + /// Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy + /// + /// Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy + [JsonPropertyName("last_seen_at")] + public long? LastSeenAt { get { return this.LastSeenAtOption; } set { this.LastSeenAtOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ProxyDetails {\n"); + sb.Append(" ProxyType: ").Append(ProxyType).Append("\n"); + sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ProxyDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ProxyDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option proxyType = default; + Option lastSeenAt = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "proxy_type": + string proxyTypeRawValue = utf8JsonReader.GetString(); + if (proxyTypeRawValue != null) + proxyType = new Option(ProxyDetails.ProxyTypeEnumFromStringOrDefault(proxyTypeRawValue)); + break; + case "last_seen_at": + lastSeenAt = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (!proxyType.IsSet) + throw new ArgumentException("Property is required for class ProxyDetails.", nameof(proxyType)); + + if (proxyType.IsSet && proxyType.Value == null) + throw new ArgumentNullException(nameof(proxyType), "Property is not nullable for class ProxyDetails."); + + if (lastSeenAt.IsSet && lastSeenAt.Value == null) + throw new ArgumentNullException(nameof(lastSeenAt), "Property is not nullable for class ProxyDetails."); + + return new ProxyDetails(proxyType.Value.Value, lastSeenAt); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ProxyDetails proxyDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, proxyDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ProxyDetails proxyDetails, JsonSerializerOptions jsonSerializerOptions) + { + var proxyTypeRawValue = ProxyDetails.ProxyTypeEnumToJsonValue(proxyDetails.ProxyType); + writer.WriteString("proxy_type", proxyTypeRawValue); + if (proxyDetails.LastSeenAtOption.IsSet) + writer.WriteNumber("last_seen_at", proxyDetails.LastSeenAtOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/SDK.cs b/src/Fingerprint.ServerSdk/Model/SDK.cs new file mode 100644 index 0000000..d0cc7db --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/SDK.cs @@ -0,0 +1,313 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Contains information about the SDK used to perform the request. + /// + public partial class SDK : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Platform of the SDK used for the identification request. + /// Version string of the SDK used for the identification request. For example: `\"3.12.1\"` + /// integrations + [JsonConstructor] + public SDK(PlatformEnum platform, string varVersion, Option> integrations = default) + { + Platform = platform; + VarVersion = varVersion; + IntegrationsOption = integrations; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Platform of the SDK used for the identification request. + /// + /// Platform of the SDK used for the identification request. + public enum PlatformEnum + { + /// + /// Enum Js for value: js + /// + Js = 1, + + /// + /// Enum Android for value: android + /// + Android = 2, + + /// + /// Enum Ios for value: ios + /// + Ios = 3, + + /// + /// Enum Unknown for value: unknown + /// + Unknown = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PlatformEnum PlatformEnumFromString(string value) + { + if (value.Equals("js")) + return PlatformEnum.Js; + + if (value.Equals("android")) + return PlatformEnum.Android; + + if (value.Equals("ios")) + return PlatformEnum.Ios; + + if (value.Equals("unknown")) + return PlatformEnum.Unknown; + + throw new NotImplementedException($"Could not convert value to type PlatformEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static PlatformEnum? PlatformEnumFromStringOrDefault(string value) + { + if (value.Equals("js")) + return PlatformEnum.Js; + + if (value.Equals("android")) + return PlatformEnum.Android; + + if (value.Equals("ios")) + return PlatformEnum.Ios; + + if (value.Equals("unknown")) + return PlatformEnum.Unknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PlatformEnumToJsonValue(PlatformEnum value) + { + if (value == PlatformEnum.Js) + return "js"; + + if (value == PlatformEnum.Android) + return "android"; + + if (value == PlatformEnum.Ios) + return "ios"; + + if (value == PlatformEnum.Unknown) + return "unknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Platform of the SDK used for the identification request. + /// + /// Platform of the SDK used for the identification request. + [JsonPropertyName("platform")] + public PlatformEnum Platform { get; set; } + + /// + /// Version string of the SDK used for the identification request. For example: `\"3.12.1\"` + /// + /// Version string of the SDK used for the identification request. For example: `\"3.12.1\"` + [JsonPropertyName("version")] + public string VarVersion { get; set; } + + /// + /// Used to track the state of Integrations + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> IntegrationsOption { get; private set; } + + /// + /// Gets or Sets Integrations + /// + [JsonPropertyName("integrations")] + public List Integrations { get { return this.IntegrationsOption; } set { this.IntegrationsOption = new Option>(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SDK {\n"); + sb.Append(" Platform: ").Append(Platform).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append(" Integrations: ").Append(Integrations).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class SDKJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SDK Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option platform = default; + Option varVersion = default; + Option> integrations = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "platform": + string platformRawValue = utf8JsonReader.GetString(); + if (platformRawValue != null) + platform = new Option(SDK.PlatformEnumFromStringOrDefault(platformRawValue)); + break; + case "version": + varVersion = new Option(utf8JsonReader.GetString()); + break; + case "integrations": + integrations = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!platform.IsSet) + throw new ArgumentException("Property is required for class SDK.", nameof(platform)); + + if (!varVersion.IsSet) + throw new ArgumentException("Property is required for class SDK.", nameof(varVersion)); + + if (platform.IsSet && platform.Value == null) + throw new ArgumentNullException(nameof(platform), "Property is not nullable for class SDK."); + + if (varVersion.IsSet && varVersion.Value == null) + throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class SDK."); + + if (integrations.IsSet && integrations.Value == null) + throw new ArgumentNullException(nameof(integrations), "Property is not nullable for class SDK."); + + return new SDK(platform.Value.Value, varVersion.Value, integrations); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SDK sDK, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, sDK, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SDK sDK, JsonSerializerOptions jsonSerializerOptions) + { + if (sDK.VarVersion == null) + throw new ArgumentNullException(nameof(sDK.VarVersion), "Property is required for class SDK."); + + if (sDK.IntegrationsOption.IsSet && sDK.Integrations == null) + throw new ArgumentNullException(nameof(sDK.Integrations), "Property is required for class SDK."); + + var platformRawValue = SDK.PlatformEnumToJsonValue(sDK.Platform); + writer.WriteString("platform", platformRawValue); + writer.WriteString("version", sDK.VarVersion); + + if (sDK.IntegrationsOption.IsSet) + { + writer.WritePropertyName("integrations"); + JsonSerializer.Serialize(writer, sDK.Integrations, jsonSerializerOptions); + } + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/SupplementaryIDHighRecall.cs b/src/Fingerprint.ServerSdk/Model/SupplementaryIDHighRecall.cs new file mode 100644 index 0000000..016e01d --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/SupplementaryIDHighRecall.cs @@ -0,0 +1,269 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// A supplementary browser identifier that prioritizes coverage over precision. The High Recall ID algorithm matches more generously, i.e., this identifier will remain the same even when there are subtle differences between two requests. This algorithm does not create as many new visitor IDs as the standard algorithms do, but there could be an increase in false-positive identification. + /// + public partial class SupplementaryIDHighRecall : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. + /// Attribute represents if a visitor had been identified before. + /// confidence + /// Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + /// Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + [JsonConstructor] + public SupplementaryIDHighRecall(string visitorId, bool visitorFound, Option confidence = default, Option firstSeenAt = default, Option lastSeenAt = default) + { + VisitorId = visitorId; + VisitorFound = visitorFound; + ConfidenceOption = confidence; + FirstSeenAtOption = firstSeenAt; + LastSeenAtOption = lastSeenAt; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. + /// + /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. + [JsonPropertyName("visitor_id")] + public string VisitorId { get; set; } + + /// + /// Attribute represents if a visitor had been identified before. + /// + /// Attribute represents if a visitor had been identified before. + [JsonPropertyName("visitor_found")] + public bool VisitorFound { get; set; } + + /// + /// Used to track the state of Confidence + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ConfidenceOption { get; private set; } + + /// + /// Gets or Sets Confidence + /// + [JsonPropertyName("confidence")] + public IdentificationConfidence Confidence { get { return this.ConfidenceOption; } set { this.ConfidenceOption = new Option(value); } } + + /// + /// Used to track the state of FirstSeenAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstSeenAtOption { get; private set; } + + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + [JsonPropertyName("first_seen_at")] + public long? FirstSeenAt { get { return this.FirstSeenAtOption; } set { this.FirstSeenAtOption = new Option(value); } } + + /// + /// Used to track the state of LastSeenAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastSeenAtOption { get; private set; } + + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + /// + /// Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + [JsonPropertyName("last_seen_at")] + public long? LastSeenAt { get { return this.LastSeenAtOption; } set { this.LastSeenAtOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SupplementaryIDHighRecall {\n"); + sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); + sb.Append(" VisitorFound: ").Append(VisitorFound).Append("\n"); + sb.Append(" Confidence: ").Append(Confidence).Append("\n"); + sb.Append(" FirstSeenAt: ").Append(FirstSeenAt).Append("\n"); + sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class SupplementaryIDHighRecallJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SupplementaryIDHighRecall Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option visitorId = default; + Option visitorFound = default; + Option confidence = default; + Option firstSeenAt = default; + Option lastSeenAt = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "visitor_id": + visitorId = new Option(utf8JsonReader.GetString()); + break; + case "visitor_found": + visitorFound = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "confidence": + confidence = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "first_seen_at": + firstSeenAt = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + case "last_seen_at": + lastSeenAt = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (!visitorId.IsSet) + throw new ArgumentException("Property is required for class SupplementaryIDHighRecall.", nameof(visitorId)); + + if (!visitorFound.IsSet) + throw new ArgumentException("Property is required for class SupplementaryIDHighRecall.", nameof(visitorFound)); + + if (visitorId.IsSet && visitorId.Value == null) + throw new ArgumentNullException(nameof(visitorId), "Property is not nullable for class SupplementaryIDHighRecall."); + + if (visitorFound.IsSet && visitorFound.Value == null) + throw new ArgumentNullException(nameof(visitorFound), "Property is not nullable for class SupplementaryIDHighRecall."); + + if (confidence.IsSet && confidence.Value == null) + throw new ArgumentNullException(nameof(confidence), "Property is not nullable for class SupplementaryIDHighRecall."); + + if (firstSeenAt.IsSet && firstSeenAt.Value == null) + throw new ArgumentNullException(nameof(firstSeenAt), "Property is not nullable for class SupplementaryIDHighRecall."); + + if (lastSeenAt.IsSet && lastSeenAt.Value == null) + throw new ArgumentNullException(nameof(lastSeenAt), "Property is not nullable for class SupplementaryIDHighRecall."); + + return new SupplementaryIDHighRecall(visitorId.Value, visitorFound.Value.Value, confidence, firstSeenAt, lastSeenAt); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SupplementaryIDHighRecall supplementaryIDHighRecall, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, supplementaryIDHighRecall, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SupplementaryIDHighRecall supplementaryIDHighRecall, JsonSerializerOptions jsonSerializerOptions) + { + if (supplementaryIDHighRecall.VisitorId == null) + throw new ArgumentNullException(nameof(supplementaryIDHighRecall.VisitorId), "Property is required for class SupplementaryIDHighRecall."); + + if (supplementaryIDHighRecall.ConfidenceOption.IsSet && supplementaryIDHighRecall.Confidence == null) + throw new ArgumentNullException(nameof(supplementaryIDHighRecall.Confidence), "Property is required for class SupplementaryIDHighRecall."); + + writer.WriteString("visitor_id", supplementaryIDHighRecall.VisitorId); + + writer.WriteBoolean("visitor_found", supplementaryIDHighRecall.VisitorFound); + + if (supplementaryIDHighRecall.ConfidenceOption.IsSet) + { + writer.WritePropertyName("confidence"); + JsonSerializer.Serialize(writer, supplementaryIDHighRecall.Confidence, jsonSerializerOptions); + } + if (supplementaryIDHighRecall.FirstSeenAtOption.IsSet) + writer.WriteNumber("first_seen_at", supplementaryIDHighRecall.FirstSeenAtOption.Value.Value); + + if (supplementaryIDHighRecall.LastSeenAtOption.IsSet) + writer.WriteNumber("last_seen_at", supplementaryIDHighRecall.LastSeenAtOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/TamperingDetails.cs b/src/Fingerprint.ServerSdk/Model/TamperingDetails.cs new file mode 100644 index 0000000..635b2e0 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/TamperingDetails.cs @@ -0,0 +1,203 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// TamperingDetails + /// + public partial class TamperingDetails : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. + /// True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. + [JsonConstructor] + public TamperingDetails(Option anomalyScore = default, Option antiDetectBrowser = default) + { + AnomalyScoreOption = anomalyScore; + AntiDetectBrowserOption = antiDetectBrowser; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of AnomalyScore + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AnomalyScoreOption { get; private set; } + + /// + /// Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. + /// + /// Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. + [JsonPropertyName("anomaly_score")] + public double? AnomalyScore { get { return this.AnomalyScoreOption; } set { this.AnomalyScoreOption = new Option(value); } } + + /// + /// Used to track the state of AntiDetectBrowser + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AntiDetectBrowserOption { get; private set; } + + /// + /// True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. + /// + /// True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. + [JsonPropertyName("anti_detect_browser")] + public bool? AntiDetectBrowser { get { return this.AntiDetectBrowserOption; } set { this.AntiDetectBrowserOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TamperingDetails {\n"); + sb.Append(" AnomalyScore: ").Append(AnomalyScore).Append("\n"); + sb.Append(" AntiDetectBrowser: ").Append(AntiDetectBrowser).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // AnomalyScore (double) maximum + if (this.AnomalyScoreOption.IsSet && this.AnomalyScoreOption.Value > (double)1) + { + yield return new ValidationResult("Invalid value for AnomalyScore, must be a value less than or equal to 1.", new [] { "AnomalyScore" }); + } + + // AnomalyScore (double) minimum + if (this.AnomalyScoreOption.IsSet && this.AnomalyScoreOption.Value < (double)0) + { + yield return new ValidationResult("Invalid value for AnomalyScore, must be a value greater than or equal to 0.", new [] { "AnomalyScore" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TamperingDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TamperingDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option anomalyScore = default; + Option antiDetectBrowser = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "anomaly_score": + anomalyScore = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); + break; + case "anti_detect_browser": + antiDetectBrowser = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (anomalyScore.IsSet && anomalyScore.Value == null) + throw new ArgumentNullException(nameof(anomalyScore), "Property is not nullable for class TamperingDetails."); + + if (antiDetectBrowser.IsSet && antiDetectBrowser.Value == null) + throw new ArgumentNullException(nameof(antiDetectBrowser), "Property is not nullable for class TamperingDetails."); + + return new TamperingDetails(anomalyScore, antiDetectBrowser); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TamperingDetails tamperingDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, tamperingDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, TamperingDetails tamperingDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (tamperingDetails.AnomalyScoreOption.IsSet) + writer.WriteNumber("anomaly_score", tamperingDetails.AnomalyScoreOption.Value.Value); + + if (tamperingDetails.AntiDetectBrowserOption.IsSet) + writer.WriteBoolean("anti_detect_browser", tamperingDetails.AntiDetectBrowserOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/TriggeredByInner.cs b/src/Fingerprint.ServerSdk/Model/TriggeredByInner.cs new file mode 100644 index 0000000..b203705 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/TriggeredByInner.cs @@ -0,0 +1,216 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// TriggeredByInner + /// + public partial class TriggeredByInner : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name + /// description + [JsonConstructor] + public TriggeredByInner(string id, string name, string description) + { + Id = id; + Name = name; + Description = description; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TriggeredByInner {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TriggeredByInnerJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TriggeredByInner Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option id = default; + Option name = default; + Option description = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!id.IsSet) + throw new ArgumentException("Property is required for class TriggeredByInner.", nameof(id)); + + if (!name.IsSet) + throw new ArgumentException("Property is required for class TriggeredByInner.", nameof(name)); + + if (!description.IsSet) + throw new ArgumentException("Property is required for class TriggeredByInner.", nameof(description)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class TriggeredByInner."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class TriggeredByInner."); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class TriggeredByInner."); + + return new TriggeredByInner(id.Value, name.Value, description.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TriggeredByInner triggeredByInner, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, triggeredByInner, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, TriggeredByInner triggeredByInner, JsonSerializerOptions jsonSerializerOptions) + { + if (triggeredByInner.Id == null) + throw new ArgumentNullException(nameof(triggeredByInner.Id), "Property is required for class TriggeredByInner."); + + if (triggeredByInner.Name == null) + throw new ArgumentNullException(nameof(triggeredByInner.Name), "Property is required for class TriggeredByInner."); + + if (triggeredByInner.Description == null) + throw new ArgumentNullException(nameof(triggeredByInner.Description), "Property is required for class TriggeredByInner."); + + writer.WriteString("id", triggeredByInner.Id); + + writer.WriteString("name", triggeredByInner.Name); + + writer.WriteString("description", triggeredByInner.Description); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/Velocity.cs b/src/Fingerprint.ServerSdk/Model/Velocity.cs new file mode 100644 index 0000000..c422f7f --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/Velocity.cs @@ -0,0 +1,355 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor Id. - Number of distinct linked Ids associated with the visitor Id. - Number of distinct countries associated with the visitor Id. - Number of identification events associated with the visitor Id. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked Id. - Number of distinct visitor Ids associated with the provided linked Id. The `24h` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24h']`) is higher than 20.000. All will not necessarily be returned in a response, some may be omitted if the associated event does not have the required data, such as a linked_id. + /// + public partial class Velocity : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// distinctIp + /// distinctLinkedId + /// distinctCountry + /// events + /// ipEvents + /// distinctIpByLinkedId + /// distinctVisitorIdByLinkedId + [JsonConstructor] + public Velocity(Option distinctIp = default, Option distinctLinkedId = default, Option distinctCountry = default, Option events = default, Option ipEvents = default, Option distinctIpByLinkedId = default, Option distinctVisitorIdByLinkedId = default) + { + DistinctIpOption = distinctIp; + DistinctLinkedIdOption = distinctLinkedId; + DistinctCountryOption = distinctCountry; + EventsOption = events; + IpEventsOption = ipEvents; + DistinctIpByLinkedIdOption = distinctIpByLinkedId; + DistinctVisitorIdByLinkedIdOption = distinctVisitorIdByLinkedId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DistinctIp + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DistinctIpOption { get; private set; } + + /// + /// Gets or Sets DistinctIp + /// + [JsonPropertyName("distinct_ip")] + public VelocityData DistinctIp { get { return this.DistinctIpOption; } set { this.DistinctIpOption = new Option(value); } } + + /// + /// Used to track the state of DistinctLinkedId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DistinctLinkedIdOption { get; private set; } + + /// + /// Gets or Sets DistinctLinkedId + /// + [JsonPropertyName("distinct_linked_id")] + public VelocityData DistinctLinkedId { get { return this.DistinctLinkedIdOption; } set { this.DistinctLinkedIdOption = new Option(value); } } + + /// + /// Used to track the state of DistinctCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DistinctCountryOption { get; private set; } + + /// + /// Gets or Sets DistinctCountry + /// + [JsonPropertyName("distinct_country")] + public VelocityData DistinctCountry { get { return this.DistinctCountryOption; } set { this.DistinctCountryOption = new Option(value); } } + + /// + /// Used to track the state of Events + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EventsOption { get; private set; } + + /// + /// Gets or Sets Events + /// + [JsonPropertyName("events")] + public VelocityData Events { get { return this.EventsOption; } set { this.EventsOption = new Option(value); } } + + /// + /// Used to track the state of IpEvents + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IpEventsOption { get; private set; } + + /// + /// Gets or Sets IpEvents + /// + [JsonPropertyName("ip_events")] + public VelocityData IpEvents { get { return this.IpEventsOption; } set { this.IpEventsOption = new Option(value); } } + + /// + /// Used to track the state of DistinctIpByLinkedId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DistinctIpByLinkedIdOption { get; private set; } + + /// + /// Gets or Sets DistinctIpByLinkedId + /// + [JsonPropertyName("distinct_ip_by_linked_id")] + public VelocityData DistinctIpByLinkedId { get { return this.DistinctIpByLinkedIdOption; } set { this.DistinctIpByLinkedIdOption = new Option(value); } } + + /// + /// Used to track the state of DistinctVisitorIdByLinkedId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DistinctVisitorIdByLinkedIdOption { get; private set; } + + /// + /// Gets or Sets DistinctVisitorIdByLinkedId + /// + [JsonPropertyName("distinct_visitor_id_by_linked_id")] + public VelocityData DistinctVisitorIdByLinkedId { get { return this.DistinctVisitorIdByLinkedIdOption; } set { this.DistinctVisitorIdByLinkedIdOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Velocity {\n"); + sb.Append(" DistinctIp: ").Append(DistinctIp).Append("\n"); + sb.Append(" DistinctLinkedId: ").Append(DistinctLinkedId).Append("\n"); + sb.Append(" DistinctCountry: ").Append(DistinctCountry).Append("\n"); + sb.Append(" Events: ").Append(Events).Append("\n"); + sb.Append(" IpEvents: ").Append(IpEvents).Append("\n"); + sb.Append(" DistinctIpByLinkedId: ").Append(DistinctIpByLinkedId).Append("\n"); + sb.Append(" DistinctVisitorIdByLinkedId: ").Append(DistinctVisitorIdByLinkedId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class VelocityJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Velocity Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option distinctIp = default; + Option distinctLinkedId = default; + Option distinctCountry = default; + Option events = default; + Option ipEvents = default; + Option distinctIpByLinkedId = default; + Option distinctVisitorIdByLinkedId = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "distinct_ip": + distinctIp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "distinct_linked_id": + distinctLinkedId = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "distinct_country": + distinctCountry = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "events": + events = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "ip_events": + ipEvents = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "distinct_ip_by_linked_id": + distinctIpByLinkedId = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "distinct_visitor_id_by_linked_id": + distinctVisitorIdByLinkedId = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (distinctIp.IsSet && distinctIp.Value == null) + throw new ArgumentNullException(nameof(distinctIp), "Property is not nullable for class Velocity."); + + if (distinctLinkedId.IsSet && distinctLinkedId.Value == null) + throw new ArgumentNullException(nameof(distinctLinkedId), "Property is not nullable for class Velocity."); + + if (distinctCountry.IsSet && distinctCountry.Value == null) + throw new ArgumentNullException(nameof(distinctCountry), "Property is not nullable for class Velocity."); + + if (events.IsSet && events.Value == null) + throw new ArgumentNullException(nameof(events), "Property is not nullable for class Velocity."); + + if (ipEvents.IsSet && ipEvents.Value == null) + throw new ArgumentNullException(nameof(ipEvents), "Property is not nullable for class Velocity."); + + if (distinctIpByLinkedId.IsSet && distinctIpByLinkedId.Value == null) + throw new ArgumentNullException(nameof(distinctIpByLinkedId), "Property is not nullable for class Velocity."); + + if (distinctVisitorIdByLinkedId.IsSet && distinctVisitorIdByLinkedId.Value == null) + throw new ArgumentNullException(nameof(distinctVisitorIdByLinkedId), "Property is not nullable for class Velocity."); + + return new Velocity(distinctIp, distinctLinkedId, distinctCountry, events, ipEvents, distinctIpByLinkedId, distinctVisitorIdByLinkedId); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Velocity velocity, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, velocity, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Velocity velocity, JsonSerializerOptions jsonSerializerOptions) + { + if (velocity.DistinctIpOption.IsSet && velocity.DistinctIp == null) + throw new ArgumentNullException(nameof(velocity.DistinctIp), "Property is required for class Velocity."); + + if (velocity.DistinctLinkedIdOption.IsSet && velocity.DistinctLinkedId == null) + throw new ArgumentNullException(nameof(velocity.DistinctLinkedId), "Property is required for class Velocity."); + + if (velocity.DistinctCountryOption.IsSet && velocity.DistinctCountry == null) + throw new ArgumentNullException(nameof(velocity.DistinctCountry), "Property is required for class Velocity."); + + if (velocity.EventsOption.IsSet && velocity.Events == null) + throw new ArgumentNullException(nameof(velocity.Events), "Property is required for class Velocity."); + + if (velocity.IpEventsOption.IsSet && velocity.IpEvents == null) + throw new ArgumentNullException(nameof(velocity.IpEvents), "Property is required for class Velocity."); + + if (velocity.DistinctIpByLinkedIdOption.IsSet && velocity.DistinctIpByLinkedId == null) + throw new ArgumentNullException(nameof(velocity.DistinctIpByLinkedId), "Property is required for class Velocity."); + + if (velocity.DistinctVisitorIdByLinkedIdOption.IsSet && velocity.DistinctVisitorIdByLinkedId == null) + throw new ArgumentNullException(nameof(velocity.DistinctVisitorIdByLinkedId), "Property is required for class Velocity."); + + if (velocity.DistinctIpOption.IsSet) + { + writer.WritePropertyName("distinct_ip"); + JsonSerializer.Serialize(writer, velocity.DistinctIp, jsonSerializerOptions); + } + if (velocity.DistinctLinkedIdOption.IsSet) + { + writer.WritePropertyName("distinct_linked_id"); + JsonSerializer.Serialize(writer, velocity.DistinctLinkedId, jsonSerializerOptions); + } + if (velocity.DistinctCountryOption.IsSet) + { + writer.WritePropertyName("distinct_country"); + JsonSerializer.Serialize(writer, velocity.DistinctCountry, jsonSerializerOptions); + } + if (velocity.EventsOption.IsSet) + { + writer.WritePropertyName("events"); + JsonSerializer.Serialize(writer, velocity.Events, jsonSerializerOptions); + } + if (velocity.IpEventsOption.IsSet) + { + writer.WritePropertyName("ip_events"); + JsonSerializer.Serialize(writer, velocity.IpEvents, jsonSerializerOptions); + } + if (velocity.DistinctIpByLinkedIdOption.IsSet) + { + writer.WritePropertyName("distinct_ip_by_linked_id"); + JsonSerializer.Serialize(writer, velocity.DistinctIpByLinkedId, jsonSerializerOptions); + } + if (velocity.DistinctVisitorIdByLinkedIdOption.IsSet) + { + writer.WritePropertyName("distinct_visitor_id_by_linked_id"); + JsonSerializer.Serialize(writer, velocity.DistinctVisitorIdByLinkedId, jsonSerializerOptions); + } + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/VelocityData.cs b/src/Fingerprint.ServerSdk/Model/VelocityData.cs new file mode 100644 index 0000000..0997f75 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/VelocityData.cs @@ -0,0 +1,208 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// Is absent if the velocity data could not be generated for the visitor Id. + /// + public partial class VelocityData : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Count for the last 5 minutes of velocity data, from the time of the event. + /// Count for the last 1 hour of velocity data, from the time of the event. + /// The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. + [JsonConstructor] + public VelocityData(int var5Minutes, int var1Hour, Option var24Hours = default) + { + Var5Minutes = var5Minutes; + Var1Hour = var1Hour; + Var24HoursOption = var24Hours; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Count for the last 5 minutes of velocity data, from the time of the event. + /// + /// Count for the last 5 minutes of velocity data, from the time of the event. + [JsonPropertyName("5_minutes")] + public int Var5Minutes { get; set; } + + /// + /// Count for the last 1 hour of velocity data, from the time of the event. + /// + /// Count for the last 1 hour of velocity data, from the time of the event. + [JsonPropertyName("1_hour")] + public int Var1Hour { get; set; } + + /// + /// Used to track the state of Var24Hours + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option Var24HoursOption { get; private set; } + + /// + /// The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. + /// + /// The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. + [JsonPropertyName("24_hours")] + public int? Var24Hours { get { return this.Var24HoursOption; } set { this.Var24HoursOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VelocityData {\n"); + sb.Append(" Var5Minutes: ").Append(Var5Minutes).Append("\n"); + sb.Append(" Var1Hour: ").Append(Var1Hour).Append("\n"); + sb.Append(" Var24Hours: ").Append(Var24Hours).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class VelocityDataJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override VelocityData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option var5Minutes = default; + Option var1Hour = default; + Option var24Hours = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "5_minutes": + var5Minutes = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); + break; + case "1_hour": + var1Hour = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); + break; + case "24_hours": + var24Hours = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!var5Minutes.IsSet) + throw new ArgumentException("Property is required for class VelocityData.", nameof(var5Minutes)); + + if (!var1Hour.IsSet) + throw new ArgumentException("Property is required for class VelocityData.", nameof(var1Hour)); + + if (var5Minutes.IsSet && var5Minutes.Value == null) + throw new ArgumentNullException(nameof(var5Minutes), "Property is not nullable for class VelocityData."); + + if (var1Hour.IsSet && var1Hour.Value == null) + throw new ArgumentNullException(nameof(var1Hour), "Property is not nullable for class VelocityData."); + + if (var24Hours.IsSet && var24Hours.Value == null) + throw new ArgumentNullException(nameof(var24Hours), "Property is not nullable for class VelocityData."); + + return new VelocityData(var5Minutes.Value.Value, var1Hour.Value.Value, var24Hours); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, VelocityData velocityData, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, velocityData, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, VelocityData velocityData, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteNumber("5_minutes", velocityData.Var5Minutes); + + writer.WriteNumber("1_hour", velocityData.Var1Hour); + + if (velocityData.Var24HoursOption.IsSet) + writer.WriteNumber("24_hours", velocityData.Var24HoursOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/VpnConfidence.cs b/src/Fingerprint.ServerSdk/Model/VpnConfidence.cs new file mode 100644 index 0000000..92756d6 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/VpnConfidence.cs @@ -0,0 +1,188 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. + /// + /// A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. + public enum VpnConfidence + { + /// + /// Enum Low for value: low + /// + Low = 1, + + /// + /// Enum Medium for value: medium + /// + Medium = 2, + + /// + /// Enum High for value: high + /// + High = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class VpnConfidenceValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static VpnConfidence FromString(string value) + { + if (value.Equals("low")) + return VpnConfidence.Low; + + if (value.Equals("medium")) + return VpnConfidence.Medium; + + if (value.Equals("high")) + return VpnConfidence.High; + + throw new NotImplementedException($"Could not convert value to type VpnConfidence: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static VpnConfidence? FromStringOrDefault(string value) + { + if (value.Equals("low")) + return VpnConfidence.Low; + + if (value.Equals("medium")) + return VpnConfidence.Medium; + + if (value.Equals("high")) + return VpnConfidence.High; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(VpnConfidence value) + { + if (value == VpnConfidence.Low) + return "low"; + + if (value == VpnConfidence.Medium) + return "medium"; + + if (value == VpnConfidence.High) + return "high"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class VpnConfidenceJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override VpnConfidence Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + VpnConfidence? result = rawValue == null + ? null + : VpnConfidenceValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the VpnConfidence to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, VpnConfidence vpnConfidence, JsonSerializerOptions options) + { + writer.WriteStringValue(VpnConfidenceValueConverter.ToJsonValue(vpnConfidence).ToString()); + } + } + + /// + /// A Json converter for type + /// + public class VpnConfidenceNullableJsonConverter : JsonConverter + { + /// + /// Returns a VpnConfidence from the Json object + /// + /// + /// + /// + /// + public override VpnConfidence? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + VpnConfidence? result = rawValue == null + ? null + : VpnConfidenceValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the VpnConfidence to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, VpnConfidence? vpnConfidence, JsonSerializerOptions options) + { + writer.WriteStringValue(vpnConfidence.HasValue ? VpnConfidenceValueConverter.ToJsonValue(vpnConfidence.Value).ToString() : "null"); + } + } +} diff --git a/src/Fingerprint.ServerSdk/Model/VpnMethods.cs b/src/Fingerprint.ServerSdk/Model/VpnMethods.cs new file mode 100644 index 0000000..b8b6ab7 --- /dev/null +++ b/src/Fingerprint.ServerSdk/Model/VpnMethods.cs @@ -0,0 +1,272 @@ +// +/* + * Server API + * + * Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * + * The version of the OpenAPI document: 4 + * Contact: support@fingerprint.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Fingerprint.ServerSdk.Client; + +namespace Fingerprint.ServerSdk.Model +{ + /// + /// VpnMethods + /// + public partial class VpnMethods : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The browser timezone doesn't match the timezone inferred from the request IP address. + /// Request IP address is owned and used by a public VPN service provider. + /// This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. + /// The browser runs on a different operating system than the operating system inferred from the request network signature. + /// Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. + [JsonConstructor] + public VpnMethods(Option timezoneMismatch = default, Option publicVpn = default, Option auxiliaryMobile = default, Option osMismatch = default, Option relay = default) + { + TimezoneMismatchOption = timezoneMismatch; + PublicVpnOption = publicVpn; + AuxiliaryMobileOption = auxiliaryMobile; + OsMismatchOption = osMismatch; + RelayOption = relay; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of TimezoneMismatch + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TimezoneMismatchOption { get; private set; } + + /// + /// The browser timezone doesn't match the timezone inferred from the request IP address. + /// + /// The browser timezone doesn't match the timezone inferred from the request IP address. + [JsonPropertyName("timezone_mismatch")] + public bool? TimezoneMismatch { get { return this.TimezoneMismatchOption; } set { this.TimezoneMismatchOption = new Option(value); } } + + /// + /// Used to track the state of PublicVpn + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PublicVpnOption { get; private set; } + + /// + /// Request IP address is owned and used by a public VPN service provider. + /// + /// Request IP address is owned and used by a public VPN service provider. + [JsonPropertyName("public_vpn")] + public bool? PublicVpn { get { return this.PublicVpnOption; } set { this.PublicVpnOption = new Option(value); } } + + /// + /// Used to track the state of AuxiliaryMobile + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuxiliaryMobileOption { get; private set; } + + /// + /// This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. + /// + /// This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. + [JsonPropertyName("auxiliary_mobile")] + public bool? AuxiliaryMobile { get { return this.AuxiliaryMobileOption; } set { this.AuxiliaryMobileOption = new Option(value); } } + + /// + /// Used to track the state of OsMismatch + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OsMismatchOption { get; private set; } + + /// + /// The browser runs on a different operating system than the operating system inferred from the request network signature. + /// + /// The browser runs on a different operating system than the operating system inferred from the request network signature. + [JsonPropertyName("os_mismatch")] + public bool? OsMismatch { get { return this.OsMismatchOption; } set { this.OsMismatchOption = new Option(value); } } + + /// + /// Used to track the state of Relay + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RelayOption { get; private set; } + + /// + /// Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. + /// + /// Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. + [JsonPropertyName("relay")] + public bool? Relay { get { return this.RelayOption; } set { this.RelayOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VpnMethods {\n"); + sb.Append(" TimezoneMismatch: ").Append(TimezoneMismatch).Append("\n"); + sb.Append(" PublicVpn: ").Append(PublicVpn).Append("\n"); + sb.Append(" AuxiliaryMobile: ").Append(AuxiliaryMobile).Append("\n"); + sb.Append(" OsMismatch: ").Append(OsMismatch).Append("\n"); + sb.Append(" Relay: ").Append(Relay).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class VpnMethodsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override VpnMethods Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option timezoneMismatch = default; + Option publicVpn = default; + Option auxiliaryMobile = default; + Option osMismatch = default; + Option relay = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "timezone_mismatch": + timezoneMismatch = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "public_vpn": + publicVpn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "auxiliary_mobile": + auxiliaryMobile = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "os_mismatch": + osMismatch = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + case "relay": + relay = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (timezoneMismatch.IsSet && timezoneMismatch.Value == null) + throw new ArgumentNullException(nameof(timezoneMismatch), "Property is not nullable for class VpnMethods."); + + if (publicVpn.IsSet && publicVpn.Value == null) + throw new ArgumentNullException(nameof(publicVpn), "Property is not nullable for class VpnMethods."); + + if (auxiliaryMobile.IsSet && auxiliaryMobile.Value == null) + throw new ArgumentNullException(nameof(auxiliaryMobile), "Property is not nullable for class VpnMethods."); + + if (osMismatch.IsSet && osMismatch.Value == null) + throw new ArgumentNullException(nameof(osMismatch), "Property is not nullable for class VpnMethods."); + + if (relay.IsSet && relay.Value == null) + throw new ArgumentNullException(nameof(relay), "Property is not nullable for class VpnMethods."); + + return new VpnMethods(timezoneMismatch, publicVpn, auxiliaryMobile, osMismatch, relay); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, VpnMethods vpnMethods, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, vpnMethods, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, VpnMethods vpnMethods, JsonSerializerOptions jsonSerializerOptions) + { + if (vpnMethods.TimezoneMismatchOption.IsSet) + writer.WriteBoolean("timezone_mismatch", vpnMethods.TimezoneMismatchOption.Value.Value); + + if (vpnMethods.PublicVpnOption.IsSet) + writer.WriteBoolean("public_vpn", vpnMethods.PublicVpnOption.Value.Value); + + if (vpnMethods.AuxiliaryMobileOption.IsSet) + writer.WriteBoolean("auxiliary_mobile", vpnMethods.AuxiliaryMobileOption.Value.Value); + + if (vpnMethods.OsMismatchOption.IsSet) + writer.WriteBoolean("os_mismatch", vpnMethods.OsMismatchOption.Value.Value); + + if (vpnMethods.RelayOption.IsSet) + writer.WriteBoolean("relay", vpnMethods.RelayOption.Value.Value); + } + } +} diff --git a/src/Fingerprint.ServerSdk/README.md b/src/Fingerprint.ServerSdk/README.md new file mode 100644 index 0000000..5f2a636 --- /dev/null +++ b/src/Fingerprint.ServerSdk/README.md @@ -0,0 +1,7 @@ +# Fingerprint.ServerSdk - the C#/Dotnet library for the Fingerprint Server API + +Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + +## Getting started + +Please follow the installation guide that you can find in our [repository](https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk/) \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/Sealed.cs b/src/Fingerprint.ServerSdk/Sealed.cs new file mode 100644 index 0000000..a0208ea --- /dev/null +++ b/src/Fingerprint.ServerSdk/Sealed.cs @@ -0,0 +1,281 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Fingerprint.ServerSdk.Client; +using Fingerprint.ServerSdk.Model; +using Org.BouncyCastle.Crypto.Engines; +using Org.BouncyCastle.Crypto.Modes; +using Org.BouncyCastle.Crypto.Parameters; + +namespace Fingerprint.ServerSdk +{ + /// + /// + /// + public class Sealed + { + /// + /// + /// + public enum DecryptionAlgorithm + { + /// + /// + /// + Aes256Gcm + } + + /// + /// + /// + public class DecryptionKey + { + /// + /// + /// + public byte[] Key { get; } + /// + /// + /// + public DecryptionAlgorithm Algorithm { get; } + + /// + /// + /// + /// + /// + public DecryptionKey(byte[] key, DecryptionAlgorithm algorithm) + { + Key = key; + Algorithm = algorithm; + } + } + + /// + /// + /// + public class UnsealAggregateException : Exception + { + /// + /// + /// + public List UnsealExceptions { get; } = new List(); + + /// + /// + /// + public UnsealAggregateException() : base("Failed to unseal with all decryption keys") + { + } + + /// + /// + /// + /// + public void AddUnsealException(UnsealException exception) + { + UnsealExceptions.Add(exception); + } + } + + /// + /// + /// + public class InvalidSealedDataException : ArgumentException + { + /// + /// + /// + public InvalidSealedDataException() : base("Invalid sealed data") + { + } + } + + /// + /// + /// + public class InvalidSealedDataHeaderException : ArgumentException + { + /// + /// + /// + public InvalidSealedDataHeaderException() : base("Invalid sealed data header") + { + } + } + + /// + /// + /// + public class UnsealException : Exception + { + /// + /// + /// + public DecryptionKey DecryptionKey { get; } + /// + /// + /// + public new Exception InnerException { get; } + + /// + /// + /// + /// + /// + /// + public UnsealException(string message, DecryptionKey decryptionKey, Exception exception) : base(message, exception) + { + DecryptionKey = decryptionKey; + InnerException = exception; + } + } + + private static readonly byte[] SealHeader = { 0x9E, 0x85, 0xDC, 0xED }; + private const int NonceLength = 12; + private const int AuthTagLength = 16; + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static byte[] Unseal(byte[] sealedData, DecryptionKey[] keys) + { + if (!sealedData.Take(SealHeader.Length).SequenceEqual(SealHeader)) + { + throw new InvalidSealedDataHeaderException(); + } + + var aggregateException = new UnsealAggregateException(); + + foreach (var key in keys) + { + switch (key.Algorithm) + { + case DecryptionAlgorithm.Aes256Gcm: + try + { + return DecryptAes256Gcm(sealedData.Skip(SealHeader.Length).ToArray(), key.Key); + } + catch (Exception exception) + { + aggregateException.AddUnsealException(new UnsealException("Failed to decrypt", key, exception)); + } + break; + + default: + throw new ArgumentException("Invalid decryption algorithm"); + } + } + + throw aggregateException; + } + + /// + /// Decrypts the sealed response with the provided keys. + /// + /// An decrypted instance of the EventResponse. + /// + /// The SDK will try to decrypt the result with each key until it succeeds. + /// + public static Event UnsealEventResponse(byte[] sealedData, DecryptionKey[] keys) + { + var unsealed = Unseal(sealedData, keys); + + var json = Encoding.UTF8.GetString(unsealed); + var value = JsonSerializer.Deserialize(json, GetJsonSerializerOptions()); + + if (value == null) + { + throw new InvalidSealedDataException(); + } + + return value; + } + + private static byte[] DecryptAes256Gcm(byte[] sealedData, byte[] key) + { + var nonce = sealedData.Take(NonceLength).ToArray(); + var cipherText = sealedData.Skip(NonceLength).ToArray(); + + var cipher = new GcmBlockCipher(new AesEngine()); + var parameters = new AeadParameters(new KeyParameter(key), AuthTagLength * 8, nonce); + cipher.Init(false, parameters); + + var output = new byte[cipher.GetOutputSize(cipherText.Length)]; + var len = cipher.ProcessBytes(cipherText, 0, cipherText.Length, output, 0); + cipher.DoFinal(output, len); + + return Decompress(output); + } + + + private static byte[] Decompress(byte[] data) + { + using (var compressedStream = new MemoryStream(data)) + { + using (var deflateStream = new DeflateStream(compressedStream, CompressionMode.Decompress)) + { + using (var resultStream = new MemoryStream()) + { + deflateStream.CopyTo(resultStream); + return resultStream.ToArray(); + } + } + } + } + + private static JsonSerializerOptions GetJsonSerializerOptions() + { + var jsonOptions = new JsonSerializerOptions(); + jsonOptions.Converters.Add(new JsonStringEnumConverter()); + jsonOptions.Converters.Add(new DateTimeJsonConverter()); + jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + jsonOptions.Converters.Add(new BotResultJsonConverter()); + jsonOptions.Converters.Add(new BotResultNullableJsonConverter()); + jsonOptions.Converters.Add(new BrowserDetailsJsonConverter()); + jsonOptions.Converters.Add(new ErrorJsonConverter()); + jsonOptions.Converters.Add(new ErrorCodeJsonConverter()); + jsonOptions.Converters.Add(new ErrorCodeNullableJsonConverter()); + jsonOptions.Converters.Add(new ErrorResponseJsonConverter()); + jsonOptions.Converters.Add(new EventJsonConverter()); + jsonOptions.Converters.Add(new EventSearchJsonConverter()); + jsonOptions.Converters.Add(new EventUpdateJsonConverter()); + jsonOptions.Converters.Add(new GeolocationJsonConverter()); + jsonOptions.Converters.Add(new GeolocationSubdivisionsInnerJsonConverter()); + jsonOptions.Converters.Add(new IPBlockListJsonConverter()); + jsonOptions.Converters.Add(new IPInfoJsonConverter()); + jsonOptions.Converters.Add(new IPInfoV4JsonConverter()); + jsonOptions.Converters.Add(new IPInfoV6JsonConverter()); + jsonOptions.Converters.Add(new IdentificationJsonConverter()); + jsonOptions.Converters.Add(new IdentificationConfidenceJsonConverter()); + jsonOptions.Converters.Add(new IntegrationJsonConverter()); + jsonOptions.Converters.Add(new IntegrationSubintegrationJsonConverter()); + jsonOptions.Converters.Add(new ProximityJsonConverter()); + jsonOptions.Converters.Add(new ProxyConfidenceJsonConverter()); + jsonOptions.Converters.Add(new ProxyConfidenceNullableJsonConverter()); + jsonOptions.Converters.Add(new ProxyDetailsJsonConverter()); + jsonOptions.Converters.Add(new SDKJsonConverter()); + jsonOptions.Converters.Add(new SupplementaryIDHighRecallJsonConverter()); + jsonOptions.Converters.Add(new TamperingDetailsJsonConverter()); + jsonOptions.Converters.Add(new TriggeredByInnerJsonConverter()); + jsonOptions.Converters.Add(new VelocityJsonConverter()); + jsonOptions.Converters.Add(new VelocityDataJsonConverter()); + jsonOptions.Converters.Add(new VpnConfidenceJsonConverter()); + jsonOptions.Converters.Add(new VpnConfidenceNullableJsonConverter()); + jsonOptions.Converters.Add(new VpnMethodsJsonConverter()); + + return jsonOptions; + } + } +} \ No newline at end of file diff --git a/src/Fingerprint.ServerSdk/WebhookValidation.cs b/src/Fingerprint.ServerSdk/WebhookValidation.cs new file mode 100644 index 0000000..597d2ee --- /dev/null +++ b/src/Fingerprint.ServerSdk/WebhookValidation.cs @@ -0,0 +1,82 @@ +using System; +using System.Security.Cryptography; +using System.Text; + +namespace Fingerprint.ServerSdk +{ + /// + /// Provides helpers for validating Fingerprint webhook requests. + /// + /// + /// Fingerprint webhooks can be signed with an HMAC and delivered with the + /// fpjs-event-signature header. This utility validates that header + /// against your shared secret. Signing is available to enterprise customers. + /// For enablement, contact Fingerprint Support. + /// + /// The current implementation supports the v1 scheme using HMAC-SHA256 + /// over the raw request body. + /// + /// + public static class WebhookValidation + { + /// + /// Computes an HMAC-SHA256 of the given using the provided + /// and compares the computed digest (hex, lowercase) with + /// the expected . + /// + /// The expected HMAC digest, hex-encoded in lowercase (no prefix). + /// The raw request payload bytes used to compute the HMAC. + /// The shared secret used to derive the HMAC key. + /// + /// if the computed HMAC digest equals ; + /// otherwise, . + /// + /// + /// This method performs a standard ordinal equality check. If you need to mitigate timing + /// attacks, consider replacing the equality comparison with a constant-time comparison. + /// + private static bool IsValidHmacSignature(string signature, byte[] data, string secret) + { + using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret))) + { + var computedHash = hmac.ComputeHash(data); + var computedHashHex = BitConverter.ToString(computedHash).Replace("-", "").ToLower(); + return signature == computedHashHex; + } + } + + /// + /// Verifies the HMAC signature extracted from the fpjs-event-signature header of the incoming request. + /// This is part of the webhook signing process, which is available only for enterprise customers. + /// + /// The full value of the fpjs-event-signature header (may contain multiple comma-separated entries). + /// The raw request body bytes used to compute and verify the HMAC. + /// The shared secret used to sign and verify the request. + /// + /// if the header contains a valid v1 signature for ; + /// otherwise, . + /// + /// + /// The header can contain multiple scheme/value pairs (e.g., v1=<hex>,v2=<hex>). + /// This method currently validates only the v1 entry using HMAC-SHA256 over the raw body. + /// + public static bool IsValidSignature(string header, byte[] data, string secret) + { + var signatures = header.Split(','); + + foreach (var signature in signatures) + { + var parts = signature.Split('='); + if (parts.Length != 2) + continue; + var version = parts[0]; + var hash = parts[1]; + if (version == "v1" && IsValidHmacSignature(hash, data, secret)) + { + return true; + } + } + return false; + } + } +} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Examples/Program.cs b/src/FingerprintPro.ServerSdk.Examples/Program.cs deleted file mode 100644 index 569968e..0000000 --- a/src/FingerprintPro.ServerSdk.Examples/Program.cs +++ /dev/null @@ -1,85 +0,0 @@ -// See https://aka.ms/new-console-template for more information - -using System; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - - -var example = new FingerprintExample(); -example.GetVisitsExample(); -example.GetEventExample(); -example.SearchEventsExample(); - -// Uncomment following line to test update event method -// example.UpdateEventExample() - -// Uncomment following line to test delete visitor data -// example.DeleteVisitorDataExample() - -internal class FingerprintExample -{ - private readonly Configuration _configuration = new(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); - private readonly string _visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!; - private readonly string _requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!; - private readonly FingerprintApi _api; - - public FingerprintExample() - { - // Change region if needed - var region = Environment.GetEnvironmentVariable("REGION")!; - _configuration.Region = region switch - { - "eu" => Region.Eu, - "ap" => Region.Asia, - _ => _configuration.Region - }; - - _api = new FingerprintApi(_configuration); - } - - - public void GetVisitsExample() - { - var visits = _api.GetVisits(_visitorId); - Console.WriteLine("GetVisits() result:"); - Console.WriteLine(visits); - } - - public void GetEventExample() - { - var events = _api.GetEvent(_requestId); - Console.WriteLine("GetEvent() result:"); - Console.WriteLine(events); - } - - public void SearchEventsExample() - { - var events = _api.SearchEvents(2, bot: "bad"); - Console.WriteLine("SearchEvents() result:"); - Console.WriteLine(events); - } - - public void UpdateEventExample() - { - var tag = new Tag - { - ["sdk"] = "dotnet" - }; - - var body = new EventsUpdateRequest() - { - Suspect = false, - Tag = tag, - LinkedId = "" - }; - _api.UpdateEvent(body, _requestId); - Console.WriteLine("Event updated"); - } - - public void DeleteVisitorDataExample() - { - _api.DeleteVisitorData(_visitorId); - Console.WriteLine("Scheduled visitor data removal"); - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.FunctionalTest/ApiTests.cs b/src/FingerprintPro.ServerSdk.FunctionalTest/ApiTests.cs deleted file mode 100644 index 8b766b0..0000000 --- a/src/FingerprintPro.ServerSdk.FunctionalTest/ApiTests.cs +++ /dev/null @@ -1,147 +0,0 @@ -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.FunctionalTest; - -[TestFixture] -public class ApiTests -{ - private FingerprintApi _api; - private string _requestId; - private string _visitorId; - private long _start; - private long _end; - private string _paginationKey; - - [OneTimeSetUp] - public void OneTimeSetup() - { - var apiKey = Environment.GetEnvironmentVariable("SECRET_API_KEY"); - if (string.IsNullOrWhiteSpace(apiKey)) - { - Assert.Fail("SECRET_API_KEY is not set. Provide it via environment."); - } - - var configuration = new Configuration(apiKey!); - _api = new FingerprintApi(configuration); - - var now = DateTimeOffset.UtcNow; - _end = now.ToUnixTimeMilliseconds(); - _start = now.AddDays(-90).ToUnixTimeMilliseconds(); - - var events = _api.SearchEvents(2, start: _start, end: _end); - Assert.That(events.Events, Is.Not.Null.And.Not.Empty, "No events returned by SearchEvents."); - - var first = events.Events[0].Products.Identification.Data; - _requestId = first.RequestId; - _visitorId = first.VisitorId; - _paginationKey = events.PaginationKey; - } - - [Test] - public void GetEvent_ReturnsExpectedFields() - { - var events = _api.GetEvent(_requestId); - - Assert.Multiple(() => - { - Assert.That(events, Is.InstanceOf()); - Assert.That(events.Products, Is.InstanceOf()); - Assert.That(events.Products.Botd, Is.InstanceOf()); - Assert.That(events.Products.Identification, Is.InstanceOf()); - Assert.That(events.Products.Identification.Data.RequestId, Is.EqualTo(_requestId)); - }); - } - - [Test] - public void GetEvent_WrongRequestId_Throws404() - { - Assert.That(async () => await _api.GetEventAsync("1662542583652.pLBzes"), - Throws.TypeOf() - .With.Message.Contains("request id not found") - .And.Property(nameof(ApiException.HttpCode)).EqualTo(404) - .And.Property(nameof(ApiException.ErrorCode)).EqualTo(ErrorCode.RequestNotFound) - .And.Property(nameof(ApiException.ErrorContent)).InstanceOf(typeof(ErrorResponse))); - } - - [Test] - public void GetVisits_WithoutRequestId() - { - var response = _api.GetVisits(_visitorId); - - Assert.Multiple(() => - { - Assert.That(response, Is.InstanceOf()); - Assert.That(response.Visits, Is.All.InstanceOf()); - Assert.That(response.VisitorId, Is.EqualTo(_visitorId)); - }); - } - - [Test] - public void GetVisits_WithRequestId() - { - var allVisits = _api.GetVisits(_visitorId); - Assert.That(allVisits.Visits, Is.Not.Null.And.Not.Empty, "Expected at least one visit for visitor."); - - var requestId = allVisits.Visits[0].RequestId; - - var response = _api.GetVisits(_visitorId, requestId); - - Assert.Multiple(() => - { - Assert.That(response, Is.InstanceOf()); - Assert.That(response.Visits, Has.Count.EqualTo(1)); - Assert.That(response.Visits[0].RequestId, Is.EqualTo(requestId)); - Assert.That(response.VisitorId, Is.EqualTo(_visitorId)); - }); - } - - [Test] - public void SearchEvents_Returns() - { - var start = DateTime.UtcNow.Subtract(TimeSpan.FromDays(365)); - var end = DateTime.UtcNow.Add(TimeSpan.FromDays(365)); - - var response = _api.SearchEvents( - limit: 2, - start: new DateTimeOffset(start, TimeSpan.Zero).ToUnixTimeMilliseconds(), - end: new DateTimeOffset(end, TimeSpan.Zero).ToUnixTimeMilliseconds() - ); - - Assert.That(response.Events, Is.Not.Empty); - } - - [Test] - public void SearchEvents_Pagination() - { - if (string.IsNullOrEmpty(_paginationKey)) - { - Assert.Inconclusive("Initial SearchEvents response did not include a pagination key."); - } - - var response = _api.SearchEvents(2, start: _start, end: _end, paginationKey: _paginationKey); - Assert.That(response.Events, Is.Not.Empty); - } - - [Test] - public void SearchEvents_ReverseWorks() - { - var response = _api.SearchEvents(limit: 2, start: _start, end: _end, reverse: true); - Assert.That(response.Events, Has.Count.EqualTo(2)); - - var oldestEventIdentificationData = response.Events[0].Products.Identification.Data; - var secondOldestEventIdentificationData = response.Events[1].Products.Identification.Data; - - Assert.Multiple(() => - { - Assert.That(oldestEventIdentificationData.Timestamp, Is.Not.Null); - Assert.That(secondOldestEventIdentificationData.Timestamp, Is.Not.Null); - }); - Assert.That(oldestEventIdentificationData.Timestamp, Is.LessThan(secondOldestEventIdentificationData.Timestamp)); - - // Try to request old events to check if they still could be deserialized - _api.GetVisits(oldestEventIdentificationData.VisitorId); - _api.GetEvent(oldestEventIdentificationData.RequestId); - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.FunctionalTest/FingerprintPro.ServerSdk.FunctionalTest.csproj b/src/FingerprintPro.ServerSdk.FunctionalTest/FingerprintPro.ServerSdk.FunctionalTest.csproj deleted file mode 100644 index 08edfe1..0000000 --- a/src/FingerprintPro.ServerSdk.FunctionalTest/FingerprintPro.ServerSdk.FunctionalTest.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - net8.0 - enable - enable - - false - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - diff --git a/src/FingerprintPro.ServerSdk.FunctionalTest/Usings.cs b/src/FingerprintPro.ServerSdk.FunctionalTest/Usings.cs deleted file mode 100644 index cefced4..0000000 --- a/src/FingerprintPro.ServerSdk.FunctionalTest/Usings.cs +++ /dev/null @@ -1 +0,0 @@ -global using NUnit.Framework; \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/Api/FingerprintApiTests.cs b/src/FingerprintPro.ServerSdk.Test/Api/FingerprintApiTests.cs deleted file mode 100644 index cca8f05..0000000 --- a/src/FingerprintPro.ServerSdk.Test/Api/FingerprintApiTests.cs +++ /dev/null @@ -1,1179 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. This API can be used for data exports, decision-making, and data analysis scenarios. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System.Globalization; -using System.Net; -using System.Text; -using System.Text.Json; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Json; -using FingerprintPro.ServerSdk.Model; -using FingerprintPro.ServerSdk.Test.Utils; - -namespace FingerprintPro.ServerSdk.Test.Api -{ - internal class ApiRequest - { - public HttpListenerRequest Request; - - public string? Body; - } - - /// - /// Class for testing FingerprintApi - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the API endpoint. - /// - [TestFixture] - public class FingerprintApiTests - { - /// - /// Setup before each unit test - /// - [SetUp] - public void Init() - { - Console.WriteLine("Starting server..."); - - // Start simple HTTP server - _mockServer = new HttpListener(); - _mockServer.Prefixes.Add(_serverUrl); - _mockServer.Start(); - - _mockResponseHeaders = new WebHeaderCollection(); - _mockResponseStatusCode = (int)HttpStatusCode.OK; - - HandleConnection().GetAwaiter(); - - Console.WriteLine("Started server"); - - var httpClient = new HttpClient - { - BaseAddress = new Uri(_serverUrl) - }; - - var config = new Configuration("123") - { - HttpClient = httpClient - }; - - _instance = new FingerprintApi(config); - } - - /// - /// Clean up after each unit test - /// - [TearDown] - public void Cleanup() - { - Console.WriteLine("Closing server."); - - _requests.Clear(); - _mockServer!.Close(); - } - - private const string _serverUrl = "http://127.0.0.1:8080/"; - - private FingerprintApi? _instance; - - private HttpListener? _mockServer; - - private readonly List _requests = []; - - private byte[]? _mockResponseBytes; - - private WebHeaderCollection? _mockResponseHeaders; - - private int? _mockResponseStatusCode; - - private T GetMockResponse() - { - return JsonUtils.Deserialize(Encoding.UTF8.GetString(_mockResponseBytes!))!; - } - - private void SetupMockResponse(string fileName) - { - _mockResponseBytes = MockLoader.Load(fileName); - } - - private async Task HandleConnection() - { - while (_mockServer != null) - { - var ctx = await _mockServer.GetContextAsync(); - - // Peel out the requests and response objects - var req = ctx.Request; - var resp = ctx.Response; - - var body = ""; - - if (req.HasEntityBody) - { - using var reader = new StreamReader(req.InputStream, req.ContentEncoding); - - body = await reader.ReadToEndAsync(); - } - - _requests.Add(new ApiRequest() - { - Request = req, - Body = body - }); - - // Print out some info about the request - Console.WriteLine(req.Url?.ToString()); - Console.WriteLine(req.HttpMethod); - Console.WriteLine(req.UserHostName); - Console.WriteLine(req.UserAgent); - Console.WriteLine(); - - resp.StatusCode = _mockResponseStatusCode ?? (int)HttpStatusCode.OK; - - - if (_mockResponseHeaders != null) - { - foreach (var key in _mockResponseHeaders.AllKeys) - { - var value = _mockResponseHeaders[key]; - - if (value != null) - { - resp.AddHeader(key, value); - } - } - } - - if (_mockResponseBytes != null) - { - resp.ContentType = "application/json"; - resp.ContentEncoding = Encoding.UTF8; - resp.ContentLength64 = _mockResponseBytes.LongLength; - - await resp.OutputStream.WriteAsync(_mockResponseBytes); - } - - resp.Close(); - } - } - - /// - /// Test an instance of FingerprintApi - /// - [Test] - public void InstanceTest() - { - Assert.That(_instance, Is.InstanceOf(typeof(FingerprintApi)), "instance is a FingerprintApi"); - } - - [Test] - public void FallbackToBaseUrlFromConfigurationIfClientIsProvidedWithEmptyAddress() - { - SetupMockResponse("get_event_200.json"); - - var config = new Configuration("123") - { - BasePath = _serverUrl, - DefaultHeader = new Dictionary - { - { "x-test-header", "test" } - }, - HttpClient = new HttpClient() - }; - - const string requestId = "1708102555327.NLOjmg"; - - _instance = new FingerprintApi(config); - _instance!.GetEvent(requestId); - - Assert.That(_requests, Has.Count.EqualTo(1)); - } - - [Test] - public void HeadersFromConfigurationTest() - { - SetupMockResponse("get_event_200.json"); - - var config = new Configuration("123") - { - BasePath = _serverUrl, - DefaultHeader = new Dictionary - { - { "x-test-header", "test" } - } - }; - - const string requestId = "1708102555327.NLOjmg"; - - _instance = new FingerprintApi(config); - _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("x-test-header"), Is.EqualTo("test")); - }); - } - - [Test] - public void CustomHttpClientTest() - { - SetupMockResponse("get_event_200.json"); - - var client = new HttpClient(); - client.DefaultRequestHeaders.Add("x-test-header", "test"); - client.BaseAddress = new Uri(_serverUrl); - - var config = new Configuration("123") - { - HttpClient = client - }; - - const string requestId = "1708102555327.NLOjmg"; - - _instance = new FingerprintApi(config); - _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("x-test-header"), Is.EqualTo("test")); - }); - } - - [Test] - public void GetEventTest() - { - SetupMockResponse("get_event_200.json"); - - const string requestId = "1708102555327.NLOjmg"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/{requestId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&api_key=123")); - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - Assert.That(response.Products.Identification.Data.RequestId, Is.EqualTo(requestId)); - Assert.That(response.Products.IpInfo.Data.V4.Address, Is.EqualTo("94.142.239.124")); - Assert.That(response.Products.ClonedApp.Data.Result, Is.False); - Assert.That(response.Products.Emulator.Data.Result, Is.False); - Assert.That(response.Products.FactoryReset.Data.Timestamp, Is.EqualTo(0)); - Assert.That(response.Products.Frida.Data.Result, Is.False); - Assert.That(response.Products.Incognito.Data.Result, Is.False); - Assert.That(response.Products.IpBlocklist.Data.Result, Is.False); - Assert.That(response.Products.IpBlocklist.Data.Details.AttackSource, Is.False); - Assert.That(response.Products.IpBlocklist.Data.Details.EmailSpam, Is.False); - Assert.That(response.Products.Jailbroken.Data.Result, Is.False); - Assert.That(response.Products.PrivacySettings.Data.Result, Is.False); - Assert.That(response.Products.Proxy.Data.Result, Is.True); - Assert.That(response.Products.Proxy.Data.Details, Is.Not.Null); - Assert.That(response.Products.Proxy.Data.Details.ProxyType, Is.EqualTo(ProxyDetails.ProxyTypeEnum.Residential)); - Assert.That(response.Products.Proxy.Data.Details.LastSeenAt, Is.InstanceOf()); - Assert.That(response.Products.RootApps.Data.Result, Is.False); - Assert.That(response.Products.Tampering.Data.Result, Is.False); - Assert.That(response.Products.Tor.Data.Result, Is.False); - Assert.That(response.Products.VirtualMachine.Data.Result, Is.False); - Assert.That(response.Products.Vpn.Data.Result, Is.False); - Assert.That(response.Products.ClonedApp.Data.Result, Is.False); - var factoryResedExpectedTime = DateTime.Parse("1970-01-01T00:00:00Z", CultureInfo.InvariantCulture, - DateTimeStyles.AdjustToUniversal); - Assert.That(response.Products.FactoryReset.Data.Time, Is.EqualTo(factoryResedExpectedTime)); - Assert.That(response.Products.Jailbroken.Data.Result, Is.False); - Assert.That(response.Products.Frida.Data.Result, Is.False); - Assert.That(response.Products.PrivacySettings.Data.Result, Is.False); - Assert.That(response.Products.VirtualMachine.Data.Result, Is.False); - var rawDeviceAttributes = response.Products.RawDeviceAttributes.Data; - Assert.That(rawDeviceAttributes.ContainsKey("colorGamut"), Is.True); - Assert.That(rawDeviceAttributes["colorGamut"], Is.Not.Null); - Assert.That(rawDeviceAttributes["colorGamut"].Value.ToString(), Is.EqualTo("p3")); - var colorGamut = rawDeviceAttributes["colorGamut"].Value; - Assert.That(colorGamut.Value.ToString(), Is.EqualTo("p3")); - var canvas = rawDeviceAttributes["canvas"].Value; - Assert.That(canvas.Value.GetProperty("Geometry").ToString(), - Is.EqualTo("4dce9d6017c3e0c052a77252f29f2b1c")); - }); - } - - [Test] - public void GetEventWithExtraFieldsTest() - { - SetupMockResponse("get_event_200_extra_fields.json"); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/{requestId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&api_key=123")); - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - Assert.That(response.Products.Identification.Data.RequestId, Is.EqualTo(requestId)); - }); - } - - [Test] - public void GetEvenAllErrorsTest() - { - SetupMockResponse("get_event_200_all_errors.json"); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/{requestId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&api_key=123")); - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - Assert.That(response.Products.Identification.Error.Code, - Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Botd.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.IpInfo.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Incognito.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.RootApps.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Emulator.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.IpBlocklist.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Tor.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Vpn.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Proxy.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Tampering.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.ClonedApp.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.FactoryReset.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Jailbroken.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.Frida.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.PrivacySettings.Error.Code, Is.EqualTo(ErrorCode.Failed)); - Assert.That(response.Products.VirtualMachine.Error.Code, Is.EqualTo(ErrorCode.Failed)); - var rawDeviceAttributes = response.Products.RawDeviceAttributes.Data; - Assert.That(rawDeviceAttributes.ContainsKey("audio"), Is.True); - Assert.That(rawDeviceAttributes["audio"], Is.Not.Null); - var audio = rawDeviceAttributes["audio"]; - var audioError = audio.Error; - Assert.That(audioError.Name, Is.EqualTo("Error")); - Assert.That(rawDeviceAttributes.ContainsKey("canvas"), Is.True); - Assert.That(rawDeviceAttributes["canvas"], Is.Not.Null); - var canvas = rawDeviceAttributes["canvas"]; - var canvasError = canvas.Error; - Assert.That(canvasError.Name, Is.EqualTo("Error")); - }); - } - - [Test] - public void GetEventBotdErrorTest() - { - SetupMockResponse("get_event_200_botd_failed_error.json"); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - Assert.That(response.Products.Botd.Error.Code, Is.EqualTo(ErrorCode.Failed)); - }); - } - - [Test] - public void GetEventAllErrorsTest() - { - SetupMockResponse("get_event_200_all_errors.json"); - var mockResponse = JsonUtils.Deserialize(Encoding.UTF8.GetString(_mockResponseBytes!)); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - Assert.That(response, Is.EqualTo(mockResponse)); - }); - } - - [Test] - public void GetEventBotdFailedErorTest() - { - SetupMockResponse("get_event_200_botd_failed_error.json"); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - Assert.That(response.Products.Botd.Error.Code, Is.EqualTo(ErrorCode.Failed)); - }); - } - - [Test] - public void GetEventIdentificationErrorTest() - { - SetupMockResponse("get_event_200_identification_failed_error.json"); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - Assert.That(response.Products.Identification.Error.Code, - Is.EqualTo(ErrorCode.Failed)); - }); - } - - [Test] - public void GetEventIdentificationFailedErrorTest() - { - SetupMockResponse("get_event_200_identification_failed_error.json"); - - const string requestId = "0KSh65EnVoB85JBmloQK"; - var response = _instance!.GetEvent(requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is EventsGetResponse"); - Assert.That(response.Products.Identification.Error.Code, - Is.EqualTo(ErrorCode.Failed)); - }); - } - - /// - /// Test GetVisits - /// - [Test] - public void GetVisitsLimit1Test() - { - SetupMockResponse("get_visitors_200_limit_1.json"); - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - const string requestId = "1655373953086.DDlfmP"; - const string? linkedId = null; - int? limit = 1; - - var response = _instance!.GetVisits(visitorId, requestId, linkedId, limit); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is VisitorsGetResponse"); - Assert.That(response.VisitorId, Is.EqualTo(visitorId)); - Assert.That(response.Visits, Has.Count.EqualTo(1)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/visitors/{visitorId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&request_id={requestId}&limit={limit}&api_key=123")); - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - }); - } - - /// - /// Test GetVisits - /// - [Test] - public void GetVisitsLimit500Test() - { - SetupMockResponse("get_visitors_200_limit_500.json"); - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - const string requestId = "1655373953086.DDlfmP"; - const string? linkedId = null; - int? limit = 500; - - var response = _instance!.GetVisits(visitorId, requestId, linkedId, limit); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response, Is.InstanceOf(), "response is VisitorsGetResponse"); - Assert.That(response.VisitorId, Is.EqualTo(visitorId)); - Assert.That(response.Visits, Has.Count.EqualTo(62)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/visitors/{visitorId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&request_id={requestId}&limit={limit}&api_key=123")); - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - }); - } - - [Test] - public async Task GetVisitsTooManyRequestsErrorTest() - { - SetupMockResponse("get_visitors_429_too_many_requests.json"); - - _mockResponseHeaders?.Add("Retry-After", "10"); - _mockResponseStatusCode = TooManyRequestsException.TooManyRequestsCode; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.GetVisitsAsync(visitorId), Throws - .TypeOf().With.Property(nameof(TooManyRequestsException.HttpCode)) - .EqualTo(TooManyRequestsException.TooManyRequestsCode)); - } - - [Test] - public void DeleteVisitorDataTest() - { - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - var response = _instance!.DeleteVisitorDataWithHttpInfo(visitorId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/visitors/{visitorId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("DELETE")); - }); - } - - [Test] - public async Task DeleteVisitorData403ErrorTest() - { - SetupMockResponse("errors/403_feature_not_enabled.json"); - - _mockResponseStatusCode = 403; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.DeleteVisitorDataAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(403) - ); - } - - [Test] - public async Task DeleteVisitorData400ErrorTest() - { - SetupMockResponse("errors/400_request_body_invalid.json"); - - _mockResponseStatusCode = 400; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.DeleteVisitorDataAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(400) - ); - } - - [Test] - public async Task DeleteVisitorData429ErrorTest() - { - SetupMockResponse("errors/429_too_many_requests.json"); - - _mockResponseStatusCode = 429; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.DeleteVisitorDataAsyncWithHttpInfo(visitorId), - Throws.TypeOf()); - } - - [Test] - public async Task DeleteVisitorData404ErrorTest() - { - SetupMockResponse("errors/404_visitor_not_found.json"); - - _mockResponseStatusCode = 404; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.DeleteVisitorDataAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(404) - ); - } - - [Test] - public async Task DeleteVisitorDataNotMappedStatusCodeText() - { - // It's ok to use this response even though it matches different status code - SetupMockResponse("errors/403_token_not_found.json"); - - _mockResponseStatusCode = 401; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.DeleteVisitorDataAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .Null - ); - } - - [Test] - public void UpdateEventTest() - { - const string requestId = "1708102555327.NLOjmg"; - - var body = new EventsUpdateRequest() - { - Suspect = false, - LinkedId = "new_linked_id", - Tag = new Tag() - { - { "key", "value" } - } - }; - var response = _instance!.UpdateEventWithHttpInfo(body, requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - - var request = _requests[0].Request; - var bodyStr = _requests[0].Body; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/{requestId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("PUT")); - Assert.That(request.ContentType, Is.EqualTo("application/json; charset=utf-8")); - - Assert.That(bodyStr, Is.EqualTo(JsonUtils.Serialize(body))); - }); - } - - [Test] - public void UpdateEventWithComplexTagTest() - { - const string requestId = "1708102555327.NLOjmg"; - - var tagStr = File.ReadAllText($"../../../local-mocks/complex_tag.json"); - var tag = JsonUtils.Deserialize(tagStr); - - var body = new EventsUpdateRequest() - { - Tag = tag! - }; - var response = _instance!.UpdateEventWithHttpInfo(body, requestId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - - var request = _requests[0].Request; - var bodyStr = _requests[0].Body; - - var expectedTag = JsonUtils.Serialize(JsonUtils.Deserialize(tagStr)!); - Assert.That(bodyStr, Is.EqualTo($"{{\"tag\":{expectedTag}}}")); - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/{requestId}?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("PUT")); - Assert.That(request.ContentType, Is.EqualTo("application/json; charset=utf-8")); - - Assert.That(bodyStr, Is.EqualTo(JsonUtils.Serialize(body))); - }); - } - - [Test] - public async Task UpdateEvent400ErrorTest() - { - SetupMockResponse("errors/400_request_body_invalid.json"); - - _mockResponseStatusCode = 400; - - const string requestId = "1708102555327.NLOjmg"; - - var body = new EventsUpdateRequest() - { - Suspect = false, - LinkedId = "new_linked_id", - Tag = new Tag() - { - { "key", "value" } - } - }; - - await Assert.ThatAsync(async () => await _instance!.UpdateEventAsyncWithHttpInfo(body, requestId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(400) - ); - } - - [Test] - public async Task UpdateEvent403ErrorTest() - { - SetupMockResponse("errors/403_feature_not_enabled.json"); - - _mockResponseStatusCode = 403; - - const string requestId = "1708102555327.NLOjmg"; - - var body = new EventsUpdateRequest() - { - Suspect = false, - LinkedId = "new_linked_id", - Tag = new Tag() - { - { "key", "value" } - } - }; - - await Assert.ThatAsync(async () => await _instance!.UpdateEventAsyncWithHttpInfo(body, requestId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(403) - ); - } - - [Test] - public async Task UpdateEvent404ErrorTest() - { - SetupMockResponse("errors/404_visitor_not_found.json"); - - _mockResponseStatusCode = 404; - - const string requestId = "1708102555327.NLOjmg"; - - var body = new EventsUpdateRequest() - { - Suspect = false, - LinkedId = "new_linked_id", - Tag = new Tag() - { - { "key", "value" } - } - }; - - await Assert.ThatAsync(async () => await _instance!.UpdateEventAsyncWithHttpInfo(body, requestId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(404) - ); - } - - [Test] - public async Task UpdateEvent409ErrorTest() - { - SetupMockResponse("errors/409_state_not_ready.json"); - - _mockResponseStatusCode = 409; - - const string requestId = "1708102555327.NLOjmg"; - - var body = new EventsUpdateRequest() - { - Suspect = false, - LinkedId = "new_linked_id", - Tag = new Tag() - { - { "key", "value" } - } - }; - - await Assert.ThatAsync(async () => await _instance!.UpdateEventAsyncWithHttpInfo(body, requestId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(409) - ); - } - - [Test] - public void GetRelatedVisitorsTest() - { - SetupMockResponse("related-visitors/get_related_visitors_200.json"); - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - var response = _instance!.GetRelatedVisitorsWithHttpInfo(visitorId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/related-visitors?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&visitor_id={visitorId}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - Assert.That(response.Data, Is.EqualTo(GetMockResponse())); - }); - } - - [Test] - public async Task GetRelatedVisitors400ErrorTest() - { - SetupMockResponse("errors/400_visitor_id_invalid.json"); - _mockResponseStatusCode = 400; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.GetRelatedVisitorsAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(400) - ); - } - - [Test] - public async Task GetRelatedVisitors403ErrorTest() - { - SetupMockResponse("errors/403_feature_not_enabled.json"); - _mockResponseStatusCode = 403; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.GetRelatedVisitorsAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(403) - ); - } - - [Test] - public async Task GetRelatedVisitors404ErrorTest() - { - SetupMockResponse("errors/404_visitor_not_found.json"); - _mockResponseStatusCode = 404; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.GetRelatedVisitorsAsyncWithHttpInfo(visitorId), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(404) - ); - } - - [Test] - public async Task GetRelatedVisitors429ErrorTest() - { - SetupMockResponse("errors/429_too_many_requests.json"); - _mockResponseStatusCode = 429; - - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - - await Assert.ThatAsync(async () => await _instance!.GetRelatedVisitorsAsyncWithHttpInfo(visitorId), Throws - .TypeOf().With.Property(nameof(TooManyRequestsException.HttpCode)) - .EqualTo(TooManyRequestsException.TooManyRequestsCode)); - } - - [Test] - public void SearchEventsMinimumParamsTest() - { - SetupMockResponse("get_event_search_200.json"); - - const int limit = 1; - - var response = _instance!.SearchEventsWithHttpInfo(limit); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/search?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&limit={limit}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - - Assert.That(response.Data.Events.Count, Is.EqualTo(1)); - var eventData = response.Data.Events[0]; - - Assert.That(eventData.Products.Identification.Data.RequestId, Is.EqualTo("1708102555327.NLOjmg")); - Assert.That(eventData.Products.IpInfo.Data.V4.Address, Is.EqualTo("94.142.239.124")); - Assert.That(eventData.Products.ClonedApp.Data.Result, Is.False); - Assert.That(eventData.Products.Emulator.Data.Result, Is.False); - Assert.That(eventData.Products.FactoryReset.Data.Timestamp, Is.EqualTo(0)); - Assert.That(eventData.Products.Frida.Data.Result, Is.False); - Assert.That(eventData.Products.Incognito.Data.Result, Is.False); - Assert.That(eventData.Products.IpBlocklist.Data.Result, Is.False); - Assert.That(eventData.Products.IpBlocklist.Data.Details.AttackSource, Is.False); - Assert.That(eventData.Products.IpBlocklist.Data.Details.EmailSpam, Is.False); - Assert.That(eventData.Products.Jailbroken.Data.Result, Is.False); - Assert.That(eventData.Products.PrivacySettings.Data.Result, Is.False); - Assert.That(eventData.Products.Proxy.Data.Result, Is.False); - Assert.That(eventData.Products.RootApps.Data.Result, Is.False); - Assert.That(eventData.Products.Tampering.Data.Result, Is.False); - Assert.That(eventData.Products.Tor.Data.Result, Is.False); - Assert.That(eventData.Products.VirtualMachine.Data.Result, Is.False); - Assert.That(eventData.Products.Vpn.Data.Result, Is.False); - Assert.That(eventData.Products.ClonedApp.Data.Result, Is.False); - var factoryResedExpectedTime = DateTime.Parse("1970-01-01T00:00:00Z", CultureInfo.InvariantCulture, - DateTimeStyles.AdjustToUniversal); - Assert.That(eventData.Products.FactoryReset.Data.Time, Is.EqualTo(factoryResedExpectedTime)); - Assert.That(eventData.Products.Jailbroken.Data.Result, Is.False); - Assert.That(eventData.Products.Frida.Data.Result, Is.False); - Assert.That(eventData.Products.PrivacySettings.Data.Result, Is.False); - Assert.That(eventData.Products.VirtualMachine.Data.Result, Is.False); - var rawDeviceAttributes = eventData.Products.RawDeviceAttributes.Data; - Assert.That(rawDeviceAttributes.ContainsKey("colorGamut"), Is.True); - Assert.That(rawDeviceAttributes["colorGamut"], Is.Not.Null); - Assert.That(rawDeviceAttributes["colorGamut"].Value.ToString(), Is.EqualTo("p3")); - var colorGamut = rawDeviceAttributes["colorGamut"].Value; - Assert.That(colorGamut.Value.ToString(), Is.EqualTo("p3")); - var canvas = rawDeviceAttributes["canvas"].Value; - Assert.That(canvas.Value.GetProperty("Geometry").ToString(), - Is.EqualTo("4dce9d6017c3e0c052a77252f29f2b1c")); - }); - } - - [Test] - public void SearchEventsMaximumParamsTest() - { - SetupMockResponse("get_event_search_200.json"); - - const int limit = 1; - const string visitorId = "AcxioeQKffpXF8iGQK3P"; - const string bot = "good"; - const string ipAddress = "10.0.0.0/24"; - const string encodedIpAddress = "10.0.0.0%2f24"; - const string linkedId = "some_linked_id"; - const long start = 1582299576511; - const long end = 1582299576513; - const bool reverse = true; - const bool suspect = false; - const string paginationKey = "pagination"; - const bool vpn = true; - const bool virtualMachine = false; - const bool tampering = false; - const bool antiDetectBrowser = false; - const bool incognito = false; - const bool privacySettings = false; - const bool jailbroken = false; - const bool frida = false; - const bool factoryReset = false; - const bool clonedApp = false; - const bool emulator = false; - const bool rootApps = false; - const string vpnConfidence = "high"; - const float minSuspectScore = 0.7f; - const string encodedMinSuspectScore = "0.70"; - const bool ipBlocklist = false; - const bool datacenter = false; - const bool developerTools = true; - const bool locationSpoofing = true; - const bool mitmAttack = true; - const bool proxy = true; - const string sdkVersion = "testSdkVersion"; - const string sdkPlatform = "testSdkPlatform"; - List environment = new List { "env1", "env2" }; - const string proximityId = "testProximityId"; - const int proximityPrecisionRadius = 10; - - var response = _instance!.SearchEventsWithHttpInfo( - limit: limit, - paginationKey: paginationKey, - visitorId: visitorId, - bot: bot, - ipAddress: ipAddress, - linkedId: linkedId, - start: start, - end: end, - reverse: reverse, - suspect: suspect, - vpn: vpn, - virtualMachine: virtualMachine, - tampering: tampering, - antiDetectBrowser: antiDetectBrowser, - incognito: incognito, - privacySettings: privacySettings, - jailbroken: jailbroken, - frida: frida, - factoryReset: factoryReset, - clonedApp: clonedApp, - emulator: emulator, - rootApps: rootApps, - vpnConfidence: vpnConfidence, - minSuspectScore: minSuspectScore, - ipBlocklist: ipBlocklist, - datacenter: datacenter, - developerTools: developerTools, - locationSpoofing: locationSpoofing, - mitmAttack: mitmAttack, - proxy: proxy, - sdkVersion: sdkVersion, - sdkPlatform: sdkPlatform, - environment: environment, - proximityId: proximityId, - proximityPrecisionRadius: proximityPrecisionRadius - ); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - Assert.That(response.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - var queryParams = - $"limit={limit}&pagination_key={paginationKey}&visitor_id={visitorId}&bot={bot}&ip_address={encodedIpAddress}&linked_id={linkedId}&start={start}&end={end}&reverse={reverse}&suspect={suspect}&vpn={vpn}&virtual_machine={virtualMachine}&tampering={tampering}&anti_detect_browser={antiDetectBrowser}&incognito={incognito}&privacy_settings={privacySettings}&jailbroken={jailbroken}&frida={frida}&factory_reset={factoryReset}&cloned_app={clonedApp}&emulator={emulator}&root_apps={rootApps}&vpn_confidence={vpnConfidence}&min_suspect_score={encodedMinSuspectScore}&ip_blocklist={ipBlocklist}&datacenter={datacenter}&developer_tools={developerTools}&location_spoofing={locationSpoofing}&mitm_attack={mitmAttack}&proxy={proxy}&sdk_version={sdkVersion}&sdk_platform={sdkPlatform}&proximity_id={proximityId}&proximity_precision_radius={proximityPrecisionRadius}&environment={environment[0]}&environment={environment[1]}"; - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/search?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&{queryParams}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - - Assert.That(response.Data.Events.Count, Is.EqualTo(1)); - }); - } - - [Test] - public void SearchEventsHalfParamsTest() - { - SetupMockResponse("get_event_search_200.json"); - - const int limit = 1; - const string bot = "good"; - const string linkedId = "some_linked_id"; - const long start = 1582299576511; - const bool reverse = true; - - - var response = _instance!.SearchEvents(limit, start: start, reverse: reverse, bot: bot, linkedId: linkedId); - - Assert.Multiple(() => - { - Assert.That(_requests, Has.Count.EqualTo(1)); - - var request = _requests[0].Request; - - Assert.That(request.Headers.Get("User-Agent"), - Is.EqualTo($"Swagger-Codegen/{Configuration.Version}/csharp")); - - var queryParams = $"limit={limit}&bot={bot}&linked_id={linkedId}&start={start}&reverse={reverse}"; - Assert.That(request.Url?.ToString(), - Is.EqualTo( - $"http://127.0.0.1:8080/events/search?ii=fingerprint-pro-server-api-dotnet-sdk%2f{Configuration.Version}&{queryParams}&api_key=123")); - - Assert.That(request.HttpMethod, Is.EqualTo("GET")); - - Assert.That(response.Events.Count, Is.EqualTo(1)); - }); - } - - [Test] - public async Task SearchEvents400ErrorTest() - { - SetupMockResponse("errors/400_ip_address_invalid.json"); - _mockResponseStatusCode = 400; - - const int limit = 1; - const string ipAddress = "10123"; - - await Assert.ThatAsync(async () => await _instance!.SearchEventsAsync(limit, ipAddress: ipAddress), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(400) - ); - } - - [Test] - public async Task SearchEvents403ErrorTest() - { - SetupMockResponse("errors/403_feature_not_enabled.json"); - _mockResponseStatusCode = 403; - - const int limit = 1; - - await Assert.ThatAsync(async () => await _instance!.SearchEventsAsync(limit), - Throws.TypeOf().With.Property(nameof(ApiException.ErrorContent)) - .InstanceOf() - .And - .With.Property(nameof(ApiException.HttpCode)).EqualTo(403) - ); - } - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/Client/ConfigurationTests.cs b/src/FingerprintPro.ServerSdk.Test/Client/ConfigurationTests.cs deleted file mode 100644 index bac60c7..0000000 --- a/src/FingerprintPro.ServerSdk.Test/Client/ConfigurationTests.cs +++ /dev/null @@ -1,49 +0,0 @@ -using FingerprintPro.ServerSdk.Client; - -namespace FingerprintPro.ServerSdk.Test.Client; - -[TestFixture] -public class ConfigurationTests -{ - [Test] - public void EuRegionTest() - { - var config = new Configuration("123") - { - Region = Region.Eu - }; - - Assert.Multiple(() => - { - Assert.That(config.BasePath, Is.EqualTo("https://eu.api.fpjs.io")); - Assert.That(config.Region, Is.EqualTo(Region.Eu)); - }); - } - - [Test] - public void AsiaRegionTest() - { - var config = new Configuration("123") - { - Region = Region.Asia - }; - - Assert.Multiple(() => - { - Assert.That(config.BasePath, Is.EqualTo("https://ap.api.fpjs.io")); - Assert.That(config.Region, Is.EqualTo(Region.Asia)); - }); - } - - [Test] - public void UsRegionTest() - { - var config = new Configuration("123"); - - Assert.Multiple(() => - { - Assert.That(config.BasePath, Is.EqualTo("https://api.fpjs.io")); - Assert.That(config.Region, Is.EqualTo(Region.Us)); - }); - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/FingerprintPro.ServerSdk.Test.csproj b/src/FingerprintPro.ServerSdk.Test/FingerprintPro.ServerSdk.Test.csproj deleted file mode 100644 index a161444..0000000 --- a/src/FingerprintPro.ServerSdk.Test/FingerprintPro.ServerSdk.Test.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net8.0 - enable - enable - - false - - FingerprintPro.ServerSdk.Test - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - diff --git a/src/FingerprintPro.ServerSdk.Test/Model/WebhookVisitTests.cs b/src/FingerprintPro.ServerSdk.Test/Model/WebhookVisitTests.cs deleted file mode 100644 index f559bd4..0000000 --- a/src/FingerprintPro.ServerSdk.Test/Model/WebhookVisitTests.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text; -using FingerprintPro.ServerSdk.Json; -using FingerprintPro.ServerSdk.Model; -using FingerprintPro.ServerSdk.Test.Utils; - -namespace FingerprintPro.ServerSdk.Test.Model; - -[TestFixture] -public class WebhookVisitTests -{ - [Test] - public void FromBytesTest() - { - var bytes = MockLoader.Load("webhook.json"); - var json = Encoding.UTF8.GetString(bytes); - var webhook = JsonUtils.Deserialize(json); - - Assert.That(webhook, Is.InstanceOf()); - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/SealedTests.cs b/src/FingerprintPro.ServerSdk.Test/SealedTests.cs deleted file mode 100644 index aeceaae..0000000 --- a/src/FingerprintPro.ServerSdk.Test/SealedTests.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; -using FingerprintPro.ServerSdk.Model; -using Org.BouncyCastle.Crypto; - -namespace FingerprintPro.ServerSdk.Test; - -[TestFixture] -public class SealedTest -{ - [Test] - public void UnsealEventResponseTest() - { - var sealedResult = Convert.FromBase64String( - "noXc7SZeaIKHXyFfzrvEXBCbQ3FPxHL7VpxiMX78XcFXPbEcgS2GRor0g27N3LLvHCWvvvhrdwkeDhKjrSC4bQfpR1OoImxLUgY4/lg7C7JZh1hlhsj9JWR3nWVo8t5oKvaDcwx/DXnyM659S5Bh9RJrP47koPwTHYsd2+N6KAXX5iuDQj4Fonhp4A3/rEmVn83mRVUSgAvyM2yRq3bww6unERvsUmVrSv/IcMw6LBIvjsKkcAj5vnFgyr0K41ITtNIaiYDMCjR3KOzvZkSstv2eWOXopEPPn9C9wHYpHEDSzEODVB9lRMB6YbcgS0vOsFD5KLHiiE/luKZl28Z3vlQNWx21ASpJdi1J2s8cEWsmEHwMoqLhnkpqHEn21wQZgMjLDvIGZ+QRJo0KnCCY4TP1cB3/TQxvzTslBpBoUqXcuC+VCLRZPXARiq6nx7SvJ2wRttQq+QFbpbjj5sXkE3HMNsb2P4r7yrMxS8WIUBlVKlxj8foqgKTTyp05AQvCxHOWc2suzDBdxEhwGlaM4vpHuzBoJIAd1c+al+mNlO+XSnJ6xPwQ37WRwHheBq/8/RNh42FQpZZh7VcXcXRvtpR9HHr8kUegzZaFQJqtZAlMUfTF9tGE7gWEWWeLAdkhEDg/NNGu+HoCIJkPt03P2gZKtnx22aUG1mlS/VEWjwtEy8u8j1q9rWpTPCPkVZR07Zflvq/rjr/4W/UdQdS5X2slz3e0Ak9rRFtZVljB3PLfVbQDZiome3FE3JojguqSraRhmMlTl0fj09mkhcze8vi4rtAWogy3iundYNLhxfNG/xAl5h3Cyrxcg2NbrZhkuLDdKoS86Ka0jGbSqLLsk1RpYx51Ljdlft0dw1viz4JNU8xReelISsfo3hsJTVaqe29Gw+IsdFq+ojlC5/YajG6SXCRGNw=="); - var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - var expectedResponse = JsonUtils.Deserialize( - "{\"products\":{\"identification\":{\"data\":{\"visitorId\":\"2ZEDCZEfOfXjEmMuE3tq\",\"requestId\":\"1703067132750.Z5hutJ\",\"replayed\":false,\"browserDetails\":{\"browserName\":\"Safari\",\"browserMajorVersion\":\"17\",\"browserFullVersion\":\"17.3\",\"os\":\"Mac OS X\",\"osVersion\":\"10.15.7\",\"device\":\"Other\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15\"},\"incognito\":false,\"ip\":\"::1\",\"ipLocation\":{\"accuracyRadius\":1000,\"latitude\":59.3241,\"longitude\":18.0517,\"postalCode\":\"100 05\",\"timezone\":\"Europe/Stockholm\",\"city\":{\"name\":\"Stockholm\"},\"country\":{\"code\":\"SE\",\"name\":\"Sweden\"},\"continent\":{\"code\":\"EU\",\"name\":\"Europe\"},\"subdivisions\":[{\"isoCode\":\"AB\",\"name\":\"Stockholm County\"}]},\"timestamp\":1703067136286,\"time\":\"2023-12-20T10:12:16Z\",\"url\":\"http://localhost:8080/\",\"tag\":{\"foo\":\"bar\"},\"confidence\":{\"score\":1},\"visitorFound\":true,\"firstSeenAt\":{\"global\":\"2023-12-15T12:13:55.103Z\",\"subscription\":\"2023-12-15T12:13:55.103Z\"},\"lastSeenAt\":{\"global\":\"2023-12-19T11:39:51.52Z\",\"subscription\":\"2023-12-19T11:39:51.52Z\"}}},\"botd\":{\"data\":{\"bot\":{\"result\":\"notDetected\"},\"meta\":{\"foo\":\"bar\"},\"url\":\"http://localhost:8080/\",\"ip\":\"::1\",\"time\":\"2023-12-20T10:12:13.894Z\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15\",\"requestId\":\"1703067132750.Z5hutJ\"}}}}") - !; - - var actualResponse = Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - // Invalid key - new(Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.Aes256Gcm), - new(key, Sealed.DecryptionAlgorithm.Aes256Gcm) - }); - - Assert.That(actualResponse.ToString(), Is.EqualTo(expectedResponse.ToString())); - } - - [Test] - public void UnsealEventResponseWithInvalidSealedResultTest() - { - // "{\"invalid\":true}" - var sealedResult = - Convert.FromBase64String("noXc7VOpBstjjcavDKSKr4HTavt4mdq8h6NC32T0hUtw9S0jXT8lPjZiWL8SyHxmrF3uTGqO+g=="); - var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(key, Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - } - - [Test] - public void UnsealEventResponseWithInvalidJsonSealedResultTest() - { - var sealedResult = Convert.FromBase64String( - "noXc7VE/iOGp4qw5etO5BigT7Gq3Grr3vFf4O+kB+JGQFDBDPAy7afWfhz/AhDRiY86mH7GSfOhBbNL4Q/xAvJPLepFFFs2YKYKGH5KLLvTfTX9/MPR4xACLJTbBRk1oLrz7KvyUh8wJzRH15MFryFIgTprKQEAURxSxVfkwKFc/lQvth9A/VD+qfrfQPPfOevGydBSuwhInuOWXsrtT+Oy036o+sf3uR2sGSAVwqMkORNu1s4jvCvT+v5fQH0SVHp2E24tscteOEUNhYcfsWInoDKl2vFR04YX8TSXqC9/YWJDRv4rSV2H806HvKJguElS7Bk4PVGELNg6bYKTV+QVq70UM/X9aABbOy/maYVE1Cv2fV7lOsKj58i4XXMnBoHf6HSrdLBMuelcEbqmILlnouZr9EusGJw9s3bVFihC1ZJMBVkwuUn93eicqg2YjTN+pUevEyQuSYJ9UZ6sRPOGp8OwQNBEYJiMN7M5/5cO4jAB5W7Sgsn+tN5khUDevrXaAdj/q/a6Sq9sGTImySH6IWm8LY+TA13JRTztQne3aD0XmWT2QkTHZ9MP67zaRl5wcJaKWHMYuDcRXu8DJNHQS3IC7RMOKboJPSTrIgmCEeNP4ctdqV+piBC0AEX1zEO/tms3XmoLqGtflHxP/h20XVRlX5YAPyRWJju5gFdXNyLRU6IS2/crJiPocgyTJXtS8/Ffg6ksyg7NSO0Z3232cv1uAszeBsQmBxz6/kwpq5fiNDGTsQouS5g8GqePB34Dduasi/Hn9oHKnDOOpYUnCkIUSJrwJSwqh6Z6kWbZywdqhS6paGeYW+bcVo/zdBhIdS6OH8AAf+5NaZpqmUweTpRcI3/2BYRMhn5KNbVJMG0Egq986V9G0g2o3+7pkpFyHMBuMN4txwLmonU5Thgg="); - var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(key, Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - } - - [Test] - public void UnsealEventResponseWithNotCompressedSealedResultTest() - { - var sealedResult = Convert.FromBase64String( - "noXc7dtuk0smGE+ZbaoXzrp6Rq8ySxLepejTsu7+jUXlPhV1w+WuHx9gbPhaENJnOQo8BcGmsaRhL5k2NVj+DRNzYO9cQD7wHxmXKCyTbl/dvSYOMoHziUZ2VbQ7tmaorFny26v8jROr/UBGfvPE0dLKC36IN9ZlJ3X0NZJO8SY+8bCr4mTrkVZsv/hpvZp+OjC4h7e5vxcpmnBWXzxfaO79Lq3aMRIEf9XfK7/bVIptHaEqtPKCTwl9rz1KUpUUNQSHTPM0NlqJe9bjYf5mr1uYvWHhcJoXSyRyVMxIv/quRiw3SKJzAMOTBiAvFICpWuRFa+T/xIMHK0g96w/IMQo0jdY1E067ZEvBUOBmsJnGJg1LllS3rbJVe+E2ClFNL8SzFphyvtlcfvYB+SVSD4bzI0w/YCldv5Sq42BFt5bn4n4aE5A6658DYsfSRYWqP6OpqPJx96cY34W7H1t/ZG0ulez6zF5NvWhc1HDQ1gMtXd+K/ogt1n+FyFtn8xzvtSGkmrc2jJgYNI5Pd0Z0ent73z0MKbJx9v2ta/emPEzPr3cndN5amdr6TmRkDU4bq0vyhAh87DJrAnJQLdrvYLddnrr8xTdeXxj1i1Yug6SGncPh9sbTYkdOfuamPAYOuiJVBAMcfYsYEiQndZe8mOQ4bpCr+hxAAqixhZ16pQ8CeUwa247+D2scRymLB8qJXlaERuFZtWGVAZ8VP/GS/9EXjrzpjGX9vlrIPeJP8fh2S5QPzw55cGNJ7JfAdOyManXnoEw2/QzDhSZQARVl+akFgSO0Y13YmbiL7H6HcKWGcJ2ipDKIaj2fJ7GE0Vzyt+CBEezSQR99Igd8x3p2JtvsVKp35iLPksjS1VqtSCTbuIRUlINlfQHNjeQiE/B/61jo3Mf7SmjYjqtvXt5e9RKb+CQku2qH4ZU8xN3DSg+4mLom3BgKBkm/MoyGBpMK41c96d2tRp3tp4hV0F6ac02Crg7P2lw8IUct+i2VJ8VUjcbRfTIPQs0HjNjM6/gLfLCkWOHYrlFjwusXWQCJz91Kq+hVxj7M9LtplPO4AUq6RUMNhlPGUmyOI2tcUMrjq9vMLXGlfdkH185zM4Mk+O7DRLC8683lXZFZvcBEmxr855PqLLH/9SpYKHBoGRatDRdQe3oRp6gHS0jpQ1SW/si4kvLKiUNjiBExvbQVOUV7/VFXvG1RpM9wbzSoOd40gg7ZzD/72QshUC/25DkM/Pm7RBzwtjgmnRKjT+mROeC/7VQLoz3amv09O8Mvbt+h/lX5+51Q834F7NgIGagbB20WtWcMtrmKrvCEZlaoiZrmYVSbi1RfknRK7CTPJkopw9IjO7Ut2EhKZ+jL4rwk6TlVm6EC6Kuj7KNqp6wB/UNe9eM2Eym/aiHAcja8XN4YQhSIuJD2Wxb0n3LkKnAjK1/GY65c8K6rZsVYQ0MQL1j4lMl0UZPjG/vzKyetIsVDyXc4J9ZhOEMYnt/LaxEeSt4EMJGBA9wpTmz33X4h3ij0Y3DY/rH7lrEScUknw20swTZRm5T6q1bnimj7M1OiOkebdI09MZ0nyaTWRHdB7B52C/moh89Q7qa2Fulp5h8Us1FYRkWBLt37a5rGI1IfVeP38KaPbagND+XzWpNqX4HVrAVPLQVK5EwUvGamED3ooJ0FMieTc0IH0N+IeUYG7Q8XmrRVBcw32W8pEfYLO9L71An/J0jQZCIP8DuQnUG0mOvunOuloBGvP/9LvkBlkamh68F0a5f5ny1jloyIFJhRh5dt2SBlbsXS9AKqUwARYSSsA9Ao4WJWOZMyjp8A+qIBAfW65MdhhUDKYMBgIAbMCc3uiptzElQQopE5TT5xIhwfYxa503jVzQbz1Q=="); - var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - var ex = Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(key, Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - - var lastError = ex!.UnsealExceptions.Last(); - - Assert.That(lastError.InnerException, Is.InstanceOf(typeof(InvalidDataException))); - } - - [Test] - public void UnsealEventResponseWithInvalidHeaderTest() - { - var sealedResult = Convert.FromBase64String( - "noXc7xXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNxlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); - var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(key, Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - } - - [Test] - public void UnsealEventResponseWithEmptyData() - { - var sealedResult = Array.Empty(); - var key = Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(key, Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - } - - [Test] - public void UnsealEventResponseWithInvalidKeys() - { - var sealedResult = Convert.FromBase64String( - "noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); - - Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - } - - [Test] - public void UnsealEventResponseWithInvalidNonce() - { - byte[] sealedResult = { 0x9E, 0x85, 0xDC, 0xED, 0xAA, 0xBB, 0xCC }; - - var ex = Assert.Throws(() => - Sealed.UnsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[] - { - new(Convert.FromBase64String("aW52YWxpZA=="), Sealed.DecryptionAlgorithm.Aes256Gcm), - new(Convert.FromBase64String("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.Aes256Gcm) - })); - - var lastError = ex!.UnsealExceptions.Last(); - Assert.That(lastError.InnerException, Is.InstanceOf(typeof(InvalidCipherTextException))); - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/Usings.cs b/src/FingerprintPro.ServerSdk.Test/Usings.cs deleted file mode 100644 index cefced4..0000000 --- a/src/FingerprintPro.ServerSdk.Test/Usings.cs +++ /dev/null @@ -1 +0,0 @@ -global using NUnit.Framework; \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/Utils/MockLoader.cs b/src/FingerprintPro.ServerSdk.Test/Utils/MockLoader.cs deleted file mode 100644 index 790f051..0000000 --- a/src/FingerprintPro.ServerSdk.Test/Utils/MockLoader.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Text; - -namespace FingerprintPro.ServerSdk.Test.Utils; - -public static class MockLoader -{ - public static byte[] Load(string fileName) - { - // Load selected json file store in /mocks directory, and save it to a "mockResponse" property - - var mockResponse = File.ReadAllText($"../../../mocks/{fileName}"); - - return Encoding.UTF8.GetBytes(mockResponse); - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/WebhookValidationTests.cs b/src/FingerprintPro.ServerSdk.Test/WebhookValidationTests.cs deleted file mode 100644 index 13d783a..0000000 --- a/src/FingerprintPro.ServerSdk.Test/WebhookValidationTests.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Text; - -namespace FingerprintPro.ServerSdk.Test; - -[TestFixture] -public class WebhookValidationTests -{ - private const string _validHeader = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; - private const string _secret = "secret"; - private static readonly byte[] Data = "data"u8.ToArray(); - - [Test] - public void ValidHeaderTest() - { - var result = WebhookValidation.IsValidSignature(_validHeader, Data, _secret); - - Assert.That(result, Is.True); - } - - [Test] - public void InvalidHeaderTest() - { - var result = WebhookValidation.IsValidSignature("v2=invalid", Data, _secret); - - Assert.That(result, Is.False); - } - - - [Test] - public void HeaderWithoutVersionTest() - { - var result = WebhookValidation.IsValidSignature("invalid", Data, _secret); - - Assert.That(result, Is.False); - } - - [Test] - public void EmptyHeaderTest() - { - var result = WebhookValidation.IsValidSignature("invalid", Data, _secret); - - Assert.That(result, Is.False); - } - - [Test] - public void EmptySecretTest() - { - var result = WebhookValidation.IsValidSignature("invalid", Data, ""); - - Assert.That(result, Is.False); - } - - [Test] - public void EmptyDataTest() - { - var result = WebhookValidation.IsValidSignature(_validHeader, ""u8.ToArray(), _secret); - - Assert.That(result, Is.False); - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/local-mocks/complex_tag.json b/src/FingerprintPro.ServerSdk.Test/local-mocks/complex_tag.json deleted file mode 100644 index 22cc003..0000000 --- a/src/FingerprintPro.ServerSdk.Test/local-mocks/complex_tag.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "automationTest_testName": "Automation Test Scenario 1", - "automationTest_testId": "test_lvjsvm", - "automationTest_metadata": { - "id": 304, - "description": "This is a metadata description for automation testing.", - "createdAt": "2025-01-23T13:02:36.628Z", - "updatedAt": "2025-01-23T13:02:36.630Z" - }, - "automationTest_settings": { - "retries": 3, - "timeout": 5000, - "environment": "staging", - "notifications": [ - "email", - "slack", - "sms" - ] - }, - "automationTest_users": [ - { - "userId": "123", - "roles": [ - "admin", - "editor" - ], - "isActive": true - }, - { - "userId": "456", - "roles": [ - "viewer" - ], - "isActive": false - } - ], - "automationTest_metrics": [ - { - "name": "executionTime", - "value": 120.5, - "unit": "seconds" - }, - { - "name": "memoryUsage", - "value": 256, - "unit": "MB" - }, - { - "name": "assertionsPassed", - "value": 100 - } - ], - "automationTest_logs": [ - { - "timestamp": "2025-01-23T13:02:36.630Z", - "level": "info", - "message": "Test started." - }, - { - "timestamp": "2025-01-23T13:02:36.630Z", - "level": "error", - "message": "Assertion failed." - } - ] -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_bot_type_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_bot_type_invalid.json deleted file mode 100644 index 8dd6526..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_bot_type_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid bot type" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_end_time_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_end_time_invalid.json deleted file mode 100644 index 8865409..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_end_time_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid end time" - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_limit_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_limit_invalid.json deleted file mode 100644 index 46297eb..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_limit_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid limit" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_linked_id_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_linked_id_invalid.json deleted file mode 100644 index 72de54e..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_linked_id_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "linked_id can't be greater than 256 characters long" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_pagination_key_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_pagination_key_invalid.json deleted file mode 100644 index df559f9..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_pagination_key_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid pagination key" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_reverse_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_reverse_invalid.json deleted file mode 100644 index 540800f..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_reverse_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid reverse param" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_start_time_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_start_time_invalid.json deleted file mode 100644 index 5d93f92..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_start_time_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid start time" - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_visitor_id_invalid.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_visitor_id_invalid.json deleted file mode 100644 index c204c56..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_visitor_id_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid visitor id" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_visitor_id_required.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_visitor_id_required.json deleted file mode 100644 index 6c5801a..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/400_visitor_id_required.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "visitor id is required" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_subscription_not_active.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_subscription_not_active.json deleted file mode 100644 index 3deac89..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_subscription_not_active.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "SubscriptionNotActive", - "message": "forbidden" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_token_not_found.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_token_not_found.json deleted file mode 100644 index 3936b53..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_token_not_found.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "TokenNotFound", - "message": "secret key is not found" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_token_required.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_token_required.json deleted file mode 100644 index 544d871..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_token_required.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "TokenRequired", - "message": "secret key is required" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_wrong_region.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_wrong_region.json deleted file mode 100644 index 8acc9e0..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/403_wrong_region.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "WrongRegion", - "message": "wrong region" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/errors/404_request_not_found.json b/src/FingerprintPro.ServerSdk.Test/mocks/errors/404_request_not_found.json deleted file mode 100644 index 389b351..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/errors/404_request_not_found.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestNotFound", - "message": "request id is not found" - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200.json deleted file mode 100644 index 7560b9a..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "sdk": { - "platform": "js", - "version": "3.11.10" - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "confidence": "high", - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false, - "relay": false - } - } - }, - "proxy": { - "data": { - "result": true, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955, - "antiDetectBrowser": false - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "velocity": { - "data": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "ipEvents": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctIpByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctVisitorIdByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - } - }, - "developerTools": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_all_errors.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_all_errors.json deleted file mode 100644 index 15ea203..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_all_errors.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "products": { - "identification": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "botd": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "ipInfo": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "incognito": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "rootApps": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "clonedApp": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "factoryReset": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "jailbroken": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "frida": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "emulator": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "ipBlocklist": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "tor": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "vpn": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "proxy": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "privacySettings": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "virtualMachine": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "tampering": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "rawDeviceAttributes": { - "data": { - "audio": { - "error": { - "name": "Error", - "message": "internal server error" - } - }, - "canvas": { - "error": { - "name": "Error", - "message": "internal server error" - } - } - } - }, - "locationSpoofing": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "highActivity": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "suspectScore": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "velocity": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "developerTools": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "mitmAttack": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "proximity": { - "error": { - "code": "Failed", - "message": "internal server error" - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_botd_failed_error.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_botd_failed_error.json deleted file mode 100644 index 0afa5b7..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_botd_failed_error.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "0KSh65EnVoB85JBmloQK", - "incognito": true, - "linkedId": "somelinkedId", - "time": "2019-05-21T16:40:13Z", - "tag": {}, - "timestamp": 1582299576512, - "url": "https://www.example.com/login", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "error": { - "code": "Failed", - "message": "internal server error" - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_extra_fields.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_extra_fields.json deleted file mode 100644 index 5a56a1c..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_extra_fields.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "0KSh65EnVoB85JBmloQK", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97, - "revision": "v1.1" - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg", - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z" - } - }, - "product3": { - "data": { - "result": false - } - }, - "product4": { - "data": { - "result": true, - "details": { - "detail1": true, - "detail2": "detail description", - "detail3": 42 - } - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_identification_failed_error.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_identification_failed_error.json deleted file mode 100644 index 4739f36..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_identification_failed_error.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "products": { - "identification": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "botd": { - "data": { - "bot": { - "result": "bad", - "type": "headlessChrome" - }, - "url": "https://example.com/login", - "ip": "94.60.143.223", - "time": "2024-02-23T10:20:25.287Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/121.0.6167.57 Safari/537.36", - "requestId": "1708683625245.tuJ4nD" - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_too_many_requests_error.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_too_many_requests_error.json deleted file mode 100644 index 138aae7..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_too_many_requests_error.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "products": { - "identification": { - "error": { - "code": "429 Too Many Requests", - "message": "too many requests" - } - }, - "botd": { - "error": { - "code": "TooManyRequests", - "message": "too many requests" - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_with_broken_format.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_with_broken_format.json deleted file mode 100644 index 5808114..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_with_broken_format.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": { - "broken": "format" - }, - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false - } - } - }, - "proxy": { - "data": { - "result": true, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955 - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": [ - "Arial Unicode MS", - "Gill Sans", - "Helvetica Neue", - "Menlo" - ] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_with_unknown_field.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_with_unknown_field.json deleted file mode 100644 index 6af6ad6..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_200_with_unknown_field.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "unknown": "field", - "products": { - "unknown": "field", - "identification": { - "unknown": "field", - "data": { - "unknown": "field", - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false - } - } - }, - "proxy": { - "data": { - "result": false, - "confidence": "high" - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955 - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": [ - "Arial Unicode MS", - "Gill Sans", - "Helvetica Neue", - "Menlo" - ] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - } -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_search_200.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_event_search_200.json deleted file mode 100644 index 27b7848..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_event_search_200.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "events": [ - { - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "confidence": "high", - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false, - "relay": false - } - } - }, - "proxy": { - "data": { - "result": false, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955, - "antiDetectBrowser": false - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "velocity": { - "data": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "ipEvents": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctIpByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctVisitorIdByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - } - }, - "developerTools": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - }} - ], - "paginationKey": "1655373953086" -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_200_limit_1.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_200_limit_1.json deleted file mode 100644 index f6357ea..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_200_limit_1.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "visitorId": "AcxioeQKffpXF8iGQK3P", - "visits": [ - { - "requestId": "1655373953086.DDlfmP", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.68", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655373953094, - "time": "2022-06-16T10:05:53Z", - "url": "https://dashboard.fingerprint.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-16T10:03:00.912Z", - "subscription": "2022-06-16T10:03:00.912Z" - } - } - ], - "lastTimestamp": 1655373953086, - "paginationKey": "1655373953086.DDlfmP" -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_200_limit_500.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_200_limit_500.json deleted file mode 100644 index 3e3aceb..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_200_limit_500.json +++ /dev/null @@ -1,3030 +0,0 @@ -{ - "visitorId": "AcxioeQKffpXF8iGQK3P", - "visits": [ - { - "requestId": "1655373780901.HhjRFX", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1655373780912, - "time": "2022-06-16T10:03:00Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-16T05:27:30.578Z", - "subscription": "2022-06-16T05:27:30.578Z" - } - }, - { - "requestId": "1655357250568.vqejDF", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.62", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655357250578, - "time": "2022-06-16T05:27:30Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-15T15:28:33.479Z", - "subscription": "2022-06-15T15:28:33.479Z" - } - }, - { - "requestId": "1655306913474.kFQsQx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.68", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655306913479, - "time": "2022-06-15T15:28:33Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-15T08:47:34.677Z", - "subscription": "2022-06-15T08:47:34.677Z" - } - }, - { - "requestId": "1655282854672.vz4ZlN", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.91", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655282854677, - "time": "2022-06-15T08:47:34Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-14T14:19:42.753Z", - "subscription": "2022-06-14T14:19:42.753Z" - } - }, - { - "requestId": "1655216382743.RDRa4h", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1655216382753, - "time": "2022-06-14T14:19:42Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-13T07:53:19.878Z", - "subscription": "2022-06-13T07:53:19.878Z" - } - }, - { - "requestId": "1655106799870.C8m8hR", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.137", - "timestamp": 1655106799878, - "time": "2022-06-13T07:53:19Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T12:54:35.413Z", - "subscription": "2022-06-07T12:54:35.413Z" - } - }, - { - "requestId": "1654606475406.2uXCJx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.157", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651 - }, - "timestamp": 1654606475413, - "time": "2022-06-07T12:54:35Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T09:37:57.43Z", - "subscription": "2022-06-07T09:37:57.43Z" - } - }, - { - "requestId": "1654594677423.pCHmKJ", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "timezone": "Europe/Moscow" - }, - "timestamp": 1654594677430, - "time": "2022-06-07T09:37:57Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T09:37:50.109Z", - "subscription": "2022-06-07T09:37:50.109Z" - } - }, - { - "requestId": "1654594670097.Lmodmj", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1654594670109, - "time": "2022-06-07T09:37:50Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T08:31:31.9Z", - "subscription": "2022-06-07T08:31:31.9Z" - } - }, - { - "requestId": "1654590691894.aCYqYE", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1654590691900, - "time": "2022-06-07T08:31:31Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-06T09:05:25.954Z", - "subscription": "2022-06-06T09:05:25.954Z" - } - }, - { - "requestId": "1654506325946.ijIwzu", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1654506325954, - "time": "2022-06-06T09:05:25Z", - "url": "https://fingerprintcom.netlify.app/blog/name-change/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-02T16:58:53.635Z", - "subscription": "2022-06-02T16:58:53.635Z" - } - }, - { - "requestId": "1654189133629.0V1gtF", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1654189133635, - "time": "2022-06-02T16:58:53Z", - "url": "https://fingerprintcom.netlify.app/blog/name-change/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-02T16:58:51.483Z", - "subscription": "2022-06-02T16:58:51.483Z" - } - }, - { - "requestId": "1654189131472.r49Bbh", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1654189131483, - "time": "2022-06-02T16:58:51Z", - "url": "https://fingerprintcom.netlify.app/", - "tag": {}, - "confidence": { - "score": 0.95 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-27T14:52:26.624Z", - "subscription": "2022-05-27T14:52:26.624Z" - } - }, - { - "requestId": "1653663146617.o8KpJO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1653663146624, - "time": "2022-05-27T14:52:26Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-20T09:50:06.7Z", - "subscription": "2022-05-20T09:50:06.7Z" - } - }, - { - "requestId": "1653040206694.Q5Csig", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1653040206700, - "time": "2022-05-20T09:50:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-19T16:27:38.029Z", - "subscription": "2022-05-19T16:27:38.029Z" - } - }, - { - "requestId": "1652977658020.xbfYhA", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652977658029, - "time": "2022-05-19T16:27:38Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-17T15:09:32.666Z", - "subscription": "2022-05-17T15:09:32.666Z" - } - }, - { - "requestId": "1652800172657.xA22Pd", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652800172666, - "time": "2022-05-17T15:09:32Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-17T14:18:17.631Z", - "subscription": "2022-05-17T14:18:17.631Z" - } - }, - { - "requestId": "1652797097626.faAMJO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652797097631, - "time": "2022-05-17T14:18:17Z", - "url": "https://fingerprintjs.com/careers/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-17T10:16:04.809Z", - "subscription": "2022-05-17T10:16:04.809Z" - } - }, - { - "requestId": "1652782564800.MWH0GO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652782564809, - "time": "2022-05-17T10:16:04Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-16T06:47:01.511Z", - "subscription": "2022-05-16T06:47:01.511Z" - } - }, - { - "requestId": "1652683621505.1tOjuc", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "217.150.54.233", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1652683621511, - "time": "2022-05-16T06:47:01Z", - "url": "https://fingerprintjs.com/products/bot-detection/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-16T06:45:49.586Z", - "subscription": "2022-05-16T06:45:49.586Z" - } - }, - { - "requestId": "1652683586557.67Faeg", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": true, - "ip": "217.150.54.233", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1652683586562, - "time": "2022-05-16T06:46:26Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.94 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-16T06:45:49.586Z", - "subscription": "2022-05-16T06:45:49.586Z" - } - }, - { - "requestId": "1652683549513.aVRqEP", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "217.150.54.233", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1652683549586, - "time": "2022-05-16T06:45:49Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-05T10:11:25.96Z", - "subscription": "2022-05-05T10:11:25.96Z" - } - }, - { - "requestId": "1651745485951.Oj68me", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651745485960, - "time": "2022-05-05T10:11:25Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-05T09:33:40.155Z", - "subscription": "2022-05-05T09:33:40.155Z" - } - }, - { - "requestId": "1651743220004.W02rhx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651743220155, - "time": "2022-05-05T09:33:40Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-03T15:26:32.826Z", - "subscription": "2022-05-03T15:26:32.826Z" - } - }, - { - "requestId": "1651591592822.Is9u93", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.157", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651591592826, - "time": "2022-05-03T15:26:32Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-29T13:23:37.049Z", - "subscription": "2022-04-29T13:23:37.049Z" - } - }, - { - "requestId": "1651238617044.rMVPGS", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651238617049, - "time": "2022-04-29T13:23:37Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-29T10:37:53.333Z", - "subscription": "2022-04-29T10:37:53.333Z" - } - }, - { - "requestId": "1651228673329.QZI2Cu", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1651228673333, - "time": "2022-04-29T10:37:53Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T13:58:06.323Z", - "subscription": "2022-04-28T13:58:06.323Z" - } - }, - { - "requestId": "1651154286221.YvuOCP", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.113", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651154286323, - "time": "2022-04-28T13:58:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T12:16:02.564Z", - "subscription": "2022-04-28T12:16:02.564Z" - } - }, - { - "requestId": "1651148162556.dySgif", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.113", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651148162564, - "time": "2022-04-28T12:16:02Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T11:57:13.267Z", - "subscription": "2022-04-28T11:57:13.267Z" - } - }, - { - "requestId": "1651147033260.SxmFvL", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.146", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651147033267, - "time": "2022-04-28T11:57:13Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T11:57:06.24Z", - "subscription": "2022-04-28T11:57:06.24Z" - } - }, - { - "requestId": "1651147026139.aAZ8TO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.146", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651147026240, - "time": "2022-04-28T11:57:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T14:10:31.908Z", - "subscription": "2022-04-26T14:10:31.908Z" - } - }, - { - "requestId": "1650982231903.eG0b6v", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.105", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650982231908, - "time": "2022-04-26T14:10:31Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:43:37.373Z", - "subscription": "2022-04-26T11:43:37.373Z" - } - }, - { - "requestId": "1650973417360.xupFFD", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.99", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650973417373, - "time": "2022-04-26T11:43:37Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:43:30.111Z", - "subscription": "2022-04-26T11:43:30.111Z" - } - }, - { - "requestId": "1650973410104.AQD4qu", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.99", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650973410111, - "time": "2022-04-26T11:43:30Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:22:34.148Z", - "subscription": "2022-04-26T11:22:34.148Z" - } - }, - { - "requestId": "1650972154133.lSWE8a", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.96", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650972154148, - "time": "2022-04-26T11:22:34Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:22:03.83Z", - "subscription": "2022-04-26T11:22:03.83Z" - } - }, - { - "requestId": "1650972123824.xk8MUR", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.96", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650972123830, - "time": "2022-04-26T11:22:03Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-25T09:46:15.458Z", - "subscription": "2022-04-25T09:46:15.458Z" - } - }, - { - "requestId": "1650879975452.kfuowM", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1650879975458, - "time": "2022-04-25T09:46:15Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-22T16:51:44.816Z", - "subscription": "2022-04-22T16:51:44.816Z" - } - }, - { - "requestId": "1650646304808.xQbAju", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.227", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650646304816, - "time": "2022-04-22T16:51:44Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-21T11:43:33.116Z", - "subscription": "2022-04-21T11:43:33.116Z" - } - }, - { - "requestId": "1650541413105.leAPLz", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.89", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650541413116, - "time": "2022-04-21T11:43:33Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-20T17:11:54.717Z", - "subscription": "2022-04-20T17:11:54.717Z" - } - }, - { - "requestId": "1650474714710.M1IGsl", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.111", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650474714717, - "time": "2022-04-20T17:11:54Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-20T17:11:47.217Z", - "subscription": "2022-04-20T17:11:47.217Z" - } - }, - { - "requestId": "1650474707211.CEUuZk", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.111", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650474707217, - "time": "2022-04-20T17:11:47Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-20T17:11:12.076Z", - "subscription": "2022-04-20T17:11:12.076Z" - } - }, - { - "requestId": "1650474672071.Pz4WsK", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.111", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650474672076, - "time": "2022-04-20T17:11:12Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T12:29:06.692Z", - "subscription": "2022-04-19T12:29:06.692Z" - } - }, - { - "requestId": "1650371346684.1d7sgv", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.198", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650371346692, - "time": "2022-04-19T12:29:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T12:29:02.15Z", - "subscription": "2022-04-19T12:29:02.15Z" - } - }, - { - "requestId": "1650371342145.oWyfRx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.198", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650371342150, - "time": "2022-04-19T12:29:02Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:35:14.729Z", - "subscription": "2022-04-19T11:35:14.729Z" - } - }, - { - "requestId": "1650368114723.YEXcHI", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.206", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650368114729, - "time": "2022-04-19T11:35:14Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:13:33.107Z", - "subscription": "2022-04-19T11:13:33.107Z" - } - }, - { - "requestId": "1650366813101.SvUZC1", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366813107, - "time": "2022-04-19T11:13:33Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:13:28.453Z", - "subscription": "2022-04-19T11:13:28.453Z" - } - }, - { - "requestId": "1650366808426.Hy6j7v", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366808453, - "time": "2022-04-19T11:13:28Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:07:05.19Z", - "subscription": "2022-04-19T11:07:05.19Z" - } - }, - { - "requestId": "1650366425184.xvYkdr", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366425190, - "time": "2022-04-19T11:07:05Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:07:00.483Z", - "subscription": "2022-04-19T11:07:00.483Z" - } - }, - { - "requestId": "1650366420377.VR5pDX", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366420483, - "time": "2022-04-19T11:07:00Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:37:45.279Z", - "subscription": "2022-04-19T10:37:45.279Z" - } - }, - { - "requestId": "1650364665274.qq31O4", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.172", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650364665279, - "time": "2022-04-19T10:37:45Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:22:58.87Z", - "subscription": "2022-04-19T10:22:58.87Z" - } - }, - { - "requestId": "1650363778864.tsVBjO", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.210", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650363778870, - "time": "2022-04-19T10:22:58Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:22:46.894Z", - "subscription": "2022-04-19T10:22:46.894Z" - } - }, - { - "requestId": "1650363766889.KuVDpm", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.210", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650363766894, - "time": "2022-04-19T10:22:46Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:07:01.528Z", - "subscription": "2022-04-19T10:07:01.528Z" - } - }, - { - "requestId": "1650362821521.dXH2Ce", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.180", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650362821528, - "time": "2022-04-19T10:07:01Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:02:42.46Z", - "subscription": "2022-04-19T10:02:42.46Z" - } - }, - { - "requestId": "1650362562448.a5cPLU", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.180", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650362562460, - "time": "2022-04-19T10:02:42Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-18T17:06:30.834Z", - "subscription": "2022-04-18T17:06:30.834Z" - } - }, - { - "requestId": "1650301590829.YXGX7h", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.195", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650301590834, - "time": "2022-04-18T17:06:30Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-18T12:23:30.446Z", - "subscription": "2022-04-18T12:23:30.446Z" - } - }, - { - "requestId": "1650284610441.lJrX4M", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.179", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650284610446, - "time": "2022-04-18T12:23:30Z", - "url": "https://fingerprintjs.com/blog/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-06T14:53:00.526Z", - "subscription": "2022-04-06T14:53:00.526Z" - } - }, - { - "requestId": "1649256780522.WAXWf2", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36" - }, - "incognito": false, - "ip": "109.245.35.200", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1649256780526, - "time": "2022-04-06T14:53:00Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-18T11:08:35.698Z", - "subscription": "2022-03-18T11:08:35.698Z" - } - }, - { - "requestId": "1649256780520.RRC4PR", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36" - }, - "incognito": false, - "ip": "109.245.35.200", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1649256780525, - "time": "2022-04-06T14:53:00Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-18T11:08:35.698Z", - "subscription": "2022-03-18T11:08:35.698Z" - } - }, - { - "requestId": "1647601715689.iocXfW", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "178.223.21.183", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647601715698, - "time": "2022-03-18T11:08:35Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-16T08:21:23.62Z", - "subscription": "2022-03-16T08:21:23.62Z" - } - }, - { - "requestId": "1647418883615.Vck2NA", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "87.116.165.97", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647418883620, - "time": "2022-03-16T08:21:23Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-16T08:21:18.398Z", - "subscription": "2022-03-16T08:21:18.398Z" - } - }, - { - "requestId": "1647418878391.NZDmht", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "87.116.165.97", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647418878398, - "time": "2022-03-16T08:21:18Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-15T11:46:51.858Z", - "subscription": "2022-03-15T11:46:51.858Z" - } - }, - { - "requestId": "1647344811836.RvNkL5", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "87.116.165.97", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647344811858, - "time": "2022-03-15T11:46:51Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-08T12:33:05.677Z", - "subscription": "2022-03-08T12:33:05.677Z" - } - } - ] -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_400_bad_request.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_400_bad_request.json deleted file mode 100644 index c2b6e29..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_400_bad_request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "bad request" -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_403_forbidden.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_403_forbidden.json deleted file mode 100644 index 8a886d1..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_403_forbidden.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "Forbidden (HTTP 403)" -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_429_too_many_requests.json b/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_429_too_many_requests.json deleted file mode 100644 index 00d00f2..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/get_visitors_429_too_many_requests.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "too many requests" -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/related-visitors/get_related_visitors_200.json b/src/FingerprintPro.ServerSdk.Test/mocks/related-visitors/get_related_visitors_200.json deleted file mode 100644 index 7a46a69..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/related-visitors/get_related_visitors_200.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "relatedVisitors": [ - { - "visitorId": "NtCUJGceWX9RpvSbhvOm" - }, - { - "visitorId": "25ee02iZwGxeyT0jMNkZ" - } - ] -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/related-visitors/get_related_visitors_200_empty.json b/src/FingerprintPro.ServerSdk.Test/mocks/related-visitors/get_related_visitors_200_empty.json deleted file mode 100644 index 6c9b02c..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/related-visitors/get_related_visitors_200_empty.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "relatedVisitors": [] -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/update_event_multiple_fields_request.json b/src/FingerprintPro.ServerSdk.Test/mocks/update_event_multiple_fields_request.json deleted file mode 100644 index f85d2e7..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/update_event_multiple_fields_request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "linkedId": "myNewLinkedId", - "tag": { - "myTag": "myNewValue" - }, - "suspect": true -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/update_event_one_field_request.json b/src/FingerprintPro.ServerSdk.Test/mocks/update_event_one_field_request.json deleted file mode 100644 index 0ebd154..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/update_event_one_field_request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "linkedId": "myNewLinkedId" -} diff --git a/src/FingerprintPro.ServerSdk.Test/mocks/webhook.json b/src/FingerprintPro.ServerSdk.Test/mocks/webhook.json deleted file mode 100644 index 1180fcd..0000000 --- a/src/FingerprintPro.ServerSdk.Test/mocks/webhook.json +++ /dev/null @@ -1,293 +0,0 @@ -{ - "requestId": "Px6VxbRC6WBkA39yeNH3", - "url": "https://banking.example.com/signup", - "ip": "216.3.128.12", - "tag": { - "requestType": "signup", - "yourCustomId": 45321 - }, - "time": "2019-10-12T07:20:50.52Z", - "timestamp": 1554910997788, - "ipLocation": { - "accuracyRadius": 1, - "city": { - "name": "Bolingbrook" - }, - "continent": { - "code": "NA", - "name": "North America" - }, - "country": { - "code": "US", - "name": "United States" - }, - "latitude": 41.12933, - "longitude": -88.9954, - "postalCode": "60547", - "subdivisions": [ - { - "isoCode": "IL", - "name": "Illinois" - } - ], - "timezone": "America/Chicago" - }, - "linkedId": "any-string", - "visitorId": "3HNey93AkBW6CRbxV6xP", - "visitorFound": true, - "confidence": { - "score": 0.97 - }, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": null - }, - "browserDetails": { - "browserName": "Chrome", - "browserFullVersion": "73.0.3683.86", - "browserMajorVersion": "73", - "os": "Mac OS X", - "osVersion": "10.14.3", - "device": "Other", - "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86" - }, - "incognito": false, - "clientReferrer": "https://google.com?search=banking+services", - "bot": { - "result": "bad", - "type": "selenium" - }, - "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86", - "rootApps": { - "result": false - }, - "emulator": { - "result": false - }, - "ipInfo": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - } - }, - "ipBlocklist": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - }, - "tor": { - "result": false - }, - "vpn": { - "result": false, - "confidence": "high", - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false, - "relay": false - } - }, - "proxy": { - "result": true, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - }, - "tampering": { - "result": false, - "anomalyScore": 0, - "antiDetectBrowser": false - }, - "clonedApp": { - "result": false - }, - "factoryReset": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - }, - "jailbroken": { - "result": false - }, - "frida": { - "result": false - }, - "privacySettings": { - "result": false - }, - "virtualMachine": { - "result": false - }, - "rawDeviceAttributes": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "srgb" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - } - }, - "highActivity": { - "result": false - }, - "locationSpoofing": { - "result": true - }, - "suspectScore": { - "result": 0 - }, - "velocity": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "ipEvents": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctIpByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctVisitorIdByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - }, - "developerTools": { - "result": false - }, - "mitmAttack": { - "result": false - }, - "sdk": { - "platform": "js", - "version": "3.11.10" - }, - "replayed": false, - "supplementaryIds": { - "standard": { - "visitorId": "3HNey93AkBW6CRbxV6xP", - "visitorFound": true, - "confidence": { - "score": 0.97 - }, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": "2022-03-16T11:28:34.023Z" - } - }, - "highRecall": { - "visitorId": "3HNey93AkBW6CRbxV6xP", - "visitorFound": true, - "confidence": { - "score": 0.97 - }, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": "2022-03-16T11:28:34.023Z" - } - } - }, - "proximity": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } -} diff --git a/src/FingerprintPro.ServerSdk/Api/FingerprintApi.cs b/src/FingerprintPro.ServerSdk/Api/FingerprintApi.cs deleted file mode 100644 index b243eb6..0000000 --- a/src/FingerprintPro.ServerSdk/Api/FingerprintApi.cs +++ /dev/null @@ -1,582 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IFingerprintApi - { - - #region Synchronous Operations - /// - /// Delete data by visitor ID - /// - /// - /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. - /// - void DeleteVisitorData(string visitorId); - - /// - /// Delete data by visitor ID - /// - /// - /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. - /// ApiResponse of Object(void) - ApiResponse DeleteVisitorDataWithHttpInfo(string visitorId); - /// - /// Get event by request ID - /// - /// - /// Get a detailed analysis of an individual identification event, including Smart Signals. 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`. - /// - /// Thrown when fails to make API call - /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. - /// EventsGetResponse - EventsGetResponse GetEvent(string requestId); - - /// - /// Get event by request ID - /// - /// - /// Get a detailed analysis of an individual identification event, including Smart Signals. 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`. - /// - /// Thrown when fails to make API call - /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. - /// ApiResponse of EventsGetResponse - ApiResponse GetEventWithHttpInfo(string requestId); - /// - /// Get Related Visitors - /// - /// - /// Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. - /// RelatedVisitorsResponse - RelatedVisitorsResponse GetRelatedVisitors(string visitorId); - - /// - /// Get Related Visitors - /// - /// - /// Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. - /// ApiResponse of RelatedVisitorsResponse - ApiResponse GetRelatedVisitorsWithHttpInfo(string visitorId); - /// - /// Get visits by visitor ID - /// - /// - /// Get a history of visits (identification events) 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. - /// - /// Thrown when fails to make API call - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. - /// 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/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - /// Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#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 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) - /// 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) - /// ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) - /// VisitorsGetResponse - VisitorsGetResponse GetVisits(string visitorId, string requestId = null!, string linkedId = null!, int? limit = null!, string paginationKey = null!, long? before = null!); - - /// - /// Get visits by visitor ID - /// - /// - /// Get a history of visits (identification events) 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. - /// - /// Thrown when fails to make API call - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. - /// 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/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - /// Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#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 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) - /// 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) - /// ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) - /// ApiResponse of VisitorsGetResponse - ApiResponse GetVisitsWithHttpInfo(string visitorId, string requestId = null!, string linkedId = null!, int? limit = null!, string paginationKey = null!, long? before = null!); - /// - /// Get events via search - /// - /// - /// Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. - /// - /// Thrown when fails to make API call - /// Limit the number of events returned. - /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` (optional) - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) - /// Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - /// Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#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) - /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - /// Sort events in reverse timestamp order. (optional) - /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) - /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) - /// Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) - /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) - /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) - /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) - /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) - /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) - /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) - /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) - /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) - /// Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) - /// Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) - /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response. (optional) - /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response. (optional) - /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response. (optional) - /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response. (optional) - /// Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` (optional) - /// Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) - /// Filter for events by providing one or more environment IDs. (optional) - /// Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// SearchEventsResponse - SearchEventsResponse SearchEvents(int? limit, string paginationKey = null!, string visitorId = null!, string bot = null!, string ipAddress = null!, string linkedId = null!, long? start = null!, long? end = null!, bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, string sdkVersion = null!, string sdkPlatform = null!, List environment = null!, string proximityId = null!, int? proximityPrecisionRadius = null!); - - /// - /// Get events via search - /// - /// - /// Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. - /// - /// Thrown when fails to make API call - /// Limit the number of events returned. - /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` (optional) - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) - /// Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - /// Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#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) - /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - /// Sort events in reverse timestamp order. (optional) - /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) - /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) - /// Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) - /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) - /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) - /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) - /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) - /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) - /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) - /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) - /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) - /// Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) - /// Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) - /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response. (optional) - /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response. (optional) - /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response. (optional) - /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response. (optional) - /// Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` (optional) - /// Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) - /// Filter for events by providing one or more environment IDs. (optional) - /// Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// ApiResponse of SearchEventsResponse - ApiResponse SearchEventsWithHttpInfo(int? limit, string paginationKey = null!, string visitorId = null!, string bot = null!, string ipAddress = null!, string linkedId = null!, long? start = null!, long? end = null!, bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, string sdkVersion = null!, string sdkPlatform = null!, List environment = null!, string proximityId = null!, int? proximityPrecisionRadius = null!); - /// - /// Update an event with a given request ID - /// - /// - /// Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. - /// - /// Thrown when fails to make API call - /// - /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). - /// - void UpdateEvent(EventsUpdateRequest body, string requestId); - - /// - /// Update an event with a given request ID - /// - /// - /// Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. - /// - /// Thrown when fails to make API call - /// - /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). - /// ApiResponse of Object(void) - ApiResponse UpdateEventWithHttpInfo(EventsUpdateRequest body, string requestId); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Delete data by visitor ID - /// - /// - /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. - /// Task of void - Task DeleteVisitorDataAsync(string visitorId); - - /// - /// Delete data by visitor IDe - /// - /// - /// Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. - /// Task of ApiResponse - Task> DeleteVisitorDataAsyncWithHttpInfo(string visitorId); - /// - /// Get event by request ID - /// - /// - /// Get a detailed analysis of an individual identification event, including Smart Signals. 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`. - /// - /// Thrown when fails to make API call - /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. - /// Task of EventsGetResponse - Task GetEventAsync(string requestId); - - /// - /// Get event by request IDe - /// - /// - /// Get a detailed analysis of an individual identification event, including Smart Signals. 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`. - /// - /// Thrown when fails to make API call - /// The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. - /// Task of ApiResponse (EventsGetResponse) - Task> GetEventAsyncWithHttpInfo(string requestId); - /// - /// Get Related Visitors - /// - /// - /// Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. - /// Task of RelatedVisitorsResponse - Task GetRelatedVisitorsAsync(string visitorId); - - /// - /// Get Related Visitorse - /// - /// - /// Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). - /// - /// Thrown when fails to make API call - /// The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. - /// Task of ApiResponse (RelatedVisitorsResponse) - Task> GetRelatedVisitorsAsyncWithHttpInfo(string visitorId); - /// - /// Get visits by visitor ID - /// - /// - /// Get a history of visits (identification events) 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. - /// - /// Thrown when fails to make API call - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. - /// 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/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - /// Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#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 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) - /// 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) - /// ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) - /// Task of VisitorsGetResponse - Task GetVisitsAsync(string visitorId, string requestId = null!, string linkedId = null!, int? limit = null!, string paginationKey = null!, long? before = null!); - - /// - /// Get visits by visitor IDe - /// - /// - /// Get a history of visits (identification events) 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. - /// - /// Thrown when fails to make API call - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. - /// 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/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - /// Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#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 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) - /// 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) - /// ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) - /// Task of ApiResponse (VisitorsGetResponse) - Task> GetVisitsAsyncWithHttpInfo(string visitorId, string requestId = null!, string linkedId = null!, int? limit = null!, string paginationKey = null!, long? before = null!); - /// - /// Get events via search - /// - /// - /// Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. - /// - /// Thrown when fails to make API call - /// Limit the number of events returned. - /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` (optional) - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) - /// Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - /// Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#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) - /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - /// Sort events in reverse timestamp order. (optional) - /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) - /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) - /// Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) - /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) - /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) - /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) - /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) - /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) - /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) - /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) - /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) - /// Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) - /// Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) - /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response. (optional) - /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response. (optional) - /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response. (optional) - /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response. (optional) - /// Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` (optional) - /// Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) - /// Filter for events by providing one or more environment IDs. (optional) - /// Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// Task of SearchEventsResponse - Task SearchEventsAsync(int? limit, string paginationKey = null!, string visitorId = null!, string bot = null!, string ipAddress = null!, string linkedId = null!, long? start = null!, long? end = null!, bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, string sdkVersion = null!, string sdkPlatform = null!, List environment = null!, string proximityId = null!, int? proximityPrecisionRadius = null!); - - /// - /// Get events via searche - /// - /// - /// Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. - /// - /// Thrown when fails to make API call - /// Limit the number of events returned. - /// Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` (optional) - /// Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - /// Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) - /// Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - /// Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#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) - /// Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - /// Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - /// Sort events in reverse timestamp order. (optional) - /// Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. (optional) - /// Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) - /// Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) - /// Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) - /// Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) - /// Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) - /// Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) - /// Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) - /// Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) - /// Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) - /// Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) - /// Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) - /// Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) - /// Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) - /// Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) - /// Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response. (optional) - /// Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response. (optional) - /// Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response. (optional) - /// Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response. (optional) - /// Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` (optional) - /// Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) - /// Filter for events by providing one or more environment IDs. (optional) - /// Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response. (optional) - /// Task of ApiResponse (SearchEventsResponse) - Task> SearchEventsAsyncWithHttpInfo(int? limit, string paginationKey = null!, string visitorId = null!, string bot = null!, string ipAddress = null!, string linkedId = null!, long? start = null!, long? end = null!, bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, string sdkVersion = null!, string sdkPlatform = null!, List environment = null!, string proximityId = null!, int? proximityPrecisionRadius = null!); - /// - /// Update an event with a given request ID - /// - /// - /// Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. - /// - /// Thrown when fails to make API call - /// - /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). - /// Task of void - Task UpdateEventAsync(EventsUpdateRequest body, string requestId); - - /// - /// Update an event with a given request IDe - /// - /// - /// Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. - /// - /// Thrown when fails to make API call - /// - /// The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). - /// Task of ApiResponse - Task> UpdateEventAsyncWithHttpInfo(EventsUpdateRequest body, string requestId); - #endregion Asynchronous Operations - } - - - internal class DeleteVisitorDataDefinition : OperationDefinition - { - public override string Path => "/visitors/{visitor_id}"; - - public override string OperationName => "DeleteVisitorData"; - - public override string[] PathParams => new[] { "visitor_id", }; - - public override Dictionary ResponseStatusCodeMap => new() - { - { - 400, typeof(ErrorResponse) - }, - { - 403, typeof(ErrorResponse) - }, - { - 404, typeof(ErrorResponse) - }, - { - 429, typeof(ErrorResponse) - }, - }; - } - internal class GetEventDefinition : OperationDefinition - { - public override string Path => "/events/{request_id}"; - - public override string OperationName => "GetEvent"; - - public override string[] PathParams => new[] { "request_id", }; - - public override Dictionary ResponseStatusCodeMap => new() - { - { - 200, typeof(EventsGetResponse) - }, - { - 403, typeof(ErrorResponse) - }, - { - 404, typeof(ErrorResponse) - }, - }; - } - internal class GetRelatedVisitorsDefinition : OperationDefinition - { - public override string Path => "/related-visitors"; - - public override string OperationName => "GetRelatedVisitors"; - - public override string[] PathParams => Array.Empty(); - - public override Dictionary ResponseStatusCodeMap => new() - { - { - 200, typeof(RelatedVisitorsResponse) - }, - { - 400, typeof(ErrorResponse) - }, - { - 403, typeof(ErrorResponse) - }, - { - 404, typeof(ErrorResponse) - }, - { - 429, typeof(ErrorResponse) - }, - }; - } - internal class GetVisitsDefinition : OperationDefinition - { - public override string Path => "/visitors/{visitor_id}"; - - public override string OperationName => "GetVisits"; - - public override string[] PathParams => new[] { "visitor_id", }; - - public override Dictionary ResponseStatusCodeMap => new() - { - { - 200, typeof(VisitorsGetResponse) - }, - { - 400, typeof(ErrorPlainResponse) - }, - { - 403, typeof(ErrorPlainResponse) - }, - { - 429, typeof(ErrorPlainResponse) - }, - }; - } - internal class SearchEventsDefinition : OperationDefinition - { - public override string Path => "/events/search"; - - public override string OperationName => "SearchEvents"; - - public override string[] PathParams => Array.Empty(); - - public override Dictionary ResponseStatusCodeMap => new() - { - { - 200, typeof(SearchEventsResponse) - }, - { - 400, typeof(ErrorResponse) - }, - { - 403, typeof(ErrorResponse) - }, - }; - } - internal class UpdateEventDefinition : OperationDefinition - { - public override string Path => "/events/{request_id}"; - - public override string OperationName => "UpdateEvent"; - - public override string[] PathParams => new[] { "request_id", }; - - public override Dictionary ResponseStatusCodeMap => new() - { - { - 400, typeof(ErrorResponse) - }, - { - 403, typeof(ErrorResponse) - }, - { - 404, typeof(ErrorResponse) - }, - { - 409, typeof(ErrorResponse) - }, - }; - } - -} diff --git a/src/FingerprintPro.ServerSdk/Api/FingerprintApiImpl.cs b/src/FingerprintPro.ServerSdk/Api/FingerprintApiImpl.cs deleted file mode 100644 index b76b53d..0000000 --- a/src/FingerprintPro.ServerSdk/Api/FingerprintApiImpl.cs +++ /dev/null @@ -1,364 +0,0 @@ -using System.Globalization; -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; -using System.Net.Http; -using System.Text; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Api; - -public class FingerprintApi : IFingerprintApi -{ - private readonly ApiClient _apiClient; - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public FingerprintApi(Configuration configuration) - { - _apiClient = new ApiClient(configuration); - } - - #region Utils - - private void AddQueryParam(List> queryParams, string name, object? value) - { - if (value is null) return; - switch (value) - { - case bool b: - queryParams.Add(new KeyValuePair(name, b.ToString())); // "True"/"False" - break; - case float f: - queryParams.Add(new KeyValuePair(name, f.ToString("F", CultureInfo.InvariantCulture))); - break; - case IFormattable formattable: - queryParams.Add(new KeyValuePair(name, formattable.ToString(null, CultureInfo.InvariantCulture)!)); - break; - default: - var str = value.ToString(); - if (!string.IsNullOrEmpty(str)) - queryParams.Add(new KeyValuePair(name, str)); - break; - } - } - #endregion - - #region GetEvent - - public EventsGetResponse GetEvent(string requestId) - { - return GetEventWithHttpInfo(requestId).Data; - } - - public ApiResponse GetEventWithHttpInfo(string requestId) - { - return GetEventAsyncWithHttpInfo(requestId).Result; - } - - public async Task GetEventAsync(string requestId) - { - return (await GetEventAsyncWithHttpInfo(requestId)).Data; - } - - public Task> GetEventAsyncWithHttpInfo(string requestId) - { - var definition = new GetEventDefinition(); - - var request = new ApiRequest - { - OperationDefinition = definition, - Method = HttpMethod.Get, - Args = new[] { requestId }, - }; - - return _apiClient.DoRequest(request); - } - - #endregion - - #region UpdateEvent - - public void UpdateEvent(EventsUpdateRequest body, string requestId) - { - UpdateEventWithHttpInfo(body, requestId); - } - - public ApiResponse UpdateEventWithHttpInfo(EventsUpdateRequest body, string requestId) - { - return UpdateEventAsyncWithHttpInfo(body, requestId).Result; - } - - public async Task UpdateEventAsync(EventsUpdateRequest body, string requestId) - { - await UpdateEventAsyncWithHttpInfo(body, requestId); - } - - public Task> UpdateEventAsyncWithHttpInfo(EventsUpdateRequest body, string requestId) - { - var definition = new UpdateEventDefinition(); - var request = new ApiRequest() - { - OperationDefinition = definition, - Method = HttpMethod.Put, - Args = new[] { requestId }, - Body = new StringContent(JsonUtils.Serialize(body), Encoding.UTF8, "application/json"), - }; - - return _apiClient.DoRequestEmpty(request); - } - - #endregion - - #region GetVisits - - public async Task GetVisitsAsync(string visitorId, string? requestId = null, - string? linkedId = null, - int? limit = null, - string? paginationKey = null, long? before = null) - { - return (await GetVisitsAsyncWithHttpInfo(visitorId, requestId, linkedId, limit, paginationKey, before)).Data; - } - - public Task> GetVisitsAsyncWithHttpInfo(string visitorId, string? requestId = null, - string? linkedId = null, int? limit = null, - string? paginationKey = null, long? before = null) - { - var queryParams = new List>(); - - AddQueryParam(queryParams, "request_id", requestId); - AddQueryParam(queryParams, "linked_id", linkedId); - AddQueryParam(queryParams, "limit", limit); - AddQueryParam(queryParams, "paginationKey", paginationKey); - AddQueryParam(queryParams, "before", before); - - var definition = new GetVisitsDefinition(); - var request = new ApiRequest() - { - OperationDefinition = definition, - Method = HttpMethod.Get, - Args = new[] { visitorId }, - QueryParams = queryParams - }; - - return _apiClient.DoRequest(request); - } - - public VisitorsGetResponse GetVisits(string visitorId, string? requestId = null, string? linkedId = null, - int? limit = null, - string? paginationKey = null, long? before = null) - { - return GetVisitsWithHttpInfo(visitorId, requestId, linkedId, limit, paginationKey, before).Data; - } - - public ApiResponse GetVisitsWithHttpInfo(string visitorId, string? requestId = null, - string? linkedId = null, int? limit = null, - string? paginationKey = null, long? before = null) - { - return GetVisitsAsyncWithHttpInfo(visitorId, requestId, linkedId, limit, paginationKey, before).Result; - } - - #endregion - - #region DeleteVisitorData - - public void DeleteVisitorData(string visitorId) - { - DeleteVisitorDataWithHttpInfo(visitorId); - } - - public ApiResponse DeleteVisitorDataWithHttpInfo(string visitorId) - { - return DeleteVisitorDataAsyncWithHttpInfo(visitorId).Result; - } - - public async Task DeleteVisitorDataAsync(string visitorId) - { - await DeleteVisitorDataAsyncWithHttpInfo(visitorId); - } - - public Task> DeleteVisitorDataAsyncWithHttpInfo(string visitorId) - { - var definition = new DeleteVisitorDataDefinition(); - - var request = new ApiRequest - { - OperationDefinition = definition, - Method = HttpMethod.Delete, - Args = new[] { visitorId } - }; - - return _apiClient.DoRequestEmpty(request); - } - - #endregion - - #region GetRelatedVisitors - - public RelatedVisitorsResponse GetRelatedVisitors(string visitorId) - { - return GetRelatedVisitorsWithHttpInfo(visitorId).Data; - } - - public ApiResponse GetRelatedVisitorsWithHttpInfo(string visitorId) - { - return GetRelatedVisitorsAsyncWithHttpInfo(visitorId).Result; - } - - public async Task GetRelatedVisitorsAsync(string visitorId) - { - var response = await GetRelatedVisitorsAsyncWithHttpInfo(visitorId); - return response.Data; - } - - public Task> GetRelatedVisitorsAsyncWithHttpInfo(string visitorId) - { - var definition = new GetRelatedVisitorsDefinition(); - - var request = new ApiRequest - { - OperationDefinition = definition, - Method = HttpMethod.Get, - QueryParams = new List> - { - new KeyValuePair("visitor_id", visitorId) - } - }; - - return _apiClient.DoRequest(request); - } - - #endregion - - #region SearchEvents - - public SearchEventsResponse SearchEvents(int? limit, string paginationKey = null!, string visitorId = null!, - string bot = null!, string ipAddress = null!, string linkedId = null!, long? start = null!, long? end = null!, - bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, bool? virtualMachine = null!, - bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, - bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, - bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, - float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, - bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, - string? sdkVersion = null!, string? sdkPlatform = null!, List? environment = null!, - string? proximityId = null!, int? proximityPrecisionRadius = null!) - { - return SearchEventsWithHttpInfo(limit, paginationKey, visitorId, bot, ipAddress, linkedId, start, end, reverse, - suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, frida, - factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, ipBlocklist, datacenter, - developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, proximityId, proximityPrecisionRadius).Data; - } - - public ApiResponse SearchEventsWithHttpInfo(int? limit, string paginationKey = null!, - string visitorId = null!, string bot = null!, string ipAddress = null!, string linkedId = null!, - long? start = null!, long? end = null!, bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, - bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, - bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, - bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, - float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, - bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, - string? sdkVersion = null!, string? sdkPlatform = null!, List? environment = null!, - string? proximityId = null!, int? proximityPrecisionRadius = null!) - { - return SearchEventsAsyncWithHttpInfo(limit, paginationKey, visitorId, bot, ipAddress, linkedId, start, end, - reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, jailbroken, - frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, ipBlocklist, datacenter, - developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, - proximityId, proximityPrecisionRadius).Result; - } - - public async Task SearchEventsAsync(int? limit, string paginationKey = null!, - string visitorId = null!, string bot = null!, string ipAddress = null!, string linkedId = null!, - long? start = null!, long? end = null!, bool? reverse = null!, bool? suspect = null!, bool? vpn = null!, - bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, bool? incognito = null!, - bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, - bool? clonedApp = null!, bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, - float? minSuspectScore = null!, bool? ipBlocklist = null!, bool? datacenter = null!, - bool? developerTools = null!, bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, - string? sdkVersion = null!, string? sdkPlatform = null!, List? environment = null!, - string? proximityId = null!, int? proximityPrecisionRadius = null!) - { - var response = await SearchEventsAsyncWithHttpInfo(limit, paginationKey, visitorId, bot, ipAddress, linkedId, - start, end, reverse, suspect, vpn, virtualMachine, tampering, antiDetectBrowser, incognito, privacySettings, - jailbroken, frida, factoryReset, clonedApp, emulator, rootApps, vpnConfidence, minSuspectScore, ipBlocklist, - datacenter, developerTools, locationSpoofing, mitmAttack, proxy, sdkVersion, sdkPlatform, environment, - proximityId, proximityPrecisionRadius); - return response.Data; - } - - public Task> SearchEventsAsyncWithHttpInfo(int? limit, - string paginationKey = null!, string visitorId = null!, string bot = null!, - string ipAddress = null!, string linkedId = null!, long? start = null!, long? end = null!, - bool? reverse = null!, bool? suspect = null!, - bool? vpn = null!, bool? virtualMachine = null!, bool? tampering = null!, bool? antiDetectBrowser = null!, - bool? incognito = null!, - bool? privacySettings = null!, bool? jailbroken = null!, bool? frida = null!, bool? factoryReset = null!, - bool? clonedApp = null!, - bool? emulator = null!, bool? rootApps = null!, string vpnConfidence = null!, float? minSuspectScore = null!, - bool? ipBlocklist = null!, bool? datacenter = null!, bool? developerTools = null!, - bool? locationSpoofing = null!, bool? mitmAttack = null!, bool? proxy = null!, string? sdkVersion = null!, - string? sdkPlatform = null!, List? environment = null!, - string? proximityId = null!, int? proximityPrecisionRadius = null!) - { - var definition = new SearchEventsDefinition(); - - var queryParams = new List>(); - - AddQueryParam(queryParams, "limit", limit); - AddQueryParam(queryParams, "pagination_key", paginationKey); - AddQueryParam(queryParams, "visitor_id", visitorId); - AddQueryParam(queryParams, "bot", bot); - AddQueryParam(queryParams, "ip_address", ipAddress); - AddQueryParam(queryParams, "linked_id", linkedId); - AddQueryParam(queryParams, "start", start); - AddQueryParam(queryParams, "end", end); - AddQueryParam(queryParams, "reverse", reverse); - AddQueryParam(queryParams, "suspect", suspect); - AddQueryParam(queryParams, "vpn", vpn); - AddQueryParam(queryParams, "virtual_machine", virtualMachine); - AddQueryParam(queryParams, "tampering", tampering); - AddQueryParam(queryParams, "anti_detect_browser", antiDetectBrowser); - AddQueryParam(queryParams, "incognito", incognito); - AddQueryParam(queryParams, "privacy_settings", privacySettings); - AddQueryParam(queryParams, "jailbroken", jailbroken); - AddQueryParam(queryParams, "frida", frida); - AddQueryParam(queryParams, "factory_reset", factoryReset); - AddQueryParam(queryParams, "cloned_app", clonedApp); - AddQueryParam(queryParams, "emulator", emulator); - AddQueryParam(queryParams, "root_apps", rootApps); - AddQueryParam(queryParams, "vpn_confidence", vpnConfidence); - AddQueryParam(queryParams, "min_suspect_score", minSuspectScore); - AddQueryParam(queryParams, "ip_blocklist", ipBlocklist); - AddQueryParam(queryParams, "datacenter", datacenter); - AddQueryParam(queryParams, "developer_tools", developerTools); - AddQueryParam(queryParams, "location_spoofing", locationSpoofing); - AddQueryParam(queryParams, "mitm_attack", mitmAttack); - AddQueryParam(queryParams, "proxy", proxy); - AddQueryParam(queryParams, "sdk_version", sdkVersion); - AddQueryParam(queryParams, "sdk_platform", sdkPlatform); - AddQueryParam(queryParams, "proximity_id", proximityId); - AddQueryParam(queryParams, "proximity_precision_radius", proximityPrecisionRadius); - - if (environment != null) - { - foreach (var envValue in environment) - { - AddQueryParam(queryParams, "environment", envValue); - } - } - - var request = new ApiRequest - { - OperationDefinition = definition, - Method = HttpMethod.Get, - QueryParams = queryParams - }; - - return _apiClient.DoRequest(request); - } - - #endregion -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk/Api/OperationDefinition.cs b/src/FingerprintPro.ServerSdk/Api/OperationDefinition.cs deleted file mode 100644 index 636808a..0000000 --- a/src/FingerprintPro.ServerSdk/Api/OperationDefinition.cs +++ /dev/null @@ -1,29 +0,0 @@ - -using System.Text.Json; - -namespace FingerprintPro.ServerSdk.Api; - -public abstract class OperationDefinition -{ - public abstract string Path { get; } - - public abstract string OperationName { get; } - - public abstract string[] PathParams { get; } - - public abstract Dictionary ResponseStatusCodeMap { get; } - - public string GetPath(params string[]? args) - { - var path = Path; - - if (args == null) return path; - - for (var i = 0; i < args.Length; i++) - { - path = path.Replace("{" + PathParams[i] + "}", args[i]); - } - - return path; - } -} diff --git a/src/FingerprintPro.ServerSdk/Client/ApiClient.cs b/src/FingerprintPro.ServerSdk/Client/ApiClient.cs deleted file mode 100644 index 15b35e8..0000000 --- a/src/FingerprintPro.ServerSdk/Client/ApiClient.cs +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System.Net; -using System.Net.Http; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Web; -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Json; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.Client -{ - /// - /// API client is responsible for making the HTTP call to the API backend. - /// - public class ApiClient - { - /// - /// Initializes a new instance of the class - /// with default base path (https://api.fpjs.io). - /// - /// An instance of Configuration. - public ApiClient(Configuration config) - { - Configuration = config; - - Client = config.HttpClient ?? new HttpClient() - { - BaseAddress = new Uri(Configuration.BasePath), - Timeout = TimeSpan.FromMilliseconds(Configuration.Timeout) - }; - } - - /// - /// Gets or sets the HttpClient. - /// - /// An instance of the HttpClient - public HttpClient Client { get; set; } - - /// - /// Gets or sets an instance of the IReadableConfiguration. - /// - /// An instance of the IReadableConfiguration. - /// - /// helps us to avoid modifying possibly global - /// configuration values from within a given client. It does not guarantee thread-safety - /// of the instance in any way. - /// - public IReadableConfiguration Configuration { get; set; } - - private HttpRequestMessage CreateRequestMessage(HttpMethod method, UriBuilder uri, - List>? queryParams, HttpContent? body = null) - { - var query = HttpUtility.ParseQueryString(uri.Query); - query["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ServerSdk.Client.Configuration.Version}"; - if (queryParams != null) - { - foreach (var param in queryParams) - { - query.Add(param.Key, param.Value); - } - } - - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) - { - query["api_key"] = this.Configuration.GetApiKeyWithPrefix("api_key"); - } - - uri.Query = query.ToString(); - - var request = new HttpRequestMessage(method, uri.ToString()); - request.Content = body; - request.Headers.TryAddWithoutValidation("User-Agent", Configuration.UserAgent); - var apiKey = Configuration.GetApiKeyWithPrefix("Auth-API-Key"); - if (!string.IsNullOrEmpty(apiKey)) - { - request.Headers.TryAddWithoutValidation("Auth-API-Key", apiKey); - } - - foreach (var header in Configuration.DefaultHeader) - { - request.Headers.TryAddWithoutValidation(header.Key, header.Value); - } - - return request; - } - - private UriBuilder GetRequestPath(OperationDefinition definition, params string[]? args) - { - var uriBuilder = new UriBuilder(Client.BaseAddress?.ToString() ?? Configuration.BasePath) - { - Path = definition.GetPath(args) - }; - - return uriBuilder; - } - - public async Task> DoRequestEmpty(ApiRequest apiRequest) - { - var definition = apiRequest.OperationDefinition; - - var path = GetRequestPath(definition, apiRequest.Args); - var request = CreateRequestMessage(apiRequest.Method, path, apiRequest.QueryParams, apiRequest.Body); - - var response = await Client.SendAsync(request); - var responseContent = await response.Content.ReadAsStringAsync(); - - if (!response.IsSuccessStatusCode) - HandleException(definition.OperationName, response, responseContent, definition); - - return new ApiResponse(response, null!); - } - - public async Task> DoRequest(ApiRequest apiRequest) - { - var definition = apiRequest.OperationDefinition; - - var path = GetRequestPath(definition, apiRequest.Args); - var request = CreateRequestMessage(apiRequest.Method, path, apiRequest.QueryParams, apiRequest.Body); - - var response = await Client.SendAsync(request); - var responseContent = await response.Content.ReadAsStringAsync(); - - if (!response.IsSuccessStatusCode) - HandleException(definition.OperationName, response, responseContent, definition); - - T? data; - - try - { - data = JsonUtils.Deserialize(responseContent); - } - catch (Exception e) - { - throw new JsonDeserializeException(response, e); - } - - return new ApiResponse(response, data!); - } - - private void HandleException(string methodName, HttpResponseMessage response, string responseContent, - OperationDefinition operationDefinition) - { - var message = $"Error calling {methodName}: {response.ReasonPhrase}"; - var statusCode = (int)response.StatusCode; - var errorCode = ErrorCode.Failed; - - if (!operationDefinition.ResponseStatusCodeMap.TryGetValue(statusCode, out var model)) - throw new ApiException(statusCode, - message, errorCode, response); - - - var result = JsonUtils.Deserialize(responseContent, model); - - switch (result) - { - case ErrorResponse errorResponse: - message = errorResponse.Error.Message; - errorCode = errorResponse.Error.Code; - break; - case ErrorPlainResponse errorPlainResponse: - message = errorPlainResponse.Error; - break; - } - - // https://github.com/dotnet/runtime/issues/54321 - if (response.StatusCode != (HttpStatusCode)429) - throw new ApiException(statusCode, message, errorCode, response, result); - - - var retryAfterHeader = response.Headers.FirstOrDefault(h => h.Key == "Retry-After").Value - ?.FirstOrDefault(); - int? retryAfterInt = !string.IsNullOrEmpty(retryAfterHeader) ? int.Parse(retryAfterHeader) : null; - - throw new TooManyRequestsException(message, response, retryAfterInt); - } - } -} diff --git a/src/FingerprintPro.ServerSdk/Client/ApiException.cs b/src/FingerprintPro.ServerSdk/Client/ApiException.cs deleted file mode 100644 index f73118b..0000000 --- a/src/FingerprintPro.ServerSdk/Client/ApiException.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System.Net.Http; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.Client -{ - /// - /// API Exception - /// - public class ApiException : Exception - { - /// - /// Gets or sets the HTTP status code - /// - /// The HTTP status code - public int HttpCode { get; private set; } - - /// - /// Gets or sets the error code - /// - /// The error code. - public ErrorCode ErrorCode { get; private set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public dynamic? ErrorContent { get; private set; } - - public HttpResponseMessage? ResponseMessage { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error code. - /// Error message. - /// Raw HTTP response - /// Error content. - public ApiException(int httpCode, string message, ErrorCode errorCode, HttpResponseMessage? responseMessage = null, dynamic? errorContent = null) : base(message) - { - HttpCode = httpCode; - ErrorCode = errorCode; - ErrorContent = errorContent; - ResponseMessage = responseMessage; - ErrorContent = errorContent; - } - } - -} diff --git a/src/FingerprintPro.ServerSdk/Client/ApiRequest.cs b/src/FingerprintPro.ServerSdk/Client/ApiRequest.cs deleted file mode 100644 index cefbdd3..0000000 --- a/src/FingerprintPro.ServerSdk/Client/ApiRequest.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Net.Http; -using FingerprintPro.ServerSdk.Api; - -namespace FingerprintPro.ServerSdk.Client; - -public class ApiRequest -{ - public OperationDefinition OperationDefinition; - - public HttpMethod Method; - - public List> QueryParams { get; set; } = new(); - - public HttpContent? Body; - - public string[]? Args; -} diff --git a/src/FingerprintPro.ServerSdk/Client/ApiResponse.cs b/src/FingerprintPro.ServerSdk/Client/ApiResponse.cs deleted file mode 100644 index d508326..0000000 --- a/src/FingerprintPro.ServerSdk/Client/ApiResponse.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System.Net.Http; - -namespace FingerprintPro.ServerSdk.Client -{ - /// - /// API Response - /// - public class ApiResponse - { - /// - /// Gets or sets the data (parsed HTTP body) - /// - /// The data. - public T Data { get; private set; } - - public HttpResponseMessage Response { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// Raw HTTP response - /// Data (parsed HTTP body) - public ApiResponse(HttpResponseMessage response, T data) - { - this.Data = data; - this.Response = response; - } - } -} diff --git a/src/FingerprintPro.ServerSdk/Client/Configuration.cs b/src/FingerprintPro.ServerSdk/Client/Configuration.cs deleted file mode 100644 index 59c6ab5..0000000 --- a/src/FingerprintPro.ServerSdk/Client/Configuration.cs +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Collections.Concurrent; -using System.Runtime.Serialization; -using System.Net.Http; - -namespace FingerprintPro.ServerSdk.Client -{ - public enum Region - { - [EnumMember(Value = "eu")] - Eu, - [EnumMember(Value = "us")] - Us, - [EnumMember(Value = "asia")] - Asia - } - - /// - /// Represents a set of configuration settings - /// - public class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "7.9.0"; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Private Members - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - private IDictionary _apiKey = null; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix = null; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - /// - /// User provided API Key - public Configuration(string apiKey) - { - UserAgent = $"Swagger-Codegen/{Version}/csharp"; - BasePath = "https://api.fpjs.io"; - DefaultHeader = new ConcurrentDictionary(); - ApiKey = new ConcurrentDictionary(); - ApiKeyPrefix = new ConcurrentDictionary(); - Timeout = 100000; - - AddApiKey("api_key", apiKey); - } - - #endregion Constructors - - - #region Properties - - private string _basePath = null; - - private Region _region = Region.Us; - /// - /// Gets or sets the base path for API access. - /// - public string BasePath { get; set; } - - /// - /// Gets or sets the default header. - /// - public IDictionary DefaultHeader { get; set; } - - /// - /// Gets or sets the HTTP Client that will be used for sending requests. - /// - public HttpClient? HttpClient { get; set; } - - /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. - /// - public int Timeout { get; set; } - - /// - /// Gets or sets the API Region - /// - /// API Region - public Region Region - { - get { return _region; } - set - { - _region = value; - - BasePath = ResolveBasePathForRegion(); - } - } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - var apiKeyValue = ""; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - return apiKeyPrefix + " " + apiKeyValue; - else - return apiKeyValue; - } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// The access token. - public string AccessToken { get; set; } - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - // Possible breaking change since swagger-codegen 2.2.1, enforce a valid temporary path on set. - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - public IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - - #endregion Properties - - #region Methods - - private string ResolveBasePathForRegion() - { - switch (_region) - { - case Region.Eu: - return "https://eu.api.fpjs.io"; - - case Region.Asia: - return "https://ap.api.fpjs.io"; - - default: - return "https://api.fpjs.io"; - } - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - public void AddDefaultHeader(string key, string value) - { - DefaultHeader[key] = value; - } - - /// - /// Returns a string with essential information for debugging. - /// - public static String ToDebugReport() - { - String report = "C# SDK (FingerprintPro.ServerSdk) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 3\n"; - report += $" SDK Package Version: {Version}\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - } -} diff --git a/src/FingerprintPro.ServerSdk/Client/IReadableConfiguration.cs b/src/FingerprintPro.ServerSdk/Client/IReadableConfiguration.cs deleted file mode 100644 index e5ce19b..0000000 --- a/src/FingerprintPro.ServerSdk/Client/IReadableConfiguration.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System.Collections.Generic; -using System.Net.Http; - -namespace FingerprintPro.ServerSdk.Client -{ - /// - /// Represents a readable-only configuration contract. - /// - public interface IReadableConfiguration - { - /// - /// Gets the access token. - /// - /// Access token. - string AccessToken { get; } - - /// - /// Gets the API key. - /// - /// API key. - IDictionary ApiKey { get; } - - /// - /// Gets the API key prefix. - /// - /// API key prefix. - IDictionary ApiKeyPrefix { get; } - - /// - /// Gets the base path. - /// - /// Base path. - string BasePath { get; } - - /// - /// Gets the date time format. - /// - /// Date time foramt. - string DateTimeFormat { get; } - - /// - /// Gets the default header. - /// - /// Default header. - IDictionary DefaultHeader { get; } - - /// - /// Gets or sets the HTTP Client that will be used for sending requests. - /// - public HttpClient? HttpClient { get; set; } - - /// - /// Gets the temp folder path. - /// - /// Temp folder path. - string TempFolderPath { get; } - - /// - /// Gets the HTTP connection timeout (in milliseconds) - /// - /// HTTP connection timeout. - int Timeout { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets the username. - /// - /// Username. - string Username { get; } - - /// - /// Gets the password. - /// - /// Password. - string Password { get; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - string GetApiKeyWithPrefix(string apiKeyIdentifier); - } -} diff --git a/src/FingerprintPro.ServerSdk/Client/JsonDeserializeException.cs b/src/FingerprintPro.ServerSdk/Client/JsonDeserializeException.cs deleted file mode 100644 index d959899..0000000 --- a/src/FingerprintPro.ServerSdk/Client/JsonDeserializeException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Net.Http; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.Client; - -public class JsonDeserializeException : ApiException -{ - public JsonDeserializeException(HttpResponseMessage response, Exception e) : base((int)response.StatusCode, "Failed to deserialize JSON data", ErrorCode.Failed, response, e) - { - } -} diff --git a/src/FingerprintPro.ServerSdk/Client/TooManyRequestsException.cs b/src/FingerprintPro.ServerSdk/Client/TooManyRequestsException.cs deleted file mode 100644 index 42c8d2f..0000000 --- a/src/FingerprintPro.ServerSdk/Client/TooManyRequestsException.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Net.Http; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.Client -{ - /// - /// API Exception thrown in case of TooManyRequests error. - /// Contains useful details about the error. - /// - public class TooManyRequestsException : ApiException - { - // TooManyRequests code is not available in HttpStatusCode enum in some .NET versions - public const int TooManyRequestsCode = 429; - - /// - /// Time in seconds to wait before next request. - /// - public int? RetryAfter { get; private set; } - - public TooManyRequestsException(string message, HttpResponseMessage responseMessage, int? retryAfter) : base(TooManyRequestsCode, message, ErrorCode.TooManyRequests, responseMessage) - { - RetryAfter = retryAfter; - } - } -} diff --git a/src/FingerprintPro.ServerSdk/Exceptions/FailedToDeserializeException.cs b/src/FingerprintPro.ServerSdk/Exceptions/FailedToDeserializeException.cs deleted file mode 100644 index c39a135..0000000 --- a/src/FingerprintPro.ServerSdk/Exceptions/FailedToDeserializeException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using FingerprintPro.ServerSdk.Client; -using FingerprintPro.ServerSdk.Model; - -namespace FingerprintPro.ServerSdk.Exceptions; - -public class FailedToDeserializeException : ApiException -{ - public FailedToDeserializeException() : base(500, "Failed to deserialize response body.", ErrorCode.Failed) - { - } -} diff --git a/src/FingerprintPro.ServerSdk/FingerprintPro.ServerSdk.csproj b/src/FingerprintPro.ServerSdk/FingerprintPro.ServerSdk.csproj deleted file mode 100644 index 524a22e..0000000 --- a/src/FingerprintPro.ServerSdk/FingerprintPro.ServerSdk.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - FingerprintPro.ServerSdk - browser,detection,fingerprint,identification,fingerprinting,browser-fingerprinting,fraud-detection,fraud,audio-fingerprinting,fingerprintjs,fingerprintjs-pro,visitor-identification - 7.9.0 - Fingerprint - Fingerprint - https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk - https://fingerprint.com/ - true - README.md - LICENSE - logo.png - - - - net8;netstandard2.0;netstandard2.1;net47;net471;net472;net48;net481 - enable - enable - 10.0 - - - - - - - - - - - - - - - - - - - diff --git a/src/FingerprintPro.ServerSdk/Json/JsonEnumMemberStringEnumConverter.cs b/src/FingerprintPro.ServerSdk/Json/JsonEnumMemberStringEnumConverter.cs deleted file mode 100644 index a07d5c6..0000000 --- a/src/FingerprintPro.ServerSdk/Json/JsonEnumMemberStringEnumConverter.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Reflection; -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace FingerprintPro.ServerSdk.Json; - -public class JsonEnumMemberStringEnumConverter : JsonConverterFactory -{ - private readonly JsonNamingPolicy? _namingPolicy; - private readonly bool _allowIntegerValues; - private readonly JsonStringEnumConverter _baseConverter; - - public JsonEnumMemberStringEnumConverter() : this(null) { } - - private JsonEnumMemberStringEnumConverter(JsonNamingPolicy? namingPolicy = null, bool allowIntegerValues = true) - { - _namingPolicy = namingPolicy; - _allowIntegerValues = allowIntegerValues; - _baseConverter = new JsonStringEnumConverter(namingPolicy, allowIntegerValues); - } - - public override bool CanConvert(Type typeToConvert) => _baseConverter.CanConvert(typeToConvert); - - public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) - { - var query = from field in typeToConvert.GetFields(BindingFlags.Public | BindingFlags.Static) - let attr = field.GetCustomAttribute() - where attr is { Value: not null } - select (field.Name, attr.Value); - var dictionary = query.ToDictionary(p => p.Item1, p => p.Item2); - if (dictionary.Count > 0) - return new JsonStringEnumConverter(new DictionaryLookupNamingPolicy(dictionary, _namingPolicy), _allowIntegerValues).CreateConverter(typeToConvert, options); - return _baseConverter.CreateConverter(typeToConvert, options); - } -} - -public class JsonNamingPolicyDecorator : JsonNamingPolicy -{ - readonly JsonNamingPolicy? _underlyingNamingPolicy; - - protected JsonNamingPolicyDecorator(JsonNamingPolicy? underlyingNamingPolicy) => _underlyingNamingPolicy = underlyingNamingPolicy; - public override string ConvertName(string name) => _underlyingNamingPolicy?.ConvertName(name) ?? name; -} - -internal class DictionaryLookupNamingPolicy : JsonNamingPolicyDecorator -{ - private readonly Dictionary _dictionary; - - public DictionaryLookupNamingPolicy(Dictionary dictionary, JsonNamingPolicy? underlyingNamingPolicy) : base(underlyingNamingPolicy) => _dictionary = dictionary ?? throw new ArgumentNullException(); - public override string ConvertName(string name) => _dictionary.TryGetValue(name, out var value) ? value : base.ConvertName(name); -} diff --git a/src/FingerprintPro.ServerSdk/Json/JsonUtils.cs b/src/FingerprintPro.ServerSdk/Json/JsonUtils.cs deleted file mode 100644 index 802ebe6..0000000 --- a/src/FingerprintPro.ServerSdk/Json/JsonUtils.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace FingerprintPro.ServerSdk.Json; - -public static class JsonUtils -{ - private static readonly JsonSerializerOptions SerializerOptions = new() - { - Converters = { new JsonEnumMemberStringEnumConverter() }, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - IncludeFields = true, - - }; - - public static object? Deserialize(string data, Type returnType) - { - return JsonSerializer.Deserialize(data, returnType, SerializerOptions); - } - - public static T? Deserialize(string data) - { - return JsonSerializer.Deserialize(data, SerializerOptions); - } - - public static string Serialize(object model) - { - return JsonSerializer.Serialize(model, SerializerOptions); - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Botd.cs b/src/FingerprintPro.ServerSdk/Model/Botd.cs deleted file mode 100644 index d8da283..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Botd.cs +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Contains all the information from Bot Detection product - /// - [DataContract] - public class Botd : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// bot (required). - /// meta. - /// A customer-provided id that was sent with the request.. - /// Page URL from which the request was sent. (required). - /// IP address of the requesting browser or bot. (required). - /// Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. (required). - /// userAgent (required). - /// Unique identifier of the user's request. (required). - public Botd(BotdBot bot = default(BotdBot), Tag meta = default(Tag), string linkedId = default(string), string url = default(string), string ip = default(string), DateTime? time = default(DateTime?), string userAgent = default(string), string requestId = default(string)) - { - // to ensure "bot" is required (not null) - // swagger debug: Botd Bot - - if (bot == null) - { - throw new InvalidDataException("bot is a required property for Botd and cannot be null"); - } - else - { - this.Bot = bot; - } - // to ensure "url" is required (not null) - // swagger debug: Botd Url - - if (url == null) - { - throw new InvalidDataException("url is a required property for Botd and cannot be null"); - } - else - { - this.Url = url; - } - // to ensure "ip" is required (not null) - // swagger debug: Botd Ip - - if (ip == null) - { - throw new InvalidDataException("ip is a required property for Botd and cannot be null"); - } - else - { - this.Ip = ip; - } - // to ensure "time" is required (not null) - // swagger debug: Botd Time - - if (time == null) - { - throw new InvalidDataException("time is a required property for Botd and cannot be null"); - } - else - { - this.Time = time; - } - // to ensure "userAgent" is required (not null) - // swagger debug: Botd UserAgent - - if (userAgent == null) - { - throw new InvalidDataException("userAgent is a required property for Botd and cannot be null"); - } - else - { - this.UserAgent = userAgent; - } - // to ensure "requestId" is required (not null) - // swagger debug: Botd RequestId - - if (requestId == null) - { - throw new InvalidDataException("requestId is a required property for Botd and cannot be null"); - } - else - { - this.RequestId = requestId; - } - this.Meta = meta; - this.LinkedId = linkedId; - } - - /// - /// Gets or Sets Bot - /// - [DataMember(Name = "bot", EmitDefaultValue = false)] - [JsonPropertyName("bot")] - public BotdBot Bot { get; set; } - - /// - /// Gets or Sets Meta - /// - [DataMember(Name = "meta", EmitDefaultValue = false)] - [JsonPropertyName("meta")] - public Tag Meta { get; set; } - - /// - /// A customer-provided id that was sent with the request. - /// - /// A customer-provided id that was sent with the request. - [DataMember(Name = "linkedId", EmitDefaultValue = false)] - [JsonPropertyName("linkedId")] - public string LinkedId { get; set; } - - /// - /// Page URL from which the request was sent. - /// - /// Page URL from which the request was sent. - [DataMember(Name = "url", EmitDefaultValue = false)] - [JsonPropertyName("url")] - public string Url { get; set; } - - /// - /// IP address of the requesting browser or bot. - /// - /// IP address of the requesting browser or bot. - [DataMember(Name = "ip", EmitDefaultValue = false)] - [JsonPropertyName("ip")] - public string Ip { get; set; } - - /// - /// Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - /// - /// Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - [DataMember(Name = "time", EmitDefaultValue = false)] - [JsonPropertyName("time")] - public DateTime? Time { get; set; } - - /// - /// Gets or Sets UserAgent - /// - [DataMember(Name = "userAgent", EmitDefaultValue = false)] - [JsonPropertyName("userAgent")] - public string UserAgent { get; set; } - - /// - /// Unique identifier of the user's request. - /// - /// Unique identifier of the user's request. - [DataMember(Name = "requestId", EmitDefaultValue = false)] - [JsonPropertyName("requestId")] - public string RequestId { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Botd {\n"); - sb.Append(" Bot: ").Append(Bot).Append("\n"); - sb.Append(" Meta: ").Append(Meta).Append("\n"); - sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); - sb.Append(" Ip: ").Append(Ip).Append("\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); - sb.Append(" RequestId: ").Append(RequestId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Botd instances are equal - /// - /// Instance of Botd to be compared - /// Boolean - public bool Equals(Botd? input) - { - if (input == null) - return false; - - return - ( - this.Bot == input.Bot || - (this.Bot != null && - this.Bot.Equals(input.Bot)) - ) && - ( - this.Meta == input.Meta || - (this.Meta != null && - this.Meta.Equals(input.Meta)) - ) && - ( - this.LinkedId == input.LinkedId || - (this.LinkedId != null && - this.LinkedId.Equals(input.LinkedId)) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ) && - ( - this.Ip == input.Ip || - (this.Ip != null && - this.Ip.Equals(input.Ip)) - ) && - ( - this.Time == input.Time || - (this.Time != null && - this.Time.Equals(input.Time)) - ) && - ( - this.UserAgent == input.UserAgent || - (this.UserAgent != null && - this.UserAgent.Equals(input.UserAgent)) - ) && - ( - this.RequestId == input.RequestId || - (this.RequestId != null && - this.RequestId.Equals(input.RequestId)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Bot != null) - hashCode = hashCode * 59 + this.Bot.GetHashCode(); - if (this.Meta != null) - hashCode = hashCode * 59 + this.Meta.GetHashCode(); - if (this.LinkedId != null) - hashCode = hashCode * 59 + this.LinkedId.GetHashCode(); - if (this.Url != null) - hashCode = hashCode * 59 + this.Url.GetHashCode(); - if (this.Ip != null) - hashCode = hashCode * 59 + this.Ip.GetHashCode(); - if (this.Time != null) - hashCode = hashCode * 59 + this.Time.GetHashCode(); - if (this.UserAgent != null) - hashCode = hashCode * 59 + this.UserAgent.GetHashCode(); - if (this.RequestId != null) - hashCode = hashCode * 59 + this.RequestId.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/BotdBot.cs b/src/FingerprintPro.ServerSdk/Model/BotdBot.cs deleted file mode 100644 index 6179b47..0000000 --- a/src/FingerprintPro.ServerSdk/Model/BotdBot.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Stores bot detection result - /// - [DataContract] - public class BotdBot : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// result (required). - /// type. - public BotdBot(BotdBotResult result = default(BotdBotResult), string type = default(string)) - { - // to ensure "result" is required (not null) - // swagger debug: BotdBot Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for BotdBot and cannot be null"); - } - else - { - this.Result = result; - } - this.Type = type; - } - - /// - /// Gets or Sets Result - /// - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public BotdBotResult Result { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", EmitDefaultValue = false)] - [JsonPropertyName("type")] - public string Type { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class BotdBot {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if BotdBot instances are equal - /// - /// Instance of BotdBot to be compared - /// Boolean - public bool Equals(BotdBot? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/BotdBotResult.cs b/src/FingerprintPro.ServerSdk/Model/BotdBotResult.cs deleted file mode 100644 index ac90746..0000000 --- a/src/FingerprintPro.ServerSdk/Model/BotdBotResult.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - /// - /// Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum BotdBotResult - { - /// - /// Enum NotDetected for value: notDetected - /// - [EnumMember(Value = "notDetected")] - NotDetected = 1, - /// - /// Enum Good for value: good - /// - [EnumMember(Value = "good")] - Good = 2, - /// - /// Enum Bad for value: bad - /// - [EnumMember(Value = "bad")] - Bad = 3 - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/BrowserDetails.cs b/src/FingerprintPro.ServerSdk/Model/BrowserDetails.cs deleted file mode 100644 index c28928a..0000000 --- a/src/FingerprintPro.ServerSdk/Model/BrowserDetails.cs +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// BrowserDetails - /// - [DataContract] - public class BrowserDetails : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// browserName (required). - /// browserMajorVersion (required). - /// browserFullVersion (required). - /// os (required). - /// osVersion (required). - /// device (required). - /// userAgent (required). - public BrowserDetails(string browserName = default(string), string browserMajorVersion = default(string), string browserFullVersion = default(string), string os = default(string), string osVersion = default(string), string device = default(string), string userAgent = default(string)) - { - // to ensure "browserName" is required (not null) - // swagger debug: BrowserDetails BrowserName - - if (browserName == null) - { - throw new InvalidDataException("browserName is a required property for BrowserDetails and cannot be null"); - } - else - { - this.BrowserName = browserName; - } - // to ensure "browserMajorVersion" is required (not null) - // swagger debug: BrowserDetails BrowserMajorVersion - - if (browserMajorVersion == null) - { - throw new InvalidDataException("browserMajorVersion is a required property for BrowserDetails and cannot be null"); - } - else - { - this.BrowserMajorVersion = browserMajorVersion; - } - // to ensure "browserFullVersion" is required (not null) - // swagger debug: BrowserDetails BrowserFullVersion - - if (browserFullVersion == null) - { - throw new InvalidDataException("browserFullVersion is a required property for BrowserDetails and cannot be null"); - } - else - { - this.BrowserFullVersion = browserFullVersion; - } - // to ensure "os" is required (not null) - // swagger debug: BrowserDetails Os - - if (os == null) - { - throw new InvalidDataException("os is a required property for BrowserDetails and cannot be null"); - } - else - { - this.Os = os; - } - // to ensure "osVersion" is required (not null) - // swagger debug: BrowserDetails OsVersion - - if (osVersion == null) - { - throw new InvalidDataException("osVersion is a required property for BrowserDetails and cannot be null"); - } - else - { - this.OsVersion = osVersion; - } - // to ensure "device" is required (not null) - // swagger debug: BrowserDetails Device - - if (device == null) - { - throw new InvalidDataException("device is a required property for BrowserDetails and cannot be null"); - } - else - { - this.Device = device; - } - // to ensure "userAgent" is required (not null) - // swagger debug: BrowserDetails UserAgent - - if (userAgent == null) - { - throw new InvalidDataException("userAgent is a required property for BrowserDetails and cannot be null"); - } - else - { - this.UserAgent = userAgent; - } - } - - /// - /// Gets or Sets BrowserName - /// - [DataMember(Name = "browserName", EmitDefaultValue = false)] - [JsonPropertyName("browserName")] - public string BrowserName { get; set; } - - /// - /// Gets or Sets BrowserMajorVersion - /// - [DataMember(Name = "browserMajorVersion", EmitDefaultValue = false)] - [JsonPropertyName("browserMajorVersion")] - public string BrowserMajorVersion { get; set; } - - /// - /// Gets or Sets BrowserFullVersion - /// - [DataMember(Name = "browserFullVersion", EmitDefaultValue = false)] - [JsonPropertyName("browserFullVersion")] - public string BrowserFullVersion { get; set; } - - /// - /// Gets or Sets Os - /// - [DataMember(Name = "os", EmitDefaultValue = false)] - [JsonPropertyName("os")] - public string Os { get; set; } - - /// - /// Gets or Sets OsVersion - /// - [DataMember(Name = "osVersion", EmitDefaultValue = false)] - [JsonPropertyName("osVersion")] - public string OsVersion { get; set; } - - /// - /// Gets or Sets Device - /// - [DataMember(Name = "device", EmitDefaultValue = false)] - [JsonPropertyName("device")] - public string Device { get; set; } - - /// - /// Gets or Sets UserAgent - /// - [DataMember(Name = "userAgent", EmitDefaultValue = false)] - [JsonPropertyName("userAgent")] - public string UserAgent { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class BrowserDetails {\n"); - sb.Append(" BrowserName: ").Append(BrowserName).Append("\n"); - sb.Append(" BrowserMajorVersion: ").Append(BrowserMajorVersion).Append("\n"); - sb.Append(" BrowserFullVersion: ").Append(BrowserFullVersion).Append("\n"); - sb.Append(" Os: ").Append(Os).Append("\n"); - sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); - sb.Append(" Device: ").Append(Device).Append("\n"); - sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if BrowserDetails instances are equal - /// - /// Instance of BrowserDetails to be compared - /// Boolean - public bool Equals(BrowserDetails? input) - { - if (input == null) - return false; - - return - ( - this.BrowserName == input.BrowserName || - (this.BrowserName != null && - this.BrowserName.Equals(input.BrowserName)) - ) && - ( - this.BrowserMajorVersion == input.BrowserMajorVersion || - (this.BrowserMajorVersion != null && - this.BrowserMajorVersion.Equals(input.BrowserMajorVersion)) - ) && - ( - this.BrowserFullVersion == input.BrowserFullVersion || - (this.BrowserFullVersion != null && - this.BrowserFullVersion.Equals(input.BrowserFullVersion)) - ) && - ( - this.Os == input.Os || - (this.Os != null && - this.Os.Equals(input.Os)) - ) && - ( - this.OsVersion == input.OsVersion || - (this.OsVersion != null && - this.OsVersion.Equals(input.OsVersion)) - ) && - ( - this.Device == input.Device || - (this.Device != null && - this.Device.Equals(input.Device)) - ) && - ( - this.UserAgent == input.UserAgent || - (this.UserAgent != null && - this.UserAgent.Equals(input.UserAgent)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BrowserName != null) - hashCode = hashCode * 59 + this.BrowserName.GetHashCode(); - if (this.BrowserMajorVersion != null) - hashCode = hashCode * 59 + this.BrowserMajorVersion.GetHashCode(); - if (this.BrowserFullVersion != null) - hashCode = hashCode * 59 + this.BrowserFullVersion.GetHashCode(); - if (this.Os != null) - hashCode = hashCode * 59 + this.Os.GetHashCode(); - if (this.OsVersion != null) - hashCode = hashCode * 59 + this.OsVersion.GetHashCode(); - if (this.Device != null) - hashCode = hashCode * 59 + this.Device.GetHashCode(); - if (this.UserAgent != null) - hashCode = hashCode * 59 + this.UserAgent.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ClonedApp.cs b/src/FingerprintPro.ServerSdk/Model/ClonedApp.cs deleted file mode 100644 index 4fcfe85..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ClonedApp.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ClonedApp - /// - [DataContract] - public class ClonedApp : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. (required). - public ClonedApp(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: ClonedApp Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for ClonedApp and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. - /// - /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ClonedApp {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ClonedApp instances are equal - /// - /// Instance of ClonedApp to be compared - /// Boolean - public bool Equals(ClonedApp? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/DeprecatedGeolocation.cs b/src/FingerprintPro.ServerSdk/Model/DeprecatedGeolocation.cs deleted file mode 100644 index 9b84cbe..0000000 --- a/src/FingerprintPro.ServerSdk/Model/DeprecatedGeolocation.cs +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// This field is **deprecated** and will not return a result for **applications created after January 23rd, 2024**. Please use the [IP Geolocation Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information. - /// - [Obsolete] - [DataContract] - public class DeprecatedGeolocation : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// The IP address is likely to be within this radius (in km) of the specified location.. - /// latitude. - /// longitude. - /// postalCode. - /// timezone. - /// city. - /// country. - /// continent. - /// subdivisions. - public DeprecatedGeolocation(int? accuracyRadius = default(int?), double? latitude = default(double?), double? longitude = default(double?), string postalCode = default(string), string timezone = default(string), GeolocationCity city = default(GeolocationCity), GeolocationCountry country = default(GeolocationCountry), GeolocationContinent continent = default(GeolocationContinent), GeolocationSubdivisions subdivisions = default(GeolocationSubdivisions)) - { - this.AccuracyRadius = accuracyRadius; - this.Latitude = latitude; - this.Longitude = longitude; - this.PostalCode = postalCode; - this.Timezone = timezone; - this.City = city; - this.Country = country; - this.Continent = continent; - this.Subdivisions = subdivisions; - } - - /// - /// The IP address is likely to be within this radius (in km) of the specified location. - /// - /// The IP address is likely to be within this radius (in km) of the specified location. - [DataMember(Name = "accuracyRadius", EmitDefaultValue = false)] - [JsonPropertyName("accuracyRadius")] - public int? AccuracyRadius { get; set; } - - /// - /// Gets or Sets Latitude - /// - [DataMember(Name = "latitude", EmitDefaultValue = false)] - [JsonPropertyName("latitude")] - public double? Latitude { get; set; } - - /// - /// Gets or Sets Longitude - /// - [DataMember(Name = "longitude", EmitDefaultValue = false)] - [JsonPropertyName("longitude")] - public double? Longitude { get; set; } - - /// - /// Gets or Sets PostalCode - /// - [DataMember(Name = "postalCode", EmitDefaultValue = false)] - [JsonPropertyName("postalCode")] - public string PostalCode { get; set; } - - /// - /// Gets or Sets Timezone - /// - [DataMember(Name = "timezone", EmitDefaultValue = false)] - [JsonPropertyName("timezone")] - public string Timezone { get; set; } - - /// - /// Gets or Sets City - /// - [DataMember(Name = "city", EmitDefaultValue = false)] - [JsonPropertyName("city")] - public GeolocationCity City { get; set; } - - /// - /// Gets or Sets Country - /// - [DataMember(Name = "country", EmitDefaultValue = false)] - [JsonPropertyName("country")] - public GeolocationCountry Country { get; set; } - - /// - /// Gets or Sets Continent - /// - [DataMember(Name = "continent", EmitDefaultValue = false)] - [JsonPropertyName("continent")] - public GeolocationContinent Continent { get; set; } - - /// - /// Gets or Sets Subdivisions - /// - [DataMember(Name = "subdivisions", EmitDefaultValue = false)] - [JsonPropertyName("subdivisions")] - public GeolocationSubdivisions Subdivisions { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class DeprecatedGeolocation {\n"); - sb.Append(" AccuracyRadius: ").Append(AccuracyRadius).Append("\n"); - sb.Append(" Latitude: ").Append(Latitude).Append("\n"); - sb.Append(" Longitude: ").Append(Longitude).Append("\n"); - sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" Timezone: ").Append(Timezone).Append("\n"); - sb.Append(" City: ").Append(City).Append("\n"); - sb.Append(" Country: ").Append(Country).Append("\n"); - sb.Append(" Continent: ").Append(Continent).Append("\n"); - sb.Append(" Subdivisions: ").Append(Subdivisions).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if DeprecatedGeolocation instances are equal - /// - /// Instance of DeprecatedGeolocation to be compared - /// Boolean - public bool Equals(DeprecatedGeolocation? input) - { - if (input == null) - return false; - - return - ( - this.AccuracyRadius == input.AccuracyRadius || - (this.AccuracyRadius != null && - this.AccuracyRadius.Equals(input.AccuracyRadius)) - ) && - ( - this.Latitude == input.Latitude || - (this.Latitude != null && - this.Latitude.Equals(input.Latitude)) - ) && - ( - this.Longitude == input.Longitude || - (this.Longitude != null && - this.Longitude.Equals(input.Longitude)) - ) && - ( - this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && - ( - this.Timezone == input.Timezone || - (this.Timezone != null && - this.Timezone.Equals(input.Timezone)) - ) && - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && - ( - this.Continent == input.Continent || - (this.Continent != null && - this.Continent.Equals(input.Continent)) - ) && - ( - this.Subdivisions == input.Subdivisions || - (this.Subdivisions != null && - this.Subdivisions.Equals(input.Subdivisions)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AccuracyRadius != null) - hashCode = hashCode * 59 + this.AccuracyRadius.GetHashCode(); - if (this.Latitude != null) - hashCode = hashCode * 59 + this.Latitude.GetHashCode(); - if (this.Longitude != null) - hashCode = hashCode * 59 + this.Longitude.GetHashCode(); - if (this.PostalCode != null) - hashCode = hashCode * 59 + this.PostalCode.GetHashCode(); - if (this.Timezone != null) - hashCode = hashCode * 59 + this.Timezone.GetHashCode(); - if (this.City != null) - hashCode = hashCode * 59 + this.City.GetHashCode(); - if (this.Country != null) - hashCode = hashCode * 59 + this.Country.GetHashCode(); - if (this.Continent != null) - hashCode = hashCode * 59 + this.Continent.GetHashCode(); - if (this.Subdivisions != null) - hashCode = hashCode * 59 + this.Subdivisions.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/DeveloperTools.cs b/src/FingerprintPro.ServerSdk/Model/DeveloperTools.cs deleted file mode 100644 index c7197de..0000000 --- a/src/FingerprintPro.ServerSdk/Model/DeveloperTools.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// DeveloperTools - /// - [DataContract] - public class DeveloperTools : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. (required). - public DeveloperTools(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: DeveloperTools Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for DeveloperTools and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. - /// - /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class DeveloperTools {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if DeveloperTools instances are equal - /// - /// Instance of DeveloperTools to be compared - /// Boolean - public bool Equals(DeveloperTools? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/DictionaryModel.cs b/src/FingerprintPro.ServerSdk/Model/DictionaryModel.cs deleted file mode 100644 index 289cb00..0000000 --- a/src/FingerprintPro.ServerSdk/Model/DictionaryModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace FingerprintPro.ServerSdk.Model; - -public class DictionaryModel : Dictionary, IEquatable> - where TKey : notnull -{ - /// - /// Returns true if Tag instances are equal - /// - /// Instance of Tag to be compared - /// Boolean - public bool Equals(DictionaryModel? input) - { - if (input == null) - return false; - - // Dict of values that are different from input - var dict = this.Where(entry => input[entry.Key]?.Equals(entry.Value) ?? false) - .ToDictionary(entry => entry.Key, entry => entry.Value); - - return dict.Count == 0; - } -} \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk/Model/Emulator.cs b/src/FingerprintPro.ServerSdk/Model/Emulator.cs deleted file mode 100644 index f60c18b..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Emulator.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Emulator - /// - [DataContract] - public class Emulator : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. (required). - public Emulator(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: Emulator Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Emulator and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. - /// - /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Emulator {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Emulator instances are equal - /// - /// Instance of Emulator to be compared - /// Boolean - public bool Equals(Emulator? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Error.cs b/src/FingerprintPro.ServerSdk/Model/Error.cs deleted file mode 100644 index 7be9c9a..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Error.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Error - /// - [DataContract] - public class Error : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// code (required). - /// message (required). - public Error(ErrorCode code = default(ErrorCode), string message = default(string)) - { - // to ensure "code" is required (not null) - // swagger debug: Error Code - - if (code == null) - { - throw new InvalidDataException("code is a required property for Error and cannot be null"); - } - else - { - this.Code = code; - } - // to ensure "message" is required (not null) - // swagger debug: Error Message - - if (message == null) - { - throw new InvalidDataException("message is a required property for Error and cannot be null"); - } - else - { - this.Message = message; - } - } - - /// - /// Gets or Sets Code - /// - [DataMember(Name = "code", EmitDefaultValue = false)] - [JsonPropertyName("code")] - public ErrorCode Code { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name = "message", EmitDefaultValue = false)] - [JsonPropertyName("message")] - public string Message { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Error {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Error instances are equal - /// - /// Instance of Error to be compared - /// Boolean - public bool Equals(Error? input) - { - if (input == null) - return false; - - return - ( - this.Code == input.Code || - (this.Code != null && - this.Code.Equals(input.Code)) - ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Code != null) - hashCode = hashCode * 59 + this.Code.GetHashCode(); - if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ErrorCode.cs b/src/FingerprintPro.ServerSdk/Model/ErrorCode.cs deleted file mode 100644 index 1ab5321..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ErrorCode.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Error code: * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `TokenRequired` - `Auth-API-Key` header is missing or empty. * `TokenNotFound` - no Fingerprint application found for specified secret key. * `SubscriptionNotActive` - Fingerprint application is not active. * `WrongRegion` - server and application region differ. * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application. * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `Failed` - internal server error. - /// - /// Error code: * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `TokenRequired` - `Auth-API-Key` header is missing or empty. * `TokenNotFound` - no Fingerprint application found for specified secret key. * `SubscriptionNotActive` - Fingerprint application is not active. * `WrongRegion` - server and application region differ. * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application. * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `Failed` - internal server error. - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum ErrorCode - { - /// - /// Enum RequestCannotBeParsed for value: RequestCannotBeParsed - /// - [EnumMember(Value = "RequestCannotBeParsed")] - RequestCannotBeParsed = 1, - /// - /// Enum TokenRequired for value: TokenRequired - /// - [EnumMember(Value = "TokenRequired")] - TokenRequired = 2, - /// - /// Enum TokenNotFound for value: TokenNotFound - /// - [EnumMember(Value = "TokenNotFound")] - TokenNotFound = 3, - /// - /// Enum SubscriptionNotActive for value: SubscriptionNotActive - /// - [EnumMember(Value = "SubscriptionNotActive")] - SubscriptionNotActive = 4, - /// - /// Enum WrongRegion for value: WrongRegion - /// - [EnumMember(Value = "WrongRegion")] - WrongRegion = 5, - /// - /// Enum FeatureNotEnabled for value: FeatureNotEnabled - /// - [EnumMember(Value = "FeatureNotEnabled")] - FeatureNotEnabled = 6, - /// - /// Enum RequestNotFound for value: RequestNotFound - /// - [EnumMember(Value = "RequestNotFound")] - RequestNotFound = 7, - /// - /// Enum VisitorNotFound for value: VisitorNotFound - /// - [EnumMember(Value = "VisitorNotFound")] - VisitorNotFound = 8, - /// - /// Enum TooManyRequests for value: TooManyRequests - /// - [EnumMember(Value = "TooManyRequests")] - TooManyRequests = 9, - /// - /// Enum _429TooManyRequests for value: 429 Too Many Requests - /// - [EnumMember(Value = "429 Too Many Requests")] - _429TooManyRequests = 10, - /// - /// Enum StateNotReady for value: StateNotReady - /// - [EnumMember(Value = "StateNotReady")] - StateNotReady = 11, - /// - /// Enum Failed for value: Failed - /// - [EnumMember(Value = "Failed")] - Failed = 12 - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ErrorPlainResponse.cs b/src/FingerprintPro.ServerSdk/Model/ErrorPlainResponse.cs deleted file mode 100644 index d818b24..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ErrorPlainResponse.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ErrorPlainResponse - /// - [DataContract] - public class ErrorPlainResponse : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// error (required). - public ErrorPlainResponse(string error = default(string)) - { - // to ensure "error" is required (not null) - // swagger debug: ErrorPlainResponse Error - - if (error == null) - { - throw new InvalidDataException("error is a required property for ErrorPlainResponse and cannot be null"); - } - else - { - this.Error = error; - } - } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public string Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ErrorPlainResponse {\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ErrorPlainResponse instances are equal - /// - /// Instance of ErrorPlainResponse to be compared - /// Boolean - public bool Equals(ErrorPlainResponse? input) - { - if (input == null) - return false; - - return - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ErrorResponse.cs b/src/FingerprintPro.ServerSdk/Model/ErrorResponse.cs deleted file mode 100644 index b5c2375..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ErrorResponse.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ErrorResponse - /// - [DataContract] - public class ErrorResponse : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// error (required). - public ErrorResponse(Error error = default(Error)) - { - // to ensure "error" is required (not null) - // swagger debug: ErrorResponse Error - - if (error == null) - { - throw new InvalidDataException("error is a required property for ErrorResponse and cannot be null"); - } - else - { - this.Error = error; - } - } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ErrorResponse {\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ErrorResponse instances are equal - /// - /// Instance of ErrorResponse to be compared - /// Boolean - public bool Equals(ErrorResponse? input) - { - if (input == null) - return false; - - return - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/EventsGetResponse.cs b/src/FingerprintPro.ServerSdk/Model/EventsGetResponse.cs deleted file mode 100644 index 1ecbaf0..0000000 --- a/src/FingerprintPro.ServerSdk/Model/EventsGetResponse.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Contains results from all activated products - Fingerprint Pro, Bot Detection, and others. - /// - [DataContract] - public class EventsGetResponse : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// products (required). - public EventsGetResponse(Products products = default(Products)) - { - // to ensure "products" is required (not null) - // swagger debug: EventsGetResponse Products - - if (products == null) - { - throw new InvalidDataException("products is a required property for EventsGetResponse and cannot be null"); - } - else - { - this.Products = products; - } - } - - /// - /// Gets or Sets Products - /// - [DataMember(Name = "products", EmitDefaultValue = false)] - [JsonPropertyName("products")] - public Products Products { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class EventsGetResponse {\n"); - sb.Append(" Products: ").Append(Products).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if EventsGetResponse instances are equal - /// - /// Instance of EventsGetResponse to be compared - /// Boolean - public bool Equals(EventsGetResponse? input) - { - if (input == null) - return false; - - return - ( - this.Products == input.Products || - (this.Products != null && - this.Products.Equals(input.Products)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Products != null) - hashCode = hashCode * 59 + this.Products.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/EventsUpdateRequest.cs b/src/FingerprintPro.ServerSdk/Model/EventsUpdateRequest.cs deleted file mode 100644 index 8ed3e88..0000000 --- a/src/FingerprintPro.ServerSdk/Model/EventsUpdateRequest.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// EventsUpdateRequest - /// - [DataContract] - public class EventsUpdateRequest : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// LinkedID value to assign to the existing event. - /// tag. - /// Suspect flag indicating observed suspicious or fraudulent event. - public EventsUpdateRequest(string linkedId = default(string), Tag tag = default(Tag), bool? suspect = default(bool?)) - { - this.LinkedId = linkedId; - this.Tag = tag; - this.Suspect = suspect; - } - - /// - /// LinkedID value to assign to the existing event - /// - /// LinkedID value to assign to the existing event - [DataMember(Name = "linkedId", EmitDefaultValue = false)] - [JsonPropertyName("linkedId")] - public string LinkedId { get; set; } - - /// - /// Gets or Sets Tag - /// - [DataMember(Name = "tag", EmitDefaultValue = false)] - [JsonPropertyName("tag")] - public Tag Tag { get; set; } - - /// - /// Suspect flag indicating observed suspicious or fraudulent event - /// - /// Suspect flag indicating observed suspicious or fraudulent event - [DataMember(Name = "suspect", EmitDefaultValue = false)] - [JsonPropertyName("suspect")] - public bool? Suspect { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class EventsUpdateRequest {\n"); - sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); - sb.Append(" Tag: ").Append(Tag).Append("\n"); - sb.Append(" Suspect: ").Append(Suspect).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if EventsUpdateRequest instances are equal - /// - /// Instance of EventsUpdateRequest to be compared - /// Boolean - public bool Equals(EventsUpdateRequest? input) - { - if (input == null) - return false; - - return - ( - this.LinkedId == input.LinkedId || - (this.LinkedId != null && - this.LinkedId.Equals(input.LinkedId)) - ) && - ( - this.Tag == input.Tag || - (this.Tag != null && - this.Tag.Equals(input.Tag)) - ) && - ( - this.Suspect == input.Suspect || - (this.Suspect != null && - this.Suspect.Equals(input.Suspect)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.LinkedId != null) - hashCode = hashCode * 59 + this.LinkedId.GetHashCode(); - if (this.Tag != null) - hashCode = hashCode * 59 + this.Tag.GetHashCode(); - if (this.Suspect != null) - hashCode = hashCode * 59 + this.Suspect.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/FactoryReset.cs b/src/FingerprintPro.ServerSdk/Model/FactoryReset.cs deleted file mode 100644 index 32a2682..0000000 --- a/src/FingerprintPro.ServerSdk/Model/FactoryReset.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// FactoryReset - /// - [DataContract] - public class FactoryReset : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. (required). - /// This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. (required). - public FactoryReset(DateTime? time = default(DateTime?), long? timestamp = default(long?)) - { - // to ensure "time" is required (not null) - // swagger debug: FactoryReset Time - - if (time == null) - { - throw new InvalidDataException("time is a required property for FactoryReset and cannot be null"); - } - else - { - this.Time = time; - } - // to ensure "timestamp" is required (not null) - // swagger debug: FactoryReset Timestamp - - if (timestamp == null) - { - throw new InvalidDataException("timestamp is a required property for FactoryReset and cannot be null"); - } - else - { - this.Timestamp = timestamp; - } - } - - /// - /// Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. - /// - /// Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. - [DataMember(Name = "time", EmitDefaultValue = false)] - [JsonPropertyName("time")] - public DateTime? Time { get; set; } - - /// - /// This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. - /// - /// This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. - [DataMember(Name = "timestamp", EmitDefaultValue = false)] - [JsonPropertyName("timestamp")] - public long? Timestamp { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class FactoryReset {\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if FactoryReset instances are equal - /// - /// Instance of FactoryReset to be compared - /// Boolean - public bool Equals(FactoryReset? input) - { - if (input == null) - return false; - - return - ( - this.Time == input.Time || - (this.Time != null && - this.Time.Equals(input.Time)) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Time != null) - hashCode = hashCode * 59 + this.Time.GetHashCode(); - if (this.Timestamp != null) - hashCode = hashCode * 59 + this.Timestamp.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Frida.cs b/src/FingerprintPro.ServerSdk/Model/Frida.cs deleted file mode 100644 index e4cef05..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Frida.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Frida - /// - [DataContract] - public class Frida : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. (required). - public Frida(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: Frida Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Frida and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. - /// - /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Frida {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Frida instances are equal - /// - /// Instance of Frida to be compared - /// Boolean - public bool Equals(Frida? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Geolocation.cs b/src/FingerprintPro.ServerSdk/Model/Geolocation.cs deleted file mode 100644 index 9510066..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Geolocation.cs +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Geolocation - /// - [DataContract] - public class Geolocation : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// The IP address is likely to be within this radius (in km) of the specified location.. - /// latitude. - /// longitude. - /// postalCode. - /// timezone. - /// city. - /// country. - /// continent. - /// subdivisions. - public Geolocation(int? accuracyRadius = default(int?), double? latitude = default(double?), double? longitude = default(double?), string postalCode = default(string), string timezone = default(string), GeolocationCity city = default(GeolocationCity), GeolocationCountry country = default(GeolocationCountry), GeolocationContinent continent = default(GeolocationContinent), GeolocationSubdivisions subdivisions = default(GeolocationSubdivisions)) - { - this.AccuracyRadius = accuracyRadius; - this.Latitude = latitude; - this.Longitude = longitude; - this.PostalCode = postalCode; - this.Timezone = timezone; - this.City = city; - this.Country = country; - this.Continent = continent; - this.Subdivisions = subdivisions; - } - - /// - /// The IP address is likely to be within this radius (in km) of the specified location. - /// - /// The IP address is likely to be within this radius (in km) of the specified location. - [DataMember(Name = "accuracyRadius", EmitDefaultValue = false)] - [JsonPropertyName("accuracyRadius")] - public int? AccuracyRadius { get; set; } - - /// - /// Gets or Sets Latitude - /// - [DataMember(Name = "latitude", EmitDefaultValue = false)] - [JsonPropertyName("latitude")] - public double? Latitude { get; set; } - - /// - /// Gets or Sets Longitude - /// - [DataMember(Name = "longitude", EmitDefaultValue = false)] - [JsonPropertyName("longitude")] - public double? Longitude { get; set; } - - /// - /// Gets or Sets PostalCode - /// - [DataMember(Name = "postalCode", EmitDefaultValue = false)] - [JsonPropertyName("postalCode")] - public string PostalCode { get; set; } - - /// - /// Gets or Sets Timezone - /// - [DataMember(Name = "timezone", EmitDefaultValue = false)] - [JsonPropertyName("timezone")] - public string Timezone { get; set; } - - /// - /// Gets or Sets City - /// - [DataMember(Name = "city", EmitDefaultValue = false)] - [JsonPropertyName("city")] - public GeolocationCity City { get; set; } - - /// - /// Gets or Sets Country - /// - [DataMember(Name = "country", EmitDefaultValue = false)] - [JsonPropertyName("country")] - public GeolocationCountry Country { get; set; } - - /// - /// Gets or Sets Continent - /// - [DataMember(Name = "continent", EmitDefaultValue = false)] - [JsonPropertyName("continent")] - public GeolocationContinent Continent { get; set; } - - /// - /// Gets or Sets Subdivisions - /// - [DataMember(Name = "subdivisions", EmitDefaultValue = false)] - [JsonPropertyName("subdivisions")] - public GeolocationSubdivisions Subdivisions { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Geolocation {\n"); - sb.Append(" AccuracyRadius: ").Append(AccuracyRadius).Append("\n"); - sb.Append(" Latitude: ").Append(Latitude).Append("\n"); - sb.Append(" Longitude: ").Append(Longitude).Append("\n"); - sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" Timezone: ").Append(Timezone).Append("\n"); - sb.Append(" City: ").Append(City).Append("\n"); - sb.Append(" Country: ").Append(Country).Append("\n"); - sb.Append(" Continent: ").Append(Continent).Append("\n"); - sb.Append(" Subdivisions: ").Append(Subdivisions).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Geolocation instances are equal - /// - /// Instance of Geolocation to be compared - /// Boolean - public bool Equals(Geolocation? input) - { - if (input == null) - return false; - - return - ( - this.AccuracyRadius == input.AccuracyRadius || - (this.AccuracyRadius != null && - this.AccuracyRadius.Equals(input.AccuracyRadius)) - ) && - ( - this.Latitude == input.Latitude || - (this.Latitude != null && - this.Latitude.Equals(input.Latitude)) - ) && - ( - this.Longitude == input.Longitude || - (this.Longitude != null && - this.Longitude.Equals(input.Longitude)) - ) && - ( - this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && - ( - this.Timezone == input.Timezone || - (this.Timezone != null && - this.Timezone.Equals(input.Timezone)) - ) && - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && - ( - this.Continent == input.Continent || - (this.Continent != null && - this.Continent.Equals(input.Continent)) - ) && - ( - this.Subdivisions == input.Subdivisions || - (this.Subdivisions != null && - this.Subdivisions.Equals(input.Subdivisions)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AccuracyRadius != null) - hashCode = hashCode * 59 + this.AccuracyRadius.GetHashCode(); - if (this.Latitude != null) - hashCode = hashCode * 59 + this.Latitude.GetHashCode(); - if (this.Longitude != null) - hashCode = hashCode * 59 + this.Longitude.GetHashCode(); - if (this.PostalCode != null) - hashCode = hashCode * 59 + this.PostalCode.GetHashCode(); - if (this.Timezone != null) - hashCode = hashCode * 59 + this.Timezone.GetHashCode(); - if (this.City != null) - hashCode = hashCode * 59 + this.City.GetHashCode(); - if (this.Country != null) - hashCode = hashCode * 59 + this.Country.GetHashCode(); - if (this.Continent != null) - hashCode = hashCode * 59 + this.Continent.GetHashCode(); - if (this.Subdivisions != null) - hashCode = hashCode * 59 + this.Subdivisions.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/GeolocationCity.cs b/src/FingerprintPro.ServerSdk/Model/GeolocationCity.cs deleted file mode 100644 index 6341c1b..0000000 --- a/src/FingerprintPro.ServerSdk/Model/GeolocationCity.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// GeolocationCity - /// - [DataContract] - public class GeolocationCity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// name (required). - public GeolocationCity(string name = default(string)) - { - // to ensure "name" is required (not null) - // swagger debug: GeolocationCity Name - - if (name == null) - { - throw new InvalidDataException("name is a required property for GeolocationCity and cannot be null"); - } - else - { - this.Name = name; - } - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class GeolocationCity {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if GeolocationCity instances are equal - /// - /// Instance of GeolocationCity to be compared - /// Boolean - public bool Equals(GeolocationCity? input) - { - if (input == null) - return false; - - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/GeolocationContinent.cs b/src/FingerprintPro.ServerSdk/Model/GeolocationContinent.cs deleted file mode 100644 index 988d246..0000000 --- a/src/FingerprintPro.ServerSdk/Model/GeolocationContinent.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// GeolocationContinent - /// - [DataContract] - public class GeolocationContinent : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// code (required). - /// name (required). - public GeolocationContinent(string code = default(string), string name = default(string)) - { - // to ensure "code" is required (not null) - // swagger debug: GeolocationContinent Code - - if (code == null) - { - throw new InvalidDataException("code is a required property for GeolocationContinent and cannot be null"); - } - else - { - this.Code = code; - } - // to ensure "name" is required (not null) - // swagger debug: GeolocationContinent Name - - if (name == null) - { - throw new InvalidDataException("name is a required property for GeolocationContinent and cannot be null"); - } - else - { - this.Name = name; - } - } - - /// - /// Gets or Sets Code - /// - [DataMember(Name = "code", EmitDefaultValue = false)] - [JsonPropertyName("code")] - public string Code { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class GeolocationContinent {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if GeolocationContinent instances are equal - /// - /// Instance of GeolocationContinent to be compared - /// Boolean - public bool Equals(GeolocationContinent? input) - { - if (input == null) - return false; - - return - ( - this.Code == input.Code || - (this.Code != null && - this.Code.Equals(input.Code)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Code != null) - hashCode = hashCode * 59 + this.Code.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/GeolocationCountry.cs b/src/FingerprintPro.ServerSdk/Model/GeolocationCountry.cs deleted file mode 100644 index 6e46869..0000000 --- a/src/FingerprintPro.ServerSdk/Model/GeolocationCountry.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// GeolocationCountry - /// - [DataContract] - public class GeolocationCountry : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// code (required). - /// name (required). - public GeolocationCountry(string code = default(string), string name = default(string)) - { - // to ensure "code" is required (not null) - // swagger debug: GeolocationCountry Code - - if (code == null) - { - throw new InvalidDataException("code is a required property for GeolocationCountry and cannot be null"); - } - else - { - this.Code = code; - } - // to ensure "name" is required (not null) - // swagger debug: GeolocationCountry Name - - if (name == null) - { - throw new InvalidDataException("name is a required property for GeolocationCountry and cannot be null"); - } - else - { - this.Name = name; - } - } - - /// - /// Gets or Sets Code - /// - [DataMember(Name = "code", EmitDefaultValue = false)] - [JsonPropertyName("code")] - public string Code { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class GeolocationCountry {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if GeolocationCountry instances are equal - /// - /// Instance of GeolocationCountry to be compared - /// Boolean - public bool Equals(GeolocationCountry? input) - { - if (input == null) - return false; - - return - ( - this.Code == input.Code || - (this.Code != null && - this.Code.Equals(input.Code)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Code != null) - hashCode = hashCode * 59 + this.Code.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/GeolocationSubdivision.cs b/src/FingerprintPro.ServerSdk/Model/GeolocationSubdivision.cs deleted file mode 100644 index 1ba3ae7..0000000 --- a/src/FingerprintPro.ServerSdk/Model/GeolocationSubdivision.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// GeolocationSubdivision - /// - [DataContract] - public class GeolocationSubdivision : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// isoCode (required). - /// name (required). - public GeolocationSubdivision(string isoCode = default(string), string name = default(string)) - { - // to ensure "isoCode" is required (not null) - // swagger debug: GeolocationSubdivision IsoCode - - if (isoCode == null) - { - throw new InvalidDataException("isoCode is a required property for GeolocationSubdivision and cannot be null"); - } - else - { - this.IsoCode = isoCode; - } - // to ensure "name" is required (not null) - // swagger debug: GeolocationSubdivision Name - - if (name == null) - { - throw new InvalidDataException("name is a required property for GeolocationSubdivision and cannot be null"); - } - else - { - this.Name = name; - } - } - - /// - /// Gets or Sets IsoCode - /// - [DataMember(Name = "isoCode", EmitDefaultValue = false)] - [JsonPropertyName("isoCode")] - public string IsoCode { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class GeolocationSubdivision {\n"); - sb.Append(" IsoCode: ").Append(IsoCode).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if GeolocationSubdivision instances are equal - /// - /// Instance of GeolocationSubdivision to be compared - /// Boolean - public bool Equals(GeolocationSubdivision? input) - { - if (input == null) - return false; - - return - ( - this.IsoCode == input.IsoCode || - (this.IsoCode != null && - this.IsoCode.Equals(input.IsoCode)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.IsoCode != null) - hashCode = hashCode * 59 + this.IsoCode.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/GeolocationSubdivisions.cs b/src/FingerprintPro.ServerSdk/Model/GeolocationSubdivisions.cs deleted file mode 100644 index 39aa34a..0000000 --- a/src/FingerprintPro.ServerSdk/Model/GeolocationSubdivisions.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// GeolocationSubdivisions - /// - [DataContract] - public class GeolocationSubdivisions : List, IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - public GeolocationSubdivisions() : base() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class GeolocationSubdivisions {\n"); - sb.Append(" ").Append(base.ToString()!.Replace("\n", "\n ")).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if GeolocationSubdivisions instances are equal - /// - /// Instance of GeolocationSubdivisions to be compared - /// Boolean - public bool Equals(GeolocationSubdivisions? input) - { - if (input == null) - return false; - - return base.Equals(input); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/HighActivity.cs b/src/FingerprintPro.ServerSdk/Model/HighActivity.cs deleted file mode 100644 index 90582a5..0000000 --- a/src/FingerprintPro.ServerSdk/Model/HighActivity.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// HighActivity - /// - [DataContract] - public class HighActivity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Flag indicating if the request came from a high-activity visitor. (required). - /// Number of requests from the same visitor in the previous day.. - public HighActivity(bool? result = default(bool?), long? dailyRequests = default(long?)) - { - // to ensure "result" is required (not null) - // swagger debug: HighActivity Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for HighActivity and cannot be null"); - } - else - { - this.Result = result; - } - this.DailyRequests = dailyRequests; - } - - /// - /// Flag indicating if the request came from a high-activity visitor. - /// - /// Flag indicating if the request came from a high-activity visitor. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Number of requests from the same visitor in the previous day. - /// - /// Number of requests from the same visitor in the previous day. - [DataMember(Name = "dailyRequests", EmitDefaultValue = false)] - [JsonPropertyName("dailyRequests")] - public long? DailyRequests { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class HighActivity {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" DailyRequests: ").Append(DailyRequests).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if HighActivity instances are equal - /// - /// Instance of HighActivity to be compared - /// Boolean - public bool Equals(HighActivity? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.DailyRequests == input.DailyRequests || - (this.DailyRequests != null && - this.DailyRequests.Equals(input.DailyRequests)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.DailyRequests != null) - hashCode = hashCode * 59 + this.DailyRequests.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPBlocklist.cs b/src/FingerprintPro.ServerSdk/Model/IPBlocklist.cs deleted file mode 100644 index a662152..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPBlocklist.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IPBlocklist - /// - [DataContract] - public class IPBlocklist : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. (required). - /// details (required). - public IPBlocklist(bool? result = default(bool?), IPBlocklistDetails details = default(IPBlocklistDetails)) - { - // to ensure "result" is required (not null) - // swagger debug: IPBlocklist Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for IPBlocklist and cannot be null"); - } - else - { - this.Result = result; - } - // to ensure "details" is required (not null) - // swagger debug: IPBlocklist Details - - if (details == null) - { - throw new InvalidDataException("details is a required property for IPBlocklist and cannot be null"); - } - else - { - this.Details = details; - } - } - - /// - /// `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. - /// - /// `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Details - /// - [DataMember(Name = "details", EmitDefaultValue = false)] - [JsonPropertyName("details")] - public IPBlocklistDetails Details { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPBlocklist {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPBlocklist instances are equal - /// - /// Instance of IPBlocklist to be compared - /// Boolean - public bool Equals(IPBlocklist? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Details == input.Details || - (this.Details != null && - this.Details.Equals(input.Details)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Details != null) - hashCode = hashCode * 59 + this.Details.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPBlocklistDetails.cs b/src/FingerprintPro.ServerSdk/Model/IPBlocklistDetails.cs deleted file mode 100644 index 73bb2aa..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPBlocklistDetails.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IPBlocklistDetails - /// - [DataContract] - public class IPBlocklistDetails : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// IP address was part of a known email spam attack (SMTP). (required). - /// IP address was part of a known network attack (SSH/HTTPS). (required). - public IPBlocklistDetails(bool? emailSpam = default(bool?), bool? attackSource = default(bool?)) - { - // to ensure "emailSpam" is required (not null) - // swagger debug: IPBlocklistDetails EmailSpam - - if (emailSpam == null) - { - throw new InvalidDataException("emailSpam is a required property for IPBlocklistDetails and cannot be null"); - } - else - { - this.EmailSpam = emailSpam; - } - // to ensure "attackSource" is required (not null) - // swagger debug: IPBlocklistDetails AttackSource - - if (attackSource == null) - { - throw new InvalidDataException("attackSource is a required property for IPBlocklistDetails and cannot be null"); - } - else - { - this.AttackSource = attackSource; - } - } - - /// - /// IP address was part of a known email spam attack (SMTP). - /// - /// IP address was part of a known email spam attack (SMTP). - [DataMember(Name = "emailSpam", EmitDefaultValue = false)] - [JsonPropertyName("emailSpam")] - public bool? EmailSpam { get; set; } - - /// - /// IP address was part of a known network attack (SSH/HTTPS). - /// - /// IP address was part of a known network attack (SSH/HTTPS). - [DataMember(Name = "attackSource", EmitDefaultValue = false)] - [JsonPropertyName("attackSource")] - public bool? AttackSource { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPBlocklistDetails {\n"); - sb.Append(" EmailSpam: ").Append(EmailSpam).Append("\n"); - sb.Append(" AttackSource: ").Append(AttackSource).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPBlocklistDetails instances are equal - /// - /// Instance of IPBlocklistDetails to be compared - /// Boolean - public bool Equals(IPBlocklistDetails? input) - { - if (input == null) - return false; - - return - ( - this.EmailSpam == input.EmailSpam || - (this.EmailSpam != null && - this.EmailSpam.Equals(input.EmailSpam)) - ) && - ( - this.AttackSource == input.AttackSource || - (this.AttackSource != null && - this.AttackSource.Equals(input.AttackSource)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.EmailSpam != null) - hashCode = hashCode * 59 + this.EmailSpam.GetHashCode(); - if (this.AttackSource != null) - hashCode = hashCode * 59 + this.AttackSource.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPInfo.cs b/src/FingerprintPro.ServerSdk/Model/IPInfo.cs deleted file mode 100644 index 05b0f44..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPInfo.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - /// - [DataContract] - public class IPInfo : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// v4. - /// v6. - public IPInfo(IPInfoV4 v4 = default(IPInfoV4), IPInfoV6 v6 = default(IPInfoV6)) - { - this.V4 = v4; - this.V6 = v6; - } - - /// - /// Gets or Sets V4 - /// - [DataMember(Name = "v4", EmitDefaultValue = false)] - [JsonPropertyName("v4")] - public IPInfoV4 V4 { get; set; } - - /// - /// Gets or Sets V6 - /// - [DataMember(Name = "v6", EmitDefaultValue = false)] - [JsonPropertyName("v6")] - public IPInfoV6 V6 { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPInfo {\n"); - sb.Append(" V4: ").Append(V4).Append("\n"); - sb.Append(" V6: ").Append(V6).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPInfo instances are equal - /// - /// Instance of IPInfo to be compared - /// Boolean - public bool Equals(IPInfo? input) - { - if (input == null) - return false; - - return - ( - this.V4 == input.V4 || - (this.V4 != null && - this.V4.Equals(input.V4)) - ) && - ( - this.V6 == input.V6 || - (this.V6 != null && - this.V6.Equals(input.V6)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.V4 != null) - hashCode = hashCode * 59 + this.V4.GetHashCode(); - if (this.V6 != null) - hashCode = hashCode * 59 + this.V6.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPInfoASN.cs b/src/FingerprintPro.ServerSdk/Model/IPInfoASN.cs deleted file mode 100644 index 0e92f36..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPInfoASN.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IPInfoASN - /// - [DataContract] - public class IPInfoASN : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// asn (required). - /// name (required). - /// network (required). - public IPInfoASN(string asn = default(string), string name = default(string), string network = default(string)) - { - // to ensure "asn" is required (not null) - // swagger debug: IPInfoASN Asn - - if (asn == null) - { - throw new InvalidDataException("asn is a required property for IPInfoASN and cannot be null"); - } - else - { - this.Asn = asn; - } - // to ensure "name" is required (not null) - // swagger debug: IPInfoASN Name - - if (name == null) - { - throw new InvalidDataException("name is a required property for IPInfoASN and cannot be null"); - } - else - { - this.Name = name; - } - // to ensure "network" is required (not null) - // swagger debug: IPInfoASN Network - - if (network == null) - { - throw new InvalidDataException("network is a required property for IPInfoASN and cannot be null"); - } - else - { - this.Network = network; - } - } - - /// - /// Gets or Sets Asn - /// - [DataMember(Name = "asn", EmitDefaultValue = false)] - [JsonPropertyName("asn")] - public string Asn { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Gets or Sets Network - /// - [DataMember(Name = "network", EmitDefaultValue = false)] - [JsonPropertyName("network")] - public string Network { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPInfoASN {\n"); - sb.Append(" Asn: ").Append(Asn).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Network: ").Append(Network).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPInfoASN instances are equal - /// - /// Instance of IPInfoASN to be compared - /// Boolean - public bool Equals(IPInfoASN? input) - { - if (input == null) - return false; - - return - ( - this.Asn == input.Asn || - (this.Asn != null && - this.Asn.Equals(input.Asn)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Network == input.Network || - (this.Network != null && - this.Network.Equals(input.Network)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Asn != null) - hashCode = hashCode * 59 + this.Asn.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Network != null) - hashCode = hashCode * 59 + this.Network.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPInfoDataCenter.cs b/src/FingerprintPro.ServerSdk/Model/IPInfoDataCenter.cs deleted file mode 100644 index 85e7f3c..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPInfoDataCenter.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IPInfoDataCenter - /// - [DataContract] - public class IPInfoDataCenter : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// result (required). - /// name (required). - public IPInfoDataCenter(bool? result = default(bool?), string name = default(string)) - { - // to ensure "result" is required (not null) - // swagger debug: IPInfoDataCenter Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for IPInfoDataCenter and cannot be null"); - } - else - { - this.Result = result; - } - // to ensure "name" is required (not null) - // swagger debug: IPInfoDataCenter Name - - if (name == null) - { - throw new InvalidDataException("name is a required property for IPInfoDataCenter and cannot be null"); - } - else - { - this.Name = name; - } - } - - /// - /// Gets or Sets Result - /// - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPInfoDataCenter {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPInfoDataCenter instances are equal - /// - /// Instance of IPInfoDataCenter to be compared - /// Boolean - public bool Equals(IPInfoDataCenter? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPInfoV4.cs b/src/FingerprintPro.ServerSdk/Model/IPInfoV4.cs deleted file mode 100644 index 65b332d..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPInfoV4.cs +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IPInfoV4 - /// - [DataContract] - public class IPInfoV4 : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// address (required). - /// geolocation (required). - /// asn. - /// datacenter. - public IPInfoV4(string address = default(string), Geolocation geolocation = default(Geolocation), IPInfoASN asn = default(IPInfoASN), IPInfoDataCenter datacenter = default(IPInfoDataCenter)) - { - // to ensure "address" is required (not null) - // swagger debug: IPInfoV4 Address - - if (address == null) - { - throw new InvalidDataException("address is a required property for IPInfoV4 and cannot be null"); - } - else - { - this.Address = address; - } - // to ensure "geolocation" is required (not null) - // swagger debug: IPInfoV4 Geolocation - - if (geolocation == null) - { - throw new InvalidDataException("geolocation is a required property for IPInfoV4 and cannot be null"); - } - else - { - this.Geolocation = geolocation; - } - this.Asn = asn; - this.Datacenter = datacenter; - } - - /// - /// Gets or Sets Address - /// - [DataMember(Name = "address", EmitDefaultValue = false)] - [JsonPropertyName("address")] - public string Address { get; set; } - - /// - /// Gets or Sets Geolocation - /// - [DataMember(Name = "geolocation", EmitDefaultValue = false)] - [JsonPropertyName("geolocation")] - public Geolocation Geolocation { get; set; } - - /// - /// Gets or Sets Asn - /// - [DataMember(Name = "asn", EmitDefaultValue = false)] - [JsonPropertyName("asn")] - public IPInfoASN Asn { get; set; } - - /// - /// Gets or Sets Datacenter - /// - [DataMember(Name = "datacenter", EmitDefaultValue = false)] - [JsonPropertyName("datacenter")] - public IPInfoDataCenter Datacenter { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPInfoV4 {\n"); - sb.Append(" Address: ").Append(Address).Append("\n"); - sb.Append(" Geolocation: ").Append(Geolocation).Append("\n"); - sb.Append(" Asn: ").Append(Asn).Append("\n"); - sb.Append(" Datacenter: ").Append(Datacenter).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPInfoV4 instances are equal - /// - /// Instance of IPInfoV4 to be compared - /// Boolean - public bool Equals(IPInfoV4? input) - { - if (input == null) - return false; - - return - ( - this.Address == input.Address || - (this.Address != null && - this.Address.Equals(input.Address)) - ) && - ( - this.Geolocation == input.Geolocation || - (this.Geolocation != null && - this.Geolocation.Equals(input.Geolocation)) - ) && - ( - this.Asn == input.Asn || - (this.Asn != null && - this.Asn.Equals(input.Asn)) - ) && - ( - this.Datacenter == input.Datacenter || - (this.Datacenter != null && - this.Datacenter.Equals(input.Datacenter)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Address != null) - hashCode = hashCode * 59 + this.Address.GetHashCode(); - if (this.Geolocation != null) - hashCode = hashCode * 59 + this.Geolocation.GetHashCode(); - if (this.Asn != null) - hashCode = hashCode * 59 + this.Asn.GetHashCode(); - if (this.Datacenter != null) - hashCode = hashCode * 59 + this.Datacenter.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IPInfoV6.cs b/src/FingerprintPro.ServerSdk/Model/IPInfoV6.cs deleted file mode 100644 index 93f1660..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IPInfoV6.cs +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IPInfoV6 - /// - [DataContract] - public class IPInfoV6 : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// address (required). - /// geolocation (required). - /// asn. - /// datacenter. - public IPInfoV6(string address = default(string), Geolocation geolocation = default(Geolocation), IPInfoASN asn = default(IPInfoASN), IPInfoDataCenter datacenter = default(IPInfoDataCenter)) - { - // to ensure "address" is required (not null) - // swagger debug: IPInfoV6 Address - - if (address == null) - { - throw new InvalidDataException("address is a required property for IPInfoV6 and cannot be null"); - } - else - { - this.Address = address; - } - // to ensure "geolocation" is required (not null) - // swagger debug: IPInfoV6 Geolocation - - if (geolocation == null) - { - throw new InvalidDataException("geolocation is a required property for IPInfoV6 and cannot be null"); - } - else - { - this.Geolocation = geolocation; - } - this.Asn = asn; - this.Datacenter = datacenter; - } - - /// - /// Gets or Sets Address - /// - [DataMember(Name = "address", EmitDefaultValue = false)] - [JsonPropertyName("address")] - public string Address { get; set; } - - /// - /// Gets or Sets Geolocation - /// - [DataMember(Name = "geolocation", EmitDefaultValue = false)] - [JsonPropertyName("geolocation")] - public Geolocation Geolocation { get; set; } - - /// - /// Gets or Sets Asn - /// - [DataMember(Name = "asn", EmitDefaultValue = false)] - [JsonPropertyName("asn")] - public IPInfoASN Asn { get; set; } - - /// - /// Gets or Sets Datacenter - /// - [DataMember(Name = "datacenter", EmitDefaultValue = false)] - [JsonPropertyName("datacenter")] - public IPInfoDataCenter Datacenter { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IPInfoV6 {\n"); - sb.Append(" Address: ").Append(Address).Append("\n"); - sb.Append(" Geolocation: ").Append(Geolocation).Append("\n"); - sb.Append(" Asn: ").Append(Asn).Append("\n"); - sb.Append(" Datacenter: ").Append(Datacenter).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IPInfoV6 instances are equal - /// - /// Instance of IPInfoV6 to be compared - /// Boolean - public bool Equals(IPInfoV6? input) - { - if (input == null) - return false; - - return - ( - this.Address == input.Address || - (this.Address != null && - this.Address.Equals(input.Address)) - ) && - ( - this.Geolocation == input.Geolocation || - (this.Geolocation != null && - this.Geolocation.Equals(input.Geolocation)) - ) && - ( - this.Asn == input.Asn || - (this.Asn != null && - this.Asn.Equals(input.Asn)) - ) && - ( - this.Datacenter == input.Datacenter || - (this.Datacenter != null && - this.Datacenter.Equals(input.Datacenter)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Address != null) - hashCode = hashCode * 59 + this.Address.GetHashCode(); - if (this.Geolocation != null) - hashCode = hashCode * 59 + this.Geolocation.GetHashCode(); - if (this.Asn != null) - hashCode = hashCode * 59 + this.Asn.GetHashCode(); - if (this.Datacenter != null) - hashCode = hashCode * 59 + this.Datacenter.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Identification.cs b/src/FingerprintPro.ServerSdk/Model/Identification.cs deleted file mode 100644 index f536ed9..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Identification.cs +++ /dev/null @@ -1,563 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Identification - /// - [DataContract] - public class Identification : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. (required). - /// Unique identifier of the user's request. (required). - /// browserDetails (required). - /// Flag if user used incognito session. (required). - /// IP address of the requesting browser or bot. (required). - /// ipLocation. - /// A customer-provided id that was sent with the request.. - /// Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent).. - /// Timestamp of the event with millisecond precision in Unix time. (required). - /// Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. (required). - /// Page URL from which the request was sent. (required). - /// tag (required). - /// confidence. - /// Attribute represents if a visitor had been identified before. (required). - /// firstSeenAt (required). - /// lastSeenAt (required). - /// components. - /// `true` if we determined that this payload was replayed, `false` otherwise. (required). - /// sdk. - /// Environment ID associated with the event. - public Identification(string visitorId = default(string), string requestId = default(string), BrowserDetails browserDetails = default(BrowserDetails), bool? incognito = default(bool?), string ip = default(string), DeprecatedGeolocation ipLocation = default(DeprecatedGeolocation), string linkedId = default(string), bool? suspect = default(bool?), long? timestamp = default(long?), DateTime? time = default(DateTime?), string url = default(string), Tag tag = default(Tag), IdentificationConfidence confidence = default(IdentificationConfidence), bool? visitorFound = default(bool?), IdentificationSeenAt firstSeenAt = default(IdentificationSeenAt), IdentificationSeenAt lastSeenAt = default(IdentificationSeenAt), RawDeviceAttributes components = default(RawDeviceAttributes), bool? replayed = default(bool?), SDK sdk = default(SDK), string environmentId = default(string)) - { - // to ensure "visitorId" is required (not null) - // swagger debug: Identification VisitorId - - if (visitorId == null) - { - throw new InvalidDataException("visitorId is a required property for Identification and cannot be null"); - } - else - { - this.VisitorId = visitorId; - } - // to ensure "requestId" is required (not null) - // swagger debug: Identification RequestId - - if (requestId == null) - { - throw new InvalidDataException("requestId is a required property for Identification and cannot be null"); - } - else - { - this.RequestId = requestId; - } - // to ensure "browserDetails" is required (not null) - // swagger debug: Identification BrowserDetails - - if (browserDetails == null) - { - throw new InvalidDataException("browserDetails is a required property for Identification and cannot be null"); - } - else - { - this.BrowserDetails = browserDetails; - } - // to ensure "incognito" is required (not null) - // swagger debug: Identification Incognito - - if (incognito == null) - { - throw new InvalidDataException("incognito is a required property for Identification and cannot be null"); - } - else - { - this.Incognito = incognito; - } - // to ensure "ip" is required (not null) - // swagger debug: Identification Ip - - if (ip == null) - { - throw new InvalidDataException("ip is a required property for Identification and cannot be null"); - } - else - { - this.Ip = ip; - } - // to ensure "timestamp" is required (not null) - // swagger debug: Identification Timestamp - - if (timestamp == null) - { - throw new InvalidDataException("timestamp is a required property for Identification and cannot be null"); - } - else - { - this.Timestamp = timestamp; - } - // to ensure "time" is required (not null) - // swagger debug: Identification Time - - if (time == null) - { - throw new InvalidDataException("time is a required property for Identification and cannot be null"); - } - else - { - this.Time = time; - } - // to ensure "url" is required (not null) - // swagger debug: Identification Url - - if (url == null) - { - throw new InvalidDataException("url is a required property for Identification and cannot be null"); - } - else - { - this.Url = url; - } - // to ensure "tag" is required (not null) - // swagger debug: Identification Tag - - if (tag == null) - { - throw new InvalidDataException("tag is a required property for Identification and cannot be null"); - } - else - { - this.Tag = tag; - } - // to ensure "visitorFound" is required (not null) - // swagger debug: Identification VisitorFound - - if (visitorFound == null) - { - throw new InvalidDataException("visitorFound is a required property for Identification and cannot be null"); - } - else - { - this.VisitorFound = visitorFound; - } - // to ensure "firstSeenAt" is required (not null) - // swagger debug: Identification FirstSeenAt - - if (firstSeenAt == null) - { - throw new InvalidDataException("firstSeenAt is a required property for Identification and cannot be null"); - } - else - { - this.FirstSeenAt = firstSeenAt; - } - // to ensure "lastSeenAt" is required (not null) - // swagger debug: Identification LastSeenAt - - if (lastSeenAt == null) - { - throw new InvalidDataException("lastSeenAt is a required property for Identification and cannot be null"); - } - else - { - this.LastSeenAt = lastSeenAt; - } - // to ensure "replayed" is required (not null) - // swagger debug: Identification Replayed - - if (replayed == null) - { - throw new InvalidDataException("replayed is a required property for Identification and cannot be null"); - } - else - { - this.Replayed = replayed; - } - this.IpLocation = ipLocation; - this.LinkedId = linkedId; - this.Suspect = suspect; - this.Confidence = confidence; - this.Components = components; - this.Sdk = sdk; - this.EnvironmentId = environmentId; - } - - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. - [DataMember(Name = "visitorId", EmitDefaultValue = false)] - [JsonPropertyName("visitorId")] - public string VisitorId { get; set; } - - /// - /// Unique identifier of the user's request. - /// - /// Unique identifier of the user's request. - [DataMember(Name = "requestId", EmitDefaultValue = false)] - [JsonPropertyName("requestId")] - public string RequestId { get; set; } - - /// - /// Gets or Sets BrowserDetails - /// - [DataMember(Name = "browserDetails", EmitDefaultValue = false)] - [JsonPropertyName("browserDetails")] - public BrowserDetails BrowserDetails { get; set; } - - /// - /// Flag if user used incognito session. - /// - /// Flag if user used incognito session. - [DataMember(Name = "incognito", EmitDefaultValue = false)] - [JsonPropertyName("incognito")] - public bool? Incognito { get; set; } - - /// - /// IP address of the requesting browser or bot. - /// - /// IP address of the requesting browser or bot. - [DataMember(Name = "ip", EmitDefaultValue = false)] - [JsonPropertyName("ip")] - public string Ip { get; set; } - - /// - /// Gets or Sets IpLocation - /// - [DataMember(Name = "ipLocation", EmitDefaultValue = false)] - [JsonPropertyName("ipLocation")] - public DeprecatedGeolocation IpLocation { get; set; } - - /// - /// A customer-provided id that was sent with the request. - /// - /// A customer-provided id that was sent with the request. - [DataMember(Name = "linkedId", EmitDefaultValue = false)] - [JsonPropertyName("linkedId")] - public string LinkedId { get; set; } - - /// - /// Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). - /// - /// Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). - [DataMember(Name = "suspect", EmitDefaultValue = false)] - [JsonPropertyName("suspect")] - public bool? Suspect { get; set; } - - /// - /// Timestamp of the event with millisecond precision in Unix time. - /// - /// Timestamp of the event with millisecond precision in Unix time. - [DataMember(Name = "timestamp", EmitDefaultValue = false)] - [JsonPropertyName("timestamp")] - public long? Timestamp { get; set; } - - /// - /// Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - /// - /// Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - [DataMember(Name = "time", EmitDefaultValue = false)] - [JsonPropertyName("time")] - public DateTime? Time { get; set; } - - /// - /// Page URL from which the request was sent. - /// - /// Page URL from which the request was sent. - [DataMember(Name = "url", EmitDefaultValue = false)] - [JsonPropertyName("url")] - public string Url { get; set; } - - /// - /// Gets or Sets Tag - /// - [DataMember(Name = "tag", EmitDefaultValue = false)] - [JsonPropertyName("tag")] - public Tag Tag { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public IdentificationConfidence Confidence { get; set; } - - /// - /// Attribute represents if a visitor had been identified before. - /// - /// Attribute represents if a visitor had been identified before. - [DataMember(Name = "visitorFound", EmitDefaultValue = false)] - [JsonPropertyName("visitorFound")] - public bool? VisitorFound { get; set; } - - /// - /// Gets or Sets FirstSeenAt - /// - [DataMember(Name = "firstSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("firstSeenAt")] - public IdentificationSeenAt FirstSeenAt { get; set; } - - /// - /// Gets or Sets LastSeenAt - /// - [DataMember(Name = "lastSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("lastSeenAt")] - public IdentificationSeenAt LastSeenAt { get; set; } - - /// - /// Gets or Sets Components - /// - [DataMember(Name = "components", EmitDefaultValue = false)] - [JsonPropertyName("components")] - public RawDeviceAttributes Components { get; set; } - - /// - /// `true` if we determined that this payload was replayed, `false` otherwise. - /// - /// `true` if we determined that this payload was replayed, `false` otherwise. - [DataMember(Name = "replayed", EmitDefaultValue = false)] - [JsonPropertyName("replayed")] - public bool? Replayed { get; set; } - - /// - /// Gets or Sets Sdk - /// - [DataMember(Name = "sdk", EmitDefaultValue = false)] - [JsonPropertyName("sdk")] - public SDK Sdk { get; set; } - - /// - /// Environment ID associated with the event - /// - /// Environment ID associated with the event - [DataMember(Name = "environmentId", EmitDefaultValue = false)] - [JsonPropertyName("environmentId")] - public string EnvironmentId { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Identification {\n"); - sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); - sb.Append(" RequestId: ").Append(RequestId).Append("\n"); - sb.Append(" BrowserDetails: ").Append(BrowserDetails).Append("\n"); - sb.Append(" Incognito: ").Append(Incognito).Append("\n"); - sb.Append(" Ip: ").Append(Ip).Append("\n"); - sb.Append(" IpLocation: ").Append(IpLocation).Append("\n"); - sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); - sb.Append(" Suspect: ").Append(Suspect).Append("\n"); - sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); - sb.Append(" Tag: ").Append(Tag).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" VisitorFound: ").Append(VisitorFound).Append("\n"); - sb.Append(" FirstSeenAt: ").Append(FirstSeenAt).Append("\n"); - sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); - sb.Append(" Components: ").Append(Components).Append("\n"); - sb.Append(" Replayed: ").Append(Replayed).Append("\n"); - sb.Append(" Sdk: ").Append(Sdk).Append("\n"); - sb.Append(" EnvironmentId: ").Append(EnvironmentId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Identification instances are equal - /// - /// Instance of Identification to be compared - /// Boolean - public bool Equals(Identification? input) - { - if (input == null) - return false; - - return - ( - this.VisitorId == input.VisitorId || - (this.VisitorId != null && - this.VisitorId.Equals(input.VisitorId)) - ) && - ( - this.RequestId == input.RequestId || - (this.RequestId != null && - this.RequestId.Equals(input.RequestId)) - ) && - ( - this.BrowserDetails == input.BrowserDetails || - (this.BrowserDetails != null && - this.BrowserDetails.Equals(input.BrowserDetails)) - ) && - ( - this.Incognito == input.Incognito || - (this.Incognito != null && - this.Incognito.Equals(input.Incognito)) - ) && - ( - this.Ip == input.Ip || - (this.Ip != null && - this.Ip.Equals(input.Ip)) - ) && - ( - this.IpLocation == input.IpLocation || - (this.IpLocation != null && - this.IpLocation.Equals(input.IpLocation)) - ) && - ( - this.LinkedId == input.LinkedId || - (this.LinkedId != null && - this.LinkedId.Equals(input.LinkedId)) - ) && - ( - this.Suspect == input.Suspect || - (this.Suspect != null && - this.Suspect.Equals(input.Suspect)) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ) && - ( - this.Time == input.Time || - (this.Time != null && - this.Time.Equals(input.Time)) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ) && - ( - this.Tag == input.Tag || - (this.Tag != null && - this.Tag.Equals(input.Tag)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.VisitorFound == input.VisitorFound || - (this.VisitorFound != null && - this.VisitorFound.Equals(input.VisitorFound)) - ) && - ( - this.FirstSeenAt == input.FirstSeenAt || - (this.FirstSeenAt != null && - this.FirstSeenAt.Equals(input.FirstSeenAt)) - ) && - ( - this.LastSeenAt == input.LastSeenAt || - (this.LastSeenAt != null && - this.LastSeenAt.Equals(input.LastSeenAt)) - ) && - ( - this.Components == input.Components || - (this.Components != null && - this.Components.Equals(input.Components)) - ) && - ( - this.Replayed == input.Replayed || - (this.Replayed != null && - this.Replayed.Equals(input.Replayed)) - ) && - ( - this.Sdk == input.Sdk || - (this.Sdk != null && - this.Sdk.Equals(input.Sdk)) - ) && - ( - this.EnvironmentId == input.EnvironmentId || - (this.EnvironmentId != null && - this.EnvironmentId.Equals(input.EnvironmentId)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.VisitorId != null) - hashCode = hashCode * 59 + this.VisitorId.GetHashCode(); - if (this.RequestId != null) - hashCode = hashCode * 59 + this.RequestId.GetHashCode(); - if (this.BrowserDetails != null) - hashCode = hashCode * 59 + this.BrowserDetails.GetHashCode(); - if (this.Incognito != null) - hashCode = hashCode * 59 + this.Incognito.GetHashCode(); - if (this.Ip != null) - hashCode = hashCode * 59 + this.Ip.GetHashCode(); - if (this.IpLocation != null) - hashCode = hashCode * 59 + this.IpLocation.GetHashCode(); - if (this.LinkedId != null) - hashCode = hashCode * 59 + this.LinkedId.GetHashCode(); - if (this.Suspect != null) - hashCode = hashCode * 59 + this.Suspect.GetHashCode(); - if (this.Timestamp != null) - hashCode = hashCode * 59 + this.Timestamp.GetHashCode(); - if (this.Time != null) - hashCode = hashCode * 59 + this.Time.GetHashCode(); - if (this.Url != null) - hashCode = hashCode * 59 + this.Url.GetHashCode(); - if (this.Tag != null) - hashCode = hashCode * 59 + this.Tag.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.VisitorFound != null) - hashCode = hashCode * 59 + this.VisitorFound.GetHashCode(); - if (this.FirstSeenAt != null) - hashCode = hashCode * 59 + this.FirstSeenAt.GetHashCode(); - if (this.LastSeenAt != null) - hashCode = hashCode * 59 + this.LastSeenAt.GetHashCode(); - if (this.Components != null) - hashCode = hashCode * 59 + this.Components.GetHashCode(); - if (this.Replayed != null) - hashCode = hashCode * 59 + this.Replayed.GetHashCode(); - if (this.Sdk != null) - hashCode = hashCode * 59 + this.Sdk.GetHashCode(); - if (this.EnvironmentId != null) - hashCode = hashCode * 59 + this.EnvironmentId.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IdentificationConfidence.cs b/src/FingerprintPro.ServerSdk/Model/IdentificationConfidence.cs deleted file mode 100644 index 097836d..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IdentificationConfidence.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IdentificationConfidence - /// - [DataContract] - public class IdentificationConfidence : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. (required). - /// The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method.. - /// comment. - public IdentificationConfidence(double? score = default(double?), string revision = default(string), string comment = default(string)) - { - // to ensure "score" is required (not null) - // swagger debug: IdentificationConfidence Score - - if (score == null) - { - throw new InvalidDataException("score is a required property for IdentificationConfidence and cannot be null"); - } - else - { - this.Score = score; - } - this.Revision = revision; - this.Comment = comment; - } - - /// - /// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. - /// - /// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. - [DataMember(Name = "score", EmitDefaultValue = false)] - [JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. - /// - /// The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. - [DataMember(Name = "revision", EmitDefaultValue = false)] - [JsonPropertyName("revision")] - public string Revision { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - [JsonPropertyName("comment")] - public string Comment { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IdentificationConfidence {\n"); - sb.Append(" Score: ").Append(Score).Append("\n"); - sb.Append(" Revision: ").Append(Revision).Append("\n"); - sb.Append(" Comment: ").Append(Comment).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IdentificationConfidence instances are equal - /// - /// Instance of IdentificationConfidence to be compared - /// Boolean - public bool Equals(IdentificationConfidence? input) - { - if (input == null) - return false; - - return - ( - this.Score == input.Score || - (this.Score != null && - this.Score.Equals(input.Score)) - ) && - ( - this.Revision == input.Revision || - (this.Revision != null && - this.Revision.Equals(input.Revision)) - ) && - ( - this.Comment == input.Comment || - (this.Comment != null && - this.Comment.Equals(input.Comment)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Score != null) - hashCode = hashCode * 59 + this.Score.GetHashCode(); - if (this.Revision != null) - hashCode = hashCode * 59 + this.Revision.GetHashCode(); - if (this.Comment != null) - hashCode = hashCode * 59 + this.Comment.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/IdentificationSeenAt.cs b/src/FingerprintPro.ServerSdk/Model/IdentificationSeenAt.cs deleted file mode 100644 index bf23053..0000000 --- a/src/FingerprintPro.ServerSdk/Model/IdentificationSeenAt.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// IdentificationSeenAt - /// - [DataContract] - public class IdentificationSeenAt : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// global (required). - /// subscription (required). - public IdentificationSeenAt(DateTime? global = default(DateTime?), DateTime? subscription = default(DateTime?)) - { - this.Global = global; - this.Subscription = subscription; - } - - /// - /// Gets or Sets Global - /// - [DataMember(Name = "global", EmitDefaultValue = false)] - [JsonPropertyName("global")] - public DateTime? Global { get; set; } - - /// - /// Gets or Sets Subscription - /// - [DataMember(Name = "subscription", EmitDefaultValue = false)] - [JsonPropertyName("subscription")] - public DateTime? Subscription { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class IdentificationSeenAt {\n"); - sb.Append(" Global: ").Append(Global).Append("\n"); - sb.Append(" Subscription: ").Append(Subscription).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if IdentificationSeenAt instances are equal - /// - /// Instance of IdentificationSeenAt to be compared - /// Boolean - public bool Equals(IdentificationSeenAt? input) - { - if (input == null) - return false; - - return - ( - this.Global == input.Global || - (this.Global != null && - this.Global.Equals(input.Global)) - ) && - ( - this.Subscription == input.Subscription || - (this.Subscription != null && - this.Subscription.Equals(input.Subscription)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Global != null) - hashCode = hashCode * 59 + this.Global.GetHashCode(); - if (this.Subscription != null) - hashCode = hashCode * 59 + this.Subscription.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Incognito.cs b/src/FingerprintPro.ServerSdk/Model/Incognito.cs deleted file mode 100644 index e2722e0..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Incognito.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Incognito - /// - [DataContract] - public class Incognito : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if we detected incognito mode used in the browser, `false` otherwise. (required). - public Incognito(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: Incognito Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Incognito and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// `true` if we detected incognito mode used in the browser, `false` otherwise. - /// - /// `true` if we detected incognito mode used in the browser, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Incognito {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Incognito instances are equal - /// - /// Instance of Incognito to be compared - /// Boolean - public bool Equals(Incognito? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Jailbroken.cs b/src/FingerprintPro.ServerSdk/Model/Jailbroken.cs deleted file mode 100644 index d1ca420..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Jailbroken.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Jailbroken - /// - [DataContract] - public class Jailbroken : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. (required). - public Jailbroken(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: Jailbroken Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Jailbroken and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. - /// - /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Jailbroken {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Jailbroken instances are equal - /// - /// Instance of Jailbroken to be compared - /// Boolean - public bool Equals(Jailbroken? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/LocationSpoofing.cs b/src/FingerprintPro.ServerSdk/Model/LocationSpoofing.cs deleted file mode 100644 index 6cdceea..0000000 --- a/src/FingerprintPro.ServerSdk/Model/LocationSpoofing.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// LocationSpoofing - /// - [DataContract] - public class LocationSpoofing : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Flag indicating whether the request came from a mobile device with location spoofing enabled. (required). - public LocationSpoofing(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: LocationSpoofing Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for LocationSpoofing and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// Flag indicating whether the request came from a mobile device with location spoofing enabled. - /// - /// Flag indicating whether the request came from a mobile device with location spoofing enabled. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class LocationSpoofing {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if LocationSpoofing instances are equal - /// - /// Instance of LocationSpoofing to be compared - /// Boolean - public bool Equals(LocationSpoofing? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/MitMAttack.cs b/src/FingerprintPro.ServerSdk/Model/MitMAttack.cs deleted file mode 100644 index c81f02e..0000000 --- a/src/FingerprintPro.ServerSdk/Model/MitMAttack.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// MitMAttack - /// - [DataContract] - public class MitMAttack : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. (required). - public MitMAttack(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: MitMAttack Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for MitMAttack and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. - /// - /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MitMAttack {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if MitMAttack instances are equal - /// - /// Instance of MitMAttack to be compared - /// Boolean - public bool Equals(MitMAttack? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/PrivacySettings.cs b/src/FingerprintPro.ServerSdk/Model/PrivacySettings.cs deleted file mode 100644 index db4fdc4..0000000 --- a/src/FingerprintPro.ServerSdk/Model/PrivacySettings.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// PrivacySettings - /// - [DataContract] - public class PrivacySettings : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. (required). - public PrivacySettings(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: PrivacySettings Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for PrivacySettings and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. - /// - /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class PrivacySettings {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if PrivacySettings instances are equal - /// - /// Instance of PrivacySettings to be compared - /// Boolean - public bool Equals(PrivacySettings? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductBotd.cs b/src/FingerprintPro.ServerSdk/Model/ProductBotd.cs deleted file mode 100644 index 9c760c8..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductBotd.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductBotd - /// - [DataContract] - public class ProductBotd : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductBotd(Botd data = default(Botd), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Botd Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductBotd {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductBotd instances are equal - /// - /// Instance of ProductBotd to be compared - /// Boolean - public bool Equals(ProductBotd? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductClonedApp.cs b/src/FingerprintPro.ServerSdk/Model/ProductClonedApp.cs deleted file mode 100644 index 4a7f7c7..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductClonedApp.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductClonedApp - /// - [DataContract] - public class ProductClonedApp : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductClonedApp(ClonedApp data = default(ClonedApp), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public ClonedApp Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductClonedApp {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductClonedApp instances are equal - /// - /// Instance of ProductClonedApp to be compared - /// Boolean - public bool Equals(ProductClonedApp? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductDeveloperTools.cs b/src/FingerprintPro.ServerSdk/Model/ProductDeveloperTools.cs deleted file mode 100644 index d2ef60b..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductDeveloperTools.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductDeveloperTools - /// - [DataContract] - public class ProductDeveloperTools : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductDeveloperTools(DeveloperTools data = default(DeveloperTools), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public DeveloperTools Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductDeveloperTools {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductDeveloperTools instances are equal - /// - /// Instance of ProductDeveloperTools to be compared - /// Boolean - public bool Equals(ProductDeveloperTools? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductEmulator.cs b/src/FingerprintPro.ServerSdk/Model/ProductEmulator.cs deleted file mode 100644 index 655a831..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductEmulator.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductEmulator - /// - [DataContract] - public class ProductEmulator : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductEmulator(Emulator data = default(Emulator), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Emulator Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductEmulator {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductEmulator instances are equal - /// - /// Instance of ProductEmulator to be compared - /// Boolean - public bool Equals(ProductEmulator? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductFactoryReset.cs b/src/FingerprintPro.ServerSdk/Model/ProductFactoryReset.cs deleted file mode 100644 index d247eb1..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductFactoryReset.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductFactoryReset - /// - [DataContract] - public class ProductFactoryReset : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductFactoryReset(FactoryReset data = default(FactoryReset), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public FactoryReset Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductFactoryReset {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductFactoryReset instances are equal - /// - /// Instance of ProductFactoryReset to be compared - /// Boolean - public bool Equals(ProductFactoryReset? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductFrida.cs b/src/FingerprintPro.ServerSdk/Model/ProductFrida.cs deleted file mode 100644 index 38d9a3d..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductFrida.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductFrida - /// - [DataContract] - public class ProductFrida : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductFrida(Frida data = default(Frida), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Frida Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductFrida {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductFrida instances are equal - /// - /// Instance of ProductFrida to be compared - /// Boolean - public bool Equals(ProductFrida? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductHighActivity.cs b/src/FingerprintPro.ServerSdk/Model/ProductHighActivity.cs deleted file mode 100644 index d7c2163..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductHighActivity.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductHighActivity - /// - [DataContract] - public class ProductHighActivity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductHighActivity(HighActivity data = default(HighActivity), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public HighActivity Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductHighActivity {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductHighActivity instances are equal - /// - /// Instance of ProductHighActivity to be compared - /// Boolean - public bool Equals(ProductHighActivity? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductIPBlocklist.cs b/src/FingerprintPro.ServerSdk/Model/ProductIPBlocklist.cs deleted file mode 100644 index ea36900..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductIPBlocklist.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductIPBlocklist - /// - [DataContract] - public class ProductIPBlocklist : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductIPBlocklist(IPBlocklist data = default(IPBlocklist), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public IPBlocklist Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductIPBlocklist {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductIPBlocklist instances are equal - /// - /// Instance of ProductIPBlocklist to be compared - /// Boolean - public bool Equals(ProductIPBlocklist? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductIPInfo.cs b/src/FingerprintPro.ServerSdk/Model/ProductIPInfo.cs deleted file mode 100644 index 246bda1..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductIPInfo.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductIPInfo - /// - [DataContract] - public class ProductIPInfo : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductIPInfo(IPInfo data = default(IPInfo), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public IPInfo Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductIPInfo {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductIPInfo instances are equal - /// - /// Instance of ProductIPInfo to be compared - /// Boolean - public bool Equals(ProductIPInfo? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductIdentification.cs b/src/FingerprintPro.ServerSdk/Model/ProductIdentification.cs deleted file mode 100644 index 019377c..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductIdentification.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductIdentification - /// - [DataContract] - public class ProductIdentification : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductIdentification(Identification data = default(Identification), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Identification Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductIdentification {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductIdentification instances are equal - /// - /// Instance of ProductIdentification to be compared - /// Boolean - public bool Equals(ProductIdentification? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductIncognito.cs b/src/FingerprintPro.ServerSdk/Model/ProductIncognito.cs deleted file mode 100644 index 953f5cb..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductIncognito.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductIncognito - /// - [DataContract] - public class ProductIncognito : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductIncognito(Incognito data = default(Incognito), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Incognito Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductIncognito {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductIncognito instances are equal - /// - /// Instance of ProductIncognito to be compared - /// Boolean - public bool Equals(ProductIncognito? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductJailbroken.cs b/src/FingerprintPro.ServerSdk/Model/ProductJailbroken.cs deleted file mode 100644 index 2371c6d..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductJailbroken.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductJailbroken - /// - [DataContract] - public class ProductJailbroken : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductJailbroken(Jailbroken data = default(Jailbroken), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Jailbroken Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductJailbroken {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductJailbroken instances are equal - /// - /// Instance of ProductJailbroken to be compared - /// Boolean - public bool Equals(ProductJailbroken? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductLocationSpoofing.cs b/src/FingerprintPro.ServerSdk/Model/ProductLocationSpoofing.cs deleted file mode 100644 index 00c9d35..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductLocationSpoofing.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductLocationSpoofing - /// - [DataContract] - public class ProductLocationSpoofing : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductLocationSpoofing(LocationSpoofing data = default(LocationSpoofing), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public LocationSpoofing Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductLocationSpoofing {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductLocationSpoofing instances are equal - /// - /// Instance of ProductLocationSpoofing to be compared - /// Boolean - public bool Equals(ProductLocationSpoofing? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductMitMAttack.cs b/src/FingerprintPro.ServerSdk/Model/ProductMitMAttack.cs deleted file mode 100644 index d089771..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductMitMAttack.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductMitMAttack - /// - [DataContract] - public class ProductMitMAttack : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductMitMAttack(MitMAttack data = default(MitMAttack), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public MitMAttack Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductMitMAttack {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductMitMAttack instances are equal - /// - /// Instance of ProductMitMAttack to be compared - /// Boolean - public bool Equals(ProductMitMAttack? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductPrivacySettings.cs b/src/FingerprintPro.ServerSdk/Model/ProductPrivacySettings.cs deleted file mode 100644 index 1b010e5..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductPrivacySettings.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductPrivacySettings - /// - [DataContract] - public class ProductPrivacySettings : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductPrivacySettings(PrivacySettings data = default(PrivacySettings), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public PrivacySettings Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductPrivacySettings {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductPrivacySettings instances are equal - /// - /// Instance of ProductPrivacySettings to be compared - /// Boolean - public bool Equals(ProductPrivacySettings? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductProximity.cs b/src/FingerprintPro.ServerSdk/Model/ProductProximity.cs deleted file mode 100644 index a87838b..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductProximity.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductProximity - /// - [DataContract] - public class ProductProximity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductProximity(Proximity data = default(Proximity), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Proximity Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductProximity {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductProximity instances are equal - /// - /// Instance of ProductProximity to be compared - /// Boolean - public bool Equals(ProductProximity? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductProxy.cs b/src/FingerprintPro.ServerSdk/Model/ProductProxy.cs deleted file mode 100644 index b42bdda..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductProxy.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductProxy - /// - [DataContract] - public class ProductProxy : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductProxy(Proxy data = default(Proxy), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Proxy Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductProxy {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductProxy instances are equal - /// - /// Instance of ProductProxy to be compared - /// Boolean - public bool Equals(ProductProxy? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductRawDeviceAttributes.cs b/src/FingerprintPro.ServerSdk/Model/ProductRawDeviceAttributes.cs deleted file mode 100644 index 506d8f7..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductRawDeviceAttributes.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductRawDeviceAttributes - /// - [DataContract] - public class ProductRawDeviceAttributes : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductRawDeviceAttributes(RawDeviceAttributes data = default(RawDeviceAttributes), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public RawDeviceAttributes Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductRawDeviceAttributes {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductRawDeviceAttributes instances are equal - /// - /// Instance of ProductRawDeviceAttributes to be compared - /// Boolean - public bool Equals(ProductRawDeviceAttributes? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductRemoteControl.cs b/src/FingerprintPro.ServerSdk/Model/ProductRemoteControl.cs deleted file mode 100644 index cec1fde..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductRemoteControl.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// This product is deprecated. - /// - [Obsolete] - [DataContract] - public class ProductRemoteControl : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductRemoteControl(RemoteControl data = default(RemoteControl), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public RemoteControl Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductRemoteControl {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductRemoteControl instances are equal - /// - /// Instance of ProductRemoteControl to be compared - /// Boolean - public bool Equals(ProductRemoteControl? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductRootApps.cs b/src/FingerprintPro.ServerSdk/Model/ProductRootApps.cs deleted file mode 100644 index d30b6d1..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductRootApps.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductRootApps - /// - [DataContract] - public class ProductRootApps : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductRootApps(RootApps data = default(RootApps), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public RootApps Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductRootApps {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductRootApps instances are equal - /// - /// Instance of ProductRootApps to be compared - /// Boolean - public bool Equals(ProductRootApps? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductSuspectScore.cs b/src/FingerprintPro.ServerSdk/Model/ProductSuspectScore.cs deleted file mode 100644 index 38d3f25..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductSuspectScore.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductSuspectScore - /// - [DataContract] - public class ProductSuspectScore : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductSuspectScore(SuspectScore data = default(SuspectScore), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public SuspectScore Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductSuspectScore {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductSuspectScore instances are equal - /// - /// Instance of ProductSuspectScore to be compared - /// Boolean - public bool Equals(ProductSuspectScore? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductTampering.cs b/src/FingerprintPro.ServerSdk/Model/ProductTampering.cs deleted file mode 100644 index 05a51fe..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductTampering.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductTampering - /// - [DataContract] - public class ProductTampering : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductTampering(Tampering data = default(Tampering), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Tampering Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductTampering {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductTampering instances are equal - /// - /// Instance of ProductTampering to be compared - /// Boolean - public bool Equals(ProductTampering? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductTor.cs b/src/FingerprintPro.ServerSdk/Model/ProductTor.cs deleted file mode 100644 index 1761d04..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductTor.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductTor - /// - [DataContract] - public class ProductTor : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductTor(Tor data = default(Tor), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Tor Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductTor {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductTor instances are equal - /// - /// Instance of ProductTor to be compared - /// Boolean - public bool Equals(ProductTor? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductVPN.cs b/src/FingerprintPro.ServerSdk/Model/ProductVPN.cs deleted file mode 100644 index e7090fb..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductVPN.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductVPN - /// - [DataContract] - public class ProductVPN : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductVPN(VPN data = default(VPN), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public VPN Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductVPN {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductVPN instances are equal - /// - /// Instance of ProductVPN to be compared - /// Boolean - public bool Equals(ProductVPN? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductVelocity.cs b/src/FingerprintPro.ServerSdk/Model/ProductVelocity.cs deleted file mode 100644 index 91be8fb..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductVelocity.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductVelocity - /// - [DataContract] - public class ProductVelocity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductVelocity(Velocity data = default(Velocity), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public Velocity Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductVelocity {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductVelocity instances are equal - /// - /// Instance of ProductVelocity to be compared - /// Boolean - public bool Equals(ProductVelocity? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProductVirtualMachine.cs b/src/FingerprintPro.ServerSdk/Model/ProductVirtualMachine.cs deleted file mode 100644 index ac10d16..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProductVirtualMachine.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// ProductVirtualMachine - /// - [DataContract] - public class ProductVirtualMachine : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// data. - /// error. - public ProductVirtualMachine(VirtualMachine data = default(VirtualMachine), Error error = default(Error)) - { - this.Data = data; - this.Error = error; - } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", EmitDefaultValue = false)] - [JsonPropertyName("data")] - public VirtualMachine Data { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public Error Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProductVirtualMachine {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProductVirtualMachine instances are equal - /// - /// Instance of ProductVirtualMachine to be compared - /// Boolean - public bool Equals(ProductVirtualMachine? input) - { - if (input == null) - return false; - - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Products.cs b/src/FingerprintPro.ServerSdk/Model/Products.cs deleted file mode 100644 index cfacd19..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Products.cs +++ /dev/null @@ -1,523 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise) - /// - [DataContract] - public class Products : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// identification. - /// botd. - /// rootApps. - /// emulator. - /// ipInfo. - /// ipBlocklist. - /// tor. - /// vpn. - /// proxy. - /// incognito. - /// tampering. - /// clonedApp. - /// factoryReset. - /// jailbroken. - /// frida. - /// privacySettings. - /// virtualMachine. - /// rawDeviceAttributes. - /// highActivity. - /// locationSpoofing. - /// suspectScore. - /// remoteControl. - /// velocity. - /// developerTools. - /// mitmAttack. - /// proximity. - public Products(ProductIdentification identification = default(ProductIdentification), ProductBotd botd = default(ProductBotd), ProductRootApps rootApps = default(ProductRootApps), ProductEmulator emulator = default(ProductEmulator), ProductIPInfo ipInfo = default(ProductIPInfo), ProductIPBlocklist ipBlocklist = default(ProductIPBlocklist), ProductTor tor = default(ProductTor), ProductVPN vpn = default(ProductVPN), ProductProxy proxy = default(ProductProxy), ProductIncognito incognito = default(ProductIncognito), ProductTampering tampering = default(ProductTampering), ProductClonedApp clonedApp = default(ProductClonedApp), ProductFactoryReset factoryReset = default(ProductFactoryReset), ProductJailbroken jailbroken = default(ProductJailbroken), ProductFrida frida = default(ProductFrida), ProductPrivacySettings privacySettings = default(ProductPrivacySettings), ProductVirtualMachine virtualMachine = default(ProductVirtualMachine), ProductRawDeviceAttributes rawDeviceAttributes = default(ProductRawDeviceAttributes), ProductHighActivity highActivity = default(ProductHighActivity), ProductLocationSpoofing locationSpoofing = default(ProductLocationSpoofing), ProductSuspectScore suspectScore = default(ProductSuspectScore), ProductRemoteControl remoteControl = default(ProductRemoteControl), ProductVelocity velocity = default(ProductVelocity), ProductDeveloperTools developerTools = default(ProductDeveloperTools), ProductMitMAttack mitmAttack = default(ProductMitMAttack), ProductProximity proximity = default(ProductProximity)) - { - this.Identification = identification; - this.Botd = botd; - this.RootApps = rootApps; - this.Emulator = emulator; - this.IpInfo = ipInfo; - this.IpBlocklist = ipBlocklist; - this.Tor = tor; - this.Vpn = vpn; - this.Proxy = proxy; - this.Incognito = incognito; - this.Tampering = tampering; - this.ClonedApp = clonedApp; - this.FactoryReset = factoryReset; - this.Jailbroken = jailbroken; - this.Frida = frida; - this.PrivacySettings = privacySettings; - this.VirtualMachine = virtualMachine; - this.RawDeviceAttributes = rawDeviceAttributes; - this.HighActivity = highActivity; - this.LocationSpoofing = locationSpoofing; - this.SuspectScore = suspectScore; - this.RemoteControl = remoteControl; - this.Velocity = velocity; - this.DeveloperTools = developerTools; - this.MitmAttack = mitmAttack; - this.Proximity = proximity; - } - - /// - /// Gets or Sets Identification - /// - [DataMember(Name = "identification", EmitDefaultValue = false)] - [JsonPropertyName("identification")] - public ProductIdentification Identification { get; set; } - - /// - /// Gets or Sets Botd - /// - [DataMember(Name = "botd", EmitDefaultValue = false)] - [JsonPropertyName("botd")] - public ProductBotd Botd { get; set; } - - /// - /// Gets or Sets RootApps - /// - [DataMember(Name = "rootApps", EmitDefaultValue = false)] - [JsonPropertyName("rootApps")] - public ProductRootApps RootApps { get; set; } - - /// - /// Gets or Sets Emulator - /// - [DataMember(Name = "emulator", EmitDefaultValue = false)] - [JsonPropertyName("emulator")] - public ProductEmulator Emulator { get; set; } - - /// - /// Gets or Sets IpInfo - /// - [DataMember(Name = "ipInfo", EmitDefaultValue = false)] - [JsonPropertyName("ipInfo")] - public ProductIPInfo IpInfo { get; set; } - - /// - /// Gets or Sets IpBlocklist - /// - [DataMember(Name = "ipBlocklist", EmitDefaultValue = false)] - [JsonPropertyName("ipBlocklist")] - public ProductIPBlocklist IpBlocklist { get; set; } - - /// - /// Gets or Sets Tor - /// - [DataMember(Name = "tor", EmitDefaultValue = false)] - [JsonPropertyName("tor")] - public ProductTor Tor { get; set; } - - /// - /// Gets or Sets Vpn - /// - [DataMember(Name = "vpn", EmitDefaultValue = false)] - [JsonPropertyName("vpn")] - public ProductVPN Vpn { get; set; } - - /// - /// Gets or Sets Proxy - /// - [DataMember(Name = "proxy", EmitDefaultValue = false)] - [JsonPropertyName("proxy")] - public ProductProxy Proxy { get; set; } - - /// - /// Gets or Sets Incognito - /// - [DataMember(Name = "incognito", EmitDefaultValue = false)] - [JsonPropertyName("incognito")] - public ProductIncognito Incognito { get; set; } - - /// - /// Gets or Sets Tampering - /// - [DataMember(Name = "tampering", EmitDefaultValue = false)] - [JsonPropertyName("tampering")] - public ProductTampering Tampering { get; set; } - - /// - /// Gets or Sets ClonedApp - /// - [DataMember(Name = "clonedApp", EmitDefaultValue = false)] - [JsonPropertyName("clonedApp")] - public ProductClonedApp ClonedApp { get; set; } - - /// - /// Gets or Sets FactoryReset - /// - [DataMember(Name = "factoryReset", EmitDefaultValue = false)] - [JsonPropertyName("factoryReset")] - public ProductFactoryReset FactoryReset { get; set; } - - /// - /// Gets or Sets Jailbroken - /// - [DataMember(Name = "jailbroken", EmitDefaultValue = false)] - [JsonPropertyName("jailbroken")] - public ProductJailbroken Jailbroken { get; set; } - - /// - /// Gets or Sets Frida - /// - [DataMember(Name = "frida", EmitDefaultValue = false)] - [JsonPropertyName("frida")] - public ProductFrida Frida { get; set; } - - /// - /// Gets or Sets PrivacySettings - /// - [DataMember(Name = "privacySettings", EmitDefaultValue = false)] - [JsonPropertyName("privacySettings")] - public ProductPrivacySettings PrivacySettings { get; set; } - - /// - /// Gets or Sets VirtualMachine - /// - [DataMember(Name = "virtualMachine", EmitDefaultValue = false)] - [JsonPropertyName("virtualMachine")] - public ProductVirtualMachine VirtualMachine { get; set; } - - /// - /// Gets or Sets RawDeviceAttributes - /// - [DataMember(Name = "rawDeviceAttributes", EmitDefaultValue = false)] - [JsonPropertyName("rawDeviceAttributes")] - public ProductRawDeviceAttributes RawDeviceAttributes { get; set; } - - /// - /// Gets or Sets HighActivity - /// - [DataMember(Name = "highActivity", EmitDefaultValue = false)] - [JsonPropertyName("highActivity")] - public ProductHighActivity HighActivity { get; set; } - - /// - /// Gets or Sets LocationSpoofing - /// - [DataMember(Name = "locationSpoofing", EmitDefaultValue = false)] - [JsonPropertyName("locationSpoofing")] - public ProductLocationSpoofing LocationSpoofing { get; set; } - - /// - /// Gets or Sets SuspectScore - /// - [DataMember(Name = "suspectScore", EmitDefaultValue = false)] - [JsonPropertyName("suspectScore")] - public ProductSuspectScore SuspectScore { get; set; } - - /// - /// Gets or Sets RemoteControl - /// - [DataMember(Name = "remoteControl", EmitDefaultValue = false)] - [JsonPropertyName("remoteControl")] - public ProductRemoteControl RemoteControl { get; set; } - - /// - /// Gets or Sets Velocity - /// - [DataMember(Name = "velocity", EmitDefaultValue = false)] - [JsonPropertyName("velocity")] - public ProductVelocity Velocity { get; set; } - - /// - /// Gets or Sets DeveloperTools - /// - [DataMember(Name = "developerTools", EmitDefaultValue = false)] - [JsonPropertyName("developerTools")] - public ProductDeveloperTools DeveloperTools { get; set; } - - /// - /// Gets or Sets MitmAttack - /// - [DataMember(Name = "mitmAttack", EmitDefaultValue = false)] - [JsonPropertyName("mitmAttack")] - public ProductMitMAttack MitmAttack { get; set; } - - /// - /// Gets or Sets Proximity - /// - [DataMember(Name = "proximity", EmitDefaultValue = false)] - [JsonPropertyName("proximity")] - public ProductProximity Proximity { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Products {\n"); - sb.Append(" Identification: ").Append(Identification).Append("\n"); - sb.Append(" Botd: ").Append(Botd).Append("\n"); - sb.Append(" RootApps: ").Append(RootApps).Append("\n"); - sb.Append(" Emulator: ").Append(Emulator).Append("\n"); - sb.Append(" IpInfo: ").Append(IpInfo).Append("\n"); - sb.Append(" IpBlocklist: ").Append(IpBlocklist).Append("\n"); - sb.Append(" Tor: ").Append(Tor).Append("\n"); - sb.Append(" Vpn: ").Append(Vpn).Append("\n"); - sb.Append(" Proxy: ").Append(Proxy).Append("\n"); - sb.Append(" Incognito: ").Append(Incognito).Append("\n"); - sb.Append(" Tampering: ").Append(Tampering).Append("\n"); - sb.Append(" ClonedApp: ").Append(ClonedApp).Append("\n"); - sb.Append(" FactoryReset: ").Append(FactoryReset).Append("\n"); - sb.Append(" Jailbroken: ").Append(Jailbroken).Append("\n"); - sb.Append(" Frida: ").Append(Frida).Append("\n"); - sb.Append(" PrivacySettings: ").Append(PrivacySettings).Append("\n"); - sb.Append(" VirtualMachine: ").Append(VirtualMachine).Append("\n"); - sb.Append(" RawDeviceAttributes: ").Append(RawDeviceAttributes).Append("\n"); - sb.Append(" HighActivity: ").Append(HighActivity).Append("\n"); - sb.Append(" LocationSpoofing: ").Append(LocationSpoofing).Append("\n"); - sb.Append(" SuspectScore: ").Append(SuspectScore).Append("\n"); - sb.Append(" RemoteControl: ").Append(RemoteControl).Append("\n"); - sb.Append(" Velocity: ").Append(Velocity).Append("\n"); - sb.Append(" DeveloperTools: ").Append(DeveloperTools).Append("\n"); - sb.Append(" MitmAttack: ").Append(MitmAttack).Append("\n"); - sb.Append(" Proximity: ").Append(Proximity).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Products instances are equal - /// - /// Instance of Products to be compared - /// Boolean - public bool Equals(Products? input) - { - if (input == null) - return false; - - return - ( - this.Identification == input.Identification || - (this.Identification != null && - this.Identification.Equals(input.Identification)) - ) && - ( - this.Botd == input.Botd || - (this.Botd != null && - this.Botd.Equals(input.Botd)) - ) && - ( - this.RootApps == input.RootApps || - (this.RootApps != null && - this.RootApps.Equals(input.RootApps)) - ) && - ( - this.Emulator == input.Emulator || - (this.Emulator != null && - this.Emulator.Equals(input.Emulator)) - ) && - ( - this.IpInfo == input.IpInfo || - (this.IpInfo != null && - this.IpInfo.Equals(input.IpInfo)) - ) && - ( - this.IpBlocklist == input.IpBlocklist || - (this.IpBlocklist != null && - this.IpBlocklist.Equals(input.IpBlocklist)) - ) && - ( - this.Tor == input.Tor || - (this.Tor != null && - this.Tor.Equals(input.Tor)) - ) && - ( - this.Vpn == input.Vpn || - (this.Vpn != null && - this.Vpn.Equals(input.Vpn)) - ) && - ( - this.Proxy == input.Proxy || - (this.Proxy != null && - this.Proxy.Equals(input.Proxy)) - ) && - ( - this.Incognito == input.Incognito || - (this.Incognito != null && - this.Incognito.Equals(input.Incognito)) - ) && - ( - this.Tampering == input.Tampering || - (this.Tampering != null && - this.Tampering.Equals(input.Tampering)) - ) && - ( - this.ClonedApp == input.ClonedApp || - (this.ClonedApp != null && - this.ClonedApp.Equals(input.ClonedApp)) - ) && - ( - this.FactoryReset == input.FactoryReset || - (this.FactoryReset != null && - this.FactoryReset.Equals(input.FactoryReset)) - ) && - ( - this.Jailbroken == input.Jailbroken || - (this.Jailbroken != null && - this.Jailbroken.Equals(input.Jailbroken)) - ) && - ( - this.Frida == input.Frida || - (this.Frida != null && - this.Frida.Equals(input.Frida)) - ) && - ( - this.PrivacySettings == input.PrivacySettings || - (this.PrivacySettings != null && - this.PrivacySettings.Equals(input.PrivacySettings)) - ) && - ( - this.VirtualMachine == input.VirtualMachine || - (this.VirtualMachine != null && - this.VirtualMachine.Equals(input.VirtualMachine)) - ) && - ( - this.RawDeviceAttributes == input.RawDeviceAttributes || - (this.RawDeviceAttributes != null && - this.RawDeviceAttributes.Equals(input.RawDeviceAttributes)) - ) && - ( - this.HighActivity == input.HighActivity || - (this.HighActivity != null && - this.HighActivity.Equals(input.HighActivity)) - ) && - ( - this.LocationSpoofing == input.LocationSpoofing || - (this.LocationSpoofing != null && - this.LocationSpoofing.Equals(input.LocationSpoofing)) - ) && - ( - this.SuspectScore == input.SuspectScore || - (this.SuspectScore != null && - this.SuspectScore.Equals(input.SuspectScore)) - ) && - ( - this.RemoteControl == input.RemoteControl || - (this.RemoteControl != null && - this.RemoteControl.Equals(input.RemoteControl)) - ) && - ( - this.Velocity == input.Velocity || - (this.Velocity != null && - this.Velocity.Equals(input.Velocity)) - ) && - ( - this.DeveloperTools == input.DeveloperTools || - (this.DeveloperTools != null && - this.DeveloperTools.Equals(input.DeveloperTools)) - ) && - ( - this.MitmAttack == input.MitmAttack || - (this.MitmAttack != null && - this.MitmAttack.Equals(input.MitmAttack)) - ) && - ( - this.Proximity == input.Proximity || - (this.Proximity != null && - this.Proximity.Equals(input.Proximity)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Identification != null) - hashCode = hashCode * 59 + this.Identification.GetHashCode(); - if (this.Botd != null) - hashCode = hashCode * 59 + this.Botd.GetHashCode(); - if (this.RootApps != null) - hashCode = hashCode * 59 + this.RootApps.GetHashCode(); - if (this.Emulator != null) - hashCode = hashCode * 59 + this.Emulator.GetHashCode(); - if (this.IpInfo != null) - hashCode = hashCode * 59 + this.IpInfo.GetHashCode(); - if (this.IpBlocklist != null) - hashCode = hashCode * 59 + this.IpBlocklist.GetHashCode(); - if (this.Tor != null) - hashCode = hashCode * 59 + this.Tor.GetHashCode(); - if (this.Vpn != null) - hashCode = hashCode * 59 + this.Vpn.GetHashCode(); - if (this.Proxy != null) - hashCode = hashCode * 59 + this.Proxy.GetHashCode(); - if (this.Incognito != null) - hashCode = hashCode * 59 + this.Incognito.GetHashCode(); - if (this.Tampering != null) - hashCode = hashCode * 59 + this.Tampering.GetHashCode(); - if (this.ClonedApp != null) - hashCode = hashCode * 59 + this.ClonedApp.GetHashCode(); - if (this.FactoryReset != null) - hashCode = hashCode * 59 + this.FactoryReset.GetHashCode(); - if (this.Jailbroken != null) - hashCode = hashCode * 59 + this.Jailbroken.GetHashCode(); - if (this.Frida != null) - hashCode = hashCode * 59 + this.Frida.GetHashCode(); - if (this.PrivacySettings != null) - hashCode = hashCode * 59 + this.PrivacySettings.GetHashCode(); - if (this.VirtualMachine != null) - hashCode = hashCode * 59 + this.VirtualMachine.GetHashCode(); - if (this.RawDeviceAttributes != null) - hashCode = hashCode * 59 + this.RawDeviceAttributes.GetHashCode(); - if (this.HighActivity != null) - hashCode = hashCode * 59 + this.HighActivity.GetHashCode(); - if (this.LocationSpoofing != null) - hashCode = hashCode * 59 + this.LocationSpoofing.GetHashCode(); - if (this.SuspectScore != null) - hashCode = hashCode * 59 + this.SuspectScore.GetHashCode(); - if (this.RemoteControl != null) - hashCode = hashCode * 59 + this.RemoteControl.GetHashCode(); - if (this.Velocity != null) - hashCode = hashCode * 59 + this.Velocity.GetHashCode(); - if (this.DeveloperTools != null) - hashCode = hashCode * 59 + this.DeveloperTools.GetHashCode(); - if (this.MitmAttack != null) - hashCode = hashCode * 59 + this.MitmAttack.GetHashCode(); - if (this.Proximity != null) - hashCode = hashCode * 59 + this.Proximity.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Proximity.cs b/src/FingerprintPro.ServerSdk/Model/Proximity.cs deleted file mode 100644 index cfc68c1..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Proximity.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - /// - [DataContract] - public class Proximity : IEquatable - { - /// - /// The radius of the proximity zone’s precision level, in meters. - /// - /// The radius of the proximity zone’s precision level, in meters. - public enum PrecisionRadiusEnum - { - /// - /// Enum NUMBER_10 for value: 10 - /// - - NUMBER_10 = 10, - /// - /// Enum NUMBER_25 for value: 25 - /// - - NUMBER_25 = 25, - /// - /// Enum NUMBER_65 for value: 65 - /// - - NUMBER_65 = 65, - /// - /// Enum NUMBER_175 for value: 175 - /// - - NUMBER_175 = 175, - /// - /// Enum NUMBER_450 for value: 450 - /// - - NUMBER_450 = 450, - /// - /// Enum NUMBER_1200 for value: 1200 - /// - - NUMBER_1200 = 1200, - /// - /// Enum NUMBER_3300 for value: 3300 - /// - - NUMBER_3300 = 3300, - /// - /// Enum NUMBER_8500 for value: 8500 - /// - - NUMBER_8500 = 8500, - /// - /// Enum NUMBER_22500 for value: 22500 - /// - - NUMBER_22500 = 22500 - } - /// - /// The radius of the proximity zone’s precision level, in meters. - /// - /// The radius of the proximity zone’s precision level, in meters. - [DataMember(Name = "precisionRadius", EmitDefaultValue = false)] - [JsonPropertyName("precisionRadius")] - public PrecisionRadiusEnum PrecisionRadius { get; set; } - - - /// - /// Initializes a new instance of the class. - /// - /// A stable privacy-preserving identifier for a given proximity zone. (required). - /// The radius of the proximity zone’s precision level, in meters. (required). - /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. (required). - public Proximity(string id = default(string), PrecisionRadiusEnum precisionRadius = default(PrecisionRadiusEnum), float? confidence = default(float?)) - { - // to ensure "id" is required (not null) - // swagger debug: Proximity Id - - if (id == null) - { - throw new InvalidDataException("id is a required property for Proximity and cannot be null"); - } - else - { - this.Id = id; - } - // to ensure "precisionRadius" is required (not null) - // swagger debug: Proximity PrecisionRadius - - if (precisionRadius == null) - { - throw new InvalidDataException("precisionRadius is a required property for Proximity and cannot be null"); - } - else - { - this.PrecisionRadius = precisionRadius; - } - // to ensure "confidence" is required (not null) - // swagger debug: Proximity Confidence - - if (confidence == null) - { - throw new InvalidDataException("confidence is a required property for Proximity and cannot be null"); - } - else - { - this.Confidence = confidence; - } - } - - /// - /// A stable privacy-preserving identifier for a given proximity zone. - /// - /// A stable privacy-preserving identifier for a given proximity zone. - [DataMember(Name = "id", EmitDefaultValue = false)] - [JsonPropertyName("id")] - public string Id { get; set; } - - - /// - /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - /// - /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public float? Confidence { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Proximity {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PrecisionRadius: ").Append(PrecisionRadius).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Proximity instances are equal - /// - /// Instance of Proximity to be compared - /// Boolean - public bool Equals(Proximity? input) - { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.PrecisionRadius == input.PrecisionRadius || - (this.PrecisionRadius != null && - this.PrecisionRadius.Equals(input.PrecisionRadius)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Id != null) - hashCode = hashCode * 59 + this.Id.GetHashCode(); - if (this.PrecisionRadius != null) - hashCode = hashCode * 59 + this.PrecisionRadius.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Proxy.cs b/src/FingerprintPro.ServerSdk/Model/Proxy.cs deleted file mode 100644 index fc0f043..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Proxy.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Proxy - /// - [DataContract] - public class Proxy : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// IP address was used by a public proxy provider or belonged to a known recent residential proxy (required). - /// confidence (required). - /// details. - public Proxy(bool? result = default(bool?), ProxyConfidence confidence = default(ProxyConfidence), ProxyDetails details = default(ProxyDetails)) - { - // to ensure "result" is required (not null) - // swagger debug: Proxy Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Proxy and cannot be null"); - } - else - { - this.Result = result; - } - // to ensure "confidence" is required (not null) - // swagger debug: Proxy Confidence - - if (confidence == null) - { - throw new InvalidDataException("confidence is a required property for Proxy and cannot be null"); - } - else - { - this.Confidence = confidence; - } - this.Details = details; - } - - /// - /// IP address was used by a public proxy provider or belonged to a known recent residential proxy - /// - /// IP address was used by a public proxy provider or belonged to a known recent residential proxy - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public ProxyConfidence Confidence { get; set; } - - /// - /// Gets or Sets Details - /// - [DataMember(Name = "details", EmitDefaultValue = false)] - [JsonPropertyName("details")] - public ProxyDetails Details { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Proxy {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Proxy instances are equal - /// - /// Instance of Proxy to be compared - /// Boolean - public bool Equals(Proxy? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.Details == input.Details || - (this.Details != null && - this.Details.Equals(input.Details)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.Details != null) - hashCode = hashCode * 59 + this.Details.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProxyConfidence.cs b/src/FingerprintPro.ServerSdk/Model/ProxyConfidence.cs deleted file mode 100644 index 04a0fcf..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProxyConfidence.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". - /// - /// Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum ProxyConfidence - { - /// - /// Enum Low for value: low - /// - [EnumMember(Value = "low")] - Low = 1, - /// - /// Enum Medium for value: medium - /// - [EnumMember(Value = "medium")] - Medium = 2, - /// - /// Enum High for value: high - /// - [EnumMember(Value = "high")] - High = 3 - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/ProxyDetails.cs b/src/FingerprintPro.ServerSdk/Model/ProxyDetails.cs deleted file mode 100644 index dfc66a3..0000000 --- a/src/FingerprintPro.ServerSdk/Model/ProxyDetails.cs +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Proxy detection details (present if proxy is detected) - /// - [DataContract] - public class ProxyDetails : IEquatable - { - /// - /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers - /// - /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum ProxyTypeEnum - { - /// - /// Enum Residential for value: residential - /// - [EnumMember(Value = "residential")] - Residential = 1, - /// - /// Enum Datacenter for value: data_center - /// - [EnumMember(Value = "data_center")] - Datacenter = 2 - } - /// - /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers - /// - /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers - [DataMember(Name = "proxyType", EmitDefaultValue = false)] - [JsonPropertyName("proxyType")] - public ProxyTypeEnum ProxyType { get; set; } - - - /// - /// Initializes a new instance of the class. - /// - /// Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers (required). - /// ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. . - public ProxyDetails(ProxyTypeEnum proxyType = default(ProxyTypeEnum), DateTime? lastSeenAt = default(DateTime?)) - { - // to ensure "proxyType" is required (not null) - // swagger debug: ProxyDetails ProxyType - - if (proxyType == null) - { - throw new InvalidDataException("proxyType is a required property for ProxyDetails and cannot be null"); - } - else - { - this.ProxyType = proxyType; - } - this.LastSeenAt = lastSeenAt; - } - - - /// - /// ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. - /// - /// ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. - [DataMember(Name = "lastSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("lastSeenAt")] - public DateTime? LastSeenAt { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ProxyDetails {\n"); - sb.Append(" ProxyType: ").Append(ProxyType).Append("\n"); - sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if ProxyDetails instances are equal - /// - /// Instance of ProxyDetails to be compared - /// Boolean - public bool Equals(ProxyDetails? input) - { - if (input == null) - return false; - - return - ( - this.ProxyType == input.ProxyType || - (this.ProxyType != null && - this.ProxyType.Equals(input.ProxyType)) - ) && - ( - this.LastSeenAt == input.LastSeenAt || - (this.LastSeenAt != null && - this.LastSeenAt.Equals(input.LastSeenAt)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ProxyType != null) - hashCode = hashCode * 59 + this.ProxyType.GetHashCode(); - if (this.LastSeenAt != null) - hashCode = hashCode * 59 + this.LastSeenAt.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RawDeviceAttribute.cs b/src/FingerprintPro.ServerSdk/Model/RawDeviceAttribute.cs deleted file mode 100644 index 3ddeed7..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RawDeviceAttribute.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// RawDeviceAttribute - /// - [DataContract] - public class RawDeviceAttribute : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// value. - /// error. - public RawDeviceAttribute(JsonElement? value = null, RawDeviceAttributeError error = default(RawDeviceAttributeError)) - { - this.Value = value; - this.Error = error; - } - - /// - /// Gets or Sets Value - /// - [DataMember(Name = "value", EmitDefaultValue = false)] - [JsonPropertyName("value")] - public JsonElement? Value { get; set; } - - /// - /// Gets or Sets Error - /// - [DataMember(Name = "error", EmitDefaultValue = false)] - [JsonPropertyName("error")] - public RawDeviceAttributeError Error { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RawDeviceAttribute {\n"); - sb.Append(" Value: ").Append(Value).Append("\n"); - sb.Append(" Error: ").Append(Error).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RawDeviceAttribute instances are equal - /// - /// Instance of RawDeviceAttribute to be compared - /// Boolean - public bool Equals(RawDeviceAttribute? input) - { - if (input == null) - return false; - - return - ( - this.Value.HasValue == input.Value.HasValue && - (!this.Value.HasValue || - this.Value.Value.Equals(input.Value.Value)) - ) && - ( - this.Error == input.Error || - (this.Error != null && - this.Error.Equals(input.Error)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Value.HasValue) - hashCode = hashCode * 59 + this.Value.Value.GetHashCode(); - if (this.Error != null) - hashCode = hashCode * 59 + this.Error.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RawDeviceAttributeError.cs b/src/FingerprintPro.ServerSdk/Model/RawDeviceAttributeError.cs deleted file mode 100644 index a4c3e96..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RawDeviceAttributeError.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// RawDeviceAttributeError - /// - [DataContract] - public class RawDeviceAttributeError : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// name. - /// message. - public RawDeviceAttributeError(string name = default(string), string message = default(string)) - { - this.Name = name; - this.Message = message; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name = "message", EmitDefaultValue = false)] - [JsonPropertyName("message")] - public string Message { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RawDeviceAttributeError {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RawDeviceAttributeError instances are equal - /// - /// Instance of RawDeviceAttributeError to be compared - /// Boolean - public bool Equals(RawDeviceAttributeError? input) - { - if (input == null) - return false; - - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RawDeviceAttributes.cs b/src/FingerprintPro.ServerSdk/Model/RawDeviceAttributes.cs deleted file mode 100644 index baf28d4..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RawDeviceAttributes.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - /// - [DataContract] - public class RawDeviceAttributes : DictionaryModel, IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - public RawDeviceAttributes() : base() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RawDeviceAttributes {\n"); - sb.Append(" ").Append(base.ToString()!.Replace("\n", "\n ")).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RawDeviceAttributes instances are equal - /// - /// Instance of RawDeviceAttributes to be compared - /// Boolean - public bool Equals(RawDeviceAttributes? input) - { - if (input == null) - return false; - - return base.Equals(input); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RelatedVisitor.cs b/src/FingerprintPro.ServerSdk/Model/RelatedVisitor.cs deleted file mode 100644 index 2a327df..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RelatedVisitor.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// RelatedVisitor - /// - [DataContract] - public class RelatedVisitor : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Visitor ID of a browser that originates from the same mobile device as the input visitor ID. (required). - public RelatedVisitor(string visitorId = default(string)) - { - // to ensure "visitorId" is required (not null) - // swagger debug: RelatedVisitor VisitorId - - if (visitorId == null) - { - throw new InvalidDataException("visitorId is a required property for RelatedVisitor and cannot be null"); - } - else - { - this.VisitorId = visitorId; - } - } - - /// - /// Visitor ID of a browser that originates from the same mobile device as the input visitor ID. - /// - /// Visitor ID of a browser that originates from the same mobile device as the input visitor ID. - [DataMember(Name = "visitorId", EmitDefaultValue = false)] - [JsonPropertyName("visitorId")] - public string VisitorId { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RelatedVisitor {\n"); - sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RelatedVisitor instances are equal - /// - /// Instance of RelatedVisitor to be compared - /// Boolean - public bool Equals(RelatedVisitor? input) - { - if (input == null) - return false; - - return - ( - this.VisitorId == input.VisitorId || - (this.VisitorId != null && - this.VisitorId.Equals(input.VisitorId)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.VisitorId != null) - hashCode = hashCode * 59 + this.VisitorId.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RelatedVisitorsResponse.cs b/src/FingerprintPro.ServerSdk/Model/RelatedVisitorsResponse.cs deleted file mode 100644 index 25ede56..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RelatedVisitorsResponse.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// RelatedVisitorsResponse - /// - [DataContract] - public class RelatedVisitorsResponse : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// relatedVisitors (required). - public RelatedVisitorsResponse(List relatedVisitors = default(List)) - { - // to ensure "relatedVisitors" is required (not null) - // swagger debug: RelatedVisitorsResponse RelatedVisitors - - if (relatedVisitors == null) - { - throw new InvalidDataException("relatedVisitors is a required property for RelatedVisitorsResponse and cannot be null"); - } - else - { - this.RelatedVisitors = relatedVisitors; - } - } - - /// - /// Gets or Sets RelatedVisitors - /// - [DataMember(Name = "relatedVisitors", EmitDefaultValue = false)] - [JsonPropertyName("relatedVisitors")] - public List RelatedVisitors { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RelatedVisitorsResponse {\n"); - sb.Append(" RelatedVisitors: ").Append(RelatedVisitors).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RelatedVisitorsResponse instances are equal - /// - /// Instance of RelatedVisitorsResponse to be compared - /// Boolean - public bool Equals(RelatedVisitorsResponse? input) - { - if (input == null) - return false; - - return - ( - this.RelatedVisitors == input.RelatedVisitors || - this.RelatedVisitors != null && - input.RelatedVisitors != null && - this.RelatedVisitors.SequenceEqual(input.RelatedVisitors) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RelatedVisitors != null) - hashCode = hashCode * 59 + this.RelatedVisitors.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RemoteControl.cs b/src/FingerprintPro.ServerSdk/Model/RemoteControl.cs deleted file mode 100644 index bc3c666..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RemoteControl.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// This signal is deprecated. - /// - [Obsolete] - [DataContract] - public class RemoteControl : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. (required). - public RemoteControl(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: RemoteControl Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for RemoteControl and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. - /// - /// `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RemoteControl {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RemoteControl instances are equal - /// - /// Instance of RemoteControl to be compared - /// Boolean - public bool Equals(RemoteControl? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/RootApps.cs b/src/FingerprintPro.ServerSdk/Model/RootApps.cs deleted file mode 100644 index 9719eb0..0000000 --- a/src/FingerprintPro.ServerSdk/Model/RootApps.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// RootApps - /// - [DataContract] - public class RootApps : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. (required). - public RootApps(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: RootApps Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for RootApps and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. - /// - /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class RootApps {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if RootApps instances are equal - /// - /// Instance of RootApps to be compared - /// Boolean - public bool Equals(RootApps? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/SDK.cs b/src/FingerprintPro.ServerSdk/Model/SDK.cs deleted file mode 100644 index 2ce819e..0000000 --- a/src/FingerprintPro.ServerSdk/Model/SDK.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Contains information about the SDK used to perform the request. - /// - [DataContract] - public class SDK : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Platform of the SDK. (required). - /// SDK version string. (required). - public SDK(string platform = default(string), string version = default(string)) - { - // to ensure "platform" is required (not null) - // swagger debug: SDK Platform - - if (platform == null) - { - throw new InvalidDataException("platform is a required property for SDK and cannot be null"); - } - else - { - this.Platform = platform; - } - // to ensure "version" is required (not null) - // swagger debug: SDK Version - - if (version == null) - { - throw new InvalidDataException("version is a required property for SDK and cannot be null"); - } - else - { - this.Version = version; - } - } - - /// - /// Platform of the SDK. - /// - /// Platform of the SDK. - [DataMember(Name = "platform", EmitDefaultValue = false)] - [JsonPropertyName("platform")] - public string Platform { get; set; } - - /// - /// SDK version string. - /// - /// SDK version string. - [DataMember(Name = "version", EmitDefaultValue = false)] - [JsonPropertyName("version")] - public string Version { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SDK {\n"); - sb.Append(" Platform: ").Append(Platform).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if SDK instances are equal - /// - /// Instance of SDK to be compared - /// Boolean - public bool Equals(SDK? input) - { - if (input == null) - return false; - - return - ( - this.Platform == input.Platform || - (this.Platform != null && - this.Platform.Equals(input.Platform)) - ) && - ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Platform != null) - hashCode = hashCode * 59 + this.Platform.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/SearchEventsResponse.cs b/src/FingerprintPro.ServerSdk/Model/SearchEventsResponse.cs deleted file mode 100644 index e38a46c..0000000 --- a/src/FingerprintPro.ServerSdk/Model/SearchEventsResponse.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Contains a list of all identification events matching the specified search criteria. - /// - [DataContract] - public class SearchEventsResponse : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// events. - /// Use this value in the `pagination_key` parameter to request the next page of search results.. - public SearchEventsResponse(List events = default(List), string paginationKey = default(string)) - { - this.Events = events; - this.PaginationKey = paginationKey; - } - - /// - /// Gets or Sets Events - /// - [DataMember(Name = "events", EmitDefaultValue = false)] - [JsonPropertyName("events")] - public List Events { get; set; } - - /// - /// Use this value in the `pagination_key` parameter to request the next page of search results. - /// - /// Use this value in the `pagination_key` parameter to request the next page of search results. - [DataMember(Name = "paginationKey", EmitDefaultValue = false)] - [JsonPropertyName("paginationKey")] - public string PaginationKey { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SearchEventsResponse {\n"); - sb.Append(" Events: ").Append(Events).Append("\n"); - sb.Append(" PaginationKey: ").Append(PaginationKey).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if SearchEventsResponse instances are equal - /// - /// Instance of SearchEventsResponse to be compared - /// Boolean - public bool Equals(SearchEventsResponse? input) - { - if (input == null) - return false; - - return - ( - this.Events == input.Events || - this.Events != null && - input.Events != null && - this.Events.SequenceEqual(input.Events) - ) && - ( - this.PaginationKey == input.PaginationKey || - (this.PaginationKey != null && - this.PaginationKey.Equals(input.PaginationKey)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Events != null) - hashCode = hashCode * 59 + this.Events.GetHashCode(); - if (this.PaginationKey != null) - hashCode = hashCode * 59 + this.PaginationKey.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/SearchEventsResponseEvents.cs b/src/FingerprintPro.ServerSdk/Model/SearchEventsResponseEvents.cs deleted file mode 100644 index 5ce6d96..0000000 --- a/src/FingerprintPro.ServerSdk/Model/SearchEventsResponseEvents.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Device intelligence results for the identification event. - /// - [DataContract] - public class SearchEventsResponseEvents : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// products (required). - public SearchEventsResponseEvents(Products products = default(Products)) - { - // to ensure "products" is required (not null) - // swagger debug: SearchEventsResponseEvents Products - - if (products == null) - { - throw new InvalidDataException("products is a required property for SearchEventsResponseEvents and cannot be null"); - } - else - { - this.Products = products; - } - } - - /// - /// Gets or Sets Products - /// - [DataMember(Name = "products", EmitDefaultValue = false)] - [JsonPropertyName("products")] - public Products Products { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SearchEventsResponseEvents {\n"); - sb.Append(" Products: ").Append(Products).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if SearchEventsResponseEvents instances are equal - /// - /// Instance of SearchEventsResponseEvents to be compared - /// Boolean - public bool Equals(SearchEventsResponseEvents? input) - { - if (input == null) - return false; - - return - ( - this.Products == input.Products || - (this.Products != null && - this.Products.Equals(input.Products)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Products != null) - hashCode = hashCode * 59 + this.Products.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/SupplementaryID.cs b/src/FingerprintPro.ServerSdk/Model/SupplementaryID.cs deleted file mode 100644 index ac5d02c..0000000 --- a/src/FingerprintPro.ServerSdk/Model/SupplementaryID.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// SupplementaryID - /// - [DataContract] - public class SupplementaryID : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device.. - /// Attribute represents if a visitor had been identified before.. - /// confidence. - /// firstSeenAt. - /// lastSeenAt. - public SupplementaryID(string visitorId = default(string), bool? visitorFound = default(bool?), IdentificationConfidence confidence = default(IdentificationConfidence), IdentificationSeenAt firstSeenAt = default(IdentificationSeenAt), IdentificationSeenAt lastSeenAt = default(IdentificationSeenAt)) - { - this.VisitorId = visitorId; - this.VisitorFound = visitorFound; - this.Confidence = confidence; - this.FirstSeenAt = firstSeenAt; - this.LastSeenAt = lastSeenAt; - } - - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. - [DataMember(Name = "visitorId", EmitDefaultValue = false)] - [JsonPropertyName("visitorId")] - public string VisitorId { get; set; } - - /// - /// Attribute represents if a visitor had been identified before. - /// - /// Attribute represents if a visitor had been identified before. - [DataMember(Name = "visitorFound", EmitDefaultValue = false)] - [JsonPropertyName("visitorFound")] - public bool? VisitorFound { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public IdentificationConfidence Confidence { get; set; } - - /// - /// Gets or Sets FirstSeenAt - /// - [DataMember(Name = "firstSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("firstSeenAt")] - public IdentificationSeenAt FirstSeenAt { get; set; } - - /// - /// Gets or Sets LastSeenAt - /// - [DataMember(Name = "lastSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("lastSeenAt")] - public IdentificationSeenAt LastSeenAt { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SupplementaryID {\n"); - sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); - sb.Append(" VisitorFound: ").Append(VisitorFound).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" FirstSeenAt: ").Append(FirstSeenAt).Append("\n"); - sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if SupplementaryID instances are equal - /// - /// Instance of SupplementaryID to be compared - /// Boolean - public bool Equals(SupplementaryID? input) - { - if (input == null) - return false; - - return - ( - this.VisitorId == input.VisitorId || - (this.VisitorId != null && - this.VisitorId.Equals(input.VisitorId)) - ) && - ( - this.VisitorFound == input.VisitorFound || - (this.VisitorFound != null && - this.VisitorFound.Equals(input.VisitorFound)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.FirstSeenAt == input.FirstSeenAt || - (this.FirstSeenAt != null && - this.FirstSeenAt.Equals(input.FirstSeenAt)) - ) && - ( - this.LastSeenAt == input.LastSeenAt || - (this.LastSeenAt != null && - this.LastSeenAt.Equals(input.LastSeenAt)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.VisitorId != null) - hashCode = hashCode * 59 + this.VisitorId.GetHashCode(); - if (this.VisitorFound != null) - hashCode = hashCode * 59 + this.VisitorFound.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.FirstSeenAt != null) - hashCode = hashCode * 59 + this.FirstSeenAt.GetHashCode(); - if (this.LastSeenAt != null) - hashCode = hashCode * 59 + this.LastSeenAt.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/SuspectScore.cs b/src/FingerprintPro.ServerSdk/Model/SuspectScore.cs deleted file mode 100644 index d53b4a0..0000000 --- a/src/FingerprintPro.ServerSdk/Model/SuspectScore.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// SuspectScore - /// - [DataContract] - public class SuspectScore : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score (required). - public SuspectScore(int? result = default(int?)) - { - // to ensure "result" is required (not null) - // swagger debug: SuspectScore Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for SuspectScore and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score - /// - /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public int? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SuspectScore {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if SuspectScore instances are equal - /// - /// Instance of SuspectScore to be compared - /// Boolean - public bool Equals(SuspectScore? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Tag.cs b/src/FingerprintPro.ServerSdk/Model/Tag.cs deleted file mode 100644 index 3b0baa9..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Tag.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// A customer-provided value or an object that was sent with identification request. - /// - [DataContract] - public class Tag : DictionaryModel, IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - public Tag() : base() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" ").Append(base.ToString()!.Replace("\n", "\n ")).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Tag instances are equal - /// - /// Instance of Tag to be compared - /// Boolean - public bool Equals(Tag? input) - { - if (input == null) - return false; - - return base.Equals(input); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Tampering.cs b/src/FingerprintPro.ServerSdk/Model/Tampering.cs deleted file mode 100644 index 3c7dbc1..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Tampering.cs +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Tampering - /// - [DataContract] - public class Tampering : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. (required). - /// A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. (required). - /// Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. (required). - public Tampering(bool? result = default(bool?), double? anomalyScore = default(double?), bool? antiDetectBrowser = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: Tampering Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Tampering and cannot be null"); - } - else - { - this.Result = result; - } - // to ensure "anomalyScore" is required (not null) - // swagger debug: Tampering AnomalyScore - - if (anomalyScore == null) - { - throw new InvalidDataException("anomalyScore is a required property for Tampering and cannot be null"); - } - else - { - this.AnomalyScore = anomalyScore; - } - // to ensure "antiDetectBrowser" is required (not null) - // swagger debug: Tampering AntiDetectBrowser - - if (antiDetectBrowser == null) - { - throw new InvalidDataException("antiDetectBrowser is a required property for Tampering and cannot be null"); - } - else - { - this.AntiDetectBrowser = antiDetectBrowser; - } - } - - /// - /// Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. - /// - /// Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. - /// - /// A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. - [DataMember(Name = "anomalyScore", EmitDefaultValue = false)] - [JsonPropertyName("anomalyScore")] - public double? AnomalyScore { get; set; } - - /// - /// Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - /// - /// Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - [DataMember(Name = "antiDetectBrowser", EmitDefaultValue = false)] - [JsonPropertyName("antiDetectBrowser")] - public bool? AntiDetectBrowser { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Tampering {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" AnomalyScore: ").Append(AnomalyScore).Append("\n"); - sb.Append(" AntiDetectBrowser: ").Append(AntiDetectBrowser).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Tampering instances are equal - /// - /// Instance of Tampering to be compared - /// Boolean - public bool Equals(Tampering? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.AnomalyScore == input.AnomalyScore || - (this.AnomalyScore != null && - this.AnomalyScore.Equals(input.AnomalyScore)) - ) && - ( - this.AntiDetectBrowser == input.AntiDetectBrowser || - (this.AntiDetectBrowser != null && - this.AntiDetectBrowser.Equals(input.AntiDetectBrowser)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.AnomalyScore != null) - hashCode = hashCode * 59 + this.AnomalyScore.GetHashCode(); - if (this.AntiDetectBrowser != null) - hashCode = hashCode * 59 + this.AntiDetectBrowser.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Tor.cs b/src/FingerprintPro.ServerSdk/Model/Tor.cs deleted file mode 100644 index 31dc667..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Tor.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Tor - /// - [DataContract] - public class Tor : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request IP address is a known tor exit node, `false` otherwise. (required). - public Tor(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: Tor Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for Tor and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// `true` if the request IP address is a known tor exit node, `false` otherwise. - /// - /// `true` if the request IP address is a known tor exit node, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Tor {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Tor instances are equal - /// - /// Instance of Tor to be compared - /// Boolean - public bool Equals(Tor? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VPN.cs b/src/FingerprintPro.ServerSdk/Model/VPN.cs deleted file mode 100644 index 18b5b39..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VPN.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// VPN - /// - [DataContract] - public class VPN : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// VPN or other anonymizing service has been used when sending the request. (required). - /// confidence (required). - /// Local timezone which is used in timezoneMismatch method. (required). - /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). (required). - /// methods (required). - public VPN(bool? result = default(bool?), VPNConfidence confidence = default(VPNConfidence), string originTimezone = default(string), string originCountry = default(string), VPNMethods methods = default(VPNMethods)) - { - // to ensure "result" is required (not null) - // swagger debug: VPN Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for VPN and cannot be null"); - } - else - { - this.Result = result; - } - // to ensure "confidence" is required (not null) - // swagger debug: VPN Confidence - - if (confidence == null) - { - throw new InvalidDataException("confidence is a required property for VPN and cannot be null"); - } - else - { - this.Confidence = confidence; - } - // to ensure "originTimezone" is required (not null) - // swagger debug: VPN OriginTimezone - - if (originTimezone == null) - { - throw new InvalidDataException("originTimezone is a required property for VPN and cannot be null"); - } - else - { - this.OriginTimezone = originTimezone; - } - // to ensure "originCountry" is required (not null) - // swagger debug: VPN OriginCountry - - if (originCountry == null) - { - throw new InvalidDataException("originCountry is a required property for VPN and cannot be null"); - } - else - { - this.OriginCountry = originCountry; - } - // to ensure "methods" is required (not null) - // swagger debug: VPN Methods - - if (methods == null) - { - throw new InvalidDataException("methods is a required property for VPN and cannot be null"); - } - else - { - this.Methods = methods; - } - } - - /// - /// VPN or other anonymizing service has been used when sending the request. - /// - /// VPN or other anonymizing service has been used when sending the request. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public VPNConfidence Confidence { get; set; } - - /// - /// Local timezone which is used in timezoneMismatch method. - /// - /// Local timezone which is used in timezoneMismatch method. - [DataMember(Name = "originTimezone", EmitDefaultValue = false)] - [JsonPropertyName("originTimezone")] - public string OriginTimezone { get; set; } - - /// - /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). - /// - /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). - [DataMember(Name = "originCountry", EmitDefaultValue = false)] - [JsonPropertyName("originCountry")] - public string OriginCountry { get; set; } - - /// - /// Gets or Sets Methods - /// - [DataMember(Name = "methods", EmitDefaultValue = false)] - [JsonPropertyName("methods")] - public VPNMethods Methods { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class VPN {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" OriginTimezone: ").Append(OriginTimezone).Append("\n"); - sb.Append(" OriginCountry: ").Append(OriginCountry).Append("\n"); - sb.Append(" Methods: ").Append(Methods).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if VPN instances are equal - /// - /// Instance of VPN to be compared - /// Boolean - public bool Equals(VPN? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.OriginTimezone == input.OriginTimezone || - (this.OriginTimezone != null && - this.OriginTimezone.Equals(input.OriginTimezone)) - ) && - ( - this.OriginCountry == input.OriginCountry || - (this.OriginCountry != null && - this.OriginCountry.Equals(input.OriginCountry)) - ) && - ( - this.Methods == input.Methods || - (this.Methods != null && - this.Methods.Equals(input.Methods)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.OriginTimezone != null) - hashCode = hashCode * 59 + this.OriginTimezone.GetHashCode(); - if (this.OriginCountry != null) - hashCode = hashCode * 59 + this.OriginCountry.GetHashCode(); - if (this.Methods != null) - hashCode = hashCode * 59 + this.Methods.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VPNConfidence.cs b/src/FingerprintPro.ServerSdk/Model/VPNConfidence.cs deleted file mode 100644 index a38a9c7..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VPNConfidence.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. - /// - /// A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum VPNConfidence - { - /// - /// Enum Low for value: low - /// - [EnumMember(Value = "low")] - Low = 1, - /// - /// Enum Medium for value: medium - /// - [EnumMember(Value = "medium")] - Medium = 2, - /// - /// Enum High for value: high - /// - [EnumMember(Value = "high")] - High = 3 - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VPNMethods.cs b/src/FingerprintPro.ServerSdk/Model/VPNMethods.cs deleted file mode 100644 index 5222482..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VPNMethods.cs +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// VPNMethods - /// - [DataContract] - public class VPNMethods : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// The browser timezone doesn't match the timezone inferred from the request IP address. (required). - /// Request IP address is owned and used by a public VPN service provider. (required). - /// This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. (required). - /// The browser runs on a different operating system than the operating system inferred from the request network signature. (required). - /// Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. (required). - public VPNMethods(bool? timezoneMismatch = default(bool?), bool? publicVPN = default(bool?), bool? auxiliaryMobile = default(bool?), bool? osMismatch = default(bool?), bool? relay = default(bool?)) - { - // to ensure "timezoneMismatch" is required (not null) - // swagger debug: VPNMethods TimezoneMismatch - - if (timezoneMismatch == null) - { - throw new InvalidDataException("timezoneMismatch is a required property for VPNMethods and cannot be null"); - } - else - { - this.TimezoneMismatch = timezoneMismatch; - } - // to ensure "publicVPN" is required (not null) - // swagger debug: VPNMethods PublicVPN - - if (publicVPN == null) - { - throw new InvalidDataException("publicVPN is a required property for VPNMethods and cannot be null"); - } - else - { - this.PublicVPN = publicVPN; - } - // to ensure "auxiliaryMobile" is required (not null) - // swagger debug: VPNMethods AuxiliaryMobile - - if (auxiliaryMobile == null) - { - throw new InvalidDataException("auxiliaryMobile is a required property for VPNMethods and cannot be null"); - } - else - { - this.AuxiliaryMobile = auxiliaryMobile; - } - // to ensure "osMismatch" is required (not null) - // swagger debug: VPNMethods OsMismatch - - if (osMismatch == null) - { - throw new InvalidDataException("osMismatch is a required property for VPNMethods and cannot be null"); - } - else - { - this.OsMismatch = osMismatch; - } - // to ensure "relay" is required (not null) - // swagger debug: VPNMethods Relay - - if (relay == null) - { - throw new InvalidDataException("relay is a required property for VPNMethods and cannot be null"); - } - else - { - this.Relay = relay; - } - } - - /// - /// The browser timezone doesn't match the timezone inferred from the request IP address. - /// - /// The browser timezone doesn't match the timezone inferred from the request IP address. - [DataMember(Name = "timezoneMismatch", EmitDefaultValue = false)] - [JsonPropertyName("timezoneMismatch")] - public bool? TimezoneMismatch { get; set; } - - /// - /// Request IP address is owned and used by a public VPN service provider. - /// - /// Request IP address is owned and used by a public VPN service provider. - [DataMember(Name = "publicVPN", EmitDefaultValue = false)] - [JsonPropertyName("publicVPN")] - public bool? PublicVPN { get; set; } - - /// - /// This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. - /// - /// This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. - [DataMember(Name = "auxiliaryMobile", EmitDefaultValue = false)] - [JsonPropertyName("auxiliaryMobile")] - public bool? AuxiliaryMobile { get; set; } - - /// - /// The browser runs on a different operating system than the operating system inferred from the request network signature. - /// - /// The browser runs on a different operating system than the operating system inferred from the request network signature. - [DataMember(Name = "osMismatch", EmitDefaultValue = false)] - [JsonPropertyName("osMismatch")] - public bool? OsMismatch { get; set; } - - /// - /// Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. - /// - /// Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. - [DataMember(Name = "relay", EmitDefaultValue = false)] - [JsonPropertyName("relay")] - public bool? Relay { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class VPNMethods {\n"); - sb.Append(" TimezoneMismatch: ").Append(TimezoneMismatch).Append("\n"); - sb.Append(" PublicVPN: ").Append(PublicVPN).Append("\n"); - sb.Append(" AuxiliaryMobile: ").Append(AuxiliaryMobile).Append("\n"); - sb.Append(" OsMismatch: ").Append(OsMismatch).Append("\n"); - sb.Append(" Relay: ").Append(Relay).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if VPNMethods instances are equal - /// - /// Instance of VPNMethods to be compared - /// Boolean - public bool Equals(VPNMethods? input) - { - if (input == null) - return false; - - return - ( - this.TimezoneMismatch == input.TimezoneMismatch || - (this.TimezoneMismatch != null && - this.TimezoneMismatch.Equals(input.TimezoneMismatch)) - ) && - ( - this.PublicVPN == input.PublicVPN || - (this.PublicVPN != null && - this.PublicVPN.Equals(input.PublicVPN)) - ) && - ( - this.AuxiliaryMobile == input.AuxiliaryMobile || - (this.AuxiliaryMobile != null && - this.AuxiliaryMobile.Equals(input.AuxiliaryMobile)) - ) && - ( - this.OsMismatch == input.OsMismatch || - (this.OsMismatch != null && - this.OsMismatch.Equals(input.OsMismatch)) - ) && - ( - this.Relay == input.Relay || - (this.Relay != null && - this.Relay.Equals(input.Relay)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.TimezoneMismatch != null) - hashCode = hashCode * 59 + this.TimezoneMismatch.GetHashCode(); - if (this.PublicVPN != null) - hashCode = hashCode * 59 + this.PublicVPN.GetHashCode(); - if (this.AuxiliaryMobile != null) - hashCode = hashCode * 59 + this.AuxiliaryMobile.GetHashCode(); - if (this.OsMismatch != null) - hashCode = hashCode * 59 + this.OsMismatch.GetHashCode(); - if (this.Relay != null) - hashCode = hashCode * 59 + this.Relay.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Velocity.cs b/src/FingerprintPro.ServerSdk/Model/Velocity.cs deleted file mode 100644 index e54c6dc..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Velocity.cs +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor ID. - Number of distinct linked IDs associated with the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked ID. - Number of distinct visitor IDs associated with the provided linked ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. - /// - [DataContract] - public class Velocity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// distinctIp (required). - /// distinctLinkedId (required). - /// distinctCountry (required). - /// events (required). - /// ipEvents (required). - /// distinctIpByLinkedId (required). - /// distinctVisitorIdByLinkedId (required). - public Velocity(VelocityData distinctIp = default(VelocityData), VelocityData distinctLinkedId = default(VelocityData), VelocityData distinctCountry = default(VelocityData), VelocityData events = default(VelocityData), VelocityData ipEvents = default(VelocityData), VelocityData distinctIpByLinkedId = default(VelocityData), VelocityData distinctVisitorIdByLinkedId = default(VelocityData)) - { - // to ensure "distinctIp" is required (not null) - // swagger debug: Velocity DistinctIp - - if (distinctIp == null) - { - throw new InvalidDataException("distinctIp is a required property for Velocity and cannot be null"); - } - else - { - this.DistinctIp = distinctIp; - } - // to ensure "distinctLinkedId" is required (not null) - // swagger debug: Velocity DistinctLinkedId - - if (distinctLinkedId == null) - { - throw new InvalidDataException("distinctLinkedId is a required property for Velocity and cannot be null"); - } - else - { - this.DistinctLinkedId = distinctLinkedId; - } - // to ensure "distinctCountry" is required (not null) - // swagger debug: Velocity DistinctCountry - - if (distinctCountry == null) - { - throw new InvalidDataException("distinctCountry is a required property for Velocity and cannot be null"); - } - else - { - this.DistinctCountry = distinctCountry; - } - // to ensure "events" is required (not null) - // swagger debug: Velocity Events - - if (events == null) - { - throw new InvalidDataException("events is a required property for Velocity and cannot be null"); - } - else - { - this.Events = events; - } - // to ensure "ipEvents" is required (not null) - // swagger debug: Velocity IpEvents - - if (ipEvents == null) - { - throw new InvalidDataException("ipEvents is a required property for Velocity and cannot be null"); - } - else - { - this.IpEvents = ipEvents; - } - // to ensure "distinctIpByLinkedId" is required (not null) - // swagger debug: Velocity DistinctIpByLinkedId - - if (distinctIpByLinkedId == null) - { - throw new InvalidDataException("distinctIpByLinkedId is a required property for Velocity and cannot be null"); - } - else - { - this.DistinctIpByLinkedId = distinctIpByLinkedId; - } - // to ensure "distinctVisitorIdByLinkedId" is required (not null) - // swagger debug: Velocity DistinctVisitorIdByLinkedId - - if (distinctVisitorIdByLinkedId == null) - { - throw new InvalidDataException("distinctVisitorIdByLinkedId is a required property for Velocity and cannot be null"); - } - else - { - this.DistinctVisitorIdByLinkedId = distinctVisitorIdByLinkedId; - } - } - - /// - /// Gets or Sets DistinctIp - /// - [DataMember(Name = "distinctIp", EmitDefaultValue = false)] - [JsonPropertyName("distinctIp")] - public VelocityData DistinctIp { get; set; } - - /// - /// Gets or Sets DistinctLinkedId - /// - [DataMember(Name = "distinctLinkedId", EmitDefaultValue = false)] - [JsonPropertyName("distinctLinkedId")] - public VelocityData DistinctLinkedId { get; set; } - - /// - /// Gets or Sets DistinctCountry - /// - [DataMember(Name = "distinctCountry", EmitDefaultValue = false)] - [JsonPropertyName("distinctCountry")] - public VelocityData DistinctCountry { get; set; } - - /// - /// Gets or Sets Events - /// - [DataMember(Name = "events", EmitDefaultValue = false)] - [JsonPropertyName("events")] - public VelocityData Events { get; set; } - - /// - /// Gets or Sets IpEvents - /// - [DataMember(Name = "ipEvents", EmitDefaultValue = false)] - [JsonPropertyName("ipEvents")] - public VelocityData IpEvents { get; set; } - - /// - /// Gets or Sets DistinctIpByLinkedId - /// - [DataMember(Name = "distinctIpByLinkedId", EmitDefaultValue = false)] - [JsonPropertyName("distinctIpByLinkedId")] - public VelocityData DistinctIpByLinkedId { get; set; } - - /// - /// Gets or Sets DistinctVisitorIdByLinkedId - /// - [DataMember(Name = "distinctVisitorIdByLinkedId", EmitDefaultValue = false)] - [JsonPropertyName("distinctVisitorIdByLinkedId")] - public VelocityData DistinctVisitorIdByLinkedId { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Velocity {\n"); - sb.Append(" DistinctIp: ").Append(DistinctIp).Append("\n"); - sb.Append(" DistinctLinkedId: ").Append(DistinctLinkedId).Append("\n"); - sb.Append(" DistinctCountry: ").Append(DistinctCountry).Append("\n"); - sb.Append(" Events: ").Append(Events).Append("\n"); - sb.Append(" IpEvents: ").Append(IpEvents).Append("\n"); - sb.Append(" DistinctIpByLinkedId: ").Append(DistinctIpByLinkedId).Append("\n"); - sb.Append(" DistinctVisitorIdByLinkedId: ").Append(DistinctVisitorIdByLinkedId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Velocity instances are equal - /// - /// Instance of Velocity to be compared - /// Boolean - public bool Equals(Velocity? input) - { - if (input == null) - return false; - - return - ( - this.DistinctIp == input.DistinctIp || - (this.DistinctIp != null && - this.DistinctIp.Equals(input.DistinctIp)) - ) && - ( - this.DistinctLinkedId == input.DistinctLinkedId || - (this.DistinctLinkedId != null && - this.DistinctLinkedId.Equals(input.DistinctLinkedId)) - ) && - ( - this.DistinctCountry == input.DistinctCountry || - (this.DistinctCountry != null && - this.DistinctCountry.Equals(input.DistinctCountry)) - ) && - ( - this.Events == input.Events || - (this.Events != null && - this.Events.Equals(input.Events)) - ) && - ( - this.IpEvents == input.IpEvents || - (this.IpEvents != null && - this.IpEvents.Equals(input.IpEvents)) - ) && - ( - this.DistinctIpByLinkedId == input.DistinctIpByLinkedId || - (this.DistinctIpByLinkedId != null && - this.DistinctIpByLinkedId.Equals(input.DistinctIpByLinkedId)) - ) && - ( - this.DistinctVisitorIdByLinkedId == input.DistinctVisitorIdByLinkedId || - (this.DistinctVisitorIdByLinkedId != null && - this.DistinctVisitorIdByLinkedId.Equals(input.DistinctVisitorIdByLinkedId)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.DistinctIp != null) - hashCode = hashCode * 59 + this.DistinctIp.GetHashCode(); - if (this.DistinctLinkedId != null) - hashCode = hashCode * 59 + this.DistinctLinkedId.GetHashCode(); - if (this.DistinctCountry != null) - hashCode = hashCode * 59 + this.DistinctCountry.GetHashCode(); - if (this.Events != null) - hashCode = hashCode * 59 + this.Events.GetHashCode(); - if (this.IpEvents != null) - hashCode = hashCode * 59 + this.IpEvents.GetHashCode(); - if (this.DistinctIpByLinkedId != null) - hashCode = hashCode * 59 + this.DistinctIpByLinkedId.GetHashCode(); - if (this.DistinctVisitorIdByLinkedId != null) - hashCode = hashCode * 59 + this.DistinctVisitorIdByLinkedId.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VelocityData.cs b/src/FingerprintPro.ServerSdk/Model/VelocityData.cs deleted file mode 100644 index dfb3aa2..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VelocityData.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// VelocityData - /// - [DataContract] - public class VelocityData : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// intervals. - public VelocityData(VelocityIntervals intervals = default(VelocityIntervals)) - { - this.Intervals = intervals; - } - - /// - /// Gets or Sets Intervals - /// - [DataMember(Name = "intervals", EmitDefaultValue = false)] - [JsonPropertyName("intervals")] - public VelocityIntervals Intervals { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class VelocityData {\n"); - sb.Append(" Intervals: ").Append(Intervals).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if VelocityData instances are equal - /// - /// Instance of VelocityData to be compared - /// Boolean - public bool Equals(VelocityData? input) - { - if (input == null) - return false; - - return - ( - this.Intervals == input.Intervals || - (this.Intervals != null && - this.Intervals.Equals(input.Intervals)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Intervals != null) - hashCode = hashCode * 59 + this.Intervals.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VelocityIntervals.cs b/src/FingerprintPro.ServerSdk/Model/VelocityIntervals.cs deleted file mode 100644 index 5c4d90b..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VelocityIntervals.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Is absent if the velocity data could not be generated for the visitor ID. - /// - [DataContract] - public class VelocityIntervals : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// _5m (required). - /// _1h (required). - /// The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. . - public VelocityIntervals(int? _5m = default(int?), int? _1h = default(int?), int? _24h = default(int?)) - { - // to ensure "_5m" is required (not null) - // swagger debug: VelocityIntervals _5m - - if (_5m == null) - { - throw new InvalidDataException("_5m is a required property for VelocityIntervals and cannot be null"); - } - else - { - this._5m = _5m; - } - // to ensure "_1h" is required (not null) - // swagger debug: VelocityIntervals _1h - - if (_1h == null) - { - throw new InvalidDataException("_1h is a required property for VelocityIntervals and cannot be null"); - } - else - { - this._1h = _1h; - } - this._24h = _24h; - } - - /// - /// Gets or Sets _5m - /// - [DataMember(Name = "5m", EmitDefaultValue = false)] - [JsonPropertyName("5m")] - public int? _5m { get; set; } - - /// - /// Gets or Sets _1h - /// - [DataMember(Name = "1h", EmitDefaultValue = false)] - [JsonPropertyName("1h")] - public int? _1h { get; set; } - - /// - /// The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. - /// - /// The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. - [DataMember(Name = "24h", EmitDefaultValue = false)] - [JsonPropertyName("24h")] - public int? _24h { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class VelocityIntervals {\n"); - sb.Append(" _5m: ").Append(_5m).Append("\n"); - sb.Append(" _1h: ").Append(_1h).Append("\n"); - sb.Append(" _24h: ").Append(_24h).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if VelocityIntervals instances are equal - /// - /// Instance of VelocityIntervals to be compared - /// Boolean - public bool Equals(VelocityIntervals? input) - { - if (input == null) - return false; - - return - ( - this._5m == input._5m || - (this._5m != null && - this._5m.Equals(input._5m)) - ) && - ( - this._1h == input._1h || - (this._1h != null && - this._1h.Equals(input._1h)) - ) && - ( - this._24h == input._24h || - (this._24h != null && - this._24h.Equals(input._24h)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._5m != null) - hashCode = hashCode * 59 + this._5m.GetHashCode(); - if (this._1h != null) - hashCode = hashCode * 59 + this._1h.GetHashCode(); - if (this._24h != null) - hashCode = hashCode * 59 + this._24h.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VirtualMachine.cs b/src/FingerprintPro.ServerSdk/Model/VirtualMachine.cs deleted file mode 100644 index 0763234..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VirtualMachine.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// VirtualMachine - /// - [DataContract] - public class VirtualMachine : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. (required). - public VirtualMachine(bool? result = default(bool?)) - { - // to ensure "result" is required (not null) - // swagger debug: VirtualMachine Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for VirtualMachine and cannot be null"); - } - else - { - this.Result = result; - } - } - - /// - /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. - /// - /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class VirtualMachine {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if VirtualMachine instances are equal - /// - /// Instance of VirtualMachine to be compared - /// Boolean - public bool Equals(VirtualMachine? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Visit.cs b/src/FingerprintPro.ServerSdk/Model/Visit.cs deleted file mode 100644 index df34ce1..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Visit.cs +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Visit - /// - [DataContract] - public class Visit : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Unique identifier of the user's request. (required). - /// browserDetails (required). - /// Flag if user used incognito session. (required). - /// IP address of the requesting browser or bot. (required). - /// ipLocation. - /// A customer-provided id that was sent with the request.. - /// Timestamp of the event with millisecond precision in Unix time. (required). - /// Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. (required). - /// Page URL from which the request was sent. (required). - /// tag (required). - /// confidence. - /// Attribute represents if a visitor had been identified before. (required). - /// firstSeenAt (required). - /// lastSeenAt (required). - /// components. - public Visit(string requestId = default(string), BrowserDetails browserDetails = default(BrowserDetails), bool? incognito = default(bool?), string ip = default(string), DeprecatedGeolocation ipLocation = default(DeprecatedGeolocation), string linkedId = default(string), long? timestamp = default(long?), DateTime? time = default(DateTime?), string url = default(string), Tag tag = default(Tag), IdentificationConfidence confidence = default(IdentificationConfidence), bool? visitorFound = default(bool?), IdentificationSeenAt firstSeenAt = default(IdentificationSeenAt), IdentificationSeenAt lastSeenAt = default(IdentificationSeenAt), RawDeviceAttributes components = default(RawDeviceAttributes)) - { - // to ensure "requestId" is required (not null) - // swagger debug: Visit RequestId - - if (requestId == null) - { - throw new InvalidDataException("requestId is a required property for Visit and cannot be null"); - } - else - { - this.RequestId = requestId; - } - // to ensure "browserDetails" is required (not null) - // swagger debug: Visit BrowserDetails - - if (browserDetails == null) - { - throw new InvalidDataException("browserDetails is a required property for Visit and cannot be null"); - } - else - { - this.BrowserDetails = browserDetails; - } - // to ensure "incognito" is required (not null) - // swagger debug: Visit Incognito - - if (incognito == null) - { - throw new InvalidDataException("incognito is a required property for Visit and cannot be null"); - } - else - { - this.Incognito = incognito; - } - // to ensure "ip" is required (not null) - // swagger debug: Visit Ip - - if (ip == null) - { - throw new InvalidDataException("ip is a required property for Visit and cannot be null"); - } - else - { - this.Ip = ip; - } - // to ensure "timestamp" is required (not null) - // swagger debug: Visit Timestamp - - if (timestamp == null) - { - throw new InvalidDataException("timestamp is a required property for Visit and cannot be null"); - } - else - { - this.Timestamp = timestamp; - } - // to ensure "time" is required (not null) - // swagger debug: Visit Time - - if (time == null) - { - throw new InvalidDataException("time is a required property for Visit and cannot be null"); - } - else - { - this.Time = time; - } - // to ensure "url" is required (not null) - // swagger debug: Visit Url - - if (url == null) - { - throw new InvalidDataException("url is a required property for Visit and cannot be null"); - } - else - { - this.Url = url; - } - // to ensure "tag" is required (not null) - // swagger debug: Visit Tag - - if (tag == null) - { - throw new InvalidDataException("tag is a required property for Visit and cannot be null"); - } - else - { - this.Tag = tag; - } - // to ensure "visitorFound" is required (not null) - // swagger debug: Visit VisitorFound - - if (visitorFound == null) - { - throw new InvalidDataException("visitorFound is a required property for Visit and cannot be null"); - } - else - { - this.VisitorFound = visitorFound; - } - // to ensure "firstSeenAt" is required (not null) - // swagger debug: Visit FirstSeenAt - - if (firstSeenAt == null) - { - throw new InvalidDataException("firstSeenAt is a required property for Visit and cannot be null"); - } - else - { - this.FirstSeenAt = firstSeenAt; - } - // to ensure "lastSeenAt" is required (not null) - // swagger debug: Visit LastSeenAt - - if (lastSeenAt == null) - { - throw new InvalidDataException("lastSeenAt is a required property for Visit and cannot be null"); - } - else - { - this.LastSeenAt = lastSeenAt; - } - this.IpLocation = ipLocation; - this.LinkedId = linkedId; - this.Confidence = confidence; - this.Components = components; - } - - /// - /// Unique identifier of the user's request. - /// - /// Unique identifier of the user's request. - [DataMember(Name = "requestId", EmitDefaultValue = false)] - [JsonPropertyName("requestId")] - public string RequestId { get; set; } - - /// - /// Gets or Sets BrowserDetails - /// - [DataMember(Name = "browserDetails", EmitDefaultValue = false)] - [JsonPropertyName("browserDetails")] - public BrowserDetails BrowserDetails { get; set; } - - /// - /// Flag if user used incognito session. - /// - /// Flag if user used incognito session. - [DataMember(Name = "incognito", EmitDefaultValue = false)] - [JsonPropertyName("incognito")] - public bool? Incognito { get; set; } - - /// - /// IP address of the requesting browser or bot. - /// - /// IP address of the requesting browser or bot. - [DataMember(Name = "ip", EmitDefaultValue = false)] - [JsonPropertyName("ip")] - public string Ip { get; set; } - - /// - /// Gets or Sets IpLocation - /// - [DataMember(Name = "ipLocation", EmitDefaultValue = false)] - [JsonPropertyName("ipLocation")] - public DeprecatedGeolocation IpLocation { get; set; } - - /// - /// A customer-provided id that was sent with the request. - /// - /// A customer-provided id that was sent with the request. - [DataMember(Name = "linkedId", EmitDefaultValue = false)] - [JsonPropertyName("linkedId")] - public string LinkedId { get; set; } - - /// - /// Timestamp of the event with millisecond precision in Unix time. - /// - /// Timestamp of the event with millisecond precision in Unix time. - [DataMember(Name = "timestamp", EmitDefaultValue = false)] - [JsonPropertyName("timestamp")] - public long? Timestamp { get; set; } - - /// - /// Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - /// - /// Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - [DataMember(Name = "time", EmitDefaultValue = false)] - [JsonPropertyName("time")] - public DateTime? Time { get; set; } - - /// - /// Page URL from which the request was sent. - /// - /// Page URL from which the request was sent. - [DataMember(Name = "url", EmitDefaultValue = false)] - [JsonPropertyName("url")] - public string Url { get; set; } - - /// - /// Gets or Sets Tag - /// - [DataMember(Name = "tag", EmitDefaultValue = false)] - [JsonPropertyName("tag")] - public Tag Tag { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public IdentificationConfidence Confidence { get; set; } - - /// - /// Attribute represents if a visitor had been identified before. - /// - /// Attribute represents if a visitor had been identified before. - [DataMember(Name = "visitorFound", EmitDefaultValue = false)] - [JsonPropertyName("visitorFound")] - public bool? VisitorFound { get; set; } - - /// - /// Gets or Sets FirstSeenAt - /// - [DataMember(Name = "firstSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("firstSeenAt")] - public IdentificationSeenAt FirstSeenAt { get; set; } - - /// - /// Gets or Sets LastSeenAt - /// - [DataMember(Name = "lastSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("lastSeenAt")] - public IdentificationSeenAt LastSeenAt { get; set; } - - /// - /// Gets or Sets Components - /// - [DataMember(Name = "components", EmitDefaultValue = false)] - [JsonPropertyName("components")] - public RawDeviceAttributes Components { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Visit {\n"); - sb.Append(" RequestId: ").Append(RequestId).Append("\n"); - sb.Append(" BrowserDetails: ").Append(BrowserDetails).Append("\n"); - sb.Append(" Incognito: ").Append(Incognito).Append("\n"); - sb.Append(" Ip: ").Append(Ip).Append("\n"); - sb.Append(" IpLocation: ").Append(IpLocation).Append("\n"); - sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); - sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); - sb.Append(" Tag: ").Append(Tag).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" VisitorFound: ").Append(VisitorFound).Append("\n"); - sb.Append(" FirstSeenAt: ").Append(FirstSeenAt).Append("\n"); - sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); - sb.Append(" Components: ").Append(Components).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Visit instances are equal - /// - /// Instance of Visit to be compared - /// Boolean - public bool Equals(Visit? input) - { - if (input == null) - return false; - - return - ( - this.RequestId == input.RequestId || - (this.RequestId != null && - this.RequestId.Equals(input.RequestId)) - ) && - ( - this.BrowserDetails == input.BrowserDetails || - (this.BrowserDetails != null && - this.BrowserDetails.Equals(input.BrowserDetails)) - ) && - ( - this.Incognito == input.Incognito || - (this.Incognito != null && - this.Incognito.Equals(input.Incognito)) - ) && - ( - this.Ip == input.Ip || - (this.Ip != null && - this.Ip.Equals(input.Ip)) - ) && - ( - this.IpLocation == input.IpLocation || - (this.IpLocation != null && - this.IpLocation.Equals(input.IpLocation)) - ) && - ( - this.LinkedId == input.LinkedId || - (this.LinkedId != null && - this.LinkedId.Equals(input.LinkedId)) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ) && - ( - this.Time == input.Time || - (this.Time != null && - this.Time.Equals(input.Time)) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ) && - ( - this.Tag == input.Tag || - (this.Tag != null && - this.Tag.Equals(input.Tag)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.VisitorFound == input.VisitorFound || - (this.VisitorFound != null && - this.VisitorFound.Equals(input.VisitorFound)) - ) && - ( - this.FirstSeenAt == input.FirstSeenAt || - (this.FirstSeenAt != null && - this.FirstSeenAt.Equals(input.FirstSeenAt)) - ) && - ( - this.LastSeenAt == input.LastSeenAt || - (this.LastSeenAt != null && - this.LastSeenAt.Equals(input.LastSeenAt)) - ) && - ( - this.Components == input.Components || - (this.Components != null && - this.Components.Equals(input.Components)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RequestId != null) - hashCode = hashCode * 59 + this.RequestId.GetHashCode(); - if (this.BrowserDetails != null) - hashCode = hashCode * 59 + this.BrowserDetails.GetHashCode(); - if (this.Incognito != null) - hashCode = hashCode * 59 + this.Incognito.GetHashCode(); - if (this.Ip != null) - hashCode = hashCode * 59 + this.Ip.GetHashCode(); - if (this.IpLocation != null) - hashCode = hashCode * 59 + this.IpLocation.GetHashCode(); - if (this.LinkedId != null) - hashCode = hashCode * 59 + this.LinkedId.GetHashCode(); - if (this.Timestamp != null) - hashCode = hashCode * 59 + this.Timestamp.GetHashCode(); - if (this.Time != null) - hashCode = hashCode * 59 + this.Time.GetHashCode(); - if (this.Url != null) - hashCode = hashCode * 59 + this.Url.GetHashCode(); - if (this.Tag != null) - hashCode = hashCode * 59 + this.Tag.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.VisitorFound != null) - hashCode = hashCode * 59 + this.VisitorFound.GetHashCode(); - if (this.FirstSeenAt != null) - hashCode = hashCode * 59 + this.FirstSeenAt.GetHashCode(); - if (this.LastSeenAt != null) - hashCode = hashCode * 59 + this.LastSeenAt.GetHashCode(); - if (this.Components != null) - hashCode = hashCode * 59 + this.Components.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/VisitorsGetResponse.cs b/src/FingerprintPro.ServerSdk/Model/VisitorsGetResponse.cs deleted file mode 100644 index a8081f3..0000000 --- a/src/FingerprintPro.ServerSdk/Model/VisitorsGetResponse.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Pagination-related fields `lastTimestamp` and `paginationKey` are included if you use a pagination parameter like `limit` or `before` and there is more data available on the next page. - /// - [DataContract] - public class VisitorsGetResponse : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// visitorId (required). - /// visits (required). - /// ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. . - /// Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results.. - public VisitorsGetResponse(string visitorId = default(string), List visits = default(List), long? lastTimestamp = default(long?), string paginationKey = default(string)) - { - // to ensure "visitorId" is required (not null) - // swagger debug: VisitorsGetResponse VisitorId - - if (visitorId == null) - { - throw new InvalidDataException("visitorId is a required property for VisitorsGetResponse and cannot be null"); - } - else - { - this.VisitorId = visitorId; - } - // to ensure "visits" is required (not null) - // swagger debug: VisitorsGetResponse Visits - - if (visits == null) - { - throw new InvalidDataException("visits is a required property for VisitorsGetResponse and cannot be null"); - } - else - { - this.Visits = visits; - } - this.LastTimestamp = lastTimestamp; - this.PaginationKey = paginationKey; - } - - /// - /// Gets or Sets VisitorId - /// - [DataMember(Name = "visitorId", EmitDefaultValue = false)] - [JsonPropertyName("visitorId")] - public string VisitorId { get; set; } - - /// - /// Gets or Sets Visits - /// - [DataMember(Name = "visits", EmitDefaultValue = false)] - [JsonPropertyName("visits")] - public List Visits { get; set; } - - /// - /// ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. - /// - /// ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. - [DataMember(Name = "lastTimestamp", EmitDefaultValue = false)] - [JsonPropertyName("lastTimestamp")] - public long? LastTimestamp { get; set; } - - /// - /// Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. - /// - /// Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. - [DataMember(Name = "paginationKey", EmitDefaultValue = false)] - [JsonPropertyName("paginationKey")] - public string PaginationKey { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class VisitorsGetResponse {\n"); - sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); - sb.Append(" Visits: ").Append(Visits).Append("\n"); - sb.Append(" LastTimestamp: ").Append(LastTimestamp).Append("\n"); - sb.Append(" PaginationKey: ").Append(PaginationKey).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if VisitorsGetResponse instances are equal - /// - /// Instance of VisitorsGetResponse to be compared - /// Boolean - public bool Equals(VisitorsGetResponse? input) - { - if (input == null) - return false; - - return - ( - this.VisitorId == input.VisitorId || - (this.VisitorId != null && - this.VisitorId.Equals(input.VisitorId)) - ) && - ( - this.Visits == input.Visits || - this.Visits != null && - input.Visits != null && - this.Visits.SequenceEqual(input.Visits) - ) && - ( - this.LastTimestamp == input.LastTimestamp || - (this.LastTimestamp != null && - this.LastTimestamp.Equals(input.LastTimestamp)) - ) && - ( - this.PaginationKey == input.PaginationKey || - (this.PaginationKey != null && - this.PaginationKey.Equals(input.PaginationKey)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.VisitorId != null) - hashCode = hashCode * 59 + this.VisitorId.GetHashCode(); - if (this.Visits != null) - hashCode = hashCode * 59 + this.Visits.GetHashCode(); - if (this.LastTimestamp != null) - hashCode = hashCode * 59 + this.LastTimestamp.GetHashCode(); - if (this.PaginationKey != null) - hashCode = hashCode * 59 + this.PaginationKey.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/Webhook.cs b/src/FingerprintPro.ServerSdk/Model/Webhook.cs deleted file mode 100644 index 6734d34..0000000 --- a/src/FingerprintPro.ServerSdk/Model/Webhook.cs +++ /dev/null @@ -1,934 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Webhook - /// - [DataContract] - public class Webhook : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Unique identifier of the user's request. (required). - /// Page URL from which the request was sent. (required). - /// IP address of the requesting browser or bot. (required). - /// Environment ID of the event.. - /// tag. - /// Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. (required). - /// Timestamp of the event with millisecond precision in Unix time. (required). - /// ipLocation. - /// A customer-provided id that was sent with the request.. - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device.. - /// Attribute represents if a visitor had been identified before.. - /// confidence. - /// firstSeenAt. - /// lastSeenAt. - /// browserDetails. - /// Flag if user used incognito session.. - /// clientReferrer. - /// components. - /// bot. - /// userAgent. - /// rootApps. - /// emulator. - /// ipInfo. - /// ipBlocklist. - /// tor. - /// vpn. - /// proxy. - /// tampering. - /// clonedApp. - /// factoryReset. - /// jailbroken. - /// frida. - /// privacySettings. - /// virtualMachine. - /// rawDeviceAttributes. - /// highActivity. - /// locationSpoofing. - /// suspectScore. - /// remoteControl. - /// velocity. - /// developerTools. - /// mitmAttack. - /// `true` if we determined that this payload was replayed, `false` otherwise. . - /// sdk (required). - /// supplementaryIds. - /// proximity. - public Webhook(string requestId = default(string), string url = default(string), string ip = default(string), string environmentId = default(string), Tag tag = default(Tag), DateTime? time = default(DateTime?), long? timestamp = default(long?), DeprecatedGeolocation ipLocation = default(DeprecatedGeolocation), string linkedId = default(string), string visitorId = default(string), bool? visitorFound = default(bool?), IdentificationConfidence confidence = default(IdentificationConfidence), IdentificationSeenAt firstSeenAt = default(IdentificationSeenAt), IdentificationSeenAt lastSeenAt = default(IdentificationSeenAt), BrowserDetails browserDetails = default(BrowserDetails), bool? incognito = default(bool?), string clientReferrer = default(string), RawDeviceAttributes components = default(RawDeviceAttributes), BotdBot bot = default(BotdBot), string userAgent = default(string), WebhookRootApps rootApps = default(WebhookRootApps), WebhookEmulator emulator = default(WebhookEmulator), WebhookIPInfo ipInfo = default(WebhookIPInfo), WebhookIPBlocklist ipBlocklist = default(WebhookIPBlocklist), WebhookTor tor = default(WebhookTor), WebhookVPN vpn = default(WebhookVPN), WebhookProxy proxy = default(WebhookProxy), WebhookTampering tampering = default(WebhookTampering), WebhookClonedApp clonedApp = default(WebhookClonedApp), WebhookFactoryReset factoryReset = default(WebhookFactoryReset), WebhookJailbroken jailbroken = default(WebhookJailbroken), WebhookFrida frida = default(WebhookFrida), WebhookPrivacySettings privacySettings = default(WebhookPrivacySettings), WebhookVirtualMachine virtualMachine = default(WebhookVirtualMachine), WebhookRawDeviceAttributes rawDeviceAttributes = default(WebhookRawDeviceAttributes), WebhookHighActivity highActivity = default(WebhookHighActivity), WebhookLocationSpoofing locationSpoofing = default(WebhookLocationSpoofing), WebhookSuspectScore suspectScore = default(WebhookSuspectScore), WebhookRemoteControl remoteControl = default(WebhookRemoteControl), WebhookVelocity velocity = default(WebhookVelocity), WebhookDeveloperTools developerTools = default(WebhookDeveloperTools), WebhookMitMAttack mitmAttack = default(WebhookMitMAttack), bool? replayed = default(bool?), SDK sdk = default(SDK), WebhookSupplementaryIDs supplementaryIds = default(WebhookSupplementaryIDs), WebhookProximity proximity = default(WebhookProximity)) - { - // to ensure "requestId" is required (not null) - // swagger debug: Webhook RequestId - - if (requestId == null) - { - throw new InvalidDataException("requestId is a required property for Webhook and cannot be null"); - } - else - { - this.RequestId = requestId; - } - // to ensure "url" is required (not null) - // swagger debug: Webhook Url - - if (url == null) - { - throw new InvalidDataException("url is a required property for Webhook and cannot be null"); - } - else - { - this.Url = url; - } - // to ensure "ip" is required (not null) - // swagger debug: Webhook Ip - - if (ip == null) - { - throw new InvalidDataException("ip is a required property for Webhook and cannot be null"); - } - else - { - this.Ip = ip; - } - // to ensure "time" is required (not null) - // swagger debug: Webhook Time - - if (time == null) - { - throw new InvalidDataException("time is a required property for Webhook and cannot be null"); - } - else - { - this.Time = time; - } - // to ensure "timestamp" is required (not null) - // swagger debug: Webhook Timestamp - - if (timestamp == null) - { - throw new InvalidDataException("timestamp is a required property for Webhook and cannot be null"); - } - else - { - this.Timestamp = timestamp; - } - // to ensure "sdk" is required (not null) - // swagger debug: Webhook Sdk - - if (sdk == null) - { - throw new InvalidDataException("sdk is a required property for Webhook and cannot be null"); - } - else - { - this.Sdk = sdk; - } - this.EnvironmentId = environmentId; - this.Tag = tag; - this.IpLocation = ipLocation; - this.LinkedId = linkedId; - this.VisitorId = visitorId; - this.VisitorFound = visitorFound; - this.Confidence = confidence; - this.FirstSeenAt = firstSeenAt; - this.LastSeenAt = lastSeenAt; - this.BrowserDetails = browserDetails; - this.Incognito = incognito; - this.ClientReferrer = clientReferrer; - this.Components = components; - this.Bot = bot; - this.UserAgent = userAgent; - this.RootApps = rootApps; - this.Emulator = emulator; - this.IpInfo = ipInfo; - this.IpBlocklist = ipBlocklist; - this.Tor = tor; - this.Vpn = vpn; - this.Proxy = proxy; - this.Tampering = tampering; - this.ClonedApp = clonedApp; - this.FactoryReset = factoryReset; - this.Jailbroken = jailbroken; - this.Frida = frida; - this.PrivacySettings = privacySettings; - this.VirtualMachine = virtualMachine; - this.RawDeviceAttributes = rawDeviceAttributes; - this.HighActivity = highActivity; - this.LocationSpoofing = locationSpoofing; - this.SuspectScore = suspectScore; - this.RemoteControl = remoteControl; - this.Velocity = velocity; - this.DeveloperTools = developerTools; - this.MitmAttack = mitmAttack; - this.Replayed = replayed; - this.SupplementaryIds = supplementaryIds; - this.Proximity = proximity; - } - - /// - /// Unique identifier of the user's request. - /// - /// Unique identifier of the user's request. - [DataMember(Name = "requestId", EmitDefaultValue = false)] - [JsonPropertyName("requestId")] - public string RequestId { get; set; } - - /// - /// Page URL from which the request was sent. - /// - /// Page URL from which the request was sent. - [DataMember(Name = "url", EmitDefaultValue = false)] - [JsonPropertyName("url")] - public string Url { get; set; } - - /// - /// IP address of the requesting browser or bot. - /// - /// IP address of the requesting browser or bot. - [DataMember(Name = "ip", EmitDefaultValue = false)] - [JsonPropertyName("ip")] - public string Ip { get; set; } - - /// - /// Environment ID of the event. - /// - /// Environment ID of the event. - [DataMember(Name = "environmentId", EmitDefaultValue = false)] - [JsonPropertyName("environmentId")] - public string EnvironmentId { get; set; } - - /// - /// Gets or Sets Tag - /// - [DataMember(Name = "tag", EmitDefaultValue = false)] - [JsonPropertyName("tag")] - public Tag Tag { get; set; } - - /// - /// Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - /// - /// Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. - [DataMember(Name = "time", EmitDefaultValue = false)] - [JsonPropertyName("time")] - public DateTime? Time { get; set; } - - /// - /// Timestamp of the event with millisecond precision in Unix time. - /// - /// Timestamp of the event with millisecond precision in Unix time. - [DataMember(Name = "timestamp", EmitDefaultValue = false)] - [JsonPropertyName("timestamp")] - public long? Timestamp { get; set; } - - /// - /// Gets or Sets IpLocation - /// - [DataMember(Name = "ipLocation", EmitDefaultValue = false)] - [JsonPropertyName("ipLocation")] - public DeprecatedGeolocation IpLocation { get; set; } - - /// - /// A customer-provided id that was sent with the request. - /// - /// A customer-provided id that was sent with the request. - [DataMember(Name = "linkedId", EmitDefaultValue = false)] - [JsonPropertyName("linkedId")] - public string LinkedId { get; set; } - - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. - /// - /// String of 20 characters that uniquely identifies the visitor's browser or mobile device. - [DataMember(Name = "visitorId", EmitDefaultValue = false)] - [JsonPropertyName("visitorId")] - public string VisitorId { get; set; } - - /// - /// Attribute represents if a visitor had been identified before. - /// - /// Attribute represents if a visitor had been identified before. - [DataMember(Name = "visitorFound", EmitDefaultValue = false)] - [JsonPropertyName("visitorFound")] - public bool? VisitorFound { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public IdentificationConfidence Confidence { get; set; } - - /// - /// Gets or Sets FirstSeenAt - /// - [DataMember(Name = "firstSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("firstSeenAt")] - public IdentificationSeenAt FirstSeenAt { get; set; } - - /// - /// Gets or Sets LastSeenAt - /// - [DataMember(Name = "lastSeenAt", EmitDefaultValue = false)] - [JsonPropertyName("lastSeenAt")] - public IdentificationSeenAt LastSeenAt { get; set; } - - /// - /// Gets or Sets BrowserDetails - /// - [DataMember(Name = "browserDetails", EmitDefaultValue = false)] - [JsonPropertyName("browserDetails")] - public BrowserDetails BrowserDetails { get; set; } - - /// - /// Flag if user used incognito session. - /// - /// Flag if user used incognito session. - [DataMember(Name = "incognito", EmitDefaultValue = false)] - [JsonPropertyName("incognito")] - public bool? Incognito { get; set; } - - /// - /// Gets or Sets ClientReferrer - /// - [DataMember(Name = "clientReferrer", EmitDefaultValue = false)] - [JsonPropertyName("clientReferrer")] - public string ClientReferrer { get; set; } - - /// - /// Gets or Sets Components - /// - [DataMember(Name = "components", EmitDefaultValue = false)] - [JsonPropertyName("components")] - public RawDeviceAttributes Components { get; set; } - - /// - /// Gets or Sets Bot - /// - [DataMember(Name = "bot", EmitDefaultValue = false)] - [JsonPropertyName("bot")] - public BotdBot Bot { get; set; } - - /// - /// Gets or Sets UserAgent - /// - [DataMember(Name = "userAgent", EmitDefaultValue = false)] - [JsonPropertyName("userAgent")] - public string UserAgent { get; set; } - - /// - /// Gets or Sets RootApps - /// - [DataMember(Name = "rootApps", EmitDefaultValue = false)] - [JsonPropertyName("rootApps")] - public WebhookRootApps RootApps { get; set; } - - /// - /// Gets or Sets Emulator - /// - [DataMember(Name = "emulator", EmitDefaultValue = false)] - [JsonPropertyName("emulator")] - public WebhookEmulator Emulator { get; set; } - - /// - /// Gets or Sets IpInfo - /// - [DataMember(Name = "ipInfo", EmitDefaultValue = false)] - [JsonPropertyName("ipInfo")] - public WebhookIPInfo IpInfo { get; set; } - - /// - /// Gets or Sets IpBlocklist - /// - [DataMember(Name = "ipBlocklist", EmitDefaultValue = false)] - [JsonPropertyName("ipBlocklist")] - public WebhookIPBlocklist IpBlocklist { get; set; } - - /// - /// Gets or Sets Tor - /// - [DataMember(Name = "tor", EmitDefaultValue = false)] - [JsonPropertyName("tor")] - public WebhookTor Tor { get; set; } - - /// - /// Gets or Sets Vpn - /// - [DataMember(Name = "vpn", EmitDefaultValue = false)] - [JsonPropertyName("vpn")] - public WebhookVPN Vpn { get; set; } - - /// - /// Gets or Sets Proxy - /// - [DataMember(Name = "proxy", EmitDefaultValue = false)] - [JsonPropertyName("proxy")] - public WebhookProxy Proxy { get; set; } - - /// - /// Gets or Sets Tampering - /// - [DataMember(Name = "tampering", EmitDefaultValue = false)] - [JsonPropertyName("tampering")] - public WebhookTampering Tampering { get; set; } - - /// - /// Gets or Sets ClonedApp - /// - [DataMember(Name = "clonedApp", EmitDefaultValue = false)] - [JsonPropertyName("clonedApp")] - public WebhookClonedApp ClonedApp { get; set; } - - /// - /// Gets or Sets FactoryReset - /// - [DataMember(Name = "factoryReset", EmitDefaultValue = false)] - [JsonPropertyName("factoryReset")] - public WebhookFactoryReset FactoryReset { get; set; } - - /// - /// Gets or Sets Jailbroken - /// - [DataMember(Name = "jailbroken", EmitDefaultValue = false)] - [JsonPropertyName("jailbroken")] - public WebhookJailbroken Jailbroken { get; set; } - - /// - /// Gets or Sets Frida - /// - [DataMember(Name = "frida", EmitDefaultValue = false)] - [JsonPropertyName("frida")] - public WebhookFrida Frida { get; set; } - - /// - /// Gets or Sets PrivacySettings - /// - [DataMember(Name = "privacySettings", EmitDefaultValue = false)] - [JsonPropertyName("privacySettings")] - public WebhookPrivacySettings PrivacySettings { get; set; } - - /// - /// Gets or Sets VirtualMachine - /// - [DataMember(Name = "virtualMachine", EmitDefaultValue = false)] - [JsonPropertyName("virtualMachine")] - public WebhookVirtualMachine VirtualMachine { get; set; } - - /// - /// Gets or Sets RawDeviceAttributes - /// - [DataMember(Name = "rawDeviceAttributes", EmitDefaultValue = false)] - [JsonPropertyName("rawDeviceAttributes")] - public WebhookRawDeviceAttributes RawDeviceAttributes { get; set; } - - /// - /// Gets or Sets HighActivity - /// - [DataMember(Name = "highActivity", EmitDefaultValue = false)] - [JsonPropertyName("highActivity")] - public WebhookHighActivity HighActivity { get; set; } - - /// - /// Gets or Sets LocationSpoofing - /// - [DataMember(Name = "locationSpoofing", EmitDefaultValue = false)] - [JsonPropertyName("locationSpoofing")] - public WebhookLocationSpoofing LocationSpoofing { get; set; } - - /// - /// Gets or Sets SuspectScore - /// - [DataMember(Name = "suspectScore", EmitDefaultValue = false)] - [JsonPropertyName("suspectScore")] - public WebhookSuspectScore SuspectScore { get; set; } - - /// - /// Gets or Sets RemoteControl - /// - [DataMember(Name = "remoteControl", EmitDefaultValue = false)] - [JsonPropertyName("remoteControl")] - public WebhookRemoteControl RemoteControl { get; set; } - - /// - /// Gets or Sets Velocity - /// - [DataMember(Name = "velocity", EmitDefaultValue = false)] - [JsonPropertyName("velocity")] - public WebhookVelocity Velocity { get; set; } - - /// - /// Gets or Sets DeveloperTools - /// - [DataMember(Name = "developerTools", EmitDefaultValue = false)] - [JsonPropertyName("developerTools")] - public WebhookDeveloperTools DeveloperTools { get; set; } - - /// - /// Gets or Sets MitmAttack - /// - [DataMember(Name = "mitmAttack", EmitDefaultValue = false)] - [JsonPropertyName("mitmAttack")] - public WebhookMitMAttack MitmAttack { get; set; } - - /// - /// `true` if we determined that this payload was replayed, `false` otherwise. - /// - /// `true` if we determined that this payload was replayed, `false` otherwise. - [DataMember(Name = "replayed", EmitDefaultValue = false)] - [JsonPropertyName("replayed")] - public bool? Replayed { get; set; } - - /// - /// Gets or Sets Sdk - /// - [DataMember(Name = "sdk", EmitDefaultValue = false)] - [JsonPropertyName("sdk")] - public SDK Sdk { get; set; } - - /// - /// Gets or Sets SupplementaryIds - /// - [DataMember(Name = "supplementaryIds", EmitDefaultValue = false)] - [JsonPropertyName("supplementaryIds")] - public WebhookSupplementaryIDs SupplementaryIds { get; set; } - - /// - /// Gets or Sets Proximity - /// - [DataMember(Name = "proximity", EmitDefaultValue = false)] - [JsonPropertyName("proximity")] - public WebhookProximity Proximity { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Webhook {\n"); - sb.Append(" RequestId: ").Append(RequestId).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); - sb.Append(" Ip: ").Append(Ip).Append("\n"); - sb.Append(" EnvironmentId: ").Append(EnvironmentId).Append("\n"); - sb.Append(" Tag: ").Append(Tag).Append("\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); - sb.Append(" IpLocation: ").Append(IpLocation).Append("\n"); - sb.Append(" LinkedId: ").Append(LinkedId).Append("\n"); - sb.Append(" VisitorId: ").Append(VisitorId).Append("\n"); - sb.Append(" VisitorFound: ").Append(VisitorFound).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" FirstSeenAt: ").Append(FirstSeenAt).Append("\n"); - sb.Append(" LastSeenAt: ").Append(LastSeenAt).Append("\n"); - sb.Append(" BrowserDetails: ").Append(BrowserDetails).Append("\n"); - sb.Append(" Incognito: ").Append(Incognito).Append("\n"); - sb.Append(" ClientReferrer: ").Append(ClientReferrer).Append("\n"); - sb.Append(" Components: ").Append(Components).Append("\n"); - sb.Append(" Bot: ").Append(Bot).Append("\n"); - sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); - sb.Append(" RootApps: ").Append(RootApps).Append("\n"); - sb.Append(" Emulator: ").Append(Emulator).Append("\n"); - sb.Append(" IpInfo: ").Append(IpInfo).Append("\n"); - sb.Append(" IpBlocklist: ").Append(IpBlocklist).Append("\n"); - sb.Append(" Tor: ").Append(Tor).Append("\n"); - sb.Append(" Vpn: ").Append(Vpn).Append("\n"); - sb.Append(" Proxy: ").Append(Proxy).Append("\n"); - sb.Append(" Tampering: ").Append(Tampering).Append("\n"); - sb.Append(" ClonedApp: ").Append(ClonedApp).Append("\n"); - sb.Append(" FactoryReset: ").Append(FactoryReset).Append("\n"); - sb.Append(" Jailbroken: ").Append(Jailbroken).Append("\n"); - sb.Append(" Frida: ").Append(Frida).Append("\n"); - sb.Append(" PrivacySettings: ").Append(PrivacySettings).Append("\n"); - sb.Append(" VirtualMachine: ").Append(VirtualMachine).Append("\n"); - sb.Append(" RawDeviceAttributes: ").Append(RawDeviceAttributes).Append("\n"); - sb.Append(" HighActivity: ").Append(HighActivity).Append("\n"); - sb.Append(" LocationSpoofing: ").Append(LocationSpoofing).Append("\n"); - sb.Append(" SuspectScore: ").Append(SuspectScore).Append("\n"); - sb.Append(" RemoteControl: ").Append(RemoteControl).Append("\n"); - sb.Append(" Velocity: ").Append(Velocity).Append("\n"); - sb.Append(" DeveloperTools: ").Append(DeveloperTools).Append("\n"); - sb.Append(" MitmAttack: ").Append(MitmAttack).Append("\n"); - sb.Append(" Replayed: ").Append(Replayed).Append("\n"); - sb.Append(" Sdk: ").Append(Sdk).Append("\n"); - sb.Append(" SupplementaryIds: ").Append(SupplementaryIds).Append("\n"); - sb.Append(" Proximity: ").Append(Proximity).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if Webhook instances are equal - /// - /// Instance of Webhook to be compared - /// Boolean - public bool Equals(Webhook? input) - { - if (input == null) - return false; - - return - ( - this.RequestId == input.RequestId || - (this.RequestId != null && - this.RequestId.Equals(input.RequestId)) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ) && - ( - this.Ip == input.Ip || - (this.Ip != null && - this.Ip.Equals(input.Ip)) - ) && - ( - this.EnvironmentId == input.EnvironmentId || - (this.EnvironmentId != null && - this.EnvironmentId.Equals(input.EnvironmentId)) - ) && - ( - this.Tag == input.Tag || - (this.Tag != null && - this.Tag.Equals(input.Tag)) - ) && - ( - this.Time == input.Time || - (this.Time != null && - this.Time.Equals(input.Time)) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ) && - ( - this.IpLocation == input.IpLocation || - (this.IpLocation != null && - this.IpLocation.Equals(input.IpLocation)) - ) && - ( - this.LinkedId == input.LinkedId || - (this.LinkedId != null && - this.LinkedId.Equals(input.LinkedId)) - ) && - ( - this.VisitorId == input.VisitorId || - (this.VisitorId != null && - this.VisitorId.Equals(input.VisitorId)) - ) && - ( - this.VisitorFound == input.VisitorFound || - (this.VisitorFound != null && - this.VisitorFound.Equals(input.VisitorFound)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.FirstSeenAt == input.FirstSeenAt || - (this.FirstSeenAt != null && - this.FirstSeenAt.Equals(input.FirstSeenAt)) - ) && - ( - this.LastSeenAt == input.LastSeenAt || - (this.LastSeenAt != null && - this.LastSeenAt.Equals(input.LastSeenAt)) - ) && - ( - this.BrowserDetails == input.BrowserDetails || - (this.BrowserDetails != null && - this.BrowserDetails.Equals(input.BrowserDetails)) - ) && - ( - this.Incognito == input.Incognito || - (this.Incognito != null && - this.Incognito.Equals(input.Incognito)) - ) && - ( - this.ClientReferrer == input.ClientReferrer || - (this.ClientReferrer != null && - this.ClientReferrer.Equals(input.ClientReferrer)) - ) && - ( - this.Components == input.Components || - (this.Components != null && - this.Components.Equals(input.Components)) - ) && - ( - this.Bot == input.Bot || - (this.Bot != null && - this.Bot.Equals(input.Bot)) - ) && - ( - this.UserAgent == input.UserAgent || - (this.UserAgent != null && - this.UserAgent.Equals(input.UserAgent)) - ) && - ( - this.RootApps == input.RootApps || - (this.RootApps != null && - this.RootApps.Equals(input.RootApps)) - ) && - ( - this.Emulator == input.Emulator || - (this.Emulator != null && - this.Emulator.Equals(input.Emulator)) - ) && - ( - this.IpInfo == input.IpInfo || - (this.IpInfo != null && - this.IpInfo.Equals(input.IpInfo)) - ) && - ( - this.IpBlocklist == input.IpBlocklist || - (this.IpBlocklist != null && - this.IpBlocklist.Equals(input.IpBlocklist)) - ) && - ( - this.Tor == input.Tor || - (this.Tor != null && - this.Tor.Equals(input.Tor)) - ) && - ( - this.Vpn == input.Vpn || - (this.Vpn != null && - this.Vpn.Equals(input.Vpn)) - ) && - ( - this.Proxy == input.Proxy || - (this.Proxy != null && - this.Proxy.Equals(input.Proxy)) - ) && - ( - this.Tampering == input.Tampering || - (this.Tampering != null && - this.Tampering.Equals(input.Tampering)) - ) && - ( - this.ClonedApp == input.ClonedApp || - (this.ClonedApp != null && - this.ClonedApp.Equals(input.ClonedApp)) - ) && - ( - this.FactoryReset == input.FactoryReset || - (this.FactoryReset != null && - this.FactoryReset.Equals(input.FactoryReset)) - ) && - ( - this.Jailbroken == input.Jailbroken || - (this.Jailbroken != null && - this.Jailbroken.Equals(input.Jailbroken)) - ) && - ( - this.Frida == input.Frida || - (this.Frida != null && - this.Frida.Equals(input.Frida)) - ) && - ( - this.PrivacySettings == input.PrivacySettings || - (this.PrivacySettings != null && - this.PrivacySettings.Equals(input.PrivacySettings)) - ) && - ( - this.VirtualMachine == input.VirtualMachine || - (this.VirtualMachine != null && - this.VirtualMachine.Equals(input.VirtualMachine)) - ) && - ( - this.RawDeviceAttributes == input.RawDeviceAttributes || - (this.RawDeviceAttributes != null && - this.RawDeviceAttributes.Equals(input.RawDeviceAttributes)) - ) && - ( - this.HighActivity == input.HighActivity || - (this.HighActivity != null && - this.HighActivity.Equals(input.HighActivity)) - ) && - ( - this.LocationSpoofing == input.LocationSpoofing || - (this.LocationSpoofing != null && - this.LocationSpoofing.Equals(input.LocationSpoofing)) - ) && - ( - this.SuspectScore == input.SuspectScore || - (this.SuspectScore != null && - this.SuspectScore.Equals(input.SuspectScore)) - ) && - ( - this.RemoteControl == input.RemoteControl || - (this.RemoteControl != null && - this.RemoteControl.Equals(input.RemoteControl)) - ) && - ( - this.Velocity == input.Velocity || - (this.Velocity != null && - this.Velocity.Equals(input.Velocity)) - ) && - ( - this.DeveloperTools == input.DeveloperTools || - (this.DeveloperTools != null && - this.DeveloperTools.Equals(input.DeveloperTools)) - ) && - ( - this.MitmAttack == input.MitmAttack || - (this.MitmAttack != null && - this.MitmAttack.Equals(input.MitmAttack)) - ) && - ( - this.Replayed == input.Replayed || - (this.Replayed != null && - this.Replayed.Equals(input.Replayed)) - ) && - ( - this.Sdk == input.Sdk || - (this.Sdk != null && - this.Sdk.Equals(input.Sdk)) - ) && - ( - this.SupplementaryIds == input.SupplementaryIds || - (this.SupplementaryIds != null && - this.SupplementaryIds.Equals(input.SupplementaryIds)) - ) && - ( - this.Proximity == input.Proximity || - (this.Proximity != null && - this.Proximity.Equals(input.Proximity)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RequestId != null) - hashCode = hashCode * 59 + this.RequestId.GetHashCode(); - if (this.Url != null) - hashCode = hashCode * 59 + this.Url.GetHashCode(); - if (this.Ip != null) - hashCode = hashCode * 59 + this.Ip.GetHashCode(); - if (this.EnvironmentId != null) - hashCode = hashCode * 59 + this.EnvironmentId.GetHashCode(); - if (this.Tag != null) - hashCode = hashCode * 59 + this.Tag.GetHashCode(); - if (this.Time != null) - hashCode = hashCode * 59 + this.Time.GetHashCode(); - if (this.Timestamp != null) - hashCode = hashCode * 59 + this.Timestamp.GetHashCode(); - if (this.IpLocation != null) - hashCode = hashCode * 59 + this.IpLocation.GetHashCode(); - if (this.LinkedId != null) - hashCode = hashCode * 59 + this.LinkedId.GetHashCode(); - if (this.VisitorId != null) - hashCode = hashCode * 59 + this.VisitorId.GetHashCode(); - if (this.VisitorFound != null) - hashCode = hashCode * 59 + this.VisitorFound.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.FirstSeenAt != null) - hashCode = hashCode * 59 + this.FirstSeenAt.GetHashCode(); - if (this.LastSeenAt != null) - hashCode = hashCode * 59 + this.LastSeenAt.GetHashCode(); - if (this.BrowserDetails != null) - hashCode = hashCode * 59 + this.BrowserDetails.GetHashCode(); - if (this.Incognito != null) - hashCode = hashCode * 59 + this.Incognito.GetHashCode(); - if (this.ClientReferrer != null) - hashCode = hashCode * 59 + this.ClientReferrer.GetHashCode(); - if (this.Components != null) - hashCode = hashCode * 59 + this.Components.GetHashCode(); - if (this.Bot != null) - hashCode = hashCode * 59 + this.Bot.GetHashCode(); - if (this.UserAgent != null) - hashCode = hashCode * 59 + this.UserAgent.GetHashCode(); - if (this.RootApps != null) - hashCode = hashCode * 59 + this.RootApps.GetHashCode(); - if (this.Emulator != null) - hashCode = hashCode * 59 + this.Emulator.GetHashCode(); - if (this.IpInfo != null) - hashCode = hashCode * 59 + this.IpInfo.GetHashCode(); - if (this.IpBlocklist != null) - hashCode = hashCode * 59 + this.IpBlocklist.GetHashCode(); - if (this.Tor != null) - hashCode = hashCode * 59 + this.Tor.GetHashCode(); - if (this.Vpn != null) - hashCode = hashCode * 59 + this.Vpn.GetHashCode(); - if (this.Proxy != null) - hashCode = hashCode * 59 + this.Proxy.GetHashCode(); - if (this.Tampering != null) - hashCode = hashCode * 59 + this.Tampering.GetHashCode(); - if (this.ClonedApp != null) - hashCode = hashCode * 59 + this.ClonedApp.GetHashCode(); - if (this.FactoryReset != null) - hashCode = hashCode * 59 + this.FactoryReset.GetHashCode(); - if (this.Jailbroken != null) - hashCode = hashCode * 59 + this.Jailbroken.GetHashCode(); - if (this.Frida != null) - hashCode = hashCode * 59 + this.Frida.GetHashCode(); - if (this.PrivacySettings != null) - hashCode = hashCode * 59 + this.PrivacySettings.GetHashCode(); - if (this.VirtualMachine != null) - hashCode = hashCode * 59 + this.VirtualMachine.GetHashCode(); - if (this.RawDeviceAttributes != null) - hashCode = hashCode * 59 + this.RawDeviceAttributes.GetHashCode(); - if (this.HighActivity != null) - hashCode = hashCode * 59 + this.HighActivity.GetHashCode(); - if (this.LocationSpoofing != null) - hashCode = hashCode * 59 + this.LocationSpoofing.GetHashCode(); - if (this.SuspectScore != null) - hashCode = hashCode * 59 + this.SuspectScore.GetHashCode(); - if (this.RemoteControl != null) - hashCode = hashCode * 59 + this.RemoteControl.GetHashCode(); - if (this.Velocity != null) - hashCode = hashCode * 59 + this.Velocity.GetHashCode(); - if (this.DeveloperTools != null) - hashCode = hashCode * 59 + this.DeveloperTools.GetHashCode(); - if (this.MitmAttack != null) - hashCode = hashCode * 59 + this.MitmAttack.GetHashCode(); - if (this.Replayed != null) - hashCode = hashCode * 59 + this.Replayed.GetHashCode(); - if (this.Sdk != null) - hashCode = hashCode * 59 + this.Sdk.GetHashCode(); - if (this.SupplementaryIds != null) - hashCode = hashCode * 59 + this.SupplementaryIds.GetHashCode(); - if (this.Proximity != null) - hashCode = hashCode * 59 + this.Proximity.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookClonedApp.cs b/src/FingerprintPro.ServerSdk/Model/WebhookClonedApp.cs deleted file mode 100644 index 90d999b..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookClonedApp.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookClonedApp - /// - [DataContract] - public class WebhookClonedApp : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. . - public WebhookClonedApp(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. - /// - /// Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookClonedApp {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookClonedApp instances are equal - /// - /// Instance of WebhookClonedApp to be compared - /// Boolean - public bool Equals(WebhookClonedApp? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookDeveloperTools.cs b/src/FingerprintPro.ServerSdk/Model/WebhookDeveloperTools.cs deleted file mode 100644 index 9d8ef02..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookDeveloperTools.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookDeveloperTools - /// - [DataContract] - public class WebhookDeveloperTools : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. . - public WebhookDeveloperTools(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. - /// - /// `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookDeveloperTools {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookDeveloperTools instances are equal - /// - /// Instance of WebhookDeveloperTools to be compared - /// Boolean - public bool Equals(WebhookDeveloperTools? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookEmulator.cs b/src/FingerprintPro.ServerSdk/Model/WebhookEmulator.cs deleted file mode 100644 index 93e8975..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookEmulator.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookEmulator - /// - [DataContract] - public class WebhookEmulator : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. . - public WebhookEmulator(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. - /// - /// Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookEmulator {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookEmulator instances are equal - /// - /// Instance of WebhookEmulator to be compared - /// Boolean - public bool Equals(WebhookEmulator? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookFactoryReset.cs b/src/FingerprintPro.ServerSdk/Model/WebhookFactoryReset.cs deleted file mode 100644 index 23b4016..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookFactoryReset.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookFactoryReset - /// - [DataContract] - public class WebhookFactoryReset : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. . - /// This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. . - public WebhookFactoryReset(DateTime? time = default(DateTime?), long? timestamp = default(long?)) - { - this.Time = time; - this.Timestamp = timestamp; - } - - /// - /// Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. - /// - /// Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. - [DataMember(Name = "time", EmitDefaultValue = false)] - [JsonPropertyName("time")] - public DateTime? Time { get; set; } - - /// - /// This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. - /// - /// This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. - [DataMember(Name = "timestamp", EmitDefaultValue = false)] - [JsonPropertyName("timestamp")] - public long? Timestamp { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookFactoryReset {\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookFactoryReset instances are equal - /// - /// Instance of WebhookFactoryReset to be compared - /// Boolean - public bool Equals(WebhookFactoryReset? input) - { - if (input == null) - return false; - - return - ( - this.Time == input.Time || - (this.Time != null && - this.Time.Equals(input.Time)) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Time != null) - hashCode = hashCode * 59 + this.Time.GetHashCode(); - if (this.Timestamp != null) - hashCode = hashCode * 59 + this.Timestamp.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookFrida.cs b/src/FingerprintPro.ServerSdk/Model/WebhookFrida.cs deleted file mode 100644 index d927087..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookFrida.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookFrida - /// - [DataContract] - public class WebhookFrida : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. . - public WebhookFrida(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. - /// - /// [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookFrida {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookFrida instances are equal - /// - /// Instance of WebhookFrida to be compared - /// Boolean - public bool Equals(WebhookFrida? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookHighActivity.cs b/src/FingerprintPro.ServerSdk/Model/WebhookHighActivity.cs deleted file mode 100644 index 0305ff5..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookHighActivity.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookHighActivity - /// - [DataContract] - public class WebhookHighActivity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Flag indicating if the request came from a high-activity visitor. (required). - /// Number of requests from the same visitor in the previous day.. - public WebhookHighActivity(bool? result = default(bool?), long? dailyRequests = default(long?)) - { - // to ensure "result" is required (not null) - // swagger debug: WebhookHighActivity Result - - if (result == null) - { - throw new InvalidDataException("result is a required property for WebhookHighActivity and cannot be null"); - } - else - { - this.Result = result; - } - this.DailyRequests = dailyRequests; - } - - /// - /// Flag indicating if the request came from a high-activity visitor. - /// - /// Flag indicating if the request came from a high-activity visitor. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Number of requests from the same visitor in the previous day. - /// - /// Number of requests from the same visitor in the previous day. - [DataMember(Name = "dailyRequests", EmitDefaultValue = false)] - [JsonPropertyName("dailyRequests")] - public long? DailyRequests { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookHighActivity {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" DailyRequests: ").Append(DailyRequests).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookHighActivity instances are equal - /// - /// Instance of WebhookHighActivity to be compared - /// Boolean - public bool Equals(WebhookHighActivity? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.DailyRequests == input.DailyRequests || - (this.DailyRequests != null && - this.DailyRequests.Equals(input.DailyRequests)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.DailyRequests != null) - hashCode = hashCode * 59 + this.DailyRequests.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookIPBlocklist.cs b/src/FingerprintPro.ServerSdk/Model/WebhookIPBlocklist.cs deleted file mode 100644 index 48c2654..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookIPBlocklist.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookIPBlocklist - /// - [DataContract] - public class WebhookIPBlocklist : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. . - /// details. - public WebhookIPBlocklist(bool? result = default(bool?), IPBlocklistDetails details = default(IPBlocklistDetails)) - { - this.Result = result; - this.Details = details; - } - - /// - /// `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. - /// - /// `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Details - /// - [DataMember(Name = "details", EmitDefaultValue = false)] - [JsonPropertyName("details")] - public IPBlocklistDetails Details { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookIPBlocklist {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookIPBlocklist instances are equal - /// - /// Instance of WebhookIPBlocklist to be compared - /// Boolean - public bool Equals(WebhookIPBlocklist? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Details == input.Details || - (this.Details != null && - this.Details.Equals(input.Details)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Details != null) - hashCode = hashCode * 59 + this.Details.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookIPInfo.cs b/src/FingerprintPro.ServerSdk/Model/WebhookIPInfo.cs deleted file mode 100644 index f95f836..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookIPInfo.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - /// - [DataContract] - public class WebhookIPInfo : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// v4. - /// v6. - public WebhookIPInfo(IPInfoV4 v4 = default(IPInfoV4), IPInfoV6 v6 = default(IPInfoV6)) - { - this.V4 = v4; - this.V6 = v6; - } - - /// - /// Gets or Sets V4 - /// - [DataMember(Name = "v4", EmitDefaultValue = false)] - [JsonPropertyName("v4")] - public IPInfoV4 V4 { get; set; } - - /// - /// Gets or Sets V6 - /// - [DataMember(Name = "v6", EmitDefaultValue = false)] - [JsonPropertyName("v6")] - public IPInfoV6 V6 { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookIPInfo {\n"); - sb.Append(" V4: ").Append(V4).Append("\n"); - sb.Append(" V6: ").Append(V6).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookIPInfo instances are equal - /// - /// Instance of WebhookIPInfo to be compared - /// Boolean - public bool Equals(WebhookIPInfo? input) - { - if (input == null) - return false; - - return - ( - this.V4 == input.V4 || - (this.V4 != null && - this.V4.Equals(input.V4)) - ) && - ( - this.V6 == input.V6 || - (this.V6 != null && - this.V6.Equals(input.V6)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.V4 != null) - hashCode = hashCode * 59 + this.V4.GetHashCode(); - if (this.V6 != null) - hashCode = hashCode * 59 + this.V6.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookJailbroken.cs b/src/FingerprintPro.ServerSdk/Model/WebhookJailbroken.cs deleted file mode 100644 index 10a730d..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookJailbroken.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookJailbroken - /// - [DataContract] - public class WebhookJailbroken : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. . - public WebhookJailbroken(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. - /// - /// iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookJailbroken {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookJailbroken instances are equal - /// - /// Instance of WebhookJailbroken to be compared - /// Boolean - public bool Equals(WebhookJailbroken? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookLocationSpoofing.cs b/src/FingerprintPro.ServerSdk/Model/WebhookLocationSpoofing.cs deleted file mode 100644 index 8e031ab..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookLocationSpoofing.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookLocationSpoofing - /// - [DataContract] - public class WebhookLocationSpoofing : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Flag indicating whether the request came from a mobile device with location spoofing enabled.. - public WebhookLocationSpoofing(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// Flag indicating whether the request came from a mobile device with location spoofing enabled. - /// - /// Flag indicating whether the request came from a mobile device with location spoofing enabled. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookLocationSpoofing {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookLocationSpoofing instances are equal - /// - /// Instance of WebhookLocationSpoofing to be compared - /// Boolean - public bool Equals(WebhookLocationSpoofing? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookMitMAttack.cs b/src/FingerprintPro.ServerSdk/Model/WebhookMitMAttack.cs deleted file mode 100644 index c5516ad..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookMitMAttack.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookMitMAttack - /// - [DataContract] - public class WebhookMitMAttack : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. . - public WebhookMitMAttack(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. - /// - /// * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookMitMAttack {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookMitMAttack instances are equal - /// - /// Instance of WebhookMitMAttack to be compared - /// Boolean - public bool Equals(WebhookMitMAttack? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookPrivacySettings.cs b/src/FingerprintPro.ServerSdk/Model/WebhookPrivacySettings.cs deleted file mode 100644 index f197211..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookPrivacySettings.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookPrivacySettings - /// - [DataContract] - public class WebhookPrivacySettings : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. . - public WebhookPrivacySettings(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. - /// - /// `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookPrivacySettings {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookPrivacySettings instances are equal - /// - /// Instance of WebhookPrivacySettings to be compared - /// Boolean - public bool Equals(WebhookPrivacySettings? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookProximity.cs b/src/FingerprintPro.ServerSdk/Model/WebhookProximity.cs deleted file mode 100644 index a700b70..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookProximity.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - /// - [DataContract] - public class WebhookProximity : IEquatable - { - /// - /// The radius of the proximity zone’s precision level, in meters. - /// - /// The radius of the proximity zone’s precision level, in meters. - public enum PrecisionRadiusEnum - { - /// - /// Enum NUMBER_10 for value: 10 - /// - - NUMBER_10 = 10, - /// - /// Enum NUMBER_25 for value: 25 - /// - - NUMBER_25 = 25, - /// - /// Enum NUMBER_65 for value: 65 - /// - - NUMBER_65 = 65, - /// - /// Enum NUMBER_175 for value: 175 - /// - - NUMBER_175 = 175, - /// - /// Enum NUMBER_450 for value: 450 - /// - - NUMBER_450 = 450, - /// - /// Enum NUMBER_1200 for value: 1200 - /// - - NUMBER_1200 = 1200, - /// - /// Enum NUMBER_3300 for value: 3300 - /// - - NUMBER_3300 = 3300, - /// - /// Enum NUMBER_8500 for value: 8500 - /// - - NUMBER_8500 = 8500, - /// - /// Enum NUMBER_22500 for value: 22500 - /// - - NUMBER_22500 = 22500 - } - /// - /// The radius of the proximity zone’s precision level, in meters. - /// - /// The radius of the proximity zone’s precision level, in meters. - [DataMember(Name = "precisionRadius", EmitDefaultValue = false)] - [JsonPropertyName("precisionRadius")] - public PrecisionRadiusEnum PrecisionRadius { get; set; } - - - /// - /// Initializes a new instance of the class. - /// - /// A stable privacy-preserving identifier for a given proximity zone. (required). - /// The radius of the proximity zone’s precision level, in meters. (required). - /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. (required). - public WebhookProximity(string id = default(string), PrecisionRadiusEnum precisionRadius = default(PrecisionRadiusEnum), float? confidence = default(float?)) - { - // to ensure "id" is required (not null) - // swagger debug: WebhookProximity Id - - if (id == null) - { - throw new InvalidDataException("id is a required property for WebhookProximity and cannot be null"); - } - else - { - this.Id = id; - } - // to ensure "precisionRadius" is required (not null) - // swagger debug: WebhookProximity PrecisionRadius - - if (precisionRadius == null) - { - throw new InvalidDataException("precisionRadius is a required property for WebhookProximity and cannot be null"); - } - else - { - this.PrecisionRadius = precisionRadius; - } - // to ensure "confidence" is required (not null) - // swagger debug: WebhookProximity Confidence - - if (confidence == null) - { - throw new InvalidDataException("confidence is a required property for WebhookProximity and cannot be null"); - } - else - { - this.Confidence = confidence; - } - } - - /// - /// A stable privacy-preserving identifier for a given proximity zone. - /// - /// A stable privacy-preserving identifier for a given proximity zone. - [DataMember(Name = "id", EmitDefaultValue = false)] - [JsonPropertyName("id")] - public string Id { get; set; } - - - /// - /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - /// - /// A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public float? Confidence { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookProximity {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PrecisionRadius: ").Append(PrecisionRadius).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookProximity instances are equal - /// - /// Instance of WebhookProximity to be compared - /// Boolean - public bool Equals(WebhookProximity? input) - { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.PrecisionRadius == input.PrecisionRadius || - (this.PrecisionRadius != null && - this.PrecisionRadius.Equals(input.PrecisionRadius)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Id != null) - hashCode = hashCode * 59 + this.Id.GetHashCode(); - if (this.PrecisionRadius != null) - hashCode = hashCode * 59 + this.PrecisionRadius.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookProxy.cs b/src/FingerprintPro.ServerSdk/Model/WebhookProxy.cs deleted file mode 100644 index 9043d8f..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookProxy.cs +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookProxy - /// - [DataContract] - public class WebhookProxy : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// IP address was used by a public proxy provider or belonged to a known recent residential proxy . - /// confidence. - /// details. - public WebhookProxy(bool? result = default(bool?), ProxyConfidence confidence = default(ProxyConfidence), ProxyDetails details = default(ProxyDetails)) - { - this.Result = result; - this.Confidence = confidence; - this.Details = details; - } - - /// - /// IP address was used by a public proxy provider or belonged to a known recent residential proxy - /// - /// IP address was used by a public proxy provider or belonged to a known recent residential proxy - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public ProxyConfidence Confidence { get; set; } - - /// - /// Gets or Sets Details - /// - [DataMember(Name = "details", EmitDefaultValue = false)] - [JsonPropertyName("details")] - public ProxyDetails Details { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookProxy {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookProxy instances are equal - /// - /// Instance of WebhookProxy to be compared - /// Boolean - public bool Equals(WebhookProxy? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.Details == input.Details || - (this.Details != null && - this.Details.Equals(input.Details)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.Details != null) - hashCode = hashCode * 59 + this.Details.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookRawDeviceAttributes.cs b/src/FingerprintPro.ServerSdk/Model/WebhookRawDeviceAttributes.cs deleted file mode 100644 index ce99a4d..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookRawDeviceAttributes.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - /// - [DataContract] - public class WebhookRawDeviceAttributes : DictionaryModel, IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - public WebhookRawDeviceAttributes() : base() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookRawDeviceAttributes {\n"); - sb.Append(" ").Append(base.ToString()!.Replace("\n", "\n ")).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookRawDeviceAttributes instances are equal - /// - /// Instance of WebhookRawDeviceAttributes to be compared - /// Boolean - public bool Equals(WebhookRawDeviceAttributes? input) - { - if (input == null) - return false; - - return base.Equals(input); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookRemoteControl.cs b/src/FingerprintPro.ServerSdk/Model/WebhookRemoteControl.cs deleted file mode 100644 index f482906..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookRemoteControl.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// This signal is deprecated. - /// - [Obsolete] - [DataContract] - public class WebhookRemoteControl : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. . - public WebhookRemoteControl(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. - /// - /// `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookRemoteControl {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookRemoteControl instances are equal - /// - /// Instance of WebhookRemoteControl to be compared - /// Boolean - public bool Equals(WebhookRemoteControl? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookRootApps.cs b/src/FingerprintPro.ServerSdk/Model/WebhookRootApps.cs deleted file mode 100644 index 5812c56..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookRootApps.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookRootApps - /// - [DataContract] - public class WebhookRootApps : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. . - public WebhookRootApps(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. - /// - /// Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookRootApps {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookRootApps instances are equal - /// - /// Instance of WebhookRootApps to be compared - /// Boolean - public bool Equals(WebhookRootApps? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookSupplementaryIDs.cs b/src/FingerprintPro.ServerSdk/Model/WebhookSupplementaryIDs.cs deleted file mode 100644 index 21df7ee..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookSupplementaryIDs.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Other identities that have been established for a given Visitor. - /// - [DataContract] - public class WebhookSupplementaryIDs : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// standard (required). - /// highRecall (required). - public WebhookSupplementaryIDs(SupplementaryID standard = default(SupplementaryID), SupplementaryID highRecall = default(SupplementaryID)) - { - // to ensure "standard" is required (not null) - // swagger debug: WebhookSupplementaryIDs Standard - - if (standard == null) - { - throw new InvalidDataException("standard is a required property for WebhookSupplementaryIDs and cannot be null"); - } - else - { - this.Standard = standard; - } - // to ensure "highRecall" is required (not null) - // swagger debug: WebhookSupplementaryIDs HighRecall - - if (highRecall == null) - { - throw new InvalidDataException("highRecall is a required property for WebhookSupplementaryIDs and cannot be null"); - } - else - { - this.HighRecall = highRecall; - } - } - - /// - /// Gets or Sets Standard - /// - [DataMember(Name = "standard", EmitDefaultValue = false)] - [JsonPropertyName("standard")] - public SupplementaryID Standard { get; set; } - - /// - /// Gets or Sets HighRecall - /// - [DataMember(Name = "highRecall", EmitDefaultValue = false)] - [JsonPropertyName("highRecall")] - public SupplementaryID HighRecall { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookSupplementaryIDs {\n"); - sb.Append(" Standard: ").Append(Standard).Append("\n"); - sb.Append(" HighRecall: ").Append(HighRecall).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookSupplementaryIDs instances are equal - /// - /// Instance of WebhookSupplementaryIDs to be compared - /// Boolean - public bool Equals(WebhookSupplementaryIDs? input) - { - if (input == null) - return false; - - return - ( - this.Standard == input.Standard || - (this.Standard != null && - this.Standard.Equals(input.Standard)) - ) && - ( - this.HighRecall == input.HighRecall || - (this.HighRecall != null && - this.HighRecall.Equals(input.HighRecall)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Standard != null) - hashCode = hashCode * 59 + this.Standard.GetHashCode(); - if (this.HighRecall != null) - hashCode = hashCode * 59 + this.HighRecall.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookSuspectScore.cs b/src/FingerprintPro.ServerSdk/Model/WebhookSuspectScore.cs deleted file mode 100644 index 057d086..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookSuspectScore.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookSuspectScore - /// - [DataContract] - public class WebhookSuspectScore : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score . - public WebhookSuspectScore(int? result = default(int?)) - { - this.Result = result; - } - - /// - /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score - /// - /// Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public int? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookSuspectScore {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookSuspectScore instances are equal - /// - /// Instance of WebhookSuspectScore to be compared - /// Boolean - public bool Equals(WebhookSuspectScore? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookTampering.cs b/src/FingerprintPro.ServerSdk/Model/WebhookTampering.cs deleted file mode 100644 index ab67dbd..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookTampering.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookTampering - /// - [DataContract] - public class WebhookTampering : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. . - /// A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. . - /// Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. . - public WebhookTampering(bool? result = default(bool?), double? anomalyScore = default(double?), bool? antiDetectBrowser = default(bool?)) - { - this.Result = result; - this.AnomalyScore = anomalyScore; - this.AntiDetectBrowser = antiDetectBrowser; - } - - /// - /// Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. - /// - /// Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. - /// - /// A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. - [DataMember(Name = "anomalyScore", EmitDefaultValue = false)] - [JsonPropertyName("anomalyScore")] - public double? AnomalyScore { get; set; } - - /// - /// Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - /// - /// Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - [DataMember(Name = "antiDetectBrowser", EmitDefaultValue = false)] - [JsonPropertyName("antiDetectBrowser")] - public bool? AntiDetectBrowser { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookTampering {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" AnomalyScore: ").Append(AnomalyScore).Append("\n"); - sb.Append(" AntiDetectBrowser: ").Append(AntiDetectBrowser).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookTampering instances are equal - /// - /// Instance of WebhookTampering to be compared - /// Boolean - public bool Equals(WebhookTampering? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.AnomalyScore == input.AnomalyScore || - (this.AnomalyScore != null && - this.AnomalyScore.Equals(input.AnomalyScore)) - ) && - ( - this.AntiDetectBrowser == input.AntiDetectBrowser || - (this.AntiDetectBrowser != null && - this.AntiDetectBrowser.Equals(input.AntiDetectBrowser)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.AnomalyScore != null) - hashCode = hashCode * 59 + this.AnomalyScore.GetHashCode(); - if (this.AntiDetectBrowser != null) - hashCode = hashCode * 59 + this.AntiDetectBrowser.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookTor.cs b/src/FingerprintPro.ServerSdk/Model/WebhookTor.cs deleted file mode 100644 index 60d164e..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookTor.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookTor - /// - [DataContract] - public class WebhookTor : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request IP address is a known tor exit node, `false` otherwise. . - public WebhookTor(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// `true` if the request IP address is a known tor exit node, `false` otherwise. - /// - /// `true` if the request IP address is a known tor exit node, `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookTor {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookTor instances are equal - /// - /// Instance of WebhookTor to be compared - /// Boolean - public bool Equals(WebhookTor? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookVPN.cs b/src/FingerprintPro.ServerSdk/Model/WebhookVPN.cs deleted file mode 100644 index 6df5b13..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookVPN.cs +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookVPN - /// - [DataContract] - public class WebhookVPN : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// VPN or other anonymizing service has been used when sending the request.. - /// confidence. - /// Local timezone which is used in timezoneMismatch method.. - /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown).. - /// methods. - public WebhookVPN(bool? result = default(bool?), VPNConfidence confidence = default(VPNConfidence), string originTimezone = default(string), string originCountry = default(string), VPNMethods methods = default(VPNMethods)) - { - this.Result = result; - this.Confidence = confidence; - this.OriginTimezone = originTimezone; - this.OriginCountry = originCountry; - this.Methods = methods; - } - - /// - /// VPN or other anonymizing service has been used when sending the request. - /// - /// VPN or other anonymizing service has been used when sending the request. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Gets or Sets Confidence - /// - [DataMember(Name = "confidence", EmitDefaultValue = false)] - [JsonPropertyName("confidence")] - public VPNConfidence Confidence { get; set; } - - /// - /// Local timezone which is used in timezoneMismatch method. - /// - /// Local timezone which is used in timezoneMismatch method. - [DataMember(Name = "originTimezone", EmitDefaultValue = false)] - [JsonPropertyName("originTimezone")] - public string OriginTimezone { get; set; } - - /// - /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). - /// - /// Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). - [DataMember(Name = "originCountry", EmitDefaultValue = false)] - [JsonPropertyName("originCountry")] - public string OriginCountry { get; set; } - - /// - /// Gets or Sets Methods - /// - [DataMember(Name = "methods", EmitDefaultValue = false)] - [JsonPropertyName("methods")] - public VPNMethods Methods { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookVPN {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Confidence: ").Append(Confidence).Append("\n"); - sb.Append(" OriginTimezone: ").Append(OriginTimezone).Append("\n"); - sb.Append(" OriginCountry: ").Append(OriginCountry).Append("\n"); - sb.Append(" Methods: ").Append(Methods).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookVPN instances are equal - /// - /// Instance of WebhookVPN to be compared - /// Boolean - public bool Equals(WebhookVPN? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ) && - ( - this.Confidence == input.Confidence || - (this.Confidence != null && - this.Confidence.Equals(input.Confidence)) - ) && - ( - this.OriginTimezone == input.OriginTimezone || - (this.OriginTimezone != null && - this.OriginTimezone.Equals(input.OriginTimezone)) - ) && - ( - this.OriginCountry == input.OriginCountry || - (this.OriginCountry != null && - this.OriginCountry.Equals(input.OriginCountry)) - ) && - ( - this.Methods == input.Methods || - (this.Methods != null && - this.Methods.Equals(input.Methods)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - if (this.Confidence != null) - hashCode = hashCode * 59 + this.Confidence.GetHashCode(); - if (this.OriginTimezone != null) - hashCode = hashCode * 59 + this.OriginTimezone.GetHashCode(); - if (this.OriginCountry != null) - hashCode = hashCode * 59 + this.OriginCountry.GetHashCode(); - if (this.Methods != null) - hashCode = hashCode * 59 + this.Methods.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookVelocity.cs b/src/FingerprintPro.ServerSdk/Model/WebhookVelocity.cs deleted file mode 100644 index b1bd594..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookVelocity.cs +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor ID. - Number of distinct linked IDs associated with the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked ID. - Number of distinct visitor IDs associated with the provided linked ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. - /// - [DataContract] - public class WebhookVelocity : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// distinctIp. - /// distinctLinkedId. - /// distinctCountry. - /// events. - /// ipEvents. - /// distinctIpByLinkedId. - /// distinctVisitorIdByLinkedId. - public WebhookVelocity(VelocityData distinctIp = default(VelocityData), VelocityData distinctLinkedId = default(VelocityData), VelocityData distinctCountry = default(VelocityData), VelocityData events = default(VelocityData), VelocityData ipEvents = default(VelocityData), VelocityData distinctIpByLinkedId = default(VelocityData), VelocityData distinctVisitorIdByLinkedId = default(VelocityData)) - { - this.DistinctIp = distinctIp; - this.DistinctLinkedId = distinctLinkedId; - this.DistinctCountry = distinctCountry; - this.Events = events; - this.IpEvents = ipEvents; - this.DistinctIpByLinkedId = distinctIpByLinkedId; - this.DistinctVisitorIdByLinkedId = distinctVisitorIdByLinkedId; - } - - /// - /// Gets or Sets DistinctIp - /// - [DataMember(Name = "distinctIp", EmitDefaultValue = false)] - [JsonPropertyName("distinctIp")] - public VelocityData DistinctIp { get; set; } - - /// - /// Gets or Sets DistinctLinkedId - /// - [DataMember(Name = "distinctLinkedId", EmitDefaultValue = false)] - [JsonPropertyName("distinctLinkedId")] - public VelocityData DistinctLinkedId { get; set; } - - /// - /// Gets or Sets DistinctCountry - /// - [DataMember(Name = "distinctCountry", EmitDefaultValue = false)] - [JsonPropertyName("distinctCountry")] - public VelocityData DistinctCountry { get; set; } - - /// - /// Gets or Sets Events - /// - [DataMember(Name = "events", EmitDefaultValue = false)] - [JsonPropertyName("events")] - public VelocityData Events { get; set; } - - /// - /// Gets or Sets IpEvents - /// - [DataMember(Name = "ipEvents", EmitDefaultValue = false)] - [JsonPropertyName("ipEvents")] - public VelocityData IpEvents { get; set; } - - /// - /// Gets or Sets DistinctIpByLinkedId - /// - [DataMember(Name = "distinctIpByLinkedId", EmitDefaultValue = false)] - [JsonPropertyName("distinctIpByLinkedId")] - public VelocityData DistinctIpByLinkedId { get; set; } - - /// - /// Gets or Sets DistinctVisitorIdByLinkedId - /// - [DataMember(Name = "distinctVisitorIdByLinkedId", EmitDefaultValue = false)] - [JsonPropertyName("distinctVisitorIdByLinkedId")] - public VelocityData DistinctVisitorIdByLinkedId { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookVelocity {\n"); - sb.Append(" DistinctIp: ").Append(DistinctIp).Append("\n"); - sb.Append(" DistinctLinkedId: ").Append(DistinctLinkedId).Append("\n"); - sb.Append(" DistinctCountry: ").Append(DistinctCountry).Append("\n"); - sb.Append(" Events: ").Append(Events).Append("\n"); - sb.Append(" IpEvents: ").Append(IpEvents).Append("\n"); - sb.Append(" DistinctIpByLinkedId: ").Append(DistinctIpByLinkedId).Append("\n"); - sb.Append(" DistinctVisitorIdByLinkedId: ").Append(DistinctVisitorIdByLinkedId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookVelocity instances are equal - /// - /// Instance of WebhookVelocity to be compared - /// Boolean - public bool Equals(WebhookVelocity? input) - { - if (input == null) - return false; - - return - ( - this.DistinctIp == input.DistinctIp || - (this.DistinctIp != null && - this.DistinctIp.Equals(input.DistinctIp)) - ) && - ( - this.DistinctLinkedId == input.DistinctLinkedId || - (this.DistinctLinkedId != null && - this.DistinctLinkedId.Equals(input.DistinctLinkedId)) - ) && - ( - this.DistinctCountry == input.DistinctCountry || - (this.DistinctCountry != null && - this.DistinctCountry.Equals(input.DistinctCountry)) - ) && - ( - this.Events == input.Events || - (this.Events != null && - this.Events.Equals(input.Events)) - ) && - ( - this.IpEvents == input.IpEvents || - (this.IpEvents != null && - this.IpEvents.Equals(input.IpEvents)) - ) && - ( - this.DistinctIpByLinkedId == input.DistinctIpByLinkedId || - (this.DistinctIpByLinkedId != null && - this.DistinctIpByLinkedId.Equals(input.DistinctIpByLinkedId)) - ) && - ( - this.DistinctVisitorIdByLinkedId == input.DistinctVisitorIdByLinkedId || - (this.DistinctVisitorIdByLinkedId != null && - this.DistinctVisitorIdByLinkedId.Equals(input.DistinctVisitorIdByLinkedId)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.DistinctIp != null) - hashCode = hashCode * 59 + this.DistinctIp.GetHashCode(); - if (this.DistinctLinkedId != null) - hashCode = hashCode * 59 + this.DistinctLinkedId.GetHashCode(); - if (this.DistinctCountry != null) - hashCode = hashCode * 59 + this.DistinctCountry.GetHashCode(); - if (this.Events != null) - hashCode = hashCode * 59 + this.Events.GetHashCode(); - if (this.IpEvents != null) - hashCode = hashCode * 59 + this.IpEvents.GetHashCode(); - if (this.DistinctIpByLinkedId != null) - hashCode = hashCode * 59 + this.DistinctIpByLinkedId.GetHashCode(); - if (this.DistinctVisitorIdByLinkedId != null) - hashCode = hashCode * 59 + this.DistinctVisitorIdByLinkedId.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/Model/WebhookVirtualMachine.cs b/src/FingerprintPro.ServerSdk/Model/WebhookVirtualMachine.cs deleted file mode 100644 index 3b97b3e..0000000 --- a/src/FingerprintPro.ServerSdk/Model/WebhookVirtualMachine.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Fingerprint Server API - * - * Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. - * - * OpenAPI spec version: 3 - * Contact: support@fingerprint.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; - -namespace FingerprintPro.ServerSdk.Model -{ - /// - /// WebhookVirtualMachine - /// - [DataContract] - public class WebhookVirtualMachine : IEquatable - { - - - /// - /// Initializes a new instance of the class. - /// - /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. . - public WebhookVirtualMachine(bool? result = default(bool?)) - { - this.Result = result; - } - - /// - /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. - /// - /// `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. - [DataMember(Name = "result", EmitDefaultValue = false)] - [JsonPropertyName("result")] - public bool? Result { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class WebhookVirtualMachine {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonUtils.Serialize(this); - } - - /// - /// Returns true if WebhookVirtualMachine instances are equal - /// - /// Instance of WebhookVirtualMachine to be compared - /// Boolean - public bool Equals(WebhookVirtualMachine? input) - { - if (input == null) - return false; - - return - ( - this.Result == input.Result || - (this.Result != null && - this.Result.Equals(input.Result)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Result != null) - hashCode = hashCode * 59 + this.Result.GetHashCode(); - return hashCode; - } - } - - } -} diff --git a/src/FingerprintPro.ServerSdk/README.md b/src/FingerprintPro.ServerSdk/README.md deleted file mode 100644 index c4384e6..0000000 --- a/src/FingerprintPro.ServerSdk/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# FingerprintPro.ServerSdk - the C#/Dotnet library for the Fingerprint Server API - -Fingerprint Server API allows you to search, update, and delete identification events in a server environment. This API can be used for data exports, decision-making, and data analysis scenarios. - - -## Getting started - -Please follow the installation guide that you can find in our [repository](https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk/) \ No newline at end of file diff --git a/src/FingerprintPro.ServerSdk/Sealed.cs b/src/FingerprintPro.ServerSdk/Sealed.cs deleted file mode 100644 index 7e159ca..0000000 --- a/src/FingerprintPro.ServerSdk/Sealed.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System.IO.Compression; -using System.Text; -using FingerprintPro.ServerSdk.Json; -using FingerprintPro.ServerSdk.Model; -using Org.BouncyCastle.Crypto.Engines; -using Org.BouncyCastle.Crypto.Modes; -using Org.BouncyCastle.Crypto.Parameters; - -namespace FingerprintPro.ServerSdk -{ - public class Sealed - { - public enum DecryptionAlgorithm - { - Aes256Gcm - } - - public class DecryptionKey - { - public byte[] Key { get; } - public DecryptionAlgorithm Algorithm { get; } - - public DecryptionKey(byte[] key, DecryptionAlgorithm algorithm) - { - Key = key; - Algorithm = algorithm; - } - } - - public class UnsealAggregateException : Exception - { - public List UnsealExceptions { get; } = new(); - - public UnsealAggregateException() : base("Failed to unseal with all decryption keys") - { - } - - public void AddUnsealException(UnsealException exception) - { - UnsealExceptions.Add(exception); - } - } - - public class InvalidSealedDataException : ArgumentException - { - public InvalidSealedDataException() : base("Invalid sealed data") - { - } - } - - public class InvalidSealedDataHeaderException : ArgumentException - { - public InvalidSealedDataHeaderException() : base("Invalid sealed data header") - { - } - } - - public class UnsealException : Exception - { - public DecryptionKey DecryptionKey { get; } - public new Exception InnerException { get; } - - public UnsealException(string message, DecryptionKey decryptionKey, Exception exception) : base(message, exception) - { - DecryptionKey = decryptionKey; - InnerException = exception; - } - } - - private static readonly byte[] SealHeader = { 0x9E, 0x85, 0xDC, 0xED }; - private const int _nonceLength = 12; - private const int _authTagLength = 16; - - public static byte[] Unseal(byte[] sealedData, DecryptionKey[] keys) - { - if (!sealedData.Take(SealHeader.Length).SequenceEqual(SealHeader)) - { - throw new InvalidSealedDataHeaderException(); - } - - var aggregateException = new UnsealAggregateException(); - - foreach (var key in keys) - { - switch (key.Algorithm) - { - case DecryptionAlgorithm.Aes256Gcm: - try - { - return DecryptAes256Gcm(sealedData.Skip(SealHeader.Length).ToArray(), key.Key); - } - catch (Exception exception) - { - aggregateException.AddUnsealException(new UnsealException("Failed to decrypt", key, exception)); - } - break; - - default: - throw new ArgumentException("Invalid decryption algorithm"); - } - } - - throw aggregateException; - } - - /// - /// Decrypts the sealed response with the provided keys. - /// - /// An decrypted instance of the EventResponse. - /// - /// The SDK will try to decrypt the result with each key until it succeeds. - /// - public static EventsGetResponse UnsealEventResponse(byte[] sealedData, DecryptionKey[] keys) - { - var unsealed = Unseal(sealedData, keys); - - var value = JsonUtils.Deserialize(Encoding.UTF8.GetString(unsealed)); - - if (value == null) - { - throw new InvalidSealedDataException(); - } - - return value; - } - - private static byte[] DecryptAes256Gcm(byte[] sealedData, byte[] key) - { - var nonce = sealedData.Take(_nonceLength).ToArray(); - var cipherText = sealedData.Skip(_nonceLength).ToArray(); - - var cipher = new GcmBlockCipher(new AesEngine()); - var parameters = new AeadParameters(new KeyParameter(key), _authTagLength * 8, nonce); - cipher.Init(false, parameters); - - var output = new byte[cipher.GetOutputSize(cipherText.Length)]; - var len = cipher.ProcessBytes(cipherText, 0, cipherText.Length, output, 0); - cipher.DoFinal(output, len); - - return Decompress(output); - } - - - private static byte[] Decompress(byte[] data) - { - using var compressedStream = new MemoryStream(data); - using var deflateStream = new DeflateStream(compressedStream, CompressionMode.Decompress); - using var resultStream = new MemoryStream(); - deflateStream.CopyTo(resultStream); - return resultStream.ToArray(); - } - } -} diff --git a/src/FingerprintPro.ServerSdk/WebhookValidation.cs b/src/FingerprintPro.ServerSdk/WebhookValidation.cs deleted file mode 100644 index b3c3767..0000000 --- a/src/FingerprintPro.ServerSdk/WebhookValidation.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Security.Cryptography; -using System.Text; - -namespace FingerprintPro.ServerSdk; - -public static class WebhookValidation -{ - private static bool IsValidHmacSignature(string signature, byte[] data, string secret) - { - using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret)); - - var computedHash = hmac.ComputeHash(data); - var computedHashHex = BitConverter.ToString(computedHash).Replace("-", "").ToLower(); - return signature == computedHashHex; - } - - /// - /// Verifies the HMAC signature extracted from the "fpjs-event-signature" header of the incoming request. This is a part of the webhook signing process, which is available only for enterprise customers. - /// If you wish to enable it, please contact our support: https://fingerprint.com/support - /// - /// - /// The value of the "fpjs-event-signature" header. - /// The raw data of the incoming request. - /// The secret key used to sign the request - public static bool IsValidSignature(string header, byte[] data, string secret) - { - var signatures = header.Split(','); - - foreach (var signature in signatures) - { - var parts = signature.Split('='); - if (parts.Length == 2) - { - var version = parts[0]; - var hash = parts[1]; - if (version == "v1" && IsValidHmacSignature(hash, data, secret)) - { - return true; - } - } - } - return false; - } -} diff --git a/sync.sh b/sync.sh index 48249fe..8968897 100644 --- a/sync.sh +++ b/sync.sh @@ -1,29 +1,33 @@ #!/bin/bash +set -euo pipefail -curl -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-compact.yaml +mkdir -p ./res + +curl -fSL -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-v4.yaml examplesList=( - 'get_visits_200_limit_1.json' - 'get_visits_200_limit_500.json' - 'get_visits_403_error.json' - 'get_visits_429_too_many_requests_error.json' - 'webhook.json' - 'get_event_200.json' - 'get_event_200_all_errors.json' - 'get_event_200_extra_fields.json' - 'get_event_403_error.json' - 'get_event_404_error.json' - 'get_event_200_botd_failed_error.json' - 'get_event_200_botd_too_many_requests_error.json' - 'get_event_200_identification_failed_error.json' - 'get_event_200_identification_too_many_requests_error.json' - 'get_event_200_identification_too_many_requests_error_all_fields.json' - 'delete_visits_400_error.json' - 'delete_visits_404_error.json' - 'delete_visits_403_error.json' - 'delete_visits_429_error.json' + 'webhook/webhook_event.json' + 'events/get_event_200.json' + 'events/search/get_event_search_200.json' + 'errors/400_ip_address_invalid.json' + 'errors/400_request_body_invalid.json' + 'errors/403_feature_not_enabled.json' + 'errors/404_visitor_not_found.json' + 'errors/404_event_not_found.json' + 'errors/409_state_not_ready.json' + 'errors/429_too_many_requests.json' ) -for example in ${examplesList[*]}; do - curl -o ./src/FingerprintPro.ServerSdk.Test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/"$example" +baseDestination="./src/Fingerprint.ServerSdk.Test/mocks" + +for example in "${examplesList[@]}"; do + destinationPath="$baseDestination/$example" + destinationDir="$(dirname "$destinationPath")" + + mkdir -p "$destinationDir" + + echo "Downloading $example to $destinationPath" + curl -fSL -o "$destinationPath" "https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/$example" done + +echo "All OpenAPI documentation downloads complete." \ No newline at end of file diff --git a/template/ApiException.mustache b/template/ApiException.mustache deleted file mode 100644 index 040d98d..0000000 --- a/template/ApiException.mustache +++ /dev/null @@ -1,50 +0,0 @@ -{{>partial_header}} - -namespace {{packageName}}.Client -{ -/// - /// API Exception - /// -{{>visibility}} class ApiException : Exception -{ -/// - /// Gets or sets the error code (HTTP status code) - /// -/// The error code (HTTP status code). -public int ErrorCode { get; set; } - -/// - /// Gets or sets the error content (body json object) - /// -/// The error content (Http response body). -public {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} ErrorContent { get; private set; } - -/// - /// Initializes a new instance of the class. - /// -public ApiException() {} - -/// - /// Initializes a new instance of the class. - /// -/// HTTP status code. -/// Error message. -public ApiException(int errorCode, string message) : base(message) -{ -this.ErrorCode = errorCode; -} - -/// - /// Initializes a new instance of the class. - /// -/// HTTP status code. -/// Error message. -/// Error content. -public ApiException(int errorCode, string message, {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} errorContent = null) : base(message) -{ -this.ErrorCode = errorCode; -this.ErrorContent = errorContent; -} -} - -} \ No newline at end of file diff --git a/template/ApiFactory.mustache b/template/ApiFactory.mustache new file mode 100644 index 0000000..acac3bc --- /dev/null +++ b/template/ApiFactory.mustache @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// An IApiFactory interface + /// + {{>visibility}} interface IApiFactory + { + /// + /// A method to create an IApi of type TResult + /// + /// + /// + TResult Create() where TResult : IApi; + } + + /// + /// An ApiFactory + /// + {{>visibility}} class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public TResult Create() where TResult : IApi + { + return Services.GetRequiredService(); + } + } +} \ No newline at end of file diff --git a/template/ClientUtils.mustache b/template/ClientUtils.mustache new file mode 100644 index 0000000..11c390d --- /dev/null +++ b/template/ClientUtils.mustache @@ -0,0 +1,396 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions;{{#useCompareNetObjects}} +using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +{{#models}} +{{#-first}} +using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} +using System.Runtime.CompilerServices; + +{{>Assembly}}namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + {{>visibility}} static {{#net70OrLater}}partial {{/net70OrLater}}class ClientUtils + { + /// + /// .NET SDK Client Version + /// + public const string ClientVersion = "{{packageVersion}}"; + + {{#useCompareNetObjects}} + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); + } + {{/useCompareNetObjects}} + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + {{#hasApiKeyMethods}} + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + {{#apiKeyMethods}} + /// + /// The {{keyParamName}} header + /// + {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{/apiKeyMethods}} + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) + { + {{#net80OrLater}} + return value switch + { + {{#apiKeyMethods}} + ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", + {{/apiKeyMethods}} + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + {{/net80OrLater}} + {{^net80OrLater}} + switch(value) + { + {{#apiKeyMethods}} + case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: + return "{{keyParamName}}"; + {{/apiKeyMethods}} + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + {{/net80OrLater}} + } + + {{/hasApiKeyMethods}} + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string{{nrt?}} ParameterToString(object{{nrt?}} obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + {{#net60OrLater}} + if (obj is DateOnly dateOnly) + return dateOnly.ToString(format); + {{/net60OrLater}} + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + {{#models}} + {{#model}} + {{#isEnum}} + if (obj is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{classname}}ValueConverter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/isEnum}} + {{^isEnum}} + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/isEnum}} + {{/vars}} + {{/isEnum}} + {{/model}} + {{/models}} + if (obj is ICollection collection) + { + List entries = new{{^net70OrLater}} List{{/net70OrLater}}(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string{{nrt?}} SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string{{nrt?}} SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + {{#net70OrLater}} + [GeneratedRegex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$")] + private static partial Regex JsonRegex(); + {{/net70OrLater}} + {{^net70OrLater}} + private static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + {{/net70OrLater}} + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return {{#net70OrLater}}JsonRegex(){{/net70OrLater}}{{^net70OrLater}}JsonRegex{{/net70OrLater}}.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string{{nrt?}} GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + + /// + /// Get base URI for the client. + /// + /// Which region to use for base URI + /// Uri for sending requests + public static Uri GetBaseUri(Region region) => region.GetBaseUri(); + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} \ No newline at end of file diff --git a/template/Configuration.mustache b/template/Configuration.mustache deleted file mode 100644 index 72831a6..0000000 --- a/template/Configuration.mustache +++ /dev/null @@ -1,323 +0,0 @@ -{{>partial_header}} -using System.Collections.Concurrent; -using System.Runtime.Serialization; -using System.Net.Http; - -namespace {{packageName}}.Client -{ - public enum Region - { - [EnumMember(Value = "eu")] - Eu, - [EnumMember(Value = "us")] - Us, - [EnumMember(Value = "asia")] - Asia - } - - /// - /// Represents a set of configuration settings - /// - public class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "{{packageVersion}}"; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Private Members - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - private IDictionary _apiKey = null; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix = null; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - /// - /// User provided API Key - public Configuration(string apiKey) - { - UserAgent = $"Swagger-Codegen/{Version}/csharp"; - BasePath = "https://api.fpjs.io"; - DefaultHeader = new ConcurrentDictionary(); - ApiKey = new ConcurrentDictionary(); - ApiKeyPrefix = new ConcurrentDictionary(); - Timeout = 100000; - - AddApiKey("api_key", apiKey); - } - - #endregion Constructors - - - #region Properties - - private string _basePath = null; - - private Region _region = Region.Us; - /// - /// Gets or sets the base path for API access. - /// - public string BasePath { get; set; } - - /// - /// Gets or sets the default header. - /// - public IDictionary DefaultHeader { get; set; } - - /// - /// Gets or sets the HTTP Client that will be used for sending requests. - /// - public HttpClient? HttpClient { get; set; } - - /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. - /// - public int Timeout { get; set; } - - /// - /// Gets or sets the API Region - /// - /// API Region - public Region Region - { - get { return _region; } - set - { - _region = value; - - BasePath = ResolveBasePathForRegion(); - } - } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - var apiKeyValue = ""; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - return apiKeyPrefix + " " + apiKeyValue; - else - return apiKeyValue; - } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// The access token. - public string AccessToken { get; set; } - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - // Possible breaking change since swagger-codegen 2.2.1, enforce a valid temporary path on set. - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - public IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - - #endregion Properties - - #region Methods - - private string ResolveBasePathForRegion() - { - switch (_region) - { - case Region.Eu: - return "https://eu.api.fpjs.io"; - - case Region.Asia: - return "https://ap.api.fpjs.io"; - - default: - return "https://api.fpjs.io"; - } - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - public void AddDefaultHeader(string key, string value) - { - DefaultHeader[key] = value; - } - - /// - /// Returns a string with essential information for debugging. - /// - public static String ToDebugReport() - { - String report = "C# SDK (FingerprintPro.ServerSdk) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: {{version}}\n"; - report += $" SDK Package Version: {Version}\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - } -} diff --git a/template/DateTimeJsonConverter.mustache b/template/DateTimeJsonConverter.mustache new file mode 100644 index 0000000..93baf2d --- /dev/null +++ b/template/DateTimeJsonConverter.mustache @@ -0,0 +1,53 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach (string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/template/DateTimeNullableJsonConverter.mustache b/template/DateTimeNullableJsonConverter.mustache new file mode 100644 index 0000000..4aecc69 --- /dev/null +++ b/template/DateTimeNullableJsonConverter.mustache @@ -0,0 +1,58 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach (string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } + } +} \ No newline at end of file diff --git a/template/DecryptionKey.md b/template/DecryptionKey.md new file mode 100644 index 0000000..d4b936e --- /dev/null +++ b/template/DecryptionKey.md @@ -0,0 +1,10 @@ +# Fingerprint.ServerSdk.Sealed.DecryptionKey + +## Properties + +| Name | Type | Description | Notes | +|---------------|------------------------------------------------------|------------------------------------------------------------------------------------|-------| +| **Key** | **byte[]** | Key generated in dashboard that will be used to decrypt sealed result | | +| **Algorithm** | **Fingerprint.ServerSdk.Sealed.DecryptionAlgorithm** | Algorithm to use for decryption. Currently only "Aes256Gcm" value is supported. | | + + diff --git a/template/DependencyInjectionTests.mustache b/template/DependencyInjectionTests.mustache new file mode 100644 index 0000000..f80c728 --- /dev/null +++ b/template/DependencyInjectionTests.mustache @@ -0,0 +1,243 @@ +{{>partial_header}} +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Linq; +using System.Net.Http.Headers; +using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Extensions; +using Xunit; + +namespace {{packageName}}.Test.{{apiPackage}} +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private const string Token = ""; + + private const string CustomUserAgentProduct = "custom-user-agent"; + private const string CustomUserAgentVersion = "1.0.0"; + + private const string CustomUserAgent = $"{CustomUserAgentProduct}/{CustomUserAgentVersion}"; + + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder([]).Configure{{apiName}}((_, _, options) => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(Token, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + var bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(Token); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder([]).Configure{{apiName}}((_, _, options) => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(Token, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + var bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(Token); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + options.Add{{apiName}}HttpClients(client => client.BaseAddress = ClientUtils.GetBaseUri(Region.Us)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder([]).ConfigureServices((_, services) => + { + services.Add{{apiName}}(options => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(Token, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + var bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(Token); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder([]).ConfigureServices((_, services) => + { + services.Add{{apiName}}(options => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(Token, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + var bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(Token); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + options.Add{{apiName}}HttpClients(client => client.BaseAddress = ClientUtils.GetBaseUri(Region.Us)); + }); + }) + .Build(); + + private readonly IHost _hostUsingDifferentUserAgent = + Host.CreateDefaultBuilder([]).ConfigureServices((_, services) => + { + services.AddApi(options => + { + options.UserAgent = CustomUserAgent; + + var bearerToken1 = new BearerToken(Token); + options.AddTokens(bearerToken1); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test custom user agent + /// + [Fact] + public void ConfigureApiWithCustomUserAgentTest() + { + var fingerprintApi = _hostUsingDifferentUserAgent.Services.GetRequiredService(); + var userAgentCollection = fingerprintApi.HttpClient.DefaultRequestHeaders.UserAgent; + Assert.Single(userAgentCollection); + var userAgent = userAgentCollection.First(); + Assert.Equal(new ProductInfoHeaderValue(CustomUserAgentProduct, CustomUserAgentVersion), userAgent); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + } +} \ No newline at end of file diff --git a/template/ExceptionFactory.mustache b/template/ExceptionFactory.mustache deleted file mode 100644 index 999098c..0000000 --- a/template/ExceptionFactory.mustache +++ /dev/null @@ -1,19 +0,0 @@ -{{>partial_header}} - -{{#netStandard}} -using RestSharp.Portable; -{{/netStandard}} -{{^netStandard}} -using RestSharp; -{{/netStandard}} - -namespace {{packageName}}.Client -{ - /// - /// A delegate to ExceptionFactory method - /// - /// Method name - /// Response - /// Exceptions - {{>visibility}} delegate Exception? ExceptionFactory(string methodName, RestResponse response); -} \ No newline at end of file diff --git a/template/GlobalConfiguration.mustache b/template/GlobalConfiguration.mustache deleted file mode 100644 index 2e1c424..0000000 --- a/template/GlobalConfiguration.mustache +++ /dev/null @@ -1,17 +0,0 @@ -{{>partial_header}} - -namespace {{packageName}}.Client -{ -/// - /// provides a compile-time extension point for globally configuring - /// API Clients. - /// -/// - /// A customized implementation via partial class may reside in another file and may - /// be excluded from automatic generation via a .swagger-codegen-ignore file. - /// -public partial class GlobalConfiguration : Configuration -{ - -} -} \ No newline at end of file diff --git a/template/HostConfiguration.mustache b/template/HostConfiguration.mustache new file mode 100644 index 0000000..d29a764 --- /dev/null +++ b/template/HostConfiguration.mustache @@ -0,0 +1,238 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using System.Net.Http.Headers; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; +{{#models}} +{{#-first}} +using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Provides hosting configuration for {{packageName}} + /// + {{>visibility}} class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new(); + + /// + /// Indicates whether at least one API token has been registered + /// + private bool TokenAdded { get; set; } + + /// + /// Indicates whether HTTP clients for the SDK have been added to the service collection. + /// + internal bool HttpClientsAdded { get; private set; } + + /// + /// The User-Agent header value sent with SDK HTTP requests. + /// Defaults to fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}. + /// + public string UserAgent { get; set; } = $"fingerprint-dotnet-sdk/{ClientUtils.ClientVersion}"; + + /// + /// The API region used to resolve the default base URL when is not provided. + /// Defaults to . + /// + public Region Region { get; set; } = Region.Us; + + /// + /// Optional absolute base URL that overrides region resolution. + /// When set, is ignored for base URL calculation. + /// + public string BaseUrl { get; set; } + + /// + /// Creates a new and registers core SDK singletons. + /// + /// Application service collection used for registration. + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + {{#supportsDateOnly}} + _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + {{/supportsDateOnly}} + {{#models}} + {{#model}} + {{#isEnum}} + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter()); + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter()); + {{/isEnum}} + {{^isEnum}} + _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); + {{/isEnum}} + {{/model}} + {{/models}} + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new{{^net60OrLater}} JsonSerializerOptionsProvider{{/net60OrLater}}(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + {{#useSourceGeneration}} + + {{#models}} + {{#-first}} + _jsonOptions.TypeInfoResolver = System.Text.Json.Serialization.Metadata.JsonTypeInfoResolver.Combine( + {{/-first}} + {{/models}} + {{#lambda.joinLinesWithComma}} + {{#models}} + {{#model}} + new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}SerializationContext(){{#-last}},{{/-last}} + {{/model}} + {{/models}} + {{/lambda.joinLinesWithComma}} + {{#models}} + {{#-last}} + + new System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver() + ); + {{/-last}} + {{/models}} + + {{/useSourceGeneration}} + _services.AddSingleton();{{#apiInfo}}{{#apis}} + _services.AddSingleton<{{classname}}Events>();{{/apis}}{{/apiInfo}} + } + + /// + /// Registers and configures the SDK instances used by . + /// Requires tokens to be added beforehand. + /// + /// Optional per-client configuration + /// Optional hook to customize the created + /// The current for chaining. + /// Thrown when no API tokens were added prior to calling this method. + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) + { + if (!TokenAdded) + { + throw new InvalidOperationException( + "No API tokens provided. Call options.AddTokens(new BearerToken(\"\")) before AddApiHttpClients." + ); + } + + if (client == null) + { + client = c => + { + c.BaseAddress = ResolveBaseUri(); + c.DefaultRequestHeaders.UserAgent.Add(ProductInfoHeaderValue.Parse(UserAgent)); + }; + } + else + { + // Override custom client's base address if it's empty. + var customClient = client; + client = c => + { + customClient(c); + if (c.BaseAddress is null) + { + c.BaseAddress = ResolveBaseUri(); + c.DefaultRequestHeaders.UserAgent.Add(ProductInfoHeaderValue.Parse(UserAgent)); + } + }; + } + + var builders = new List + { + {{#apiInfo}}{{#apis}}_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client){{^-last}},{{/-last}}{{/apis}}{{/apiInfo}} + }; + + if (builder != null) + foreach (var instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Allows customizing the JSON serialization options used by the SDK. + /// + /// A delegate that mutates the instance. + /// The current for chaining. + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds a single token to the service collection (e.g. ) + /// + /// Token base type. + /// The token instance to register. + /// The current for chaining. + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + TokenAdded = true; + return AddTokens(new[] { token }); + } + + /// + /// Adds multiple tokens to the service collection. + /// + /// Token base type. + /// A sequence of tokens to register. + /// The current for chaining. + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + var container = new TokenContainer(tokens); + _services.AddSingleton(_ => container); + + if (container.Tokens.Count > 0) + { + TokenAdded = true; + } + + return this; + } + + /// + /// Registers a token provider in the service collection. + /// + /// Provider type. + /// Token base type produced by the provider. + /// The current for chaining. + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + + /// + /// Resolves the base API URI using if provided; otherwise by . + /// + /// + /// If is non-empty, it is used directly. + /// Otherwise, the default URL for is returned. + /// + /// The resolved . + private Uri ResolveBaseUri() + { + return !string.IsNullOrWhiteSpace(BaseUrl) ? new Uri(BaseUrl) : Region.GetBaseUri(); + } + } +} \ No newline at end of file diff --git a/template/IApiAccessor.mustache b/template/IApiAccessor.mustache deleted file mode 100644 index 9455660..0000000 --- a/template/IApiAccessor.mustache +++ /dev/null @@ -1,27 +0,0 @@ -{{>partial_header}} - -namespace {{packageName}}.Client -{ -/// - /// Represents configuration aspects required to interact with the API endpoints. - /// -{{>visibility}} interface IApiAccessor -{ -/// - /// Gets or sets the configuration object - /// -/// An instance of the Configuration -Configuration Configuration {get; set;} - -/// - /// Gets the base path of the API client. - /// -/// The base path -String GetBasePath(); - -/// - /// Provides a factory method hook for the creation of exceptions. - /// -ExceptionFactory ExceptionFactory { get; set; } -} -} \ No newline at end of file diff --git a/template/IHostBuilderExtensions.mustache b/template/IHostBuilderExtensions.mustache new file mode 100644 index 0000000..4129048 --- /dev/null +++ b/template/IHostBuilderExtensions.mustache @@ -0,0 +1,55 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + {{>visibility}} static class IHostBuilderExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + } +} \ No newline at end of file diff --git a/template/IServiceCollectionExtensions.mustache b/template/IServiceCollectionExtensions.mustache new file mode 100644 index 0000000..b665a27 --- /dev/null +++ b/template/IServiceCollectionExtensions.mustache @@ -0,0 +1,69 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + {{>visibility}} static class IServiceCollectionExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static void Add{{apiName}}(this IServiceCollection services) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + Add{{apiName}}(services, config); + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static void Add{{apiName}}(this IServiceCollection services, Action options) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + options(config); + Add{{apiName}}(services, config); + } + + internal static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.Add{{apiName}}HttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach (var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} \ No newline at end of file diff --git a/template/README.client.mustache b/template/README.client.mustache new file mode 100644 index 0000000..dae45ca --- /dev/null +++ b/template/README.client.mustache @@ -0,0 +1,7 @@ +# {{packageName}} - the C#/Dotnet library for the Fingerprint Server API + +{{packageDescription}} + +## Getting started + +Please follow the installation guide that you can find in our [repository](https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/) \ No newline at end of file diff --git a/template/README.mustache b/template/README.solution.mustache similarity index 51% rename from template/README.mustache rename to template/README.solution.mustache index 3b2b99f..4ee86fe 100644 --- a/template/README.mustache +++ b/template/README.solution.mustache @@ -17,21 +17,17 @@ # Fingerprint Server API Dotnet SDK [Fingerprint](https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. -This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} - SDK version: {{packageVersion}} {{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} +- Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} - Build package: {{generatorClass}} -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} ## Requirements @@ -42,120 +38,148 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c We recommend installing the package from [NuGet](https://docs.nuget.org/consume/installing-nuget): ```shell -dotnet add package FingerprintPro.ServerSdk +dotnet add package Fingerprint.ServerSdk ``` ## Getting Started ```csharp -// See https://aka.ms/new-console-template for more information // Example usage of our SDK // Import namespaces -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; - -// Initialize configuration and add your api key -var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); - -var api = new FingerprintApi( - configuration -); - -var requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!; -var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!; - -var visits = api.GetVisits(visitorId); -var events = api.GetEvent(requestId); -var eventsFound = api.SearchEvents(20, paginationKey: "1740815825085", bot: "bad"); - -Console.WriteLine(visits); -Console.WriteLine(events); -Console.WriteLine(eventsFound); - -var tag = new Tag -{ - ["key"] = "value" -}; -var body = new EventsUpdateRequest() +using System.Net; +using System.Net.Http.Headers; +using System.Text.Json; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.Api; +using {{packageName}}.Client; +using {{packageName}}.Model; + +namespace YourProject { - Suspect = false, - Tag = tag, - LinkedId = "" -}; -api.UpdateEvent(body, requestId); -``` - -You can also access the raw HTTP response by using the `WithHttpInfo` methods: - -```csharp -// See https://aka.ms/new-console-template for more information -// Example usage of our SDK - -// Import namespaces -using FingerprintPro.ServerSdk.Api; -using FingerprintPro.ServerSdk.Client; - -// Initialize configuration and add your api key -var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); - -var api = new FingerprintApi( - configuration -); - -var requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!; -var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!; + public class Program + { + public static async Task Main(string[] args) + { + IHost host = CreateHostBuilder(args).Build(); + {{#apiInfo}} + {{#apis}} + {{#-first}} + {{interfacePrefix}}{{classname}} api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + + string eventId = Environment.GetEnvironmentVariable("EVENT_ID")!; + + // Example usage of Try method + {{interfacePrefix}}GetEventApiResponse getEventResponse = await api.GetEventAsync(eventId); + if (getEventResponse.TryOk(out Event getEvent)) { + Console.WriteLine(JsonSerializer.Serialize(getEvent)); + } -var visits = api.GetVisitsWithHttpInfo(visitorId); + // Example usage of `IsOk` property and typed response + {{interfacePrefix}}SearchEventsApiResponse searchEventsResponse = await api.SearchEventsAsync(limit: 20, paginationKey: "1740815825085", bot: "bad"); + if (searchEventsResponse.IsOk) { + EventSearch searchEvents = searchEventsResponse.Ok(); + Console.WriteLine(JsonSerializer.Serialize(searchEvents)); + } + // You can also access the raw content, headers, and status code: + // string rawContent = searchEventsResponse.RawContent; + // HttpResponseHeaders headers = searchEventsResponse.Headers; + // HttpStatusCode statusCode = searchEventsResponse.StatusCode; -// HttpResponseMessage -Console.WriteLine(visits.Response); + var tags = new Dictionary + { + ["key"] = "value" + }; + var body = new EventUpdate + { + Suspect = false, + Tags = tags, + LinkedId = "" + }; + await api.UpdateEventAsync(eventId, body); + {{/-first}} + {{/apis}} + {{/apiInfo}} + } -// Response data -Console.WriteLine(visits.Data); + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, services, options) => + { + {{#authMethods}} + {{#-first}} + BearerToken token = new(Environment.GetEnvironmentVariable("SECRET_API_KEY")!); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, BearerToken>(); + + {{/-first}} + {{/authMethods}} + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.Add{{apiName}}HttpClients(client => + { + // custom client configuration + }, builder => + { + builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)); + // add whatever middleware you prefer + } + ); + }); + } +} ``` -You can view more examples in [src/FingerprintPro.ServerSdk.Examples/Program.cs](src/FingerprintPro.ServerSdk.Examples/Program.cs). +You can view more examples in [src/Fingerprint.ServerSdk.Examples/Program.cs](src/Fingerprint.ServerSdk.Examples/Program.cs). ### Region -If your subscription is in region other than US, you need to change the region in the configuration: +If your subscription is in a region other than the US, you need to change the region when building a host: ```csharp -using FingerprintPro.ServerSdk.Client; - -var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!) -{ - Region = Region.Eu // or Region.Asia -}; +public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, services, options) => + { + // ... + options.SetRegion(Region.EU); + }); ``` ## Sealed results This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). + ```csharp -using FingerprintPro.ServerSdk; +using {{packageName}}; var sealedResult = Environment.GetEnvironmentVariable("BASE64_SEALED_RESULT")!; var sealedKey = Environment.GetEnvironmentVariable("BASE64_KEY")!; -var events = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), new[] +var event = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), new[] { new Sealed.DecryptionKey(Convert.FromBase64String(sealedKey), Sealed.DecryptionAlgorithm.Aes256Gcm) }); - -Console.WriteLine(events.ToJson()); ``` -To learn more, refer to example located in [src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs](src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs). + +To learn more, refer to example located in [src/{{packageName}}.SealedResultExample/Program.cs](src/{{packageName}}.SealedResultExample/Program.cs). ## Webhook signature validation This SDK provides utility method for verifying the HMAC signature of the incoming webhook request. + ```csharp namespace FingerprintAspNetCore.Areas.Identity.Pages; -using FingerprintPro.ServerSdk; +using {{packageName}}; using Microsoft.AspNetCore.Mvc; using System; using System.IO; @@ -206,62 +230,26 @@ public class WebhookController : ControllerBase } } } - ``` -To learn more, refer to example located in [src/FingerprintPro.ServerSdk.WebhookExample/Program.cs](src/FingerprintPro.ServerSdk.WebhookExample/Program.cs). + +To learn more, refer to example located in [src/{{packageName}}.WebhookExample/Program.cs](src/{{packageName}}.WebhookExample/Program.cs). ## Documentation for API Endpoints -All URIs are relative to *{{{basePath}}}* +All URIs are relative to *https://api.fpjs.io/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}Async**](docs/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models {{#modelPackage}} -{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} -{{/modelPackage}} -{{^modelPackage}} - No model defined in this package -{{/modelPackage}} - - -## Documentation for Authorization - -{{^authMethods}} -All endpoints do not require authorization. -{{/authMethods}} -{{#authMethods}} - {{#last}} -Authentication schemes defined for the API: - {{/last}} -{{/authMethods}} -{{#authMethods}} - -### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} - {{/isApiKey}} - {{#isBasic}}- **Type**: HTTP basic authentication - {{/isBasic}} - {{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} - {{#each scopes}} - {{@key}}: {{this}} - {{/each}} - {{/isOAuth}} - -{{/authMethods}} - +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}](docs/models/{{{classname}}}.md) +{{/model}}{{/models}}{{/modelPackage}} ## Documentation for sealed results - [Sealed](docs/Sealed.md) diff --git a/template/Region.mustache b/template/Region.mustache new file mode 100644 index 0000000..169e738 --- /dev/null +++ b/template/Region.mustache @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// TODO: Region summary + /// + public enum Region + { + /// + /// TODO: US summary + /// + Us = 1, + /// + /// TODO: EU summary + /// + Eu = 2, + /// + /// TODO: Asia summary + /// + Asia = 3, + } + + /// + /// TODO: RegionConfig summary + /// + public sealed class RegionConfig + { + /// + /// TODO: Scheme summary + /// + public string Scheme { get; } + + /// + /// TODO: Host summary + /// + public string Host { get; } + + /// + /// TODO: ContextPath summary + /// + public string ContextPath { get; } + + /// + /// TODO: RegionConfig docs + /// + /// + /// + /// + public RegionConfig(string scheme, string host, string contextPath) + { + Scheme = scheme; + Host = host; + ContextPath = contextPath; + } + + /// + /// TODO: BaseUri summary + /// + public Uri BaseUri => new Uri(Scheme + "://" + Host + ContextPath); + + /// + /// TODO: BaseAddress summary + /// + public string BaseAddress => Scheme + "://" + Host + ContextPath; + } + + /// + /// TODO: Regions summary + /// + public static class Regions + { + private const string DefaultContextPath = "/v4"; + + private static readonly IReadOnlyDictionary Map = + new Dictionary + { + [Region.Us] = new RegionConfig("https", "api.fpjs.io", DefaultContextPath), + [Region.Eu] = new RegionConfig("https", "eu.api.fpjs.io", DefaultContextPath), + [Region.Asia] = new RegionConfig("https", "ap.api.fpjs.io", DefaultContextPath), + }; + + /// + /// + /// + /// + /// + public static RegionConfig GetConfig(this Region r) => Map[r]; + + /// + /// + /// + /// + /// + public static Uri GetBaseUri(this Region r) => Map[r].BaseUri; + + /// + /// + /// + /// + /// + public static string GetHost(this Region r) => Map[r].Host; + + /// + /// + /// + /// + /// + public static string GetScheme(this Region r) => Map[r].Scheme; + + /// + /// + /// + /// + /// + public static string GetContextPath(this Region r) => Map[r].ContextPath; + + /// + /// + /// + /// + /// + /// + public static Region Parse(string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return Region.Us; + } + + switch (value.Trim().ToLowerInvariant()) + { + case "us": + case "global": + return Region.Us; + case "eu": + return Region.Eu; + case "asia": + case "ap": + return Region.Asia; + default: + throw new ArgumentException($"Unknown region: '{value}'. Allowed: us/global, eu, ap/asia."); + } + } + } +} \ No newline at end of file diff --git a/template/Sealed.md b/template/Sealed.md new file mode 100644 index 0000000..dc5f891 --- /dev/null +++ b/template/Sealed.md @@ -0,0 +1,27 @@ +# Fingerprint.ServerSdk.Sealed + +## **UnsealEventsResponse** + +> Event UnsealEventResponse(sealedData []byte, keys DecryptionKey[]) + +Decrypts the sealed response with provided keys and returns deserialized Event instance. + +### Required Parameters + +| Name | Type | Description | Notes | +|----------------|---------------------|------------------------------------------------------------------------------------------|-------| +| **sealedData** | **byte[]** | Base64 encoded sealed data | | +| **keys** | **DecryptionKey[]** | Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. | | + +## **Unseal** + +> byte[] Unseal(sealedData []byte, keys DecryptionKey[]) + +Decrypts the sealed response with provided keys and returns byte array. + +### Required Parameters + +| Name | Type | Description | Notes | +|----------------|---------------------|------------------------------------------------------------------------------------------|-------| +| **sealedData** | **byte[]** | Base64 encoded sealed data | | +| **keys** | **DecryptionKey[]** | Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. | | diff --git a/template/Sealed.mustache b/template/Sealed.mustache new file mode 100644 index 0000000..94ef2f8 --- /dev/null +++ b/template/Sealed.mustache @@ -0,0 +1,263 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{modelPackage}}; +using Org.BouncyCastle.Crypto.Engines; +using Org.BouncyCastle.Crypto.Modes; +using Org.BouncyCastle.Crypto.Parameters; + +namespace {{packageName}} +{ + /// + /// + /// + public class Sealed + { + /// + /// + /// + public enum DecryptionAlgorithm + { + /// + /// + /// + Aes256Gcm + } + + /// + /// + /// + public class DecryptionKey + { + /// + /// + /// + public byte[] Key { get; } + /// + /// + /// + public DecryptionAlgorithm Algorithm { get; } + + /// + /// + /// + /// + /// + public DecryptionKey(byte[] key, DecryptionAlgorithm algorithm) + { + Key = key; + Algorithm = algorithm; + } + } + + /// + /// + /// + public class UnsealAggregateException : Exception + { + /// + /// + /// + public List UnsealExceptions { get; } = new List(); + + /// + /// + /// + public UnsealAggregateException() : base("Failed to unseal with all decryption keys") + { + } + + /// + /// + /// + /// + public void AddUnsealException(UnsealException exception) + { + UnsealExceptions.Add(exception); + } + } + + /// + /// + /// + public class InvalidSealedDataException : ArgumentException + { + /// + /// + /// + public InvalidSealedDataException() : base("Invalid sealed data") + { + } + } + + /// + /// + /// + public class InvalidSealedDataHeaderException : ArgumentException + { + /// + /// + /// + public InvalidSealedDataHeaderException() : base("Invalid sealed data header") + { + } + } + + /// + /// + /// + public class UnsealException : Exception + { + /// + /// + /// + public DecryptionKey DecryptionKey { get; } + /// + /// + /// + public new Exception InnerException { get; } + + /// + /// + /// + /// + /// + /// + public UnsealException(string message, DecryptionKey decryptionKey, Exception exception) : base(message, exception) + { + DecryptionKey = decryptionKey; + InnerException = exception; + } + } + + private static readonly byte[] SealHeader = { 0x9E, 0x85, 0xDC, 0xED }; + private const int NonceLength = 12; + private const int AuthTagLength = 16; + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static byte[] Unseal(byte[] sealedData, DecryptionKey[] keys) + { + if (!sealedData.Take(SealHeader.Length).SequenceEqual(SealHeader)) + { + throw new InvalidSealedDataHeaderException(); + } + + var aggregateException = new UnsealAggregateException(); + + foreach (var key in keys) + { + switch (key.Algorithm) + { + case DecryptionAlgorithm.Aes256Gcm: + try + { + return DecryptAes256Gcm(sealedData.Skip(SealHeader.Length).ToArray(), key.Key); + } + catch (Exception exception) + { + aggregateException.AddUnsealException(new UnsealException("Failed to decrypt", key, exception)); + } + break; + + default: + throw new ArgumentException("Invalid decryption algorithm"); + } + } + + throw aggregateException; + } + + /// + /// Decrypts the sealed response with the provided keys. + /// + /// An decrypted instance of the EventResponse. + /// + /// The SDK will try to decrypt the result with each key until it succeeds. + /// + public static Event UnsealEventResponse(byte[] sealedData, DecryptionKey[] keys) + { + var unsealed = Unseal(sealedData, keys); + + var json = Encoding.UTF8.GetString(unsealed); + var value = JsonSerializer.Deserialize(json, GetJsonSerializerOptions()); + + if (value == null) + { + throw new InvalidSealedDataException(); + } + + return value; + } + + private static byte[] DecryptAes256Gcm(byte[] sealedData, byte[] key) + { + var nonce = sealedData.Take(NonceLength).ToArray(); + var cipherText = sealedData.Skip(NonceLength).ToArray(); + + var cipher = new GcmBlockCipher(new AesEngine()); + var parameters = new AeadParameters(new KeyParameter(key), AuthTagLength * 8, nonce); + cipher.Init(false, parameters); + + var output = new byte[cipher.GetOutputSize(cipherText.Length)]; + var len = cipher.ProcessBytes(cipherText, 0, cipherText.Length, output, 0); + cipher.DoFinal(output, len); + + return Decompress(output); + } + + + private static byte[] Decompress(byte[] data) + { + using (var compressedStream = new MemoryStream(data)) + { + using (var deflateStream = new DeflateStream(compressedStream, CompressionMode.Decompress)) + { + using (var resultStream = new MemoryStream()) + { + deflateStream.CopyTo(resultStream); + return resultStream.ToArray(); + } + } + } + } + + private static JsonSerializerOptions GetJsonSerializerOptions() + { + var jsonOptions = new JsonSerializerOptions(); + jsonOptions.Converters.Add(new JsonStringEnumConverter()); + jsonOptions.Converters.Add(new DateTimeJsonConverter()); + jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + {{#supportsDateOnly}} + jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + {{/supportsDateOnly}} + {{#models}} + {{#model}} + {{#isEnum}} + jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter()); + jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter()); + {{/isEnum}} + {{^isEnum}} + jsonOptions.Converters.Add(new {{classname}}JsonConverter()); + {{/isEnum}} + {{/model}} + {{/models}} + + return jsonOptions; + } + } +} \ No newline at end of file diff --git a/template/Solution.mustache b/template/Solution.mustache new file mode 100644 index 0000000..6c6d59d --- /dev/null +++ b/template/Solution.mustache @@ -0,0 +1,57 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio {{^netStandard}}2012{{/netStandard}}{{#netStandard}}14{{/netStandard}} +VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14.0.25420.1{{/netStandard}} +MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{=<% %>=}}{<%packageGuid%>}<%={{ }}=%>" +EndProject +{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "{{sourceFolder}}\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +{{/excludeTests}} +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}.Examples", "src\{{packageName}}.Examples\{{packageName}}.Examples.csproj", "{7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}.FunctionalTest", "src\{{packageName}}.FunctionalTest\{{packageName}}.FunctionalTest.csproj", "{60A3F0A3-764A-43CA-9BDD-E2A727F86347}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}.SealedResultExample", "src\{{packageName}}.SealedResultExample\{{packageName}}.SealedResultExample.csproj", "{68302477-4772-4F13-B569-54881B84F6B4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}.WebhookExample", "src\{{packageName}}.WebhookExample\{{packageName}}.WebhookExample.csproj", "{F95774AB-BC02-45AE-8916-0EFF0689E89F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution{{=<% %>=}} + {<%packageGuid%>}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {<%packageGuid%>}.Debug|Any CPU.Build.0 = Debug|Any CPU + {<%packageGuid%>}.Release|Any CPU.ActiveCfg = Release|Any CPU + {<%packageGuid%>}.Release|Any CPU.Build.0 = Release|Any CPU<%={{ }}=%> + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FBC349E-CE18-4668-BC36-8DF98F9F5E3C}.Release|Any CPU.Build.0 = Release|Any CPU + {60A3F0A3-764A-43CA-9BDD-E2A727F86347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60A3F0A3-764A-43CA-9BDD-E2A727F86347}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60A3F0A3-764A-43CA-9BDD-E2A727F86347}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60A3F0A3-764A-43CA-9BDD-E2A727F86347}.Release|Any CPU.Build.0 = Release|Any CPU + {68302477-4772-4F13-B569-54881B84F6B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68302477-4772-4F13-B569-54881B84F6B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68302477-4772-4F13-B569-54881B84F6B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68302477-4772-4F13-B569-54881B84F6B4}.Release|Any CPU.Build.0 = Release|Any CPU + {F95774AB-BC02-45AE-8916-0EFF0689E89F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F95774AB-BC02-45AE-8916-0EFF0689E89F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F95774AB-BC02-45AE-8916-0EFF0689E89F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F95774AB-BC02-45AE-8916-0EFF0689E89F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + Policies = $0 + $0.DotNetNamingPolicy = $1 + $1.DirectoryNamespaceAssociation = PrefixedHierarchical + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/template/WebhookValidation.md b/template/WebhookValidation.md new file mode 100644 index 0000000..ac4664b --- /dev/null +++ b/template/WebhookValidation.md @@ -0,0 +1,17 @@ +# Fingerprint.ServerSdk.WebhookValidation + +## **IsValidSignature** + +> bool IsValidSignature(string header, byte[] data, string secret) + +Verifies the HMAC signature extracted from the "fpjs-event-signature" header of the incoming request. This is a part of +the webhook signing process, which is available only for enterprise customers. +If you wish to enable it, please contact our support: https://fingerprint.com/support + +### Required Parameters + +| Name | Type | Description | Notes | +|------------|--------------|-------------------------------------------------|-------| +| **header** | **string** | The value of the "fpjs-event-signature" header. | | +| **data** | **byte[]** | The raw data of the incoming request. | | +| **secret** | **string[]** | The secret key used to sign the request | | \ No newline at end of file diff --git a/template/WebhookValidation.mustache b/template/WebhookValidation.mustache new file mode 100644 index 0000000..5247458 --- /dev/null +++ b/template/WebhookValidation.mustache @@ -0,0 +1,82 @@ +using System; +using System.Security.Cryptography; +using System.Text; + +namespace {{packageName}} +{ + /// + /// Provides helpers for validating Fingerprint webhook requests. + /// + /// + /// Fingerprint webhooks can be signed with an HMAC and delivered with the + /// fpjs-event-signature header. This utility validates that header + /// against your shared secret. Signing is available to enterprise customers. + /// For enablement, contact Fingerprint Support. + /// + /// The current implementation supports the v1 scheme using HMAC-SHA256 + /// over the raw request body. + /// + /// + public static class WebhookValidation + { + /// + /// Computes an HMAC-SHA256 of the given using the provided + /// and compares the computed digest (hex, lowercase) with + /// the expected . + /// + /// The expected HMAC digest, hex-encoded in lowercase (no prefix). + /// The raw request payload bytes used to compute the HMAC. + /// The shared secret used to derive the HMAC key. + /// + /// if the computed HMAC digest equals ; + /// otherwise, . + /// + /// + /// This method performs a standard ordinal equality check. If you need to mitigate timing + /// attacks, consider replacing the equality comparison with a constant-time comparison. + /// + private static bool IsValidHmacSignature(string signature, byte[] data, string secret) + { + using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret))) + { + var computedHash = hmac.ComputeHash(data); + var computedHashHex = BitConverter.ToString(computedHash).Replace("-", "").ToLower(); + return signature == computedHashHex; + } + } + + /// + /// Verifies the HMAC signature extracted from the fpjs-event-signature header of the incoming request. + /// This is part of the webhook signing process, which is available only for enterprise customers. + /// + /// The full value of the fpjs-event-signature header (may contain multiple comma-separated entries). + /// The raw request body bytes used to compute and verify the HMAC. + /// The shared secret used to sign and verify the request. + /// + /// if the header contains a valid v1 signature for ; + /// otherwise, . + /// + /// + /// The header can contain multiple scheme/value pairs (e.g., v1=<hex>,v2=<hex>). + /// This method currently validates only the v1 entry using HMAC-SHA256 over the raw body. + /// + public static bool IsValidSignature(string header, byte[] data, string secret) + { + var signatures = header.Split(','); + + foreach (var signature in signatures) + { + var parts = signature.Split('='); + if (parts.Length != 2) + continue; + var version = parts[0]; + var hash = parts[1]; + if (version == "v1" && IsValidHmacSignature(hash, data, secret)) + { + return true; + } + } + return false; + } + } +} \ No newline at end of file diff --git a/template/api.mustache b/template/api.mustache index b6b3d14..047e450 100644 --- a/template/api.mustache +++ b/template/api.mustache @@ -1,94 +1,835 @@ {{>partial_header}} -using {{packageName}}.Client; -{{#hasImport}}using {{packageName}}.{{modelPackage}}; + +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections.Generic; +{{#net80OrLater}} +{{#lambda.uniqueLines}} +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-set-cookie}} +using System.Linq; +{{/vendorExtensions.x-set-cookie}} +{{/operation}} +{{/operations}} +{{/lambda.uniqueLines}} +{{/net80OrLater}} +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using {{packageName}}.{{clientPackage}}; +{{#hasImport}} +using {{packageName}}.{{modelPackage}}; {{/hasImport}} +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} namespace {{packageName}}.{{apiPackage}} { -{{#operations}} + {{#operations}} /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApi { + /// + /// The class containing the events + /// + {{classname}}Events Events { get; } + + {{#operation}} + /// + /// {{{summary}}} + /// + /// + /// {{{notes}}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + {{#allParams}} + /// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <{{nrt?}}> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); + {{^-last}} - #region Synchronous Operations + {{/-last}} + {{/operation}} + } {{#operation}} - {{#contents}} - /// - /// {{summary}} - /// - /// - /// {{{notes}}} - /// - /// Thrown when fails to make API call - {{#parameters}}/// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/parameters}}/// {{#returnType}}{{returnType}}{{/returnType}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#parameters}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null!{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); + {{^vendorExtensions.x-duplicates}} + {{#responses}} + {{#-first}} - /// - /// {{summary}} - /// - /// - /// {{{notes}}} - /// - /// Thrown when fails to make API call - {{#parameters}}/// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/parameters}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#parameters}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null!{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); - {{/contents}} + /// + /// The + /// + {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + { + {{#responses}} + {{#vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is the default response type + /// + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^-last}} + + {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} + {{/vendorExtensions.x-duplicates}} {{/operation}} - #endregion Synchronous Operations - {{#supportsAsync}} - #region Asynchronous Operations + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} class {{classname}}Events + { + {{#lambda.trimTrailingWithNewLine}} {{#operation}} - {{#contents}} - /// - /// {{summary}} - /// - /// - /// {{{notes}}} - /// - /// Thrown when fails to make API call - {{#parameters}}/// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/parameters}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{operationId}}Async ({{#parameters}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null!{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); - - /// - /// {{summary}}e - /// - /// - /// {{{notes}}} - /// - /// Thrown when fails to make API call - {{#parameters}}/// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/parameters}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - Task> {{operationId}}AsyncWithHttpInfo ({{#parameters}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null!{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); - {{/contents}} + /// + /// The event raised after the server response + /// + public event EventHandler{{nrt?}} On{{operationId}}; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler{{nrt?}} OnError{{operationId}}; + + internal void ExecuteOn{{operationId}}({{#vendorExtensions.x-duplicates}}{{.}}{{/vendorExtensions.x-duplicates}}{{^vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}.{{operationId}}ApiResponse apiResponse) + { + On{{operationId}}?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnError{{operationId}}(Exception exception) + { + OnError{{operationId}}?.Invoke(this, new ExceptionEventArgs(exception)); + } + {{/operation}} - #endregion Asynchronous Operations - {{/supportsAsync}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} sealed partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger<{{classname}}> Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public {{classname}}Events Events { get; }{{#hasApiKeyMethods}} + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; }{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + + {{#net80OrLater}} + {{#lambda.unique}} + {{#operation}} + {{#vendorExtensions.x-set-cookie}} + /// + /// The token cookie container + /// + public {{packageName}}.{{clientPackage}}.CookieContainer CookieContainer { get; } + + {{/vendorExtensions.x-set-cookie}} + {{/operation}} + {{/lambda.unique}} + {{/net80OrLater}} + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, + TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger<{{classname}}>(); + HttpClient = httpClient; + Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} + ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}} + CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}} } + {{#operation}} + {{#allParams}} + {{#-first}} + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - {{#operation}} - internal class {{nickname}}Definition: OperationDefinition { - public override string Path => "{{path}}"; + {{/-first}} + {{/allParams}} + {{#vendorExtensions.x-has-not-nullable-reference-types}} + /// + /// Validates the request parameters + /// + {{#vendorExtensions.x-not-nullable-reference-types}} + /// + {{/vendorExtensions.x-not-nullable-reference-types}} + /// + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + { + {{#lambda.trimTrailingWithNewLine}} + {{#vendorExtensions.x-not-nullable-reference-types}} + {{#required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}} == null) + throw new ArgumentNullException(nameof({{paramName}})); - public override string OperationName => "{{nickname}}"; + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{^required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}}.IsSet && {{paramName}}.Value == null) + throw new ArgumentNullException(nameof({{paramName}})); - public override string[] PathParams => {{#pathParams}} new[] {"{{baseName}}", } {{/pathParams}} {{^pathParams}}Array.Empty(){{/pathParams}}; + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{/vendorExtensions.x-not-nullable-reference-types}} + {{/lambda.trimTrailingWithNewLine}} + } - public override Dictionary ResponseStatusCodeMap => new() + {{/vendorExtensions.x-has-not-nullable-reference-types}} + /// + /// Processes the server response + /// + /// + {{#allParams}} + /// + {{/allParams}} + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + { + bool suppressDefaultLog = false; + After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>AfterOperationDefaultImplementation}} + } + + /// + /// Processes the server response + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + { + bool suppressDefaultLogLocalVar = false; + OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>OnErrorDefaultImplementation}} + + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + + /// + /// {{summary}} {{notes}} + /// + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) + { + try { - {{#responses}}{{#dataType}} + return await {{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// {{{summary}}} + /// + /// + /// {{{notes}}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{{description}}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) + { + {{#lambda.trimLineBreaks}} + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + {{#vendorExtensions.x-has-not-nullable-reference-types}} + Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}); + + {{/vendorExtensions.x-has-not-nullable-reference-types}} + {{#allParams}} + {{#-first}} + Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{/-first}} + {{/allParams}} + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - {{code}}, typeof({{dataType}}) - }, - {{/dataType}}{{/responses}} - }; + {{^servers}} + uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "{{{path}}}" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "{{{path}}}"); + {{/servers}} + {{#servers}} + {{#-first}} + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("{{url}}"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + {{/-first}} + {{/servers}} + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString(ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}))); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString())); + {{#-last}} + + {{/-last}} + {{/pathParams}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + parseQueryStringLocalVar["ii"] = $"fingerprint-pro-server-api-dotnet-sdk/{ClientUtils.ClientVersion}"; + + {{#queryParams}} + {{#required}} + {{#-first}} + + {{/-first}} + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}); + {{/required}} + {{/queryParams}} + + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{^required}} + if ({{paramName}}.IsSet) + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); + + {{/required}} + {{/queryParams}} + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); + + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#-first}} + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} + + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); + + {{/required}} + {{/isFile}} + {{#isFile}} + {{#required}} + multipartContentLocalVar.Add(new StreamContent({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + multipartContentLocalVar.Add(new StreamContent({{paramName}}.Value)); + + {{/required}} + {{/isFile}} + {{/formParams}} + {{#bodyParam}} + {{#required}} + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + + {{/bodyParam}} + {{#authMethods}} + {{#-first}} + List tokenBaseLocalVars = new List(); + {{/-first}} + {{#isApiKey}} + {{^isKeyInCookie}} + ApiKeyToken apiKeyTokenLocalVar{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}}); + {{#isKeyInHeader}} + apiKeyTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar); + + {{/isKeyInHeader}} + {{/isKeyInCookie}} + {{#isKeyInQuery}} + + apiKeyTokenLocalVar{{-index}}.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + {{#authMethods}} + {{#isBasicBasic}} + + BasicToken basicTokenLocalVar{{-index}} = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar{{-index}}); + + basicTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBasic}} + {{#isBasicBearer}} + + BearerToken bearerTokenLocalVar{{-index}} = await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar{{-index}}); + + bearerTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBearer}} + {{#isOAuth}} + + OAuthToken oauthTokenLocalVar{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar{{-index}}); + + oauthTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isOAuth}} + {{#isHttpSignature}} + + HttpSignatureToken httpSignatureTokenLocalVar{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar{{-index}}); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + + httpSignatureTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + {{/isHttpSignature}} + {{/authMethods}} + {{#consumes}} + {{#-first}} + + {{=<% %>=}} + string[] contentTypes = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/consumes}} + {{#consumes}} + {{#-first}} + + string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + {{/-first}} + {{/consumes}} + {{#produces}} + {{#-first}} + + {{=<% %>=}} + string[] acceptLocalVars = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/produces}} + {{#produces}} + {{#-first}} + + string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + {{/-first}} + {{/produces}} + {{#net60OrLater}} + + httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + {{/net60OrLater}} + {{^net60OrLater}} + httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); + {{/net60OrLater}} + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); + {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) + { + {{#responses}} + {{#isBinary}} + case ({{code}}): + {{/isBinary}} + {{/responses}} + {{#responses}} + {{#isBinary}} + {{#-first}} + { + byte[] responseBytesArrayLocalVar = await httpResponseMessageLocalVar.Content.ReadAsByteArrayAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + System.IO.Stream responseContentStreamLocalVar = new System.IO.MemoryStream(responseBytesArrayLocalVar); + apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentStreamLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + {{/-first}} + {{/isBinary}} + {{/responses}} + default: + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } + + After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + + Events.ExecuteOn{{operationId}}(apiResponseLocalVar); + + {{#authMethods}} + {{#-first}} + if (apiResponseLocalVar.StatusCode == (HttpStatusCode)429) + foreach (TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + {{/-first}} + {{/authMethods}} + {{#net80OrLater}} + {{#responses}} + {{#vendorExtensions.x-set-cookie}} + if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar)) + { + foreach(string cookieHeader in cookieHeadersLocalVar) + { + IList setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray()); + + foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar) + { + Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString()) + { + HttpOnly = setCookieHeaderValueLocalVar.HttpOnly + }; + + if (setCookieHeaderValueLocalVar.Expires.HasValue) + cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime; + + if (setCookieHeaderValueLocalVar.Path.HasValue) + cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value; + + if (setCookieHeaderValueLocalVar.Domain.HasValue) + cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value; + + CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar); + } + } + } + + {{/vendorExtensions.x-set-cookie}} + {{/responses}} + {{/net80OrLater}} + return apiResponseLocalVar; + } + } + } + catch (Exception e) + { + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + Events.ExecuteOnError{{operationId}}(e); + throw; + } + {{/lambda.trimLineBreaks}} } - {{/operation}} + {{^vendorExtensions.x-duplicates}} + {{#responses}} + {{#-first}} -{{/operations}} + /// + /// The + /// + {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + { + /// + /// The logger + /// + public ILogger<{{operationId}}ApiResponse> Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + {{#responses}} + + {{#vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is the default response type + /// + /// + public bool Is{{vendorExtensions.x-http-status}} => {{#vendorExtensions.x-only-default}}true{{/vendorExtensions.x-only-default}}{{^vendorExtensions.x-only-default}}{{#lambda.joinConditions}}{{#responses}}{{^vendorExtensions.x-http-status-is-default}}!Is{{vendorExtensions.x-http-status}} {{/vendorExtensions.x-http-status-is-default}}{{/responses}}{{/lambda.joinConditions}}{{/vendorExtensions.x-only-default}}; + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + {{#vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} + { + get + { + int statusCode = (int)StatusCode; + return {{vendorExtensions.x-http-status-range}}00 >= statusCode && {{vendorExtensions.x-http-status-range}}99 <= statusCode; + } + } + {{/vendorExtensions.x-http-status-range}} + {{^vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} => {{code}} == (int)StatusCode; + {{/vendorExtensions.x-http-status-range}} + {{/vendorExtensions.x-http-status-is-default}} + {{#dataType}} + + /// + /// Deserializes the response if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>AsModel}}{{! prevent indent}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null + /// + /// + /// + public bool Try{{vendorExtensions.x-http-status}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) + { + result = null; + + try + { + result = {{vendorExtensions.x-http-status}}(); + } + catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); + } + + return result != null; + } + {{/dataType}} + {{#-last}} + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>OnDeserializationError}}{{! prevent indent}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} + {{/vendorExtensions.x-duplicates}} + {{/operation}} } + {{/operations}} +} diff --git a/template/api_doc.mustache b/template/api_doc.mustache index 875b007..e87373a 100644 --- a/template/api_doc.mustache +++ b/template/api_doc.mustache @@ -1,29 +1,82 @@ # {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/operation}}{{/operations}} +| Method | HTTP request | Description | +|--------|--------------|-------------| +{{#operations}} +{{#operation}} +| [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}} +{{/operations}} {{#operations}} {{#operation}} -{{#contents}} -{{#@first}} - + # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#parameters}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) +> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} +{{#useGenericHost}} ### Example ```csharp -using System; using System.Diagnostics; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.Extensions; +using {{packageName}}.{{modelPackage}}; + +namespace {{operationId}}Example +{ + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}I{{{operationId}}}ApiResponse result = {{/returnType}}await api.{{{operationId}}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result.Ok());{{/returnType}} + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((_, _, options) => + { + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBearer}} + BearerToken token = new("YOUR_API_KEY"); + options.AddTokens(token); + {{/isBasicBearer}} + {{/authMethods}} + {{/hasAuthMethods}} + }); +} +``` +{{/useGenericHost}}{{^useGenericHost}} +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} using {{packageName}}.{{apiPackage}}; using {{packageName}}.Client; using {{packageName}}.{{modelPackage}}; @@ -32,58 +85,128 @@ namespace Example { public class {{operationId}}Example { - public void main() + public static void Main() { - var configuration = new Configuration("YOUR_API_KEY"); - var apiInstance = new {{classname}}(configuration); - {{#parameters}} + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} {{#isPrimitiveType}} var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} {{/isPrimitiveType}} {{^isPrimitiveType}} var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} {{/isPrimitiveType}} - {{/parameters}} + {{/allParams}} try { {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#parameters}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); } } } } ``` +#### Using the {{operationId}}WithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}ApiResponse<{{{.}}}> response = {{/returnType}}apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data);{{/returnType}} +} +catch (ApiException e) +{ + Debug.Print("Exception when calling {{classname}}.{{operationId}}WithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` +{{/useGenericHost}} + ### Parameters -{{^parameters}}This endpoint does not need any parameter.{{/parameters}}{{#parameters}}{{#@last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/@last}}{{/parameters}} -{{#parameters}} **{{paramName}}** | {{#isBinary}}**{{dataType}}**{{/isBinary}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isBinary}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isBinary}}{{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} -{{/parameters}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------|------|-------------|-------| +{{/-last}} +{{/allParams}} +{{#allParams}} +| **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | +{{/allParams}} ### Return type -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} ### Authorization -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^@last}}, {{/@last}}{{/authMethods}} +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} ### HTTP request headers - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[Back to top]](#) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) -[[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) -{{/@first}} -{{/contents}} {{/operation}} {{/operations}} diff --git a/template/enumClass.mustache b/template/enumClass.mustache deleted file mode 100644 index e8569ae..0000000 --- a/template/enumClass.mustache +++ /dev/null @@ -1,17 +0,0 @@ - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// - {{#description}} - /// {{{description}}} - {{/description}} - [JsonConverter(typeof(JsonStringEnumConverter))] - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} - { - {{#allowableValues}}{{#enumVars}} - /// - /// Enum {{name}} for {{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}} - /// - [EnumMember(Value = {{#value}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}}{{/value}}{{^value}}null{{/value}})] - {{name}} {{#value}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^isInteger}} = {{@index}}{{/isInteger}}{{/value}}{{^value}}null{{/value}}{{^@last}}, - {{/@last}}{{/enumVars}}{{/allowableValues}} - } diff --git a/template/model.mustache b/template/model.mustache deleted file mode 100644 index b43c94a..0000000 --- a/template/model.mustache +++ /dev/null @@ -1,28 +0,0 @@ -{{>partial_header}} -using System.Text; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using System.Text.Json; -using FingerprintPro.ServerSdk.Json; -{{#models}} - {{#model}} - {{#discriminator}} - using JsonSubTypes; - {{/discriminator}} - {{/model}} -{{/models}} -{{^netStandard}} - {{#generatePropertyChanged}} - using PropertyChanged; - using System.ComponentModel; - {{/generatePropertyChanged}} -{{/netStandard}} - -{{#models}} - {{#model}} - namespace {{packageName}}.{{modelPackage}} - { - {{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}} - {{/model}} -{{/models}} -} diff --git a/template/modelEnum.mustache b/template/modelEnum.mustache deleted file mode 100644 index 584ad55..0000000 --- a/template/modelEnum.mustache +++ /dev/null @@ -1,19 +0,0 @@ - /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// - {{#description}} - /// {{{description}}} - {{/description}} - {{#allowableValues}}{{#enumVars}}{{#@first}}{{#isString}} - [JsonConverter(typeof(JsonStringEnumConverter))] - {{/isString}}{{/@first}}{{/enumVars}}{{/allowableValues}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} - { - {{#allowableValues}}{{#enumVars}} - /// - /// Enum {{name}} for value: {{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}} - /// - {{#isString}}[EnumMember(Value = {{#value}}"{{{value}}}"{{/value}}{{^value}}null{{/value}})]{{/isString}} - {{name}}{{^isString}} = {{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}}{{/isString}}{{#isString}} = {{@index_1}}{{/isString}}{{^@last}}, - {{/@last}}{{/enumVars}}{{/allowableValues}} - }{{! NOTE: This model's enumVars is modified to look like CodegenProperty}} diff --git a/template/modelGeneric.mustache b/template/modelGeneric.mustache deleted file mode 100644 index 7ce5939..0000000 --- a/template/modelGeneric.mustache +++ /dev/null @@ -1,227 +0,0 @@ -/// - /// {{#description}}{{{.}}}{{/description}}{{^description}}{{classname}}{{/description}} - /// {{#schema.deprecated}} -[Obsolete]{{/schema.deprecated}} -[DataContract] -{{#discriminator}} - [JsonConverter(typeof(JsonSubtypes), "{{discriminator.propertyName}}")]{{#children}} - [JsonSubtypes.KnownSubType(typeof({{classname}}), "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}")]{{/children}} -{{/discriminator}} -{{#generatePropertyChanged}} - [ImplementPropertyChanged] -{{/generatePropertyChanged}} -{{>visibility}} class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{/netStandard}} -{ -{{#vars}} - {{#items.isEnum}} - {{#items}} - {{^complexType}} - {{>modelInnerEnum}} - {{/complexType}} - {{/items}} - {{/items.isEnum}} - {{#isEnum}} - {{^complexType}} - {{>modelInnerEnum}} - {{/complexType}} - {{/isEnum}} - {{#isEnum}} - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// - {{#description}} - /// {{{description}}} - {{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] - [JsonPropertyName("{{baseName}}")] - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - {{/isEnum}} -{{/vars}} - - -{{#hasRequired}} - {{^hasOnlyReadOnly}} - /// - /// Initializes a new instance of the class. - /// - [JsonConstructor] - protected {{classname}}() { } - {{/hasOnlyReadOnly}} -{{/hasRequired}} -/// - /// Initializes a new instance of the class. - /// -{{#vars}} - {{^isReadOnly}} - /// {{#description}}{{{description}}}{{/description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. - {{/isReadOnly}} -{{/vars}} -{{#hasOnlyReadOnly}} - [JsonConstructor] -{{/hasOnlyReadOnly}} -public {{classname}}({{#readWriteVars}}{{#datatypeWithEnum}}{{/datatypeWithEnum}}{{{datatypeWithEnum}}}{{^datatypeWithEnum}}JsonElement?{{/datatypeWithEnum}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}{{#datatypeWithEnum}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/datatypeWithEnum}}{{/defaultValue}}{{^datatypeWithEnum}}null{{/datatypeWithEnum}}{{^@last}}, {{/@last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#hasMore}}, {{/hasMore}}{{/parentVars}}){{/parent}} -{ -{{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{#required}} - {{^nullable}} - // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - // swagger debug: {{classname}} {{name}} - - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - { - throw new InvalidDataException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); - } - else - { - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - } - {{/nullable}} - {{#nullable}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/nullable}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} -{{/vars}} -{{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{^required}} - {{#defaultValue}}// use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - { - this.{{name}} = {{{defaultValue}}}; - } - else - { - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - } - {{/defaultValue}} - {{^defaultValue}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/defaultValue}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} -{{/vars}} -} - -{{#vars}} - {{^isInherited}} - {{^isEnum}} - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// {{#description}} - /// {{{description}}}{{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] - [JsonPropertyName("{{baseName}}")]{{#isDate}} - [JsonConverter(typeof(SwaggerDateConverter))]{{/isDate}} - public {{#datatype}}{{{datatype}}}{{/datatype}}{{^datatype}}JsonElement?{{/datatype}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - {{/isEnum}} - {{/isInherited}} - -{{/vars}} -/// - /// Returns the string presentation of the object - /// -/// String presentation of the object -public override string ToString() -{ -var sb = new StringBuilder(); -sb.Append("class {{classname}} {\n"); -{{#parent}} - sb.Append(" ").Append(base.ToString()!.Replace("\n", "\n ")).Append("\n"); -{{/parent}} -{{#vars}} - sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); -{{/vars}} -sb.Append("}\n"); -return sb.ToString(); -} - -/// - /// Returns the JSON string presentation of the object - /// -/// JSON string presentation of the object -public {{#parent}}{{^isArrayModel}}override {{/isArrayModel}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() -{ -return JsonUtils.Serialize(this); -} - -/// - /// Returns true if {{classname}} instances are equal - /// -/// Instance of {{classname}} to be compared -/// Boolean -public bool Equals({{classname}}? input) -{ -if (input == null) -return false; - -return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{#isNotContainer}} - {{#datatype}}( - this.{{name}} == input.{{name}} || - (this.{{name}} != null && - this.{{name}}.Equals(input.{{name}})) - ){{/datatype}}{{^datatype}}( - this.{{name}}.HasValue == input.{{name}}.HasValue && - (!this.{{name}}.HasValue || - this.{{name}}.Value.Equals(input.{{name}}.Value)) - ){{/datatype}}{{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{^isNotContainer}} - ( - this.{{name}} == input.{{name}} || - this.{{name}} != null && - input.{{name}} != null && - this.{{name}}.SequenceEqual(input.{{name}}) - ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}; -} - -/// - /// Gets the hash code - /// -/// Hash code -public override int GetHashCode() -{ -unchecked // Overflow is fine, just wrap -{ -{{#parent}} - int hashCode = base.GetHashCode(); -{{/parent}} -{{^parent}} - int hashCode = 41; -{{/parent}} -{{#vars}} - if ({{#datatype}}this.{{name}} != null{{/datatype}}{{^datatype}}this.{{name}}.HasValue{{/datatype}}) - hashCode = hashCode * 59 + this.{{name}}{{^datatype}}.Value{{/datatype}}.GetHashCode(); -{{/vars}} -return hashCode; -} -} -{{^netStandard}} - - {{#generatePropertyChanged}} - /// - /// Property changed event handler - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Trigger when a property changed - /// - /// Property Name - public virtual void OnPropertyChanged(string propertyName) - { - // NOTE: property changed is handled via "code weaving" using Fody. - // Properties with setters are modified at compile time to notify of changes. - var propertyChanged = PropertyChanged; - if (propertyChanged != null) - { - propertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - {{/generatePropertyChanged}} -{{/netStandard}} - } diff --git a/template/modelInnerEnum.mustache b/template/modelInnerEnum.mustache deleted file mode 100644 index 26d6206..0000000 --- a/template/modelInnerEnum.mustache +++ /dev/null @@ -1,21 +0,0 @@ - {{^isContainer}} - /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// - {{#description}} - /// {{{description}}} - {{/description}} - {{#isString}} - [JsonConverter(typeof(JsonStringEnumConverter))] - {{/isString}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} - { - {{#allowableValues}}{{#enumVars}} - /// - /// Enum {{name}} for value: {{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}} - /// - {{#isString}}[EnumMember(Value = {{#value}}"{{{value}}}"{{/value}}{{^value}}null{{/value}})]{{/isString}} - {{name}}{{^isString}} = {{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}}{{/isString}}{{#isString}} = {{@index_1}}{{/isString}}{{^@last}}, - {{/@last}}{{/enumVars}}{{/allowableValues}} - } - {{/isContainer}} diff --git a/template/model_doc.mustache b/template/model_doc.mustache index e26df16..4455deb 100644 --- a/template/model_doc.mustache +++ b/template/model_doc.mustache @@ -3,22 +3,23 @@ # {{{packageName}}}.{{modelPackage}}.{{{classname}}} {{#unescapedDescription}} {{{.}}} - {{/unescapedDescription}} -{{^emptyVars}}## Properties +{{#hasVars}} + +## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#parent}} {{#parentVars}} -**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/parentVars}} {{/parent}} -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) -{{/emptyVars}} +{{/hasVars}} {{/model}} -{{/models}} +{{/models}} \ No newline at end of file diff --git a/template/netcore_project.additions.mustache b/template/netcore_project.additions.mustache new file mode 100644 index 0000000..6489274 --- /dev/null +++ b/template/netcore_project.additions.mustache @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/template/netcore_project.mustache b/template/netcore_project.mustache new file mode 100644 index 0000000..c823b30 --- /dev/null +++ b/template/netcore_project.mustache @@ -0,0 +1,90 @@ + + + {{#useGenericHost}} + {{packageName}}{{#packageTags}} + {{{.}}}{{/packageTags}} + {{packageVersion}} + {{packageAuthors}} + {{packageCompany}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}} + {{packageProjectUrl}} + true + {{packageReadmeFile}} + {{packageLicenseFile}} + {{packageIcon}} + {{targetFramework}}{{#nrt}} + {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + 10.0 + {{packageName}} + Library + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + {{packageName}} + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{.}}{{/licenseId}} + git{{#releaseNote}} + {{.}}{{/releaseNote}} + false + true{{/useGenericHost}}{{^useGenericHost}} + false{{/useGenericHost}} + + + + {{#useCompareNetObjects}} + + {{/useCompareNetObjects}} + {{^useGenericHost}} + + + {{/useGenericHost}} + {{#useRestSharp}} + + {{/useRestSharp}} + {{#useGenericHost}} + + + {{#supportsRetry}} + + {{/supportsRetry}} + {{#net80OrLater}} + + {{/net80OrLater}} + {{^net60OrLater}} + + {{#net47OrLater}} + + {{/net47OrLater}} + {{/net60OrLater}} + {{/useGenericHost}} + {{^useGenericHost}} + {{#supportsRetry}} + + {{/supportsRetry}} + {{/useGenericHost}} + {{#validatable}} + {{^net60OrLater}} + + {{/net60OrLater}} + {{/validatable}} + + +{{^useGenericHost}} + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + +{{/useGenericHost}} +{{>netcore_project.additions}} \ No newline at end of file diff --git a/template/netcore_testproject.additions.mustache b/template/netcore_testproject.additions.mustache new file mode 100644 index 0000000..fb15b44 --- /dev/null +++ b/template/netcore_testproject.additions.mustache @@ -0,0 +1,6 @@ + + + + PreserveNewest + + diff --git a/template/netcore_testproject.mustache b/template/netcore_testproject.mustache new file mode 100644 index 0000000..3c3892b --- /dev/null +++ b/template/netcore_testproject.mustache @@ -0,0 +1,20 @@ + + + + {{testPackageName}} + {{testPackageName}} + {{testTargetFramework}} + false{{#nrt}} + {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + + + + + + + + + + + +{{>netcore_testproject.additions}} diff --git a/template/partial_header.mustache b/template/partial_header.mustache new file mode 100644 index 0000000..dcdee0f --- /dev/null +++ b/template/partial_header.mustache @@ -0,0 +1,17 @@ +/* + {{#appName}} + * {{{.}}} + * + {{/appName}} + {{#packageDescription}} + * {{{.}}} + * + {{/packageDescription}} + {{#version}} + * The version of the OpenAPI document: {{{.}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{.}}} + {{/infoEmail}} + * Generated by: https://github.com/openapitools/openapi-generator.git + */ \ No newline at end of file