diff --git a/CLAUDE.md b/CLAUDE.md index f046683d69..58e9bb3a1f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,12 +2,26 @@ This is a customized fork of the mitmproxy project, maintained by a company name is used to man-in-the-middle connections to provide debugging info, allow for security research and other uses. -Browserup uses the mitmproxy to capture traffic from within containers that are run during a load test. -This captured traffic, through mitmproxy addons, is used to build a HAR (HTTP Archive) file. The HAR -file is made available via an API. The API is also used to control the proxy, and to add custom metrics -to a har at runtime, as well as adding verifications for HAR content. Clients for -this API are generated in multiple languages via the open api specification. The clients live in /clients -which should be ignored, as they are generated files. - -Browserup extends mitmproxy's mitmdump executable with addons -The most important code for browserup live in mitmproxy/addons/browserup +The Browserup proxy fork uses a variation of the mitmproxy's "mitmdump" (no UI) mode to capture traffic from within containers that are run during a load test. +This captured traffic, captured through mitmproxy addons, is +used to build a HAR (HTTP Archive) file. The HAR file is made available via an API. The HAR also gets decorated with custom data, which start with an underscore. + +The proxy offers an API that is also used to control the proxy, and to add custom metrics to a har at runtime, as well as adding verifications for HAR +content. Clients for this API are generated in multiple languages via the open api specification. The clients live in /clients which should be ignored, as +they are generated files. + +Unusually, the schema .json files are regenerated when the tests are run. The definitions of the schemas are in mitmproxy/addons/browserup/har/har_schemas.py. +They are defined in marshmallow. + +The command to run the tests is: tox -e py + +The command to check the linting, which we should do after all changes are done is: +tox -e lint + + +The BrowserUp proxy extends mitmproxy's mitmdump executable with addons. The most important code for browserup lives in the subfolder mitmproxy/addons/browserup. +It is implemented almost entirely by changes and additions to addons. It is undesirable to change files outside of this path, and the corresponding test path, as that +makes it difficult to take merges from the upstream mitmproxy project. + +It is also ok to change items in the subfolder mitmproxy/tools/browserup_proxy.py as new +addons are added. This is where they are loaded. diff --git a/browserup-proxy.schema.json b/browserup-proxy.schema.json index 2a73b8df5d..4751174ba8 100644 --- a/browserup-proxy.schema.json +++ b/browserup-proxy.schema.json @@ -25,7 +25,7 @@ "url": "logo.png" }, "title": "BrowserUp MitmProxy", - "version": "1.24" + "version": "1.25" }, "paths": { "/har": { @@ -387,52 +387,60 @@ "type": "object", "properties": { "onContentLoad": { - "type": "number", + "type": "integer", "description": "onContentLoad per the browser" }, "onLoad": { - "type": "number", + "type": "integer", "description": "onLoad per the browser" }, "_firstInputDelay": { - "type": "number", + "type": "integer", "description": "firstInputDelay from the browser" }, "_firstPaint": { - "type": "number", + "type": "integer", "description": "firstPaint from the browser" }, "_cumulativeLayoutShift": { - "type": "number", + "type": "integer", "description": "cumulativeLayoutShift metric from the browser" }, "_largestContentfulPaint": { - "type": "number", + "type": "integer", "description": "largestContentfulPaint from the browser" }, "_domInteractive": { - "type": "number", + "type": "integer", "description": "domInteractive from the browser" }, "_firstContentfulPaint": { - "type": "number", + "type": "integer", "description": "firstContentfulPaint from the browser" }, "_dns": { - "type": "number", + "type": "integer", "description": "dns lookup time from the browser" }, "_ssl": { - "type": "number", + "type": "integer", "description": "Ssl connect time from the browser" }, "_timeToFirstByte": { - "type": "number", + "type": "integer", "description": "Time to first byte of the page's first request per the browser" }, "_href": { "type": "string", "description": "Top level href, including hashtag, etc per the browser" + }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this page" + }, + "_parent_id": { + "type": "string", + "description": "W3C Trace Context parent span ID (typically the HAR log span ID)" } } }, @@ -602,7 +610,7 @@ "description": "Name of Custom Metric to add to the page under _metrics" }, "value": { - "type": "number", + "type": "integer", "format": "double", "description": "Value for the metric" } @@ -856,6 +864,14 @@ "$ref": "#/components/schemas/HarEntry" } }, + "_trace_id": { + "type": "string", + "description": "W3C Trace Context trace ID for distributed tracing" + }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this HAR trace root" + }, "comment": { "type": "string" } @@ -1314,6 +1330,18 @@ "$ref": "#/components/schemas/WebSocketMessage" } }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this entry" + }, + "_parent_id": { + "type": "string", + "description": "W3C Trace Context parent span ID (typically the page span ID)" + }, + "_trace_id": { + "type": "string", + "description": "W3C Trace Context trace ID for distributed tracing" + }, "connection": { "type": "string" }, @@ -1367,6 +1395,14 @@ }, "default": [] }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this page" + }, + "_parent_id": { + "type": "string", + "description": "W3C Trace Context parent span ID (typically the HAR log span ID)" + }, "pageTimings": { "$ref": "#/components/schemas/PageTimings" }, diff --git a/clients/build-clients.sh b/clients/build-clients.sh index f0a638b260..bdc7e0497b 100755 --- a/clients/build-clients.sh +++ b/clients/build-clients.sh @@ -1,38 +1,53 @@ #!/bin/bash -# requires openapi-generator installed +# requires openapi-generator installed and accessible in your PATH DIR="$(dirname "${BASH_SOURCE[0]}")" - -# we need to regenerate the schema in the top level dir - -rm -rf markdown && npx openapi-generator-cli generate \ --g markdown -i "${DIR}/../browserup-proxy.schema.json" \ --o markdown - -rm -rf csharp && npx openapi-generator-cli generate \ ---package-name BrowserUpMitmProxyClient \ --g csharp-netcore -i "${DIR}/../browserup-proxy.schema.json" \ --o csharp -c config-csharp.yaml - -rm -rf java && npx openapi-generator-cli generate \ ---package-name BrowserUpMitmProxyClient \ --g java -i "${DIR}/../browserup-proxy.schema.json" \ --o java -c config-java.yaml - -rm -rf javascript && npx openapi-generator-cli generate \ ---package-name BrowserUpMitmProxyClient \ --g javascript -i "${DIR}/../browserup-proxy.schema.json" \ --o javascript -c config-javascript.yaml - -rm -rf python && npx openapi-generator-cli generate \ ---package-name BrowserUpMitmProxyClient \ --g python -i "${DIR}/../browserup-proxy.schema.json" \ --o python -c config-python.yaml - -rm -rf ruby && npx openapi-generator-cli generate \ ---package-name BrowserUpMitmProxyClient \ --g ruby -i "${DIR}/../browserup-proxy.schema.json" \ --o ruby -c config-ruby.yaml +SCHEMA="${DIR}/../browserup-proxy.schema.json" + +# Generate Markdown documentation +rm -rf markdown && openapi-generator generate \ + -g markdown -i "${SCHEMA}" \ + -o markdown + +# Generate C# (.NET Core) client +rm -rf csharp && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g csharp -i "${SCHEMA}" \ + -o csharp -c config-csharp.yaml + +# Generate Java client +rm -rf java && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g java -i "${SCHEMA}" \ + -o java -c config-java.yaml + +# Generate JavaScript client +rm -rf javascript && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g javascript -i "${SCHEMA}" \ + -o javascript -c config-javascript.yaml + +# Generate Python client +rm -rf python && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g python -i "${SCHEMA}" \ + -o python -c config-python.yaml + +# Generate Ruby client +rm -rf ruby && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g ruby -i "${SCHEMA}" \ + -o ruby -c config-ruby.yaml + +rm -rf ruby && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g ruby -i "${SCHEMA}" \ + -o ruby -c config-ruby.yaml + +rm -rf go && openapi-generator generate \ + --package-name BrowserUpMitmProxyClient \ + -g go -i "${SCHEMA}" \ + -o go -c config-go.yaml ./post-build-java-client.sh diff --git a/clients/config-go.yaml b/clients/config-go.yaml new file mode 100644 index 0000000000..0b578ab707 --- /dev/null +++ b/clients/config-go.yaml @@ -0,0 +1,14 @@ +# Config file for OpenAPI Generator Go client + +# The package name for the generated code. +# In Go, package names should be all lower case without special characters. +packageName: browserupmitmproxyclient + +# (Optional) Module name for the Go module (go.mod). +moduleName: BrowserUpMitmProxyClient + +# Project metadata +projectName: browserup-mitmproxy-client +projectVersion: 1.0.0 +projectDescription: "REST client for the BrowserUp Proxy" +licenseName: MIT diff --git a/clients/config-python.yaml b/clients/config-python.yaml index d6d6ec34f5..e5bcbe6961 100644 --- a/clients/config-python.yaml +++ b/clients/config-python.yaml @@ -6,7 +6,8 @@ infoName: BrowserUp, Inc. packageVersion: "1.0.1" packageUrl: https://github.com/browserup/mitmproxy - + +enablePostProcessFile: true templateDir: python-overlay files: diff --git a/clients/csharp/.gitignore b/clients/csharp/.gitignore deleted file mode 100644 index 1ee53850b8..0000000000 --- a/clients/csharp/.gitignore +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/clients/csharp/.openapi-generator/FILES b/clients/csharp/.openapi-generator/FILES deleted file mode 100644 index 1b241c1408..0000000000 --- a/clients/csharp/.openapi-generator/FILES +++ /dev/null @@ -1,112 +0,0 @@ -.gitignore -.openapi-generator-ignore -BrowserUpMitmProxyClient.sln -README.md -appveyor.yml -docs/Action.md -docs/BrowserUpProxyApi.md -docs/Error.md -docs/Har.md -docs/HarEntry.md -docs/HarEntryCache.md -docs/HarEntryCacheBeforeRequest.md -docs/HarEntryCacheBeforeRequestOneOf.md -docs/HarEntryRequest.md -docs/HarEntryRequestCookiesInner.md -docs/HarEntryRequestPostData.md -docs/HarEntryRequestPostDataParamsInner.md -docs/HarEntryRequestQueryStringInner.md -docs/HarEntryResponse.md -docs/HarEntryResponseContent.md -docs/HarEntryTimings.md -docs/HarLog.md -docs/HarLogCreator.md -docs/Header.md -docs/LargestContentfulPaint.md -docs/MatchCriteria.md -docs/MatchCriteriaRequestHeader.md -docs/Metric.md -docs/NameValuePair.md -docs/Page.md -docs/PageTiming.md -docs/PageTimings.md -docs/VerifyResult.md -docs/WebSocketMessage.md -git_push.sh -src/BrowserUpMitmProxyClient.Test/Api/BrowserUpProxyApiTests.cs -src/BrowserUpMitmProxyClient.Test/BrowserUpMitmProxyClient.Test.csproj -src/BrowserUpMitmProxyClient.Test/Model/ActionTests.cs -src/BrowserUpMitmProxyClient.Test/Model/ErrorTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestOneOfTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestCookiesInnerTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataParamsInnerTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestQueryStringInnerTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseContentTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarEntryTimingsTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarLogCreatorTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarLogTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HarTests.cs -src/BrowserUpMitmProxyClient.Test/Model/HeaderTests.cs -src/BrowserUpMitmProxyClient.Test/Model/LargestContentfulPaintTests.cs -src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaRequestHeaderTests.cs -src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaTests.cs -src/BrowserUpMitmProxyClient.Test/Model/MetricTests.cs -src/BrowserUpMitmProxyClient.Test/Model/NameValuePairTests.cs -src/BrowserUpMitmProxyClient.Test/Model/PageTests.cs -src/BrowserUpMitmProxyClient.Test/Model/PageTimingTests.cs -src/BrowserUpMitmProxyClient.Test/Model/PageTimingsTests.cs -src/BrowserUpMitmProxyClient.Test/Model/VerifyResultTests.cs -src/BrowserUpMitmProxyClient.Test/Model/WebSocketMessageTests.cs -src/BrowserUpMitmProxyClient/Api/BrowserUpProxyApi.cs -src/BrowserUpMitmProxyClient/BrowserUpMitmProxyClient.csproj -src/BrowserUpMitmProxyClient/Client/ApiClient.cs -src/BrowserUpMitmProxyClient/Client/ApiException.cs -src/BrowserUpMitmProxyClient/Client/ApiResponse.cs -src/BrowserUpMitmProxyClient/Client/ClientUtils.cs -src/BrowserUpMitmProxyClient/Client/Configuration.cs -src/BrowserUpMitmProxyClient/Client/ExceptionFactory.cs -src/BrowserUpMitmProxyClient/Client/GlobalConfiguration.cs -src/BrowserUpMitmProxyClient/Client/HttpMethod.cs -src/BrowserUpMitmProxyClient/Client/IApiAccessor.cs -src/BrowserUpMitmProxyClient/Client/IAsynchronousClient.cs -src/BrowserUpMitmProxyClient/Client/IReadableConfiguration.cs -src/BrowserUpMitmProxyClient/Client/ISynchronousClient.cs -src/BrowserUpMitmProxyClient/Client/Multimap.cs -src/BrowserUpMitmProxyClient/Client/OpenAPIDateConverter.cs -src/BrowserUpMitmProxyClient/Client/RequestOptions.cs -src/BrowserUpMitmProxyClient/Client/RetryConfiguration.cs -src/BrowserUpMitmProxyClient/Model/AbstractOpenAPISchema.cs -src/BrowserUpMitmProxyClient/Model/Action.cs -src/BrowserUpMitmProxyClient/Model/Error.cs -src/BrowserUpMitmProxyClient/Model/Har.cs -src/BrowserUpMitmProxyClient/Model/HarEntry.cs -src/BrowserUpMitmProxyClient/Model/HarEntryCache.cs -src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequest.cs -src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequestOneOf.cs -src/BrowserUpMitmProxyClient/Model/HarEntryRequest.cs -src/BrowserUpMitmProxyClient/Model/HarEntryRequestCookiesInner.cs -src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostData.cs -src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostDataParamsInner.cs -src/BrowserUpMitmProxyClient/Model/HarEntryRequestQueryStringInner.cs -src/BrowserUpMitmProxyClient/Model/HarEntryResponse.cs -src/BrowserUpMitmProxyClient/Model/HarEntryResponseContent.cs -src/BrowserUpMitmProxyClient/Model/HarEntryTimings.cs -src/BrowserUpMitmProxyClient/Model/HarLog.cs -src/BrowserUpMitmProxyClient/Model/HarLogCreator.cs -src/BrowserUpMitmProxyClient/Model/Header.cs -src/BrowserUpMitmProxyClient/Model/LargestContentfulPaint.cs -src/BrowserUpMitmProxyClient/Model/MatchCriteria.cs -src/BrowserUpMitmProxyClient/Model/MatchCriteriaRequestHeader.cs -src/BrowserUpMitmProxyClient/Model/Metric.cs -src/BrowserUpMitmProxyClient/Model/NameValuePair.cs -src/BrowserUpMitmProxyClient/Model/Page.cs -src/BrowserUpMitmProxyClient/Model/PageTiming.cs -src/BrowserUpMitmProxyClient/Model/PageTimings.cs -src/BrowserUpMitmProxyClient/Model/VerifyResult.cs -src/BrowserUpMitmProxyClient/Model/WebSocketMessage.cs diff --git a/clients/csharp/.openapi-generator/VERSION b/clients/csharp/.openapi-generator/VERSION deleted file mode 100644 index c0be8a7992..0000000000 --- a/clients/csharp/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.4.0 \ No newline at end of file diff --git a/clients/csharp/BrowserUpMitmProxyClient.sln b/clients/csharp/BrowserUpMitmProxyClient.sln deleted file mode 100644 index a3e7e37975..0000000000 --- a/clients/csharp/BrowserUpMitmProxyClient.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -VisualStudioVersion = 12.0.0.0 -MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserUpMitmProxyClient", "src\BrowserUpMitmProxyClient\BrowserUpMitmProxyClient.csproj", "{979682E2-30D9-4EB9-A593-E1494EA7C849}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserUpMitmProxyClient.Test", "src\BrowserUpMitmProxyClient.Test\BrowserUpMitmProxyClient.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {979682E2-30D9-4EB9-A593-E1494EA7C849}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {979682E2-30D9-4EB9-A593-E1494EA7C849}.Debug|Any CPU.Build.0 = Debug|Any CPU - {979682E2-30D9-4EB9-A593-E1494EA7C849}.Release|Any CPU.ActiveCfg = Release|Any CPU - {979682E2-30D9-4EB9-A593-E1494EA7C849}.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 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal \ No newline at end of file diff --git a/clients/csharp/README.md b/clients/csharp/README.md deleted file mode 100644 index ec1a1b7c1d..0000000000 --- a/clients/csharp/README.md +++ /dev/null @@ -1,167 +0,0 @@ -# BrowserUpMitmProxyClient - the C# library for the BrowserUp MitmProxy - -___ -This is the REST API for controlling the BrowserUp MitmProxy. -The BrowserUp MitmProxy is a swiss army knife for automated testing that -captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. -___ - - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.24 -- SDK version: 1.0.0 -- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen - - -## Frameworks supported - - -## Dependencies - -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later -- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later -- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later - -The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: -``` -Install-Package RestSharp -Install-Package Newtonsoft.Json -Install-Package JsonSubTypes -Install-Package System.ComponentModel.Annotations -``` - -NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). -NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). - - -## Installation -Run the following command to generate the DLL -- [Mac/Linux] `/bin/sh build.sh` -- [Windows] `build.bat` - -Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: -```csharp -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; -``` - -## Packaging - -A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. - -This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: - -``` -nuget pack -Build -OutputDirectory out BrowserUpMitmProxyClient.csproj -``` - -Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. - - -## Usage - -To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` -```csharp -Configuration c = new Configuration(); -System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); -webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; -c.Proxy = webProxy; -``` - - -## Getting Started - -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class Example - { - public static void Main() - { - - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var error = new Error(); // Error | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - - try - { - apiInstance.AddError(error); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.AddError: " + e.Message ); - Debug.Print("Status Code: "+ e.ErrorCode); - Debug.Print(e.StackTrace); - } - - } - } -} -``` - - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:48088* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*BrowserUpProxyApi* | [**AddError**](docs/BrowserUpProxyApi.md#adderror) | **POST** /har/errors | -*BrowserUpProxyApi* | [**AddMetric**](docs/BrowserUpProxyApi.md#addmetric) | **POST** /har/metrics | -*BrowserUpProxyApi* | [**GetHarLog**](docs/BrowserUpProxyApi.md#getharlog) | **GET** /har | -*BrowserUpProxyApi* | [**Healthcheck**](docs/BrowserUpProxyApi.md#healthcheck) | **GET** /healthcheck | -*BrowserUpProxyApi* | [**NewPage**](docs/BrowserUpProxyApi.md#newpage) | **POST** /har/page | -*BrowserUpProxyApi* | [**ResetHarLog**](docs/BrowserUpProxyApi.md#resetharlog) | **PUT** /har | -*BrowserUpProxyApi* | [**VerifyNotPresent**](docs/BrowserUpProxyApi.md#verifynotpresent) | **POST** /verify/not_present/{name} | -*BrowserUpProxyApi* | [**VerifyPresent**](docs/BrowserUpProxyApi.md#verifypresent) | **POST** /verify/present/{name} | -*BrowserUpProxyApi* | [**VerifySLA**](docs/BrowserUpProxyApi.md#verifysla) | **POST** /verify/sla/{time}/{name} | -*BrowserUpProxyApi* | [**VerifySize**](docs/BrowserUpProxyApi.md#verifysize) | **POST** /verify/size/{size}/{name} | - - - -## Documentation for Models - - - [Model.Action](docs/Action.md) - - [Model.Error](docs/Error.md) - - [Model.Har](docs/Har.md) - - [Model.HarEntry](docs/HarEntry.md) - - [Model.HarEntryCache](docs/HarEntryCache.md) - - [Model.HarEntryCacheBeforeRequest](docs/HarEntryCacheBeforeRequest.md) - - [Model.HarEntryCacheBeforeRequestOneOf](docs/HarEntryCacheBeforeRequestOneOf.md) - - [Model.HarEntryRequest](docs/HarEntryRequest.md) - - [Model.HarEntryRequestCookiesInner](docs/HarEntryRequestCookiesInner.md) - - [Model.HarEntryRequestPostData](docs/HarEntryRequestPostData.md) - - [Model.HarEntryRequestPostDataParamsInner](docs/HarEntryRequestPostDataParamsInner.md) - - [Model.HarEntryRequestQueryStringInner](docs/HarEntryRequestQueryStringInner.md) - - [Model.HarEntryResponse](docs/HarEntryResponse.md) - - [Model.HarEntryResponseContent](docs/HarEntryResponseContent.md) - - [Model.HarEntryTimings](docs/HarEntryTimings.md) - - [Model.HarLog](docs/HarLog.md) - - [Model.HarLogCreator](docs/HarLogCreator.md) - - [Model.Header](docs/Header.md) - - [Model.LargestContentfulPaint](docs/LargestContentfulPaint.md) - - [Model.MatchCriteria](docs/MatchCriteria.md) - - [Model.MatchCriteriaRequestHeader](docs/MatchCriteriaRequestHeader.md) - - [Model.Metric](docs/Metric.md) - - [Model.NameValuePair](docs/NameValuePair.md) - - [Model.Page](docs/Page.md) - - [Model.PageTiming](docs/PageTiming.md) - - [Model.PageTimings](docs/PageTimings.md) - - [Model.VerifyResult](docs/VerifyResult.md) - - [Model.WebSocketMessage](docs/WebSocketMessage.md) - - - -## Documentation for Authorization - -All endpoints do not require authorization. diff --git a/clients/csharp/appveyor.yml b/clients/csharp/appveyor.yml deleted file mode 100644 index ac2886e0b4..0000000000 --- a/clients/csharp/appveyor.yml +++ /dev/null @@ -1,9 +0,0 @@ -# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) -# -image: Visual Studio 2019 -clone_depth: 1 -build_script: -- dotnet build -c Release -- dotnet test -c Release -after_build: -- dotnet pack .\src\BrowserUpMitmProxyClient\BrowserUpMitmProxyClient.csproj -o ../../output -c Release --no-build diff --git a/clients/csharp/docs/Action.md b/clients/csharp/docs/Action.md deleted file mode 100644 index 6a4918c10e..0000000000 --- a/clients/csharp/docs/Action.md +++ /dev/null @@ -1,17 +0,0 @@ -# BrowserUpMitmProxyClient.Model.Action - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] -**Id** | **string** | | [optional] -**ClassName** | **string** | | [optional] -**TagName** | **string** | | [optional] -**Xpath** | **string** | | [optional] -**DataAttributes** | **string** | | [optional] -**FormName** | **string** | | [optional] -**Content** | **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/clients/csharp/docs/BrowserUpProxyApi.md b/clients/csharp/docs/BrowserUpProxyApi.md deleted file mode 100644 index eb5a562c3f..0000000000 --- a/clients/csharp/docs/BrowserUpProxyApi.md +++ /dev/null @@ -1,898 +0,0 @@ -# BrowserUpMitmProxyClient.Api.BrowserUpProxyApi - -All URIs are relative to *http://localhost:48088* - -| Method | HTTP request | Description | -|--------|--------------|-------------| -| [**AddError**](BrowserUpProxyApi.md#adderror) | **POST** /har/errors | | -| [**AddMetric**](BrowserUpProxyApi.md#addmetric) | **POST** /har/metrics | | -| [**GetHarLog**](BrowserUpProxyApi.md#getharlog) | **GET** /har | | -| [**Healthcheck**](BrowserUpProxyApi.md#healthcheck) | **GET** /healthcheck | | -| [**NewPage**](BrowserUpProxyApi.md#newpage) | **POST** /har/page | | -| [**ResetHarLog**](BrowserUpProxyApi.md#resetharlog) | **PUT** /har | | -| [**VerifyNotPresent**](BrowserUpProxyApi.md#verifynotpresent) | **POST** /verify/not_present/{name} | | -| [**VerifyPresent**](BrowserUpProxyApi.md#verifypresent) | **POST** /verify/present/{name} | | -| [**VerifySLA**](BrowserUpProxyApi.md#verifysla) | **POST** /verify/sla/{time}/{name} | | -| [**VerifySize**](BrowserUpProxyApi.md#verifysize) | **POST** /verify/size/{size}/{name} | | - - -# **AddError** -> void AddError (Error error) - - - -Add Custom Error to the captured traffic har - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class AddErrorExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var error = new Error(); // Error | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - - try - { - apiInstance.AddError(error); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.AddError: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the AddErrorWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - apiInstance.AddErrorWithHttpInfo(error); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.AddErrorWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **error** | [**Error**](Error.md) | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key | | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | The Error was added. | - | -| **422** | The Error was invalid. | - | - -[[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) - - -# **AddMetric** -> void AddMetric (Metric metric) - - - -Add Custom Metric to the captured traffic har - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class AddMetricExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var metric = new Metric(); // Metric | Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - - try - { - apiInstance.AddMetric(metric); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.AddMetric: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the AddMetricWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - apiInstance.AddMetricWithHttpInfo(metric); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.AddMetricWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **metric** | [**Metric**](Metric.md) | Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key | | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | The metric was added. | - | -| **422** | The metric was invalid. | - | - -[[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) - - -# **GetHarLog** -> Har GetHarLog () - - - -Get the current HAR. - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class GetHarLogExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - - try - { - Har result = apiInstance.GetHarLog(); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.GetHarLog: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the GetHarLogWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.GetHarLogWithHttpInfo(); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.GetHarLogWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters -This endpoint does not need any parameter. -### Return type - -[**Har**](Har.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The current Har file. | - | - -[[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) - - -# **Healthcheck** -> void Healthcheck () - - - -Get the healthcheck - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class HealthcheckExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - - try - { - apiInstance.Healthcheck(); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.Healthcheck: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the HealthcheckWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - apiInstance.HealthcheckWithHttpInfo(); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.HealthcheckWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters -This endpoint does not need any parameter. -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK means all is well. | - | - -[[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) - - -# **NewPage** -> Har NewPage (string title) - - - -Starts a fresh HAR Page (Step) in the current active HAR to group requests. - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class NewPageExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var title = "title_example"; // string | The unique title for this har page/step. - - try - { - Har result = apiInstance.NewPage(title); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.NewPage: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the NewPageWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.NewPageWithHttpInfo(title); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.NewPageWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **title** | **string** | The unique title for this har page/step. | | - -### Return type - -[**Har**](Har.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The current Har file. | - | - -[[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) - - -# **ResetHarLog** -> Har ResetHarLog () - - - -Starts a fresh HAR capture session. - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class ResetHarLogExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - - try - { - Har result = apiInstance.ResetHarLog(); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.ResetHarLog: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the ResetHarLogWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.ResetHarLogWithHttpInfo(); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.ResetHarLogWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters -This endpoint does not need any parameter. -### Return type - -[**Har**](Har.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The current Har file. | - | - -[[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) - - -# **VerifyNotPresent** -> VerifyResult VerifyNotPresent (string name, MatchCriteria matchCriteria) - - - -Verify no matching items are present in the captured traffic - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class VerifyNotPresentExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var name = "name_example"; // string | The unique name for this verification operation - var matchCriteria = new MatchCriteria(); // MatchCriteria | Match criteria to select requests - response pairs for size tests - - try - { - VerifyResult result = apiInstance.VerifyNotPresent(name, matchCriteria); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.VerifyNotPresent: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the VerifyNotPresentWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.VerifyNotPresentWithHttpInfo(name, matchCriteria); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.VerifyNotPresentWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **name** | **string** | The unique name for this verification operation | | -| **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | | - -### Return type - -[**VerifyResult**](VerifyResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The traffic had no matching items | - | -| **422** | The MatchCriteria are invalid. | - | - -[[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) - - -# **VerifyPresent** -> VerifyResult VerifyPresent (string name, MatchCriteria matchCriteria) - - - -Verify at least one matching item is present in the captured traffic - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class VerifyPresentExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var name = "name_example"; // string | The unique name for this verification operation - var matchCriteria = new MatchCriteria(); // MatchCriteria | Match criteria to select requests - response pairs for size tests - - try - { - VerifyResult result = apiInstance.VerifyPresent(name, matchCriteria); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.VerifyPresent: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the VerifyPresentWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.VerifyPresentWithHttpInfo(name, matchCriteria); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.VerifyPresentWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **name** | **string** | The unique name for this verification operation | | -| **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | | - -### Return type - -[**VerifyResult**](VerifyResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The traffic conformed to the time criteria. | - | -| **422** | The MatchCriteria are invalid. | - | - -[[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) - - -# **VerifySLA** -> VerifyResult VerifySLA (int time, string name, MatchCriteria matchCriteria) - - - -Verify each traffic item matching the criteria meets is below SLA time - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class VerifySLAExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var time = 56; // int | The time used for comparison - var name = "name_example"; // string | The unique name for this verification operation - var matchCriteria = new MatchCriteria(); // MatchCriteria | Match criteria to select requests - response pairs for size tests - - try - { - VerifyResult result = apiInstance.VerifySLA(time, name, matchCriteria); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.VerifySLA: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the VerifySLAWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.VerifySLAWithHttpInfo(time, name, matchCriteria); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.VerifySLAWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **time** | **int** | The time used for comparison | | -| **name** | **string** | The unique name for this verification operation | | -| **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | | - -### Return type - -[**VerifyResult**](VerifyResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The traffic conformed to the time criteria. | - | -| **422** | The MatchCriteria are invalid. | - | - -[[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) - - -# **VerifySize** -> VerifyResult VerifySize (int size, string name, MatchCriteria matchCriteria) - - - -Verify matching items in the captured traffic meet the size criteria - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace Example -{ - public class VerifySizeExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://localhost:48088"; - var apiInstance = new BrowserUpProxyApi(config); - var size = 56; // int | The size used for comparison, in kilobytes - var name = "name_example"; // string | The unique name for this verification operation - var matchCriteria = new MatchCriteria(); // MatchCriteria | Match criteria to select requests - response pairs for size tests - - try - { - VerifyResult result = apiInstance.VerifySize(size, name, matchCriteria); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling BrowserUpProxyApi.VerifySize: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the VerifySizeWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - ApiResponse response = apiInstance.VerifySizeWithHttpInfo(size, name, matchCriteria); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling BrowserUpProxyApi.VerifySizeWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **size** | **int** | The size used for comparison, in kilobytes | | -| **name** | **string** | The unique name for this verification operation | | -| **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | | - -### Return type - -[**VerifyResult**](VerifyResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The traffic conformed to the size criteria. | - | -| **422** | The MatchCriteria are invalid. | - | - -[[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/clients/csharp/docs/Error.md b/clients/csharp/docs/Error.md deleted file mode 100644 index 233292cb71..0000000000 --- a/clients/csharp/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# BrowserUpMitmProxyClient.Model.Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | Name of the Error to add. Stored in har under _errors | [optional] -**Details** | **string** | Short details of the error | [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/clients/csharp/docs/HarEntry.md b/clients/csharp/docs/HarEntry.md deleted file mode 100644 index c82d4b3a11..0000000000 --- a/clients/csharp/docs/HarEntry.md +++ /dev/null @@ -1,20 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Pageref** | **string** | | [optional] -**StartedDateTime** | **DateTime** | | -**Time** | **long** | | -**Request** | [**HarEntryRequest**](HarEntryRequest.md) | | -**Response** | [**HarEntryResponse**](HarEntryResponse.md) | | -**Cache** | [**HarEntryCache**](HarEntryCache.md) | | -**Timings** | [**HarEntryTimings**](HarEntryTimings.md) | | -**ServerIPAddress** | **string** | | [optional] -**WebSocketMessages** | [**List<WebSocketMessage>**](WebSocketMessage.md) | | [optional] -**Connection** | **string** | | [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/clients/csharp/docs/HarEntryCache.md b/clients/csharp/docs/HarEntryCache.md deleted file mode 100644 index 9c5f791723..0000000000 --- a/clients/csharp/docs/HarEntryCache.md +++ /dev/null @@ -1,12 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryCache - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BeforeRequest** | [**HarEntryCacheBeforeRequest**](HarEntryCacheBeforeRequest.md) | | [optional] -**AfterRequest** | [**HarEntryCacheBeforeRequest**](HarEntryCacheBeforeRequest.md) | | [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/clients/csharp/docs/HarEntryCacheBeforeRequest.md b/clients/csharp/docs/HarEntryCacheBeforeRequest.md deleted file mode 100644 index e82a792085..0000000000 --- a/clients/csharp/docs/HarEntryCacheBeforeRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryCacheBeforeRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Expires** | **string** | | [optional] -**LastAccess** | **string** | | -**ETag** | **string** | | -**HitCount** | **int** | | -**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/clients/csharp/docs/HarEntryCacheBeforeRequestOneOf.md b/clients/csharp/docs/HarEntryCacheBeforeRequestOneOf.md deleted file mode 100644 index 327c082ec9..0000000000 --- a/clients/csharp/docs/HarEntryCacheBeforeRequestOneOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryCacheBeforeRequestOneOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Expires** | **string** | | [optional] -**LastAccess** | **string** | | -**ETag** | **string** | | -**HitCount** | **int** | | -**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/clients/csharp/docs/HarEntryRequest.md b/clients/csharp/docs/HarEntryRequest.md deleted file mode 100644 index c8652581ea..0000000000 --- a/clients/csharp/docs/HarEntryRequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Method** | **string** | | -**Url** | **string** | | -**HttpVersion** | **string** | | -**Cookies** | [**List<HarEntryRequestCookiesInner>**](HarEntryRequestCookiesInner.md) | | -**Headers** | [**List<Header>**](Header.md) | | -**QueryString** | [**List<HarEntryRequestQueryStringInner>**](HarEntryRequestQueryStringInner.md) | | -**PostData** | [**HarEntryRequestPostData**](HarEntryRequestPostData.md) | | [optional] -**HeadersSize** | **int** | | -**BodySize** | **int** | | -**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/clients/csharp/docs/HarEntryRequestCookiesInner.md b/clients/csharp/docs/HarEntryRequestCookiesInner.md deleted file mode 100644 index dad007ba56..0000000000 --- a/clients/csharp/docs/HarEntryRequestCookiesInner.md +++ /dev/null @@ -1,17 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryRequestCookiesInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Value** | **string** | | -**Path** | **string** | | [optional] -**Domain** | **string** | | [optional] -**Expires** | **string** | | [optional] -**HttpOnly** | **bool** | | [optional] -**Secure** | **bool** | | [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/clients/csharp/docs/HarEntryRequestPostData.md b/clients/csharp/docs/HarEntryRequestPostData.md deleted file mode 100644 index 01c50e07ec..0000000000 --- a/clients/csharp/docs/HarEntryRequestPostData.md +++ /dev/null @@ -1,13 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryRequestPostData -Posted data info. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MimeType** | **string** | | -**Text** | **string** | | [optional] -**Params** | [**List<HarEntryRequestPostDataParamsInner>**](HarEntryRequestPostDataParamsInner.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/clients/csharp/docs/HarEntryRequestPostDataParamsInner.md b/clients/csharp/docs/HarEntryRequestPostDataParamsInner.md deleted file mode 100644 index c8af0de1ad..0000000000 --- a/clients/csharp/docs/HarEntryRequestPostDataParamsInner.md +++ /dev/null @@ -1,14 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryRequestPostDataParamsInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] -**Value** | **string** | | [optional] -**FileName** | **string** | | [optional] -**ContentType** | **string** | | [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/clients/csharp/docs/HarEntryRequestQueryStringInner.md b/clients/csharp/docs/HarEntryRequestQueryStringInner.md deleted file mode 100644 index 19c1ceecdb..0000000000 --- a/clients/csharp/docs/HarEntryRequestQueryStringInner.md +++ /dev/null @@ -1,12 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryRequestQueryStringInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Value** | **string** | | -**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/clients/csharp/docs/HarEntryResponse.md b/clients/csharp/docs/HarEntryResponse.md deleted file mode 100644 index 620119003a..0000000000 --- a/clients/csharp/docs/HarEntryResponse.md +++ /dev/null @@ -1,19 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Status** | **int** | | -**StatusText** | **string** | | -**HttpVersion** | **string** | | -**Cookies** | [**List<HarEntryRequestCookiesInner>**](HarEntryRequestCookiesInner.md) | | -**Headers** | [**List<Header>**](Header.md) | | -**Content** | [**HarEntryResponseContent**](HarEntryResponseContent.md) | | -**RedirectURL** | **string** | | -**HeadersSize** | **int** | | -**BodySize** | **int** | | -**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/clients/csharp/docs/HarEntryResponseContent.md b/clients/csharp/docs/HarEntryResponseContent.md deleted file mode 100644 index 06ecc72427..0000000000 --- a/clients/csharp/docs/HarEntryResponseContent.md +++ /dev/null @@ -1,23 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryResponseContent - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Size** | **int** | | -**Compression** | **int** | | [optional] -**MimeType** | **string** | | -**Text** | **string** | | [optional] -**Encoding** | **string** | | [optional] -**VideoBufferedPercent** | **long** | | [optional] [default to -1] -**VideoStallCount** | **long** | | [optional] [default to -1] -**VideoDecodedByteCount** | **long** | | [optional] [default to -1] -**VideoWaitingCount** | **long** | | [optional] [default to -1] -**VideoErrorCount** | **long** | | [optional] [default to -1] -**VideoDroppedFrames** | **long** | | [optional] [default to -1] -**VideoTotalFrames** | **long** | | [optional] [default to -1] -**VideoAudioBytesDecoded** | **long** | | [optional] [default to -1] -**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/clients/csharp/docs/HarEntryTimings.md b/clients/csharp/docs/HarEntryTimings.md deleted file mode 100644 index 6e7e376f9e..0000000000 --- a/clients/csharp/docs/HarEntryTimings.md +++ /dev/null @@ -1,17 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarEntryTimings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Dns** | **long** | | [default to -1] -**Connect** | **long** | | [default to -1] -**Blocked** | **long** | | [default to -1] -**Send** | **long** | | [default to -1] -**Wait** | **long** | | [default to -1] -**Receive** | **long** | | [default to -1] -**Ssl** | **long** | | [default to -1] -**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/clients/csharp/docs/HarLog.md b/clients/csharp/docs/HarLog.md deleted file mode 100644 index 99698d97f2..0000000000 --- a/clients/csharp/docs/HarLog.md +++ /dev/null @@ -1,15 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarLog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_Version** | **string** | | -**Creator** | [**HarLogCreator**](HarLogCreator.md) | | -**Browser** | [**HarLogCreator**](HarLogCreator.md) | | [optional] -**Pages** | [**List<Page>**](Page.md) | | -**Entries** | [**List<HarEntry>**](HarEntry.md) | | -**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/clients/csharp/docs/HarLogCreator.md b/clients/csharp/docs/HarLogCreator.md deleted file mode 100644 index f543a199dc..0000000000 --- a/clients/csharp/docs/HarLogCreator.md +++ /dev/null @@ -1,12 +0,0 @@ -# BrowserUpMitmProxyClient.Model.HarLogCreator - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**_Version** | **string** | | -**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/clients/csharp/docs/Header.md b/clients/csharp/docs/Header.md deleted file mode 100644 index 28f7024168..0000000000 --- a/clients/csharp/docs/Header.md +++ /dev/null @@ -1,12 +0,0 @@ -# BrowserUpMitmProxyClient.Model.Header - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Value** | **string** | | -**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/clients/csharp/docs/LargestContentfulPaint.md b/clients/csharp/docs/LargestContentfulPaint.md deleted file mode 100644 index f79c97251e..0000000000 --- a/clients/csharp/docs/LargestContentfulPaint.md +++ /dev/null @@ -1,13 +0,0 @@ -# BrowserUpMitmProxyClient.Model.LargestContentfulPaint - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StartTime** | **long** | | [optional] [default to -1] -**Size** | **long** | | [optional] [default to -1] -**DomPath** | **string** | | [optional] [default to ""] -**Tag** | **string** | | [optional] [default to ""] - -[[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/clients/csharp/docs/MatchCriteria.md b/clients/csharp/docs/MatchCriteria.md deleted file mode 100644 index baa7157432..0000000000 --- a/clients/csharp/docs/MatchCriteria.md +++ /dev/null @@ -1,24 +0,0 @@ -# BrowserUpMitmProxyClient.Model.MatchCriteria -A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Url** | **string** | Request URL regexp to match | [optional] -**Page** | **string** | current|all | [optional] -**Status** | **string** | HTTP Status code to match. | [optional] -**Content** | **string** | Body content regexp content to match | [optional] -**ContentType** | **string** | Content type | [optional] -**WebsocketMessage** | **string** | Websocket message text to match | [optional] -**RequestHeader** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**RequestCookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**ResponseHeader** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**ResponseCookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**JsonValid** | **bool** | Is valid JSON | [optional] -**JsonPath** | **string** | Has JSON path | [optional] -**JsonSchema** | **string** | Validates against passed JSON schema | [optional] -**ErrorIfNoTraffic** | **bool** | If the proxy has NO traffic at all, return error | [optional] [default to true] - -[[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/clients/csharp/docs/MatchCriteriaRequestHeader.md b/clients/csharp/docs/MatchCriteriaRequestHeader.md deleted file mode 100644 index 8b26bc9191..0000000000 --- a/clients/csharp/docs/MatchCriteriaRequestHeader.md +++ /dev/null @@ -1,11 +0,0 @@ -# BrowserUpMitmProxyClient.Model.MatchCriteriaRequestHeader - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | Name to match | [optional] -**Value** | **string** | Value to match | [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/clients/csharp/docs/Metric.md b/clients/csharp/docs/Metric.md deleted file mode 100644 index 59f9266dff..0000000000 --- a/clients/csharp/docs/Metric.md +++ /dev/null @@ -1,11 +0,0 @@ -# BrowserUpMitmProxyClient.Model.Metric - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | Name of Custom Metric to add to the page under _metrics | [optional] -**Value** | **double** | Value for the metric | [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/clients/csharp/docs/NameValuePair.md b/clients/csharp/docs/NameValuePair.md deleted file mode 100644 index cfbe1b6fa3..0000000000 --- a/clients/csharp/docs/NameValuePair.md +++ /dev/null @@ -1,11 +0,0 @@ -# BrowserUpMitmProxyClient.Model.NameValuePair - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | Name to match | [optional] -**Value** | **string** | Value to match | [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/clients/csharp/docs/Page.md b/clients/csharp/docs/Page.md deleted file mode 100644 index e883302e97..0000000000 --- a/clients/csharp/docs/Page.md +++ /dev/null @@ -1,17 +0,0 @@ -# BrowserUpMitmProxyClient.Model.Page - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StartedDateTime** | **DateTime** | | -**Id** | **string** | | -**Title** | **string** | | -**Verifications** | [**List<VerifyResult>**](VerifyResult.md) | | [optional] -**Metrics** | [**List<Metric>**](Metric.md) | | [optional] -**Errors** | [**List<Error>**](Error.md) | | [optional] -**PageTimings** | [**PageTimings**](PageTimings.md) | | -**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/clients/csharp/docs/PageTiming.md b/clients/csharp/docs/PageTiming.md deleted file mode 100644 index 2b5a0b2d25..0000000000 --- a/clients/csharp/docs/PageTiming.md +++ /dev/null @@ -1,21 +0,0 @@ -# BrowserUpMitmProxyClient.Model.PageTiming - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**OnContentLoad** | **decimal** | onContentLoad per the browser | [optional] -**OnLoad** | **decimal** | onLoad per the browser | [optional] -**FirstInputDelay** | **decimal** | firstInputDelay from the browser | [optional] -**FirstPaint** | **decimal** | firstPaint from the browser | [optional] -**CumulativeLayoutShift** | **decimal** | cumulativeLayoutShift metric from the browser | [optional] -**LargestContentfulPaint** | **decimal** | largestContentfulPaint from the browser | [optional] -**DomInteractive** | **decimal** | domInteractive from the browser | [optional] -**FirstContentfulPaint** | **decimal** | firstContentfulPaint from the browser | [optional] -**Dns** | **decimal** | dns lookup time from the browser | [optional] -**Ssl** | **decimal** | Ssl connect time from the browser | [optional] -**TimeToFirstByte** | **decimal** | Time to first byte of the page's first request per the browser | [optional] -**Href** | **string** | Top level href, including hashtag, etc per the browser | [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/clients/csharp/docs/PageTimings.md b/clients/csharp/docs/PageTimings.md deleted file mode 100644 index f41b9119cf..0000000000 --- a/clients/csharp/docs/PageTimings.md +++ /dev/null @@ -1,22 +0,0 @@ -# BrowserUpMitmProxyClient.Model.PageTimings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**OnContentLoad** | **long** | | [default to -1] -**OnLoad** | **long** | | [default to -1] -**Href** | **string** | | [optional] [default to ""] -**Dns** | **long** | | [optional] [default to -1] -**Ssl** | **long** | | [optional] [default to -1] -**TimeToFirstByte** | **long** | | [optional] [default to -1] -**CumulativeLayoutShift** | **float** | | [optional] [default to -1F] -**LargestContentfulPaint** | [**LargestContentfulPaint**](LargestContentfulPaint.md) | | [optional] -**FirstPaint** | **long** | | [optional] [default to -1] -**FirstInputDelay** | **float** | | [optional] [default to -1F] -**DomInteractive** | **long** | | [optional] [default to -1] -**FirstContentfulPaint** | **long** | | [optional] [default to -1] -**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/clients/csharp/docs/VerifyResult.md b/clients/csharp/docs/VerifyResult.md deleted file mode 100644 index 95af4c4c6d..0000000000 --- a/clients/csharp/docs/VerifyResult.md +++ /dev/null @@ -1,12 +0,0 @@ -# BrowserUpMitmProxyClient.Model.VerifyResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Result** | **bool** | Result True / False | [optional] -**Name** | **string** | Name | [optional] -**Type** | **string** | Type | [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/clients/csharp/docs/WebSocketMessage.md b/clients/csharp/docs/WebSocketMessage.md deleted file mode 100644 index fe0fa5bbcc..0000000000 --- a/clients/csharp/docs/WebSocketMessage.md +++ /dev/null @@ -1,13 +0,0 @@ -# BrowserUpMitmProxyClient.Model.WebSocketMessage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | **string** | | -**Opcode** | **decimal** | | -**Data** | **string** | | -**Time** | **decimal** | | - -[[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/clients/csharp/src/BrowserUpMitmProxyClient.Test/Api/BrowserUpProxyApiTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Api/BrowserUpProxyApiTests.cs deleted file mode 100644 index 2a9e07eec7..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Api/BrowserUpProxyApiTests.cs +++ /dev/null @@ -1,177 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reflection; -using RestSharp; -using Xunit; - -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Api; -// uncomment below to import models -//using BrowserUpMitmProxyClient.Model; - -namespace BrowserUpMitmProxyClient.Test.Api -{ - /// - /// Class for testing BrowserUpProxyApi - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the API endpoint. - /// - public class BrowserUpProxyApiTests : IDisposable - { - private BrowserUpProxyApi instance; - - public BrowserUpProxyApiTests() - { - instance = new BrowserUpProxyApi(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of BrowserUpProxyApi - /// - [Fact] - public void InstanceTest() - { - // TODO uncomment below to test 'IsType' BrowserUpProxyApi - //Assert.IsType(instance); - } - - /// - /// Test AddError - /// - [Fact] - public void AddErrorTest() - { - // TODO uncomment below to test the method and replace null with proper value - //Error error = null; - //instance.AddError(error); - } - - /// - /// Test AddMetric - /// - [Fact] - public void AddMetricTest() - { - // TODO uncomment below to test the method and replace null with proper value - //Metric metric = null; - //instance.AddMetric(metric); - } - - /// - /// Test GetHarLog - /// - [Fact] - public void GetHarLogTest() - { - // TODO uncomment below to test the method and replace null with proper value - //var response = instance.GetHarLog(); - //Assert.IsType(response); - } - - /// - /// Test Healthcheck - /// - [Fact] - public void HealthcheckTest() - { - // TODO uncomment below to test the method and replace null with proper value - //instance.Healthcheck(); - } - - /// - /// Test NewPage - /// - [Fact] - public void NewPageTest() - { - // TODO uncomment below to test the method and replace null with proper value - //string title = null; - //var response = instance.NewPage(title); - //Assert.IsType(response); - } - - /// - /// Test ResetHarLog - /// - [Fact] - public void ResetHarLogTest() - { - // TODO uncomment below to test the method and replace null with proper value - //var response = instance.ResetHarLog(); - //Assert.IsType(response); - } - - /// - /// Test VerifyNotPresent - /// - [Fact] - public void VerifyNotPresentTest() - { - // TODO uncomment below to test the method and replace null with proper value - //string name = null; - //MatchCriteria matchCriteria = null; - //var response = instance.VerifyNotPresent(name, matchCriteria); - //Assert.IsType(response); - } - - /// - /// Test VerifyPresent - /// - [Fact] - public void VerifyPresentTest() - { - // TODO uncomment below to test the method and replace null with proper value - //string name = null; - //MatchCriteria matchCriteria = null; - //var response = instance.VerifyPresent(name, matchCriteria); - //Assert.IsType(response); - } - - /// - /// Test VerifySLA - /// - [Fact] - public void VerifySLATest() - { - // TODO uncomment below to test the method and replace null with proper value - //int time = null; - //string name = null; - //MatchCriteria matchCriteria = null; - //var response = instance.VerifySLA(time, name, matchCriteria); - //Assert.IsType(response); - } - - /// - /// Test VerifySize - /// - [Fact] - public void VerifySizeTest() - { - // TODO uncomment below to test the method and replace null with proper value - //int size = null; - //string name = null; - //MatchCriteria matchCriteria = null; - //var response = instance.VerifySize(size, name, matchCriteria); - //Assert.IsType(response); - } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/BrowserUpMitmProxyClient.Test.csproj b/clients/csharp/src/BrowserUpMitmProxyClient.Test/BrowserUpMitmProxyClient.Test.csproj deleted file mode 100644 index 03c8dd80c4..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/BrowserUpMitmProxyClient.Test.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - BrowserUpMitmProxyClient.Test - BrowserUpMitmProxyClient.Test - net7.0 - false - annotations - - - - - - - - - - - - diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/ActionTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/ActionTests.cs deleted file mode 100644 index 403d0695ff..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/ActionTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing Action - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class ActionTests : IDisposable - { - // TODO uncomment below to declare an instance variable for Action - //private Action instance; - - public ActionTests() - { - // TODO uncomment below to create an instance of Action - //instance = new Action(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of Action - /// - [Fact] - public void ActionInstanceTest() - { - // TODO uncomment below to test "IsType" Action - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Id' - /// - [Fact] - public void IdTest() - { - // TODO unit test for the property 'Id' - } - /// - /// Test the property 'ClassName' - /// - [Fact] - public void ClassNameTest() - { - // TODO unit test for the property 'ClassName' - } - /// - /// Test the property 'TagName' - /// - [Fact] - public void TagNameTest() - { - // TODO unit test for the property 'TagName' - } - /// - /// Test the property 'Xpath' - /// - [Fact] - public void XpathTest() - { - // TODO unit test for the property 'Xpath' - } - /// - /// Test the property 'DataAttributes' - /// - [Fact] - public void DataAttributesTest() - { - // TODO unit test for the property 'DataAttributes' - } - /// - /// Test the property 'FormName' - /// - [Fact] - public void FormNameTest() - { - // TODO unit test for the property 'FormName' - } - /// - /// Test the property 'Content' - /// - [Fact] - public void ContentTest() - { - // TODO unit test for the property 'Content' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/ErrorTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/ErrorTests.cs deleted file mode 100644 index 6c9f3fe91e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/ErrorTests.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing Error - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class ErrorTests : IDisposable - { - // TODO uncomment below to declare an instance variable for Error - //private Error instance; - - public ErrorTests() - { - // TODO uncomment below to create an instance of Error - //instance = new Error(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of Error - /// - [Fact] - public void ErrorInstanceTest() - { - // TODO uncomment below to test "IsType" Error - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Details' - /// - [Fact] - public void DetailsTest() - { - // TODO unit test for the property 'Details' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestOneOfTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestOneOfTests.cs deleted file mode 100644 index 476578ad1e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestOneOfTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryCacheBeforeRequestOneOf - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryCacheBeforeRequestOneOfTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryCacheBeforeRequestOneOf - //private HarEntryCacheBeforeRequestOneOf instance; - - public HarEntryCacheBeforeRequestOneOfTests() - { - // TODO uncomment below to create an instance of HarEntryCacheBeforeRequestOneOf - //instance = new HarEntryCacheBeforeRequestOneOf(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryCacheBeforeRequestOneOf - /// - [Fact] - public void HarEntryCacheBeforeRequestOneOfInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryCacheBeforeRequestOneOf - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Expires' - /// - [Fact] - public void ExpiresTest() - { - // TODO unit test for the property 'Expires' - } - /// - /// Test the property 'LastAccess' - /// - [Fact] - public void LastAccessTest() - { - // TODO unit test for the property 'LastAccess' - } - /// - /// Test the property 'ETag' - /// - [Fact] - public void ETagTest() - { - // TODO unit test for the property 'ETag' - } - /// - /// Test the property 'HitCount' - /// - [Fact] - public void HitCountTest() - { - // TODO unit test for the property 'HitCount' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestTests.cs deleted file mode 100644 index f60f6c0232..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheBeforeRequestTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryCacheBeforeRequest - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryCacheBeforeRequestTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryCacheBeforeRequest - //private HarEntryCacheBeforeRequest instance; - - public HarEntryCacheBeforeRequestTests() - { - // TODO uncomment below to create an instance of HarEntryCacheBeforeRequest - //instance = new HarEntryCacheBeforeRequest(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryCacheBeforeRequest - /// - [Fact] - public void HarEntryCacheBeforeRequestInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryCacheBeforeRequest - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Expires' - /// - [Fact] - public void ExpiresTest() - { - // TODO unit test for the property 'Expires' - } - /// - /// Test the property 'LastAccess' - /// - [Fact] - public void LastAccessTest() - { - // TODO unit test for the property 'LastAccess' - } - /// - /// Test the property 'ETag' - /// - [Fact] - public void ETagTest() - { - // TODO unit test for the property 'ETag' - } - /// - /// Test the property 'HitCount' - /// - [Fact] - public void HitCountTest() - { - // TODO unit test for the property 'HitCount' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheTests.cs deleted file mode 100644 index 6fd3b0f1c6..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryCacheTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryCache - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryCacheTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryCache - //private HarEntryCache instance; - - public HarEntryCacheTests() - { - // TODO uncomment below to create an instance of HarEntryCache - //instance = new HarEntryCache(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryCache - /// - [Fact] - public void HarEntryCacheInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryCache - //Assert.IsType(instance); - } - - - /// - /// Test the property 'BeforeRequest' - /// - [Fact] - public void BeforeRequestTest() - { - // TODO unit test for the property 'BeforeRequest' - } - /// - /// Test the property 'AfterRequest' - /// - [Fact] - public void AfterRequestTest() - { - // TODO unit test for the property 'AfterRequest' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestCookiesInnerTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestCookiesInnerTests.cs deleted file mode 100644 index 4e41276773..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestCookiesInnerTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryRequestCookiesInner - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryRequestCookiesInnerTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryRequestCookiesInner - //private HarEntryRequestCookiesInner instance; - - public HarEntryRequestCookiesInnerTests() - { - // TODO uncomment below to create an instance of HarEntryRequestCookiesInner - //instance = new HarEntryRequestCookiesInner(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryRequestCookiesInner - /// - [Fact] - public void HarEntryRequestCookiesInnerInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryRequestCookiesInner - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - /// - /// Test the property 'Path' - /// - [Fact] - public void PathTest() - { - // TODO unit test for the property 'Path' - } - /// - /// Test the property 'Domain' - /// - [Fact] - public void DomainTest() - { - // TODO unit test for the property 'Domain' - } - /// - /// Test the property 'Expires' - /// - [Fact] - public void ExpiresTest() - { - // TODO unit test for the property 'Expires' - } - /// - /// Test the property 'HttpOnly' - /// - [Fact] - public void HttpOnlyTest() - { - // TODO unit test for the property 'HttpOnly' - } - /// - /// Test the property 'Secure' - /// - [Fact] - public void SecureTest() - { - // TODO unit test for the property 'Secure' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataParamsInnerTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataParamsInnerTests.cs deleted file mode 100644 index e7dc363d08..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataParamsInnerTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryRequestPostDataParamsInner - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryRequestPostDataParamsInnerTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryRequestPostDataParamsInner - //private HarEntryRequestPostDataParamsInner instance; - - public HarEntryRequestPostDataParamsInnerTests() - { - // TODO uncomment below to create an instance of HarEntryRequestPostDataParamsInner - //instance = new HarEntryRequestPostDataParamsInner(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryRequestPostDataParamsInner - /// - [Fact] - public void HarEntryRequestPostDataParamsInnerInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryRequestPostDataParamsInner - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - /// - /// Test the property 'FileName' - /// - [Fact] - public void FileNameTest() - { - // TODO unit test for the property 'FileName' - } - /// - /// Test the property 'ContentType' - /// - [Fact] - public void ContentTypeTest() - { - // TODO unit test for the property 'ContentType' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataTests.cs deleted file mode 100644 index fa51f67117..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestPostDataTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryRequestPostData - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryRequestPostDataTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryRequestPostData - //private HarEntryRequestPostData instance; - - public HarEntryRequestPostDataTests() - { - // TODO uncomment below to create an instance of HarEntryRequestPostData - //instance = new HarEntryRequestPostData(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryRequestPostData - /// - [Fact] - public void HarEntryRequestPostDataInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryRequestPostData - //Assert.IsType(instance); - } - - - /// - /// Test the property 'MimeType' - /// - [Fact] - public void MimeTypeTest() - { - // TODO unit test for the property 'MimeType' - } - /// - /// Test the property 'Text' - /// - [Fact] - public void TextTest() - { - // TODO unit test for the property 'Text' - } - /// - /// Test the property 'Params' - /// - [Fact] - public void ParamsTest() - { - // TODO unit test for the property 'Params' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestQueryStringInnerTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestQueryStringInnerTests.cs deleted file mode 100644 index eb8f515e86..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestQueryStringInnerTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryRequestQueryStringInner - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryRequestQueryStringInnerTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryRequestQueryStringInner - //private HarEntryRequestQueryStringInner instance; - - public HarEntryRequestQueryStringInnerTests() - { - // TODO uncomment below to create an instance of HarEntryRequestQueryStringInner - //instance = new HarEntryRequestQueryStringInner(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryRequestQueryStringInner - /// - [Fact] - public void HarEntryRequestQueryStringInnerInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryRequestQueryStringInner - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestTests.cs deleted file mode 100644 index 8bb0a0fef8..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryRequestTests.cs +++ /dev/null @@ -1,142 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryRequest - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryRequestTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryRequest - //private HarEntryRequest instance; - - public HarEntryRequestTests() - { - // TODO uncomment below to create an instance of HarEntryRequest - //instance = new HarEntryRequest(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryRequest - /// - [Fact] - public void HarEntryRequestInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryRequest - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Method' - /// - [Fact] - public void MethodTest() - { - // TODO unit test for the property 'Method' - } - /// - /// Test the property 'Url' - /// - [Fact] - public void UrlTest() - { - // TODO unit test for the property 'Url' - } - /// - /// Test the property 'HttpVersion' - /// - [Fact] - public void HttpVersionTest() - { - // TODO unit test for the property 'HttpVersion' - } - /// - /// Test the property 'Cookies' - /// - [Fact] - public void CookiesTest() - { - // TODO unit test for the property 'Cookies' - } - /// - /// Test the property 'Headers' - /// - [Fact] - public void HeadersTest() - { - // TODO unit test for the property 'Headers' - } - /// - /// Test the property 'QueryString' - /// - [Fact] - public void QueryStringTest() - { - // TODO unit test for the property 'QueryString' - } - /// - /// Test the property 'PostData' - /// - [Fact] - public void PostDataTest() - { - // TODO unit test for the property 'PostData' - } - /// - /// Test the property 'HeadersSize' - /// - [Fact] - public void HeadersSizeTest() - { - // TODO unit test for the property 'HeadersSize' - } - /// - /// Test the property 'BodySize' - /// - [Fact] - public void BodySizeTest() - { - // TODO unit test for the property 'BodySize' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseContentTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseContentTests.cs deleted file mode 100644 index a1d810f183..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseContentTests.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryResponseContent - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryResponseContentTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryResponseContent - //private HarEntryResponseContent instance; - - public HarEntryResponseContentTests() - { - // TODO uncomment below to create an instance of HarEntryResponseContent - //instance = new HarEntryResponseContent(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryResponseContent - /// - [Fact] - public void HarEntryResponseContentInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryResponseContent - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Size' - /// - [Fact] - public void SizeTest() - { - // TODO unit test for the property 'Size' - } - /// - /// Test the property 'Compression' - /// - [Fact] - public void CompressionTest() - { - // TODO unit test for the property 'Compression' - } - /// - /// Test the property 'MimeType' - /// - [Fact] - public void MimeTypeTest() - { - // TODO unit test for the property 'MimeType' - } - /// - /// Test the property 'Text' - /// - [Fact] - public void TextTest() - { - // TODO unit test for the property 'Text' - } - /// - /// Test the property 'Encoding' - /// - [Fact] - public void EncodingTest() - { - // TODO unit test for the property 'Encoding' - } - /// - /// Test the property 'VideoBufferedPercent' - /// - [Fact] - public void VideoBufferedPercentTest() - { - // TODO unit test for the property 'VideoBufferedPercent' - } - /// - /// Test the property 'VideoStallCount' - /// - [Fact] - public void VideoStallCountTest() - { - // TODO unit test for the property 'VideoStallCount' - } - /// - /// Test the property 'VideoDecodedByteCount' - /// - [Fact] - public void VideoDecodedByteCountTest() - { - // TODO unit test for the property 'VideoDecodedByteCount' - } - /// - /// Test the property 'VideoWaitingCount' - /// - [Fact] - public void VideoWaitingCountTest() - { - // TODO unit test for the property 'VideoWaitingCount' - } - /// - /// Test the property 'VideoErrorCount' - /// - [Fact] - public void VideoErrorCountTest() - { - // TODO unit test for the property 'VideoErrorCount' - } - /// - /// Test the property 'VideoDroppedFrames' - /// - [Fact] - public void VideoDroppedFramesTest() - { - // TODO unit test for the property 'VideoDroppedFrames' - } - /// - /// Test the property 'VideoTotalFrames' - /// - [Fact] - public void VideoTotalFramesTest() - { - // TODO unit test for the property 'VideoTotalFrames' - } - /// - /// Test the property 'VideoAudioBytesDecoded' - /// - [Fact] - public void VideoAudioBytesDecodedTest() - { - // TODO unit test for the property 'VideoAudioBytesDecoded' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseTests.cs deleted file mode 100644 index bfda3da0b5..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryResponseTests.cs +++ /dev/null @@ -1,142 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryResponse - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryResponseTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryResponse - //private HarEntryResponse instance; - - public HarEntryResponseTests() - { - // TODO uncomment below to create an instance of HarEntryResponse - //instance = new HarEntryResponse(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryResponse - /// - [Fact] - public void HarEntryResponseInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryResponse - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Status' - /// - [Fact] - public void StatusTest() - { - // TODO unit test for the property 'Status' - } - /// - /// Test the property 'StatusText' - /// - [Fact] - public void StatusTextTest() - { - // TODO unit test for the property 'StatusText' - } - /// - /// Test the property 'HttpVersion' - /// - [Fact] - public void HttpVersionTest() - { - // TODO unit test for the property 'HttpVersion' - } - /// - /// Test the property 'Cookies' - /// - [Fact] - public void CookiesTest() - { - // TODO unit test for the property 'Cookies' - } - /// - /// Test the property 'Headers' - /// - [Fact] - public void HeadersTest() - { - // TODO unit test for the property 'Headers' - } - /// - /// Test the property 'Content' - /// - [Fact] - public void ContentTest() - { - // TODO unit test for the property 'Content' - } - /// - /// Test the property 'RedirectURL' - /// - [Fact] - public void RedirectURLTest() - { - // TODO unit test for the property 'RedirectURL' - } - /// - /// Test the property 'HeadersSize' - /// - [Fact] - public void HeadersSizeTest() - { - // TODO unit test for the property 'HeadersSize' - } - /// - /// Test the property 'BodySize' - /// - [Fact] - public void BodySizeTest() - { - // TODO unit test for the property 'BodySize' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryTests.cs deleted file mode 100644 index 81f436c297..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryTests.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntry - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntry - //private HarEntry instance; - - public HarEntryTests() - { - // TODO uncomment below to create an instance of HarEntry - //instance = new HarEntry(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntry - /// - [Fact] - public void HarEntryInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntry - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Pageref' - /// - [Fact] - public void PagerefTest() - { - // TODO unit test for the property 'Pageref' - } - /// - /// Test the property 'StartedDateTime' - /// - [Fact] - public void StartedDateTimeTest() - { - // TODO unit test for the property 'StartedDateTime' - } - /// - /// Test the property 'Time' - /// - [Fact] - public void TimeTest() - { - // TODO unit test for the property 'Time' - } - /// - /// Test the property 'Request' - /// - [Fact] - public void RequestTest() - { - // TODO unit test for the property 'Request' - } - /// - /// Test the property 'Response' - /// - [Fact] - public void ResponseTest() - { - // TODO unit test for the property 'Response' - } - /// - /// Test the property 'Cache' - /// - [Fact] - public void CacheTest() - { - // TODO unit test for the property 'Cache' - } - /// - /// Test the property 'Timings' - /// - [Fact] - public void TimingsTest() - { - // TODO unit test for the property 'Timings' - } - /// - /// Test the property 'ServerIPAddress' - /// - [Fact] - public void ServerIPAddressTest() - { - // TODO unit test for the property 'ServerIPAddress' - } - /// - /// Test the property 'WebSocketMessages' - /// - [Fact] - public void WebSocketMessagesTest() - { - // TODO unit test for the property 'WebSocketMessages' - } - /// - /// Test the property 'Connection' - /// - [Fact] - public void ConnectionTest() - { - // TODO unit test for the property 'Connection' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryTimingsTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryTimingsTests.cs deleted file mode 100644 index 7e5c826ec8..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarEntryTimingsTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarEntryTimings - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarEntryTimingsTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarEntryTimings - //private HarEntryTimings instance; - - public HarEntryTimingsTests() - { - // TODO uncomment below to create an instance of HarEntryTimings - //instance = new HarEntryTimings(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarEntryTimings - /// - [Fact] - public void HarEntryTimingsInstanceTest() - { - // TODO uncomment below to test "IsType" HarEntryTimings - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Dns' - /// - [Fact] - public void DnsTest() - { - // TODO unit test for the property 'Dns' - } - /// - /// Test the property 'Connect' - /// - [Fact] - public void ConnectTest() - { - // TODO unit test for the property 'Connect' - } - /// - /// Test the property 'Blocked' - /// - [Fact] - public void BlockedTest() - { - // TODO unit test for the property 'Blocked' - } - /// - /// Test the property 'Send' - /// - [Fact] - public void SendTest() - { - // TODO unit test for the property 'Send' - } - /// - /// Test the property 'Wait' - /// - [Fact] - public void WaitTest() - { - // TODO unit test for the property 'Wait' - } - /// - /// Test the property 'Receive' - /// - [Fact] - public void ReceiveTest() - { - // TODO unit test for the property 'Receive' - } - /// - /// Test the property 'Ssl' - /// - [Fact] - public void SslTest() - { - // TODO unit test for the property 'Ssl' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarLogCreatorTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarLogCreatorTests.cs deleted file mode 100644 index 52897d3b75..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarLogCreatorTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarLogCreator - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarLogCreatorTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarLogCreator - //private HarLogCreator instance; - - public HarLogCreatorTests() - { - // TODO uncomment below to create an instance of HarLogCreator - //instance = new HarLogCreator(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarLogCreator - /// - [Fact] - public void HarLogCreatorInstanceTest() - { - // TODO uncomment below to test "IsType" HarLogCreator - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property '_Version' - /// - [Fact] - public void _VersionTest() - { - // TODO unit test for the property '_Version' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarLogTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarLogTests.cs deleted file mode 100644 index 953de64f39..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarLogTests.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing HarLog - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarLogTests : IDisposable - { - // TODO uncomment below to declare an instance variable for HarLog - //private HarLog instance; - - public HarLogTests() - { - // TODO uncomment below to create an instance of HarLog - //instance = new HarLog(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of HarLog - /// - [Fact] - public void HarLogInstanceTest() - { - // TODO uncomment below to test "IsType" HarLog - //Assert.IsType(instance); - } - - - /// - /// Test the property '_Version' - /// - [Fact] - public void _VersionTest() - { - // TODO unit test for the property '_Version' - } - /// - /// Test the property 'Creator' - /// - [Fact] - public void CreatorTest() - { - // TODO unit test for the property 'Creator' - } - /// - /// Test the property 'Browser' - /// - [Fact] - public void BrowserTest() - { - // TODO unit test for the property 'Browser' - } - /// - /// Test the property 'Pages' - /// - [Fact] - public void PagesTest() - { - // TODO unit test for the property 'Pages' - } - /// - /// Test the property 'Entries' - /// - [Fact] - public void EntriesTest() - { - // TODO unit test for the property 'Entries' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarTests.cs deleted file mode 100644 index e33682fee1..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HarTests.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing Har - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HarTests : IDisposable - { - // TODO uncomment below to declare an instance variable for Har - //private Har instance; - - public HarTests() - { - // TODO uncomment below to create an instance of Har - //instance = new Har(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of Har - /// - [Fact] - public void HarInstanceTest() - { - // TODO uncomment below to test "IsType" Har - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Log' - /// - [Fact] - public void LogTest() - { - // TODO unit test for the property 'Log' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HeaderTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HeaderTests.cs deleted file mode 100644 index daf3a0d950..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/HeaderTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing Header - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class HeaderTests : IDisposable - { - // TODO uncomment below to declare an instance variable for Header - //private Header instance; - - public HeaderTests() - { - // TODO uncomment below to create an instance of Header - //instance = new Header(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of Header - /// - [Fact] - public void HeaderInstanceTest() - { - // TODO uncomment below to test "IsType" Header - //Assert.IsType
(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/LargestContentfulPaintTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/LargestContentfulPaintTests.cs deleted file mode 100644 index ac739d704b..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/LargestContentfulPaintTests.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing LargestContentfulPaint - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class LargestContentfulPaintTests : IDisposable - { - // TODO uncomment below to declare an instance variable for LargestContentfulPaint - //private LargestContentfulPaint instance; - - public LargestContentfulPaintTests() - { - // TODO uncomment below to create an instance of LargestContentfulPaint - //instance = new LargestContentfulPaint(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of LargestContentfulPaint - /// - [Fact] - public void LargestContentfulPaintInstanceTest() - { - // TODO uncomment below to test "IsType" LargestContentfulPaint - //Assert.IsType(instance); - } - - - /// - /// Test the property 'StartTime' - /// - [Fact] - public void StartTimeTest() - { - // TODO unit test for the property 'StartTime' - } - /// - /// Test the property 'Size' - /// - [Fact] - public void SizeTest() - { - // TODO unit test for the property 'Size' - } - /// - /// Test the property 'DomPath' - /// - [Fact] - public void DomPathTest() - { - // TODO unit test for the property 'DomPath' - } - /// - /// Test the property 'Tag' - /// - [Fact] - public void TagTest() - { - // TODO unit test for the property 'Tag' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaRequestHeaderTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaRequestHeaderTests.cs deleted file mode 100644 index b66d083018..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaRequestHeaderTests.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing MatchCriteriaRequestHeader - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MatchCriteriaRequestHeaderTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MatchCriteriaRequestHeader - //private MatchCriteriaRequestHeader instance; - - public MatchCriteriaRequestHeaderTests() - { - // TODO uncomment below to create an instance of MatchCriteriaRequestHeader - //instance = new MatchCriteriaRequestHeader(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MatchCriteriaRequestHeader - /// - [Fact] - public void MatchCriteriaRequestHeaderInstanceTest() - { - // TODO uncomment below to test "IsType" MatchCriteriaRequestHeader - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaTests.cs deleted file mode 100644 index 7f7c7dc955..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MatchCriteriaTests.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing MatchCriteria - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MatchCriteriaTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MatchCriteria - //private MatchCriteria instance; - - public MatchCriteriaTests() - { - // TODO uncomment below to create an instance of MatchCriteria - //instance = new MatchCriteria(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MatchCriteria - /// - [Fact] - public void MatchCriteriaInstanceTest() - { - // TODO uncomment below to test "IsType" MatchCriteria - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Url' - /// - [Fact] - public void UrlTest() - { - // TODO unit test for the property 'Url' - } - /// - /// Test the property 'Page' - /// - [Fact] - public void PageTest() - { - // TODO unit test for the property 'Page' - } - /// - /// Test the property 'Status' - /// - [Fact] - public void StatusTest() - { - // TODO unit test for the property 'Status' - } - /// - /// Test the property 'Content' - /// - [Fact] - public void ContentTest() - { - // TODO unit test for the property 'Content' - } - /// - /// Test the property 'ContentType' - /// - [Fact] - public void ContentTypeTest() - { - // TODO unit test for the property 'ContentType' - } - /// - /// Test the property 'WebsocketMessage' - /// - [Fact] - public void WebsocketMessageTest() - { - // TODO unit test for the property 'WebsocketMessage' - } - /// - /// Test the property 'RequestHeader' - /// - [Fact] - public void RequestHeaderTest() - { - // TODO unit test for the property 'RequestHeader' - } - /// - /// Test the property 'RequestCookie' - /// - [Fact] - public void RequestCookieTest() - { - // TODO unit test for the property 'RequestCookie' - } - /// - /// Test the property 'ResponseHeader' - /// - [Fact] - public void ResponseHeaderTest() - { - // TODO unit test for the property 'ResponseHeader' - } - /// - /// Test the property 'ResponseCookie' - /// - [Fact] - public void ResponseCookieTest() - { - // TODO unit test for the property 'ResponseCookie' - } - /// - /// Test the property 'JsonValid' - /// - [Fact] - public void JsonValidTest() - { - // TODO unit test for the property 'JsonValid' - } - /// - /// Test the property 'JsonPath' - /// - [Fact] - public void JsonPathTest() - { - // TODO unit test for the property 'JsonPath' - } - /// - /// Test the property 'JsonSchema' - /// - [Fact] - public void JsonSchemaTest() - { - // TODO unit test for the property 'JsonSchema' - } - /// - /// Test the property 'ErrorIfNoTraffic' - /// - [Fact] - public void ErrorIfNoTrafficTest() - { - // TODO unit test for the property 'ErrorIfNoTraffic' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MetricTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MetricTests.cs deleted file mode 100644 index 9dc722e0a4..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/MetricTests.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing Metric - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MetricTests : IDisposable - { - // TODO uncomment below to declare an instance variable for Metric - //private Metric instance; - - public MetricTests() - { - // TODO uncomment below to create an instance of Metric - //instance = new Metric(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of Metric - /// - [Fact] - public void MetricInstanceTest() - { - // TODO uncomment below to test "IsType" Metric - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/NameValuePairTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/NameValuePairTests.cs deleted file mode 100644 index 0d2b16c5c9..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/NameValuePairTests.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing NameValuePair - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class NameValuePairTests : IDisposable - { - // TODO uncomment below to declare an instance variable for NameValuePair - //private NameValuePair instance; - - public NameValuePairTests() - { - // TODO uncomment below to create an instance of NameValuePair - //instance = new NameValuePair(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of NameValuePair - /// - [Fact] - public void NameValuePairInstanceTest() - { - // TODO uncomment below to test "IsType" NameValuePair - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Value' - /// - [Fact] - public void ValueTest() - { - // TODO unit test for the property 'Value' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTests.cs deleted file mode 100644 index b6a727a758..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing Page - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class PageTests : IDisposable - { - // TODO uncomment below to declare an instance variable for Page - //private Page instance; - - public PageTests() - { - // TODO uncomment below to create an instance of Page - //instance = new Page(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of Page - /// - [Fact] - public void PageInstanceTest() - { - // TODO uncomment below to test "IsType" Page - //Assert.IsType(instance); - } - - - /// - /// Test the property 'StartedDateTime' - /// - [Fact] - public void StartedDateTimeTest() - { - // TODO unit test for the property 'StartedDateTime' - } - /// - /// Test the property 'Id' - /// - [Fact] - public void IdTest() - { - // TODO unit test for the property 'Id' - } - /// - /// Test the property 'Title' - /// - [Fact] - public void TitleTest() - { - // TODO unit test for the property 'Title' - } - /// - /// Test the property 'Verifications' - /// - [Fact] - public void VerificationsTest() - { - // TODO unit test for the property 'Verifications' - } - /// - /// Test the property 'Metrics' - /// - [Fact] - public void MetricsTest() - { - // TODO unit test for the property 'Metrics' - } - /// - /// Test the property 'Errors' - /// - [Fact] - public void ErrorsTest() - { - // TODO unit test for the property 'Errors' - } - /// - /// Test the property 'PageTimings' - /// - [Fact] - public void PageTimingsTest() - { - // TODO unit test for the property 'PageTimings' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTimingTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTimingTests.cs deleted file mode 100644 index 859b9157c2..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTimingTests.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing PageTiming - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class PageTimingTests : IDisposable - { - // TODO uncomment below to declare an instance variable for PageTiming - //private PageTiming instance; - - public PageTimingTests() - { - // TODO uncomment below to create an instance of PageTiming - //instance = new PageTiming(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of PageTiming - /// - [Fact] - public void PageTimingInstanceTest() - { - // TODO uncomment below to test "IsType" PageTiming - //Assert.IsType(instance); - } - - - /// - /// Test the property 'OnContentLoad' - /// - [Fact] - public void OnContentLoadTest() - { - // TODO unit test for the property 'OnContentLoad' - } - /// - /// Test the property 'OnLoad' - /// - [Fact] - public void OnLoadTest() - { - // TODO unit test for the property 'OnLoad' - } - /// - /// Test the property 'FirstInputDelay' - /// - [Fact] - public void FirstInputDelayTest() - { - // TODO unit test for the property 'FirstInputDelay' - } - /// - /// Test the property 'FirstPaint' - /// - [Fact] - public void FirstPaintTest() - { - // TODO unit test for the property 'FirstPaint' - } - /// - /// Test the property 'CumulativeLayoutShift' - /// - [Fact] - public void CumulativeLayoutShiftTest() - { - // TODO unit test for the property 'CumulativeLayoutShift' - } - /// - /// Test the property 'LargestContentfulPaint' - /// - [Fact] - public void LargestContentfulPaintTest() - { - // TODO unit test for the property 'LargestContentfulPaint' - } - /// - /// Test the property 'DomInteractive' - /// - [Fact] - public void DomInteractiveTest() - { - // TODO unit test for the property 'DomInteractive' - } - /// - /// Test the property 'FirstContentfulPaint' - /// - [Fact] - public void FirstContentfulPaintTest() - { - // TODO unit test for the property 'FirstContentfulPaint' - } - /// - /// Test the property 'Dns' - /// - [Fact] - public void DnsTest() - { - // TODO unit test for the property 'Dns' - } - /// - /// Test the property 'Ssl' - /// - [Fact] - public void SslTest() - { - // TODO unit test for the property 'Ssl' - } - /// - /// Test the property 'TimeToFirstByte' - /// - [Fact] - public void TimeToFirstByteTest() - { - // TODO unit test for the property 'TimeToFirstByte' - } - /// - /// Test the property 'Href' - /// - [Fact] - public void HrefTest() - { - // TODO unit test for the property 'Href' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTimingsTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTimingsTests.cs deleted file mode 100644 index ee8f203c9d..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/PageTimingsTests.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing PageTimings - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class PageTimingsTests : IDisposable - { - // TODO uncomment below to declare an instance variable for PageTimings - //private PageTimings instance; - - public PageTimingsTests() - { - // TODO uncomment below to create an instance of PageTimings - //instance = new PageTimings(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of PageTimings - /// - [Fact] - public void PageTimingsInstanceTest() - { - // TODO uncomment below to test "IsType" PageTimings - //Assert.IsType(instance); - } - - - /// - /// Test the property 'OnContentLoad' - /// - [Fact] - public void OnContentLoadTest() - { - // TODO unit test for the property 'OnContentLoad' - } - /// - /// Test the property 'OnLoad' - /// - [Fact] - public void OnLoadTest() - { - // TODO unit test for the property 'OnLoad' - } - /// - /// Test the property 'Href' - /// - [Fact] - public void HrefTest() - { - // TODO unit test for the property 'Href' - } - /// - /// Test the property 'Dns' - /// - [Fact] - public void DnsTest() - { - // TODO unit test for the property 'Dns' - } - /// - /// Test the property 'Ssl' - /// - [Fact] - public void SslTest() - { - // TODO unit test for the property 'Ssl' - } - /// - /// Test the property 'TimeToFirstByte' - /// - [Fact] - public void TimeToFirstByteTest() - { - // TODO unit test for the property 'TimeToFirstByte' - } - /// - /// Test the property 'CumulativeLayoutShift' - /// - [Fact] - public void CumulativeLayoutShiftTest() - { - // TODO unit test for the property 'CumulativeLayoutShift' - } - /// - /// Test the property 'LargestContentfulPaint' - /// - [Fact] - public void LargestContentfulPaintTest() - { - // TODO unit test for the property 'LargestContentfulPaint' - } - /// - /// Test the property 'FirstPaint' - /// - [Fact] - public void FirstPaintTest() - { - // TODO unit test for the property 'FirstPaint' - } - /// - /// Test the property 'FirstInputDelay' - /// - [Fact] - public void FirstInputDelayTest() - { - // TODO unit test for the property 'FirstInputDelay' - } - /// - /// Test the property 'DomInteractive' - /// - [Fact] - public void DomInteractiveTest() - { - // TODO unit test for the property 'DomInteractive' - } - /// - /// Test the property 'FirstContentfulPaint' - /// - [Fact] - public void FirstContentfulPaintTest() - { - // TODO unit test for the property 'FirstContentfulPaint' - } - /// - /// Test the property 'Comment' - /// - [Fact] - public void CommentTest() - { - // TODO unit test for the property 'Comment' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/VerifyResultTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/VerifyResultTests.cs deleted file mode 100644 index 2a72d308e4..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/VerifyResultTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing VerifyResult - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class VerifyResultTests : IDisposable - { - // TODO uncomment below to declare an instance variable for VerifyResult - //private VerifyResult instance; - - public VerifyResultTests() - { - // TODO uncomment below to create an instance of VerifyResult - //instance = new VerifyResult(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of VerifyResult - /// - [Fact] - public void VerifyResultInstanceTest() - { - // TODO uncomment below to test "IsType" VerifyResult - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Result' - /// - [Fact] - public void ResultTest() - { - // TODO unit test for the property 'Result' - } - /// - /// Test the property 'Name' - /// - [Fact] - public void NameTest() - { - // TODO unit test for the property 'Name' - } - /// - /// Test the property 'Type' - /// - [Fact] - public void TypeTest() - { - // TODO unit test for the property 'Type' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/WebSocketMessageTests.cs b/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/WebSocketMessageTests.cs deleted file mode 100644 index 64f5a70329..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient.Test/Model/WebSocketMessageTests.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using BrowserUpMitmProxyClient.Api; -using BrowserUpMitmProxyClient.Model; -using BrowserUpMitmProxyClient.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace BrowserUpMitmProxyClient.Test.Model -{ - /// - /// Class for testing WebSocketMessage - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class WebSocketMessageTests : IDisposable - { - // TODO uncomment below to declare an instance variable for WebSocketMessage - //private WebSocketMessage instance; - - public WebSocketMessageTests() - { - // TODO uncomment below to create an instance of WebSocketMessage - //instance = new WebSocketMessage(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of WebSocketMessage - /// - [Fact] - public void WebSocketMessageInstanceTest() - { - // TODO uncomment below to test "IsType" WebSocketMessage - //Assert.IsType(instance); - } - - - /// - /// Test the property 'Type' - /// - [Fact] - public void TypeTest() - { - // TODO unit test for the property 'Type' - } - /// - /// Test the property 'Opcode' - /// - [Fact] - public void OpcodeTest() - { - // TODO unit test for the property 'Opcode' - } - /// - /// Test the property 'Data' - /// - [Fact] - public void DataTest() - { - // TODO unit test for the property 'Data' - } - /// - /// Test the property 'Time' - /// - [Fact] - public void TimeTest() - { - // TODO unit test for the property 'Time' - } - - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Api/BrowserUpProxyApi.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Api/BrowserUpProxyApi.cs deleted file mode 100644 index 44aa4f2371..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Api/BrowserUpProxyApi.cs +++ /dev/null @@ -1,2121 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Mime; -using BrowserUpMitmProxyClient.Client; -using BrowserUpMitmProxyClient.Model; - -namespace BrowserUpMitmProxyClient.Api -{ - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IBrowserUpProxyApiSync : IApiAccessor - { - #region Synchronous Operations - /// - /// - /// - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// - void AddError(Error error, int operationIndex = 0); - - /// - /// - /// - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse AddErrorWithHttpInfo(Error error, int operationIndex = 0); - /// - /// - /// - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// - void AddMetric(Metric metric, int operationIndex = 0); - - /// - /// - /// - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse AddMetricWithHttpInfo(Metric metric, int operationIndex = 0); - /// - /// - /// - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Har - Har GetHarLog(int operationIndex = 0); - - /// - /// - /// - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of Har - ApiResponse GetHarLogWithHttpInfo(int operationIndex = 0); - /// - /// - /// - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// - void Healthcheck(int operationIndex = 0); - - /// - /// - /// - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse HealthcheckWithHttpInfo(int operationIndex = 0); - /// - /// - /// - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// Har - Har NewPage(string title, int operationIndex = 0); - - /// - /// - /// - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// ApiResponse of Har - ApiResponse NewPageWithHttpInfo(string title, int operationIndex = 0); - /// - /// - /// - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Har - Har ResetHarLog(int operationIndex = 0); - - /// - /// - /// - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of Har - ApiResponse ResetHarLogWithHttpInfo(int operationIndex = 0); - /// - /// - /// - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - VerifyResult VerifyNotPresent(string name, MatchCriteria matchCriteria, int operationIndex = 0); - - /// - /// - /// - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - ApiResponse VerifyNotPresentWithHttpInfo(string name, MatchCriteria matchCriteria, int operationIndex = 0); - /// - /// - /// - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - VerifyResult VerifyPresent(string name, MatchCriteria matchCriteria, int operationIndex = 0); - - /// - /// - /// - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - ApiResponse VerifyPresentWithHttpInfo(string name, MatchCriteria matchCriteria, int operationIndex = 0); - /// - /// - /// - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - VerifyResult VerifySLA(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0); - - /// - /// - /// - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - ApiResponse VerifySLAWithHttpInfo(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0); - /// - /// - /// - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - VerifyResult VerifySize(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0); - - /// - /// - /// - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - ApiResponse VerifySizeWithHttpInfo(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IBrowserUpProxyApiAsync : IApiAccessor - { - #region Asynchronous Operations - /// - /// - /// - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task AddErrorAsync(Error error, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> AddErrorWithHttpInfoAsync(Error error, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task AddMetricAsync(Metric metric, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> AddMetricWithHttpInfoAsync(Metric metric, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Har - System.Threading.Tasks.Task GetHarLogAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Har) - System.Threading.Tasks.Task> GetHarLogWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task HealthcheckAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> HealthcheckWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Har - System.Threading.Tasks.Task NewPageAsync(string title, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Har) - System.Threading.Tasks.Task> NewPageWithHttpInfoAsync(string title, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Har - System.Threading.Tasks.Task ResetHarLogAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Har) - System.Threading.Tasks.Task> ResetHarLogWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - System.Threading.Tasks.Task VerifyNotPresentAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - System.Threading.Tasks.Task> VerifyNotPresentWithHttpInfoAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - System.Threading.Tasks.Task VerifyPresentAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - System.Threading.Tasks.Task> VerifyPresentWithHttpInfoAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - System.Threading.Tasks.Task VerifySLAAsync(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - System.Threading.Tasks.Task> VerifySLAWithHttpInfoAsync(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// - /// - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - System.Threading.Tasks.Task VerifySizeAsync(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// - /// - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - System.Threading.Tasks.Task> VerifySizeWithHttpInfoAsync(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IBrowserUpProxyApi : IBrowserUpProxyApiSync, IBrowserUpProxyApiAsync - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class BrowserUpProxyApi : IBrowserUpProxyApi - { - private BrowserUpMitmProxyClient.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public BrowserUpProxyApi() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - public BrowserUpProxyApi(string basePath) - { - this.Configuration = BrowserUpMitmProxyClient.Client.Configuration.MergeConfigurations( - BrowserUpMitmProxyClient.Client.GlobalConfiguration.Instance, - new BrowserUpMitmProxyClient.Client.Configuration { BasePath = basePath } - ); - this.Client = new BrowserUpMitmProxyClient.Client.ApiClient(this.Configuration.BasePath); - this.AsynchronousClient = new BrowserUpMitmProxyClient.Client.ApiClient(this.Configuration.BasePath); - this.ExceptionFactory = BrowserUpMitmProxyClient.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public BrowserUpProxyApi(BrowserUpMitmProxyClient.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = BrowserUpMitmProxyClient.Client.Configuration.MergeConfigurations( - BrowserUpMitmProxyClient.Client.GlobalConfiguration.Instance, - configuration - ); - this.Client = new BrowserUpMitmProxyClient.Client.ApiClient(this.Configuration.BasePath); - this.AsynchronousClient = new BrowserUpMitmProxyClient.Client.ApiClient(this.Configuration.BasePath); - ExceptionFactory = BrowserUpMitmProxyClient.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access. - /// The client interface for asynchronous API access. - /// The configuration object. - public BrowserUpProxyApi(BrowserUpMitmProxyClient.Client.ISynchronousClient client, BrowserUpMitmProxyClient.Client.IAsynchronousClient asyncClient, BrowserUpMitmProxyClient.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - this.AsynchronousClient = asyncClient; - this.Configuration = configuration; - this.ExceptionFactory = BrowserUpMitmProxyClient.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// The client for accessing this underlying API asynchronously. - /// - public BrowserUpMitmProxyClient.Client.IAsynchronousClient AsynchronousClient { get; set; } - - /// - /// The client for accessing this underlying API synchronously. - /// - public BrowserUpMitmProxyClient.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public BrowserUpMitmProxyClient.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public BrowserUpMitmProxyClient.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// - public void AddError(Error error, int operationIndex = 0) - { - AddErrorWithHttpInfo(error); - } - - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// ApiResponse of Object(void) - public BrowserUpMitmProxyClient.Client.ApiResponse AddErrorWithHttpInfo(Error error, int operationIndex = 0) - { - // verify the required parameter 'error' is set - if (error == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'error' when calling BrowserUpProxyApi->AddError"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.Data = error; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.AddError"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/har/errors", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("AddError", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task AddErrorAsync(Error error, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await AddErrorWithHttpInfoAsync(error, operationIndex, cancellationToken).ConfigureAwait(false); - } - - /// - /// Add Custom Error to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddErrorWithHttpInfoAsync(Error error, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'error' is set - if (error == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'error' when calling BrowserUpProxyApi->AddError"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.Data = error; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.AddError"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/har/errors", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("AddError", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// - public void AddMetric(Metric metric, int operationIndex = 0) - { - AddMetricWithHttpInfo(metric); - } - - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// ApiResponse of Object(void) - public BrowserUpMitmProxyClient.Client.ApiResponse AddMetricWithHttpInfo(Metric metric, int operationIndex = 0) - { - // verify the required parameter 'metric' is set - if (metric == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'metric' when calling BrowserUpProxyApi->AddMetric"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.Data = metric; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.AddMetric"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/har/metrics", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("AddMetric", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task AddMetricAsync(Metric metric, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await AddMetricWithHttpInfoAsync(metric, operationIndex, cancellationToken).ConfigureAwait(false); - } - - /// - /// Add Custom Metric to the captured traffic har - /// - /// Thrown when fails to make API call - /// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddMetricWithHttpInfoAsync(Metric metric, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'metric' is set - if (metric == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'metric' when calling BrowserUpProxyApi->AddMetric"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.Data = metric; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.AddMetric"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/har/metrics", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("AddMetric", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Har - public Har GetHarLog(int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = GetHarLogWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of Har - public BrowserUpMitmProxyClient.Client.ApiResponse GetHarLogWithHttpInfo(int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - - localVarRequestOptions.Operation = "BrowserUpProxyApi.GetHarLog"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Get("/har", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("GetHarLog", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Har - public async System.Threading.Tasks.Task GetHarLogAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await GetHarLogWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Get the current HAR. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Har) - public async System.Threading.Tasks.Task> GetHarLogWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - - localVarRequestOptions.Operation = "BrowserUpProxyApi.GetHarLog"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/har", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("GetHarLog", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// - public void Healthcheck(int operationIndex = 0) - { - HealthcheckWithHttpInfo(); - } - - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of Object(void) - public BrowserUpMitmProxyClient.Client.ApiResponse HealthcheckWithHttpInfo(int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - - localVarRequestOptions.Operation = "BrowserUpProxyApi.Healthcheck"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Get("/healthcheck", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("Healthcheck", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task HealthcheckAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await HealthcheckWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the healthcheck - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> HealthcheckWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - - localVarRequestOptions.Operation = "BrowserUpProxyApi.Healthcheck"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/healthcheck", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("Healthcheck", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// Har - public Har NewPage(string title, int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = NewPageWithHttpInfo(title); - return localVarResponse.Data; - } - - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// ApiResponse of Har - public BrowserUpMitmProxyClient.Client.ApiResponse NewPageWithHttpInfo(string title, int operationIndex = 0) - { - // verify the required parameter 'title' is set - if (title == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'title' when calling BrowserUpProxyApi->NewPage"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("title", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(title)); // path parameter - - localVarRequestOptions.Operation = "BrowserUpProxyApi.NewPage"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/har/page", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("NewPage", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Har - public async System.Threading.Tasks.Task NewPageAsync(string title, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await NewPageWithHttpInfoAsync(title, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Starts a fresh HAR Page (Step) in the current active HAR to group requests. - /// - /// Thrown when fails to make API call - /// The unique title for this har page/step. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Har) - public async System.Threading.Tasks.Task> NewPageWithHttpInfoAsync(string title, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'title' is set - if (title == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'title' when calling BrowserUpProxyApi->NewPage"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("title", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(title)); // path parameter - - localVarRequestOptions.Operation = "BrowserUpProxyApi.NewPage"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/har/page", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("NewPage", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Har - public Har ResetHarLog(int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = ResetHarLogWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of Har - public BrowserUpMitmProxyClient.Client.ApiResponse ResetHarLogWithHttpInfo(int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - - localVarRequestOptions.Operation = "BrowserUpProxyApi.ResetHarLog"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Put("/har", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("ResetHarLog", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Har - public async System.Threading.Tasks.Task ResetHarLogAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await ResetHarLogWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Starts a fresh HAR capture session. - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Har) - public async System.Threading.Tasks.Task> ResetHarLogWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - - localVarRequestOptions.Operation = "BrowserUpProxyApi.ResetHarLog"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/har", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("ResetHarLog", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - public VerifyResult VerifyNotPresent(string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = VerifyNotPresentWithHttpInfo(name, matchCriteria); - return localVarResponse.Data; - } - - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - public BrowserUpMitmProxyClient.Client.ApiResponse VerifyNotPresentWithHttpInfo(string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifyNotPresent"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifyNotPresent"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifyNotPresent"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/verify/not_present/{name}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifyNotPresent", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - public async System.Threading.Tasks.Task VerifyNotPresentAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await VerifyNotPresentWithHttpInfoAsync(name, matchCriteria, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Verify no matching items are present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - public async System.Threading.Tasks.Task> VerifyNotPresentWithHttpInfoAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifyNotPresent"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifyNotPresent"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifyNotPresent"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/verify/not_present/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifyNotPresent", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - public VerifyResult VerifyPresent(string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = VerifyPresentWithHttpInfo(name, matchCriteria); - return localVarResponse.Data; - } - - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - public BrowserUpMitmProxyClient.Client.ApiResponse VerifyPresentWithHttpInfo(string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifyPresent"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifyPresent"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifyPresent"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/verify/present/{name}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifyPresent", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - public async System.Threading.Tasks.Task VerifyPresentAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await VerifyPresentWithHttpInfoAsync(name, matchCriteria, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Verify at least one matching item is present in the captured traffic - /// - /// Thrown when fails to make API call - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - public async System.Threading.Tasks.Task> VerifyPresentWithHttpInfoAsync(string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifyPresent"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifyPresent"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifyPresent"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/verify/present/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifyPresent", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - public VerifyResult VerifySLA(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = VerifySLAWithHttpInfo(time, name, matchCriteria); - return localVarResponse.Data; - } - - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - public BrowserUpMitmProxyClient.Client.ApiResponse VerifySLAWithHttpInfo(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifySLA"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifySLA"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("time", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(time)); // path parameter - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifySLA"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/verify/sla/{time}/{name}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifySLA", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - public async System.Threading.Tasks.Task VerifySLAAsync(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await VerifySLAWithHttpInfoAsync(time, name, matchCriteria, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Verify each traffic item matching the criteria meets is below SLA time - /// - /// Thrown when fails to make API call - /// The time used for comparison - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - public async System.Threading.Tasks.Task> VerifySLAWithHttpInfoAsync(int time, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifySLA"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifySLA"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("time", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(time)); // path parameter - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifySLA"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/verify/sla/{time}/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifySLA", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// VerifyResult - public VerifyResult VerifySize(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = VerifySizeWithHttpInfo(size, name, matchCriteria); - return localVarResponse.Data; - } - - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// ApiResponse of VerifyResult - public BrowserUpMitmProxyClient.Client.ApiResponse VerifySizeWithHttpInfo(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifySize"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifySize"); - } - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("size", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(size)); // path parameter - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifySize"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = this.Client.Post("/verify/size/{size}/{name}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifySize", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of VerifyResult - public async System.Threading.Tasks.Task VerifySizeAsync(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BrowserUpMitmProxyClient.Client.ApiResponse localVarResponse = await VerifySizeWithHttpInfoAsync(size, name, matchCriteria, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Verify matching items in the captured traffic meet the size criteria - /// - /// Thrown when fails to make API call - /// The size used for comparison, in kilobytes - /// The unique name for this verification operation - /// Match criteria to select requests - response pairs for size tests - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (VerifyResult) - public async System.Threading.Tasks.Task> VerifySizeWithHttpInfoAsync(int size, string name, MatchCriteria matchCriteria, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'name' is set - if (name == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'name' when calling BrowserUpProxyApi->VerifySize"); - } - - // verify the required parameter 'matchCriteria' is set - if (matchCriteria == null) - { - throw new BrowserUpMitmProxyClient.Client.ApiException(400, "Missing required parameter 'matchCriteria' when calling BrowserUpProxyApi->VerifySize"); - } - - - BrowserUpMitmProxyClient.Client.RequestOptions localVarRequestOptions = new BrowserUpMitmProxyClient.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/json" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = BrowserUpMitmProxyClient.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("size", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(size)); // path parameter - localVarRequestOptions.PathParameters.Add("name", BrowserUpMitmProxyClient.Client.ClientUtils.ParameterToString(name)); // path parameter - localVarRequestOptions.Data = matchCriteria; - - localVarRequestOptions.Operation = "BrowserUpProxyApi.VerifySize"; - localVarRequestOptions.OperationIndex = operationIndex; - - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/verify/size/{size}/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("VerifySize", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/BrowserUpMitmProxyClient.csproj b/clients/csharp/src/BrowserUpMitmProxyClient/BrowserUpMitmProxyClient.csproj deleted file mode 100644 index da35bc999d..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/BrowserUpMitmProxyClient.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - false - net7.0 - BrowserUpMitmProxyClient - BrowserUpMitmProxyClient - Library - OpenAPI - OpenAPI - OpenAPI Library - A library generated from a OpenAPI doc - No Copyright - BrowserUpMitmProxyClient - 1.0.0 - bin\$(Configuration)\$(TargetFramework)\BrowserUpMitmProxyClient.xml - https://github.com/GIT_USER_ID/GIT_REPO_ID.git - git - Minor update - annotations - - - - - - - - - - - - - - - - - diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiClient.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiClient.cs deleted file mode 100644 index b8c9ddd72b..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiClient.cs +++ /dev/null @@ -1,834 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Web; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using RestSharp; -using RestSharp.Serializers; -using RestSharpMethod = RestSharp.Method; -using Polly; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer - { - private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is BrowserUpMitmProxyClient.Model.AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return ((BrowserUpMitmProxyClient.Model.AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); - - public T Deserialize(RestResponse response) - { - var result = (T)Deserialize(response, typeof(T)); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal object Deserialize(RestResponse response, Type type) - { - if (type == typeof(byte[])) // return byte array - { - return response.RawBytes; - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = response.RawBytes; - if (response.Headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() - : _configuration.TempFolderPath; - var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); - foreach (var header in response.Headers) - { - var match = regex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(response.Content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public ISerializer Serializer => this; - public IDeserializer Deserializer => this; - - public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept; - - public SupportsContentType SupportsContentType => contentType => - contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } - - public DataFormat DataFormat => DataFormat.Json; - } - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - public partial class ApiClient : ISynchronousClient, IAsynchronousClient - { - private readonly string _baseUrl; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Allows for extending request processing for generated code. - /// - /// The RestSharp request object - partial void InterceptRequest(RestRequest request); - - /// - /// Allows for extending response processing for generated code. - /// - /// The RestSharp request object - /// The RestSharp response object - partial void InterceptResponse(RestRequest request, RestResponse response); - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - public ApiClient() - { - _baseUrl = BrowserUpMitmProxyClient.Client.GlobalConfiguration.Instance.BasePath; - } - - /// - /// Initializes a new instance of the - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) - throw new ArgumentException("basePath cannot be empty"); - - _baseUrl = basePath; - } - - /// - /// Constructs the RestSharp version of an http method - /// - /// Swagger Client Custom HttpMethod - /// RestSharp's HttpMethod instance. - /// - private RestSharpMethod Method(HttpMethod method) - { - RestSharpMethod other; - switch (method) - { - case HttpMethod.Get: - other = RestSharpMethod.Get; - break; - case HttpMethod.Post: - other = RestSharpMethod.Post; - break; - case HttpMethod.Put: - other = RestSharpMethod.Put; - break; - case HttpMethod.Delete: - other = RestSharpMethod.Delete; - break; - case HttpMethod.Head: - other = RestSharpMethod.Head; - break; - case HttpMethod.Options: - other = RestSharpMethod.Options; - break; - case HttpMethod.Patch: - other = RestSharpMethod.Patch; - break; - default: - throw new ArgumentOutOfRangeException("method", method, null); - } - - return other; - } - - /// - /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// [private] A new RestRequest instance. - /// - private RestRequest NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - RestRequest request = new RestRequest(path, Method(method)); - - if (options.PathParameters != null) - { - foreach (var pathParam in options.PathParameters) - { - request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); - } - } - - if (options.QueryParameters != null) - { - foreach (var queryParam in options.QueryParameters) - { - foreach (var value in queryParam.Value) - { - request.AddQueryParameter(queryParam.Key, value); - } - } - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.AddHeader(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - request.AddHeader(headerParam.Key, value); - } - } - } - - if (options.FormParameters != null) - { - foreach (var formParam in options.FormParameters) - { - request.AddParameter(formParam.Key, formParam.Value); - } - } - - if (options.Data != null) - { - if (options.Data is Stream stream) - { - var contentType = "application/octet-stream"; - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes[0]; - } - - var bytes = ClientUtils.ReadAsBytes(stream); - request.AddParameter(contentType, bytes, ParameterType.RequestBody); - } - else - { - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) - { - request.RequestFormat = DataFormat.Json; - } - else - { - // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. - } - } - else - { - // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. - request.RequestFormat = DataFormat.Json; - } - - request.AddJsonBody(options.Data); - } - } - - if (options.FileParameters != null) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var bytes = ClientUtils.ReadAsBytes(file); - var fileStream = file as FileStream; - if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); - else - request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); - } - } - } - - return request; - } - - private ApiResponse ToApiResponse(RestResponse response) - { - T result = response.Data; - string rawContent = response.Content; - - var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) - { - ErrorText = response.ErrorMessage, - Cookies = new List() - }; - - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.ContentHeaders != null) - { - foreach (var responseHeader in response.ContentHeaders) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.Cookies != null) - { - foreach (var responseCookies in response.Cookies.Cast()) - { - transformed.Cookies.Add( - new Cookie( - responseCookies.Name, - responseCookies.Value, - responseCookies.Path, - responseCookies.Domain) - ); - } - } - - return transformed; - } - - private ApiResponse Exec(RestRequest req, RequestOptions options, IReadableConfiguration configuration) - { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent - }; - - RestClient client = new RestClient(clientOptions) - .UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - - InterceptRequest(req); - - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse - { - Request = req, - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(req); - } - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(BrowserUpMitmProxyClient.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - try - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - catch (Exception ex) - { - throw ex.InnerException != null ? ex.InnerException : ex; - } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - - InterceptResponse(req, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); - } - } - return result; - } - - private async Task> ExecAsync(RestRequest req, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent - }; - - RestClient client = new RestClient(clientOptions) - .UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - - InterceptRequest(req); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse - { - Request = req, - ErrorException = policyResult.FinalException - }; - } - else - { - response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); - } - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(BrowserUpMitmProxyClient.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - - InterceptResponse(req, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); - } - } - return result; - } - - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); - } - #endregion IAsynchronousClient - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); - } - #endregion ISynchronousClient - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiException.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiException.cs deleted file mode 100644 index 1c38ace00e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiException.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// API Exception - /// - public 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 object ErrorContent { get; private set; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { 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. - /// HTTP Headers. - public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) - { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - this.Headers = headers; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiResponse.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiResponse.cs deleted file mode 100644 index e8a741d67c..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ApiResponse.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Generic; -using System.Net; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Provides a non-generic contract for the ApiResponse wrapper. - /// - public interface IApiResponse - { - /// - /// The data type of - /// - Type ResponseType { get; } - - /// - /// The content of this response - /// - Object Content { get; } - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - Multimap Headers { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - List Cookies { get; set; } - - /// - /// The raw content of this response - /// - string RawContent { get; } - } - - /// - /// API Response - /// - public class ApiResponse : IApiResponse - { - #region Properties - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - public HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { get; } - - /// - /// Gets or sets the data (parsed HTTP body) - /// - /// The data. - public T Data { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - public string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - public List Cookies { get; set; } - - /// - /// The content of this response - /// - public Type ResponseType - { - get { return typeof(T); } - } - - /// - /// The data type of - /// - public object Content - { - get { return Data; } - } - - /// - /// The raw content - /// - public string RawContent { get; } - - #endregion Properties - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) - { - StatusCode = statusCode; - Headers = headers; - Data = data; - RawContent = rawContent; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) - { - } - - #endregion Constructors - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ClientUtils.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/ClientUtils.cs deleted file mode 100644 index a657c5e09e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ClientUtils.cs +++ /dev/null @@ -1,242 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Utility functions providing some benefit to API client consumers. - /// - public static class ClientUtils - { - /// - /// Sanitize filename by removing the path - /// - /// Filename - /// Filename - public static string SanitizeFilename(string filename) - { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); - return match.Success ? match.Groups[1].Value : filename; - } - - /// - /// Convert params to key/value pairs. - /// Use collectionFormat to properly format lists and collections. - /// - /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi - /// Key name. - /// Value object. - /// A multimap of keys with 1..n associated values. - public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) - { - var parameters = new Multimap(); - - if (value is ICollection collection && collectionFormat == "multi") - { - foreach (var item in collection) - { - parameters.Add(name, ParameterToString(item)); - } - } - else if (value is IDictionary dictionary) - { - if(collectionFormat == "deepObject") { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); - } - } - else { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); - } - } - } - else - { - parameters.Add(name, ParameterToString(value)); - } - - return parameters; - } - - /// - /// 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). - /// An optional configuration instance, providing formatting options used in processing. - /// Formatted string. - public static string ParameterToString(object obj, IReadableConfiguration configuration = null) - { - 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((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - 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((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); - if (obj is Enum && HasEnumMemberAttrValue(obj)) - return GetEnumMemberAttrValue(obj); - - return Convert.ToString(obj, CultureInfo.InvariantCulture); - } - - /// - /// Serializes the given object when not null. Otherwise return null. - /// - /// The object to serialize. - /// Serialized string. - public static string Serialize(object obj) - { - return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; - } - - /// - /// Encode string in base64 format. - /// - /// string to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - return Convert.ToBase64String(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. - /// - public 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"); - } - - /// - /// Is the Enum decorated with EnumMember Attribute - /// - /// - /// true if found - private static bool HasEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); - var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); - if (attr != null) return true; - return false; - } - - /// - /// Get the EnumMember value - /// - /// - /// EnumMember value as string otherwise null - private static string GetEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); - var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); - if (attr != null) - { - return attr.Value; - } - return null; - } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/Configuration.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/Configuration.cs deleted file mode 100644 index 2e4b5c7d9e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/Configuration.cs +++ /dev/null @@ -1,607 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Net.Http; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Represents a set of configuration settings - /// - public class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.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 Static Members - - /// - /// Default creation of exceptions for a given method name and response object - /// - public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => - { - var status = (int)response.StatusCode; - if (status >= 400) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.RawContent), - response.RawContent, response.Headers); - } - if (status == 0) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); - } - return null; - }; - - #endregion Static Members - - #region Private Members - - /// - /// Defines the base path of the target API server. - /// Example: http://localhost:3000/v1/ - /// - private string _basePath; - - /// - /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for accessing an API. - /// - /// The API key. - private IDictionary _apiKey; - - /// - /// 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; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the servers defined in the OpenAPI spec. - /// - /// The servers - private IList> _servers; - - /// - /// Gets or sets the operation servers defined in the OpenAPI spec. - /// - /// The operation servers - private IReadOnlyDictionary>> _operationServers; - - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration() - { - Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); - BasePath = "http://localhost:48088"; - DefaultHeaders = new ConcurrentDictionary(); - ApiKey = new ConcurrentDictionary(); - ApiKeyPrefix = new ConcurrentDictionary(); - Servers = new List>() - { - { - new Dictionary { - {"url", "http://localhost:{port}"}, - {"description", "The development API server"}, - { - "variables", new Dictionary { - { - "port", new Dictionary { - {"description", "No description provided"}, - {"default_value", "48088"}, - { - "enum_values", new List() { - "48088" - } - } - } - } - } - } - } - } - }; - OperationServers = new Dictionary>>() - { - }; - - // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; - } - - /// - /// Initializes a new instance of the class - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration( - IDictionary defaultHeaders, - IDictionary apiKey, - IDictionary apiKeyPrefix, - string basePath = "http://localhost:48088") : this() - { - if (string.IsNullOrWhiteSpace(basePath)) - throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeaders == null) - throw new ArgumentNullException("defaultHeaders"); - if (apiKey == null) - throw new ArgumentNullException("apiKey"); - if (apiKeyPrefix == null) - throw new ArgumentNullException("apiKeyPrefix"); - - BasePath = basePath; - - foreach (var keyValuePair in defaultHeaders) - { - DefaultHeaders.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKey) - { - ApiKey.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKeyPrefix) - { - ApiKeyPrefix.Add(keyValuePair); - } - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the base path for API access. - /// - public virtual string BasePath { - get { return _basePath; } - set { _basePath = value; } - } - - /// - /// Gets or sets the default header. - /// - [Obsolete("Use DefaultHeaders instead.")] - public virtual IDictionary DefaultHeader - { - get - { - return DefaultHeaders; - } - set - { - DefaultHeaders = value; - } - } - - /// - /// Gets or sets the default headers. - /// - public virtual IDictionary DefaultHeaders { get; set; } - - /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. - /// - public virtual int Timeout { get; set; } - - /// - /// Gets or sets the proxy - /// - /// Proxy. - public virtual WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public virtual string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public virtual string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public virtual string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - string apiKeyValue; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - string apiKeyPrefix; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - { - return apiKeyPrefix + " " + apiKeyValue; - } - - return apiKeyValue; - } - - /// - /// Gets or sets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - public X509CertificateCollection ClientCertificates { get; set; } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// This helper property simplifies code generation. - /// - /// The access token. - public virtual string AccessToken { get; set; } - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public virtual string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - _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 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 virtual 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. - /// - /// Whatever you set here will be prepended to the value defined in AddApiKey. - /// - /// An example invocation here might be: - /// - /// ApiKeyPrefix["Authorization"] = "Bearer"; - /// - /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. - /// - /// - /// OAuth2 workflows should set tokens via AccessToken. - /// - /// - /// The prefix of the API key. - public virtual 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 virtual IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - - /// - /// Gets or sets the servers. - /// - /// The servers. - public virtual IList> Servers - { - get { return _servers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Servers may not be null."); - } - _servers = value; - } - } - - /// - /// Gets or sets the operation servers. - /// - /// The operation servers. - public virtual IReadOnlyDictionary>> OperationServers - { - get { return _operationServers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Operation servers may not be null."); - } - _operationServers = value; - } - } - - /// - /// Returns URL based on server settings without providing values - /// for the variables - /// - /// Array index of the server settings. - /// The server URL. - public string GetServerUrl(int index) - { - return GetServerUrl(Servers, index, null); - } - - /// - /// Returns URL based on server settings. - /// - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - public string GetServerUrl(int index, Dictionary inputVariables) - { - return GetServerUrl(Servers, index, inputVariables); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index) - { - return GetOperationServerUrl(operation, index, null); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) - { - if (OperationServers.TryGetValue(operation, out var operationServer)) - { - return GetServerUrl(operationServer, index, inputVariables); - } - - return null; - } - - /// - /// Returns URL based on server settings. - /// - /// Dictionary of server settings. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) - { - if (index < 0 || index >= servers.Count) - { - throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); - } - - if (inputVariables == null) - { - inputVariables = new Dictionary(); - } - - IReadOnlyDictionary server = servers[index]; - string url = (string)server["url"]; - - if (server.ContainsKey("variables")) - { - // go through each variable and assign a value - foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) - { - - IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - - if (inputVariables.ContainsKey(variable.Key)) - { - if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) - { - url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); - } - else - { - throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); - } - } - else - { - // use default value - url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); - } - } - } - - return url; - } - - #endregion Properties - - #region Methods - - /// - /// Returns a string with essential information for debugging. - /// - public static string ToDebugReport() - { - string report = "C# SDK (BrowserUpMitmProxyClient) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 1.24\n"; - report += " SDK Package Version: 1.0.0\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 - - #region Static Members - /// - /// Merge configurations. - /// - /// First configuration. - /// Second configuration. - /// Merged configuration. - public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) - { - if (second == null) return first ?? GlobalConfiguration.Instance; - - Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - - foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; - foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; - - var config = new Configuration - { - ApiKey = apiKey, - ApiKeyPrefix = apiKeyPrefix, - DefaultHeaders = defaultHeaders, - BasePath = second.BasePath ?? first.BasePath, - Timeout = second.Timeout, - Proxy = second.Proxy ?? first.Proxy, - UserAgent = second.UserAgent ?? first.UserAgent, - Username = second.Username ?? first.Username, - Password = second.Password ?? first.Password, - AccessToken = second.AccessToken ?? first.AccessToken, - TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, - DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, - ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, - }; - return config; - } - #endregion Static Members - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ExceptionFactory.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/ExceptionFactory.cs deleted file mode 100644 index 42148d22c4..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ExceptionFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// A delegate to ExceptionFactory method - /// - /// Method name - /// Response - /// Exceptions - public delegate Exception ExceptionFactory(string methodName, IApiResponse response); -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/GlobalConfiguration.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/GlobalConfiguration.cs deleted file mode 100644 index fd95ab905c..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/GlobalConfiguration.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System.Collections.Generic; - -namespace BrowserUpMitmProxyClient.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 .openapi-generator-ignore file. - /// - public partial class GlobalConfiguration : Configuration - { - #region Private Members - - private static readonly object GlobalConfigSync = new { }; - private static IReadableConfiguration _globalConfiguration; - - #endregion Private Members - - #region Constructors - - /// - private GlobalConfiguration() - { - } - - /// - public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) - { - } - - static GlobalConfiguration() - { - Instance = new GlobalConfiguration(); - } - - #endregion Constructors - - /// - /// Gets or sets the default Configuration. - /// - /// Configuration. - public static IReadableConfiguration Instance - { - get { return _globalConfiguration; } - set - { - lock (GlobalConfigSync) - { - _globalConfiguration = value; - } - } - } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/HttpMethod.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/HttpMethod.cs deleted file mode 100644 index 7c79411868..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/HttpMethod.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Http methods supported by swagger - /// - public enum HttpMethod - { - /// HTTP GET request. - Get, - /// HTTP POST request. - Post, - /// HTTP PUT request. - Put, - /// HTTP DELETE request. - Delete, - /// HTTP HEAD request. - Head, - /// HTTP OPTIONS request. - Options, - /// HTTP PATCH request. - Patch - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/IApiAccessor.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/IApiAccessor.cs deleted file mode 100644 index 5243403a95..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/IApiAccessor.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Represents configuration aspects required to interact with the API endpoints. - /// - public interface IApiAccessor - { - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - IReadableConfiguration 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; } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/IAsynchronousClient.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/IAsynchronousClient.cs deleted file mode 100644 index a6f92308c3..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/IAsynchronousClient.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Threading.Tasks; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Contract for Asynchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface IAsynchronousClient - { - /// - /// Executes a non-blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Executes a non-blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Executes a non-blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Executes a non-blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Executes a non-blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Executes a non-blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Executes a non-blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/IReadableConfiguration.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/IReadableConfiguration.cs deleted file mode 100644 index 06f727a210..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/IReadableConfiguration.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Generic; -using System.Net; -using System.Security.Cryptography.X509Certificates; - -namespace BrowserUpMitmProxyClient.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 format. - string DateTimeFormat { get; } - - /// - /// Gets the default header. - /// - /// Default header. - [Obsolete("Use DefaultHeaders instead.")] - IDictionary DefaultHeader { get; } - - /// - /// Gets the default headers. - /// - /// Default headers. - IDictionary DefaultHeaders { get; } - - /// - /// 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 proxy. - /// - /// Proxy. - WebProxy Proxy { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets the username. - /// - /// Username. - string Username { get; } - - /// - /// Gets the password. - /// - /// Password. - string Password { get; } - - /// - /// Get the servers associated with the operation. - /// - /// Operation servers. - IReadOnlyDictionary>> OperationServers { get; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - string GetApiKeyWithPrefix(string apiKeyIdentifier); - - /// - /// Gets the Operation server url at the provided index. - /// - /// Operation server name. - /// Index of the operation server settings. - /// - string GetOperationServerUrl(string operation, int index); - - /// - /// Gets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - X509CertificateCollection ClientCertificates { get; } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ISynchronousClient.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/ISynchronousClient.cs deleted file mode 100644 index 430c94b24e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/ISynchronousClient.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.IO; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Contract for Synchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface ISynchronousClient - { - /// - /// Executes a blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/Multimap.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/Multimap.cs deleted file mode 100644 index 48abb21165..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/Multimap.cs +++ /dev/null @@ -1,295 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// A dictionary in which one key has many associated values. - /// - /// The type of the key - /// The type of the value associated with the key. - public class Multimap : IDictionary> - { - #region Private Fields - - private readonly Dictionary> _dictionary; - - #endregion Private Fields - - #region Constructors - - /// - /// Empty Constructor. - /// - public Multimap() - { - _dictionary = new Dictionary>(); - } - - /// - /// Constructor with comparer. - /// - /// - public Multimap(IEqualityComparer comparer) - { - _dictionary = new Dictionary>(comparer); - } - - #endregion Constructors - - #region Enumerators - - /// - /// To get the enumerator. - /// - /// Enumerator - public IEnumerator>> GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - /// - /// To get the enumerator. - /// - /// Enumerator - IEnumerator IEnumerable.GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - #endregion Enumerators - - #region Public Members - /// - /// Add values to Multimap - /// - /// Key value pair - public void Add(KeyValuePair> item) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - - /// - /// Add Multimap to Multimap - /// - /// Multimap - public void Add(Multimap multimap) - { - foreach (var item in multimap) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - - /// - /// Clear Multimap - /// - public void Clear() - { - _dictionary.Clear(); - } - - /// - /// Determines whether Multimap contains the specified item. - /// - /// Key value pair - /// Method needs to be implemented - /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Copy items of the Multimap to an array, - /// starting at a particular array index. - /// - /// The array that is the destination of the items copied - /// from Multimap. The array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - /// - /// Removes the specified item from the Multimap. - /// - /// Key value pair - /// true if the item is successfully removed; otherwise, false. - /// Method needs to be implemented - public bool Remove(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Gets the number of items contained in the Multimap. - /// - public int Count => _dictionary.Count; - - /// - /// Gets a value indicating whether the Multimap is read-only. - /// - public bool IsReadOnly => false; - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add the value to Multimap. - public void Add(TKey key, IList value) - { - if (value != null && value.Count > 0) - { - if (_dictionary.TryGetValue(key, out var list)) - { - foreach (var k in value) list.Add(k); - } - else - { - list = new List(value); - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - } - - /// - /// Determines whether the Multimap contains an item with the specified key. - /// - /// The key to locate in the Multimap. - /// true if the Multimap contains an item with - /// the key; otherwise, false. - public bool ContainsKey(TKey key) - { - return _dictionary.ContainsKey(key); - } - - /// - /// Removes item with the specified key from the Multimap. - /// - /// The key to locate in the Multimap. - /// true if the item is successfully removed; otherwise, false. - public bool Remove(TKey key) - { - return TryRemove(key, out var _); - } - - /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get. - /// When this method returns, the value associated with the specified key, if the - /// key is found; otherwise, the default value for the type of the value parameter. - /// This parameter is passed uninitialized. - /// true if the object that implements Multimap contains - /// an item with the specified key; otherwise, false. - public bool TryGetValue(TKey key, out IList value) - { - return _dictionary.TryGetValue(key, out value); - } - - /// - /// Gets or sets the item with the specified key. - /// - /// The key of the item to get or set. - /// The value of the specified key. - public IList this[TKey key] - { - get => _dictionary[key]; - set => _dictionary[key] = value; - } - - /// - /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. - /// - public ICollection Keys => _dictionary.Keys; - - /// - /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. - /// - public ICollection> Values => _dictionary.Values; - - /// - /// Copy the items of the Multimap to an System.Array, - /// starting at a particular System.Array index. - /// - /// The one-dimensional System.Array that is the destination of the items copied - /// from Multimap. The System.Array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - public void CopyTo(Array array, int index) - { - ((ICollection)_dictionary).CopyTo(array, index); - } - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add value to Multimap. - public void Add(TKey key, TValue value) - { - if (value != null) - { - if (_dictionary.TryGetValue(key, out var list)) - { - list.Add(value); - } - else - { - list = new List { value }; - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add value to Multimap."); - } - } - } - - #endregion Public Members - - #region Private Members - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryRemove(TKey key, out IList value) - { - _dictionary.TryGetValue(key, out value); - return _dictionary.Remove(key); - } - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryAdd(TKey key, IList value) - { - try - { - _dictionary.Add(key, value); - } - catch (ArgumentException) - { - return false; - } - - return true; - } - #endregion Private Members - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/OpenAPIDateConverter.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/OpenAPIDateConverter.cs deleted file mode 100644 index ea5de2a19b..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/OpenAPIDateConverter.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using Newtonsoft.Json.Converters; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Formatter for 'date' 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 OpenAPIDateConverter : IsoDateTimeConverter - { - /// - /// Initializes a new instance of the class. - /// - public OpenAPIDateConverter() - { - // full-date = date-fullyear "-" date-month "-" date-mday - DateTimeFormat = "yyyy-MM-dd"; - } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/RequestOptions.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/RequestOptions.cs deleted file mode 100644 index 76b060de33..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/RequestOptions.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Operation associated with the request path. - /// - public string Operation { get; set; } - - /// - /// Index associated with the operation. - /// - public int OperationIndex { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - FileParameters = new Multimap(); - Cookies = new List(); - } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Client/RetryConfiguration.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Client/RetryConfiguration.cs deleted file mode 100644 index 1ffd197846..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Client/RetryConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Polly; -using RestSharp; - -namespace BrowserUpMitmProxyClient.Client -{ - /// - /// Configuration class to set the polly retry policies to be applied to the requests. - /// - public static class RetryConfiguration - { - /// - /// Retry policy - /// - public static Policy RetryPolicy { get; set; } - - /// - /// Async retry policy - /// - public static AsyncPolicy AsyncRetryPolicy { get; set; } - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/AbstractOpenAPISchema.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/AbstractOpenAPISchema.cs deleted file mode 100644 index a7f4423184..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/AbstractOpenAPISchema.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification - /// - public abstract partial class AbstractOpenAPISchema - { - /// - /// Custom JSON serializer - /// - static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Error, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Custom JSON serializer for objects with additional properties - /// - static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Gets or Sets the actual instance - /// - public abstract Object ActualInstance { get; set; } - - /// - /// Gets or Sets IsNullable to indicate whether the instance is nullable - /// - public bool IsNullable { get; protected set; } - - /// - /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` - /// - public string SchemaType { get; protected set; } - - /// - /// Converts the instance into JSON string. - /// - public abstract string ToJson(); - } -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Action.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/Action.cs deleted file mode 100644 index 6049eddf1f..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Action.cs +++ /dev/null @@ -1,254 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Action - /// - [DataContract(Name = "Action")] - public partial class Action : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// name. - /// id. - /// className. - /// tagName. - /// xpath. - /// dataAttributes. - /// formName. - /// content. - public Action(string name = default(string), string id = default(string), string className = default(string), string tagName = default(string), string xpath = default(string), string dataAttributes = default(string), string formName = default(string), string content = default(string)) - { - this.Name = name; - this.Id = id; - this.ClassName = className; - this.TagName = tagName; - this.Xpath = xpath; - this.DataAttributes = dataAttributes; - this.FormName = formName; - this.Content = content; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } - - /// - /// Gets or Sets ClassName - /// - [DataMember(Name = "className", EmitDefaultValue = false)] - public string ClassName { get; set; } - - /// - /// Gets or Sets TagName - /// - [DataMember(Name = "tagName", EmitDefaultValue = false)] - public string TagName { get; set; } - - /// - /// Gets or Sets Xpath - /// - [DataMember(Name = "xpath", EmitDefaultValue = false)] - public string Xpath { get; set; } - - /// - /// Gets or Sets DataAttributes - /// - [DataMember(Name = "dataAttributes", EmitDefaultValue = false)] - public string DataAttributes { get; set; } - - /// - /// Gets or Sets FormName - /// - [DataMember(Name = "formName", EmitDefaultValue = false)] - public string FormName { get; set; } - - /// - /// Gets or Sets Content - /// - [DataMember(Name = "content", EmitDefaultValue = false)] - public string Content { 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 Action {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); - sb.Append(" TagName: ").Append(TagName).Append("\n"); - sb.Append(" Xpath: ").Append(Xpath).Append("\n"); - sb.Append(" DataAttributes: ").Append(DataAttributes).Append("\n"); - sb.Append(" FormName: ").Append(FormName).Append("\n"); - sb.Append(" Content: ").Append(Content).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Action); - } - - /// - /// Returns true if Action instances are equal - /// - /// Instance of Action to be compared - /// Boolean - public bool Equals(Action input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.ClassName == input.ClassName || - (this.ClassName != null && - this.ClassName.Equals(input.ClassName)) - ) && - ( - this.TagName == input.TagName || - (this.TagName != null && - this.TagName.Equals(input.TagName)) - ) && - ( - this.Xpath == input.Xpath || - (this.Xpath != null && - this.Xpath.Equals(input.Xpath)) - ) && - ( - this.DataAttributes == input.DataAttributes || - (this.DataAttributes != null && - this.DataAttributes.Equals(input.DataAttributes)) - ) && - ( - this.FormName == input.FormName || - (this.FormName != null && - this.FormName.Equals(input.FormName)) - ) && - ( - this.Content == input.Content || - (this.Content != null && - this.Content.Equals(input.Content)) - ); - } - - /// - /// 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.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.ClassName != null) - { - hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); - } - if (this.TagName != null) - { - hashCode = (hashCode * 59) + this.TagName.GetHashCode(); - } - if (this.Xpath != null) - { - hashCode = (hashCode * 59) + this.Xpath.GetHashCode(); - } - if (this.DataAttributes != null) - { - hashCode = (hashCode * 59) + this.DataAttributes.GetHashCode(); - } - if (this.FormName != null) - { - hashCode = (hashCode * 59) + this.FormName.GetHashCode(); - } - if (this.Content != null) - { - hashCode = (hashCode * 59) + this.Content.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Error.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/Error.cs deleted file mode 100644 index e4e46fbbef..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Error.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Error - /// - [DataContract(Name = "Error")] - public partial class Error : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Name of the Error to add. Stored in har under _errors. - /// Short details of the error. - public Error(string name = default(string), string details = default(string)) - { - this.Name = name; - this.Details = details; - } - - /// - /// Name of the Error to add. Stored in har under _errors - /// - /// Name of the Error to add. Stored in har under _errors - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Short details of the error - /// - /// Short details of the error - [DataMember(Name = "details", EmitDefaultValue = false)] - public string Details { 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(" Name: ").Append(Name).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Error); - } - - /// - /// 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.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - 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.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Details != null) - { - hashCode = (hashCode * 59) + this.Details.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Har.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/Har.cs deleted file mode 100644 index 8f68197694..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Har.cs +++ /dev/null @@ -1,155 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Har - /// - [DataContract(Name = "Har")] - public partial class Har : Dictionary, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected Har() - { - this.AdditionalProperties = new Dictionary(); - } - /// - /// Initializes a new instance of the class. - /// - /// log (required). - public Har(HarLog log = default(HarLog)) : base() - { - // to ensure "log" is required (not null) - if (log == null) - { - throw new ArgumentNullException("log is a required property for Har and cannot be null"); - } - this.Log = log; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets Log - /// - [DataMember(Name = "log", IsRequired = true, EmitDefaultValue = true)] - public HarLog Log { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { 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 Har {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Log: ").Append(Log).Append("\n"); - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Har); - } - - /// - /// Returns true if Har instances are equal - /// - /// Instance of Har to be compared - /// Boolean - public bool Equals(Har input) - { - if (input == null) - { - return false; - } - return base.Equals(input) && - ( - this.Log == input.Log || - (this.Log != null && - this.Log.Equals(input.Log)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - if (this.Log != null) - { - hashCode = (hashCode * 59) + this.Log.GetHashCode(); - } - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntry.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntry.cs deleted file mode 100644 index 14a35b4e5c..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntry.cs +++ /dev/null @@ -1,336 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntry - /// - [DataContract(Name = "HarEntry")] - public partial class HarEntry : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntry() { } - /// - /// Initializes a new instance of the class. - /// - /// pageref. - /// startedDateTime (required). - /// time (required). - /// request (required). - /// response (required). - /// cache (required). - /// timings (required). - /// serverIPAddress. - /// webSocketMessages. - /// connection. - /// comment. - public HarEntry(string pageref = default(string), DateTime startedDateTime = default(DateTime), long time = default(long), HarEntryRequest request = default(HarEntryRequest), HarEntryResponse response = default(HarEntryResponse), HarEntryCache cache = default(HarEntryCache), HarEntryTimings timings = default(HarEntryTimings), string serverIPAddress = default(string), List webSocketMessages = default(List), string connection = default(string), string comment = default(string)) - { - this.StartedDateTime = startedDateTime; - this.Time = time; - // to ensure "request" is required (not null) - if (request == null) - { - throw new ArgumentNullException("request is a required property for HarEntry and cannot be null"); - } - this.Request = request; - // to ensure "response" is required (not null) - if (response == null) - { - throw new ArgumentNullException("response is a required property for HarEntry and cannot be null"); - } - this.Response = response; - // to ensure "cache" is required (not null) - if (cache == null) - { - throw new ArgumentNullException("cache is a required property for HarEntry and cannot be null"); - } - this.Cache = cache; - // to ensure "timings" is required (not null) - if (timings == null) - { - throw new ArgumentNullException("timings is a required property for HarEntry and cannot be null"); - } - this.Timings = timings; - this.Pageref = pageref; - this.ServerIPAddress = serverIPAddress; - this.WebSocketMessages = webSocketMessages; - this.Connection = connection; - this.Comment = comment; - } - - /// - /// Gets or Sets Pageref - /// - [DataMember(Name = "pageref", EmitDefaultValue = false)] - public string Pageref { get; set; } - - /// - /// Gets or Sets StartedDateTime - /// - [DataMember(Name = "startedDateTime", IsRequired = true, EmitDefaultValue = true)] - public DateTime StartedDateTime { get; set; } - - /// - /// Gets or Sets Time - /// - [DataMember(Name = "time", IsRequired = true, EmitDefaultValue = true)] - public long Time { get; set; } - - /// - /// Gets or Sets Request - /// - [DataMember(Name = "request", IsRequired = true, EmitDefaultValue = true)] - public HarEntryRequest Request { get; set; } - - /// - /// Gets or Sets Response - /// - [DataMember(Name = "response", IsRequired = true, EmitDefaultValue = true)] - public HarEntryResponse Response { get; set; } - - /// - /// Gets or Sets Cache - /// - [DataMember(Name = "cache", IsRequired = true, EmitDefaultValue = true)] - public HarEntryCache Cache { get; set; } - - /// - /// Gets or Sets Timings - /// - [DataMember(Name = "timings", IsRequired = true, EmitDefaultValue = true)] - public HarEntryTimings Timings { get; set; } - - /// - /// Gets or Sets ServerIPAddress - /// - [DataMember(Name = "serverIPAddress", EmitDefaultValue = false)] - public string ServerIPAddress { get; set; } - - /// - /// Gets or Sets WebSocketMessages - /// - [DataMember(Name = "_webSocketMessages", EmitDefaultValue = false)] - public List WebSocketMessages { get; set; } - - /// - /// Gets or Sets Connection - /// - [DataMember(Name = "connection", EmitDefaultValue = false)] - public string Connection { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntry {\n"); - sb.Append(" Pageref: ").Append(Pageref).Append("\n"); - sb.Append(" StartedDateTime: ").Append(StartedDateTime).Append("\n"); - sb.Append(" Time: ").Append(Time).Append("\n"); - sb.Append(" Request: ").Append(Request).Append("\n"); - sb.Append(" Response: ").Append(Response).Append("\n"); - sb.Append(" Cache: ").Append(Cache).Append("\n"); - sb.Append(" Timings: ").Append(Timings).Append("\n"); - sb.Append(" ServerIPAddress: ").Append(ServerIPAddress).Append("\n"); - sb.Append(" WebSocketMessages: ").Append(WebSocketMessages).Append("\n"); - sb.Append(" Connection: ").Append(Connection).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntry); - } - - /// - /// Returns true if HarEntry instances are equal - /// - /// Instance of HarEntry to be compared - /// Boolean - public bool Equals(HarEntry input) - { - if (input == null) - { - return false; - } - return - ( - this.Pageref == input.Pageref || - (this.Pageref != null && - this.Pageref.Equals(input.Pageref)) - ) && - ( - this.StartedDateTime == input.StartedDateTime || - (this.StartedDateTime != null && - this.StartedDateTime.Equals(input.StartedDateTime)) - ) && - ( - this.Time == input.Time || - this.Time.Equals(input.Time) - ) && - ( - this.Request == input.Request || - (this.Request != null && - this.Request.Equals(input.Request)) - ) && - ( - this.Response == input.Response || - (this.Response != null && - this.Response.Equals(input.Response)) - ) && - ( - this.Cache == input.Cache || - (this.Cache != null && - this.Cache.Equals(input.Cache)) - ) && - ( - this.Timings == input.Timings || - (this.Timings != null && - this.Timings.Equals(input.Timings)) - ) && - ( - this.ServerIPAddress == input.ServerIPAddress || - (this.ServerIPAddress != null && - this.ServerIPAddress.Equals(input.ServerIPAddress)) - ) && - ( - this.WebSocketMessages == input.WebSocketMessages || - this.WebSocketMessages != null && - input.WebSocketMessages != null && - this.WebSocketMessages.SequenceEqual(input.WebSocketMessages) - ) && - ( - this.Connection == input.Connection || - (this.Connection != null && - this.Connection.Equals(input.Connection)) - ) && - ( - 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.Pageref != null) - { - hashCode = (hashCode * 59) + this.Pageref.GetHashCode(); - } - if (this.StartedDateTime != null) - { - hashCode = (hashCode * 59) + this.StartedDateTime.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Time.GetHashCode(); - if (this.Request != null) - { - hashCode = (hashCode * 59) + this.Request.GetHashCode(); - } - if (this.Response != null) - { - hashCode = (hashCode * 59) + this.Response.GetHashCode(); - } - if (this.Cache != null) - { - hashCode = (hashCode * 59) + this.Cache.GetHashCode(); - } - if (this.Timings != null) - { - hashCode = (hashCode * 59) + this.Timings.GetHashCode(); - } - if (this.ServerIPAddress != null) - { - hashCode = (hashCode * 59) + this.ServerIPAddress.GetHashCode(); - } - if (this.WebSocketMessages != null) - { - hashCode = (hashCode * 59) + this.WebSocketMessages.GetHashCode(); - } - if (this.Connection != null) - { - hashCode = (hashCode * 59) + this.Connection.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Time (long) minimum - if (this.Time < (long)0) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Time, must be a value greater than or equal to 0.", new [] { "Time" }); - } - - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCache.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCache.cs deleted file mode 100644 index 416090a8b7..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCache.cs +++ /dev/null @@ -1,164 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryCache - /// - [DataContract(Name = "HarEntry_cache")] - public partial class HarEntryCache : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// beforeRequest. - /// afterRequest. - /// comment. - public HarEntryCache(HarEntryCacheBeforeRequest beforeRequest = default(HarEntryCacheBeforeRequest), HarEntryCacheBeforeRequest afterRequest = default(HarEntryCacheBeforeRequest), string comment = default(string)) - { - this.BeforeRequest = beforeRequest; - this.AfterRequest = afterRequest; - this.Comment = comment; - } - - /// - /// Gets or Sets BeforeRequest - /// - [DataMember(Name = "beforeRequest", EmitDefaultValue = false)] - public HarEntryCacheBeforeRequest BeforeRequest { get; set; } - - /// - /// Gets or Sets AfterRequest - /// - [DataMember(Name = "afterRequest", EmitDefaultValue = false)] - public HarEntryCacheBeforeRequest AfterRequest { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryCache {\n"); - sb.Append(" BeforeRequest: ").Append(BeforeRequest).Append("\n"); - sb.Append(" AfterRequest: ").Append(AfterRequest).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryCache); - } - - /// - /// Returns true if HarEntryCache instances are equal - /// - /// Instance of HarEntryCache to be compared - /// Boolean - public bool Equals(HarEntryCache input) - { - if (input == null) - { - return false; - } - return - ( - this.BeforeRequest == input.BeforeRequest || - (this.BeforeRequest != null && - this.BeforeRequest.Equals(input.BeforeRequest)) - ) && - ( - this.AfterRequest == input.AfterRequest || - (this.AfterRequest != null && - this.AfterRequest.Equals(input.AfterRequest)) - ) && - ( - 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.BeforeRequest != null) - { - hashCode = (hashCode * 59) + this.BeforeRequest.GetHashCode(); - } - if (this.AfterRequest != null) - { - hashCode = (hashCode * 59) + this.AfterRequest.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequest.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequest.cs deleted file mode 100644 index 8859334142..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequest.cs +++ /dev/null @@ -1,256 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; -using System.Reflection; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryCacheBeforeRequest - /// - [JsonConverter(typeof(HarEntryCacheBeforeRequestJsonConverter))] - [DataContract(Name = "HarEntry_cache_beforeRequest")] - public partial class HarEntryCacheBeforeRequest : AbstractOpenAPISchema, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - public HarEntryCacheBeforeRequest() - { - this.IsNullable = true; - this.SchemaType= "oneOf"; - } - - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of HarEntryCacheBeforeRequestOneOf. - public HarEntryCacheBeforeRequest(HarEntryCacheBeforeRequestOneOf actualInstance) - { - this.IsNullable = true; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance; - } - - - private Object _actualInstance; - - /// - /// Gets or Sets ActualInstance - /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - if (value.GetType() == typeof(HarEntryCacheBeforeRequestOneOf)) - { - this._actualInstance = value; - } - else - { - throw new ArgumentException("Invalid instance found. Must be the following types: HarEntryCacheBeforeRequestOneOf"); - } - } - } - - /// - /// Get the actual instance of `HarEntryCacheBeforeRequestOneOf`. If the actual instance is not `HarEntryCacheBeforeRequestOneOf`, - /// the InvalidClassException will be thrown - /// - /// An instance of HarEntryCacheBeforeRequestOneOf - public HarEntryCacheBeforeRequestOneOf GetHarEntryCacheBeforeRequestOneOf() - { - return (HarEntryCacheBeforeRequestOneOf)this.ActualInstance; - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class HarEntryCacheBeforeRequest {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return JsonConvert.SerializeObject(this.ActualInstance, HarEntryCacheBeforeRequest.SerializerSettings); - } - - /// - /// Converts the JSON string into an instance of HarEntryCacheBeforeRequest - /// - /// JSON string - /// An instance of HarEntryCacheBeforeRequest - public static HarEntryCacheBeforeRequest FromJson(string jsonString) - { - HarEntryCacheBeforeRequest newHarEntryCacheBeforeRequest = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return newHarEntryCacheBeforeRequest; - } - int match = 0; - List matchedTypes = new List(); - - try - { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(HarEntryCacheBeforeRequestOneOf).GetProperty("AdditionalProperties") == null) - { - newHarEntryCacheBeforeRequest = new HarEntryCacheBeforeRequest(JsonConvert.DeserializeObject(jsonString, HarEntryCacheBeforeRequest.SerializerSettings)); - } - else - { - newHarEntryCacheBeforeRequest = new HarEntryCacheBeforeRequest(JsonConvert.DeserializeObject(jsonString, HarEntryCacheBeforeRequest.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("HarEntryCacheBeforeRequestOneOf"); - match++; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into HarEntryCacheBeforeRequestOneOf: {1}", jsonString, exception.ToString())); - } - - if (match == 0) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); - } - else if (match > 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return newHarEntryCacheBeforeRequest; - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryCacheBeforeRequest); - } - - /// - /// Returns true if HarEntryCacheBeforeRequest instances are equal - /// - /// Instance of HarEntryCacheBeforeRequest to be compared - /// Boolean - public bool Equals(HarEntryCacheBeforeRequest input) - { - if (input == null) - return false; - - return this.ActualInstance.Equals(input.ActualInstance); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - - /// - /// Custom JSON converter for HarEntryCacheBeforeRequest - /// - public class HarEntryCacheBeforeRequestJsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof(HarEntryCacheBeforeRequest).GetMethod("ToJson").Invoke(value, null))); - } - - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if(reader.TokenType != JsonToken.Null) - { - return HarEntryCacheBeforeRequest.FromJson(JObject.Load(reader).ToString(Formatting.None)); - } - return null; - } - - /// - /// Check if the object can be converted - /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) - { - return false; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequestOneOf.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequestOneOf.cs deleted file mode 100644 index 62dc016d6b..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryCacheBeforeRequestOneOf.cs +++ /dev/null @@ -1,211 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryCacheBeforeRequestOneOf - /// - [DataContract(Name = "HarEntry_cache_beforeRequest_oneOf")] - public partial class HarEntryCacheBeforeRequestOneOf : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryCacheBeforeRequestOneOf() { } - /// - /// Initializes a new instance of the class. - /// - /// expires. - /// lastAccess (required). - /// eTag (required). - /// hitCount (required). - /// comment. - public HarEntryCacheBeforeRequestOneOf(string expires = default(string), string lastAccess = default(string), string eTag = default(string), int hitCount = default(int), string comment = default(string)) - { - // to ensure "lastAccess" is required (not null) - if (lastAccess == null) - { - throw new ArgumentNullException("lastAccess is a required property for HarEntryCacheBeforeRequestOneOf and cannot be null"); - } - this.LastAccess = lastAccess; - // to ensure "eTag" is required (not null) - if (eTag == null) - { - throw new ArgumentNullException("eTag is a required property for HarEntryCacheBeforeRequestOneOf and cannot be null"); - } - this.ETag = eTag; - this.HitCount = hitCount; - this.Expires = expires; - this.Comment = comment; - } - - /// - /// Gets or Sets Expires - /// - [DataMember(Name = "expires", EmitDefaultValue = false)] - public string Expires { get; set; } - - /// - /// Gets or Sets LastAccess - /// - [DataMember(Name = "lastAccess", IsRequired = true, EmitDefaultValue = true)] - public string LastAccess { get; set; } - - /// - /// Gets or Sets ETag - /// - [DataMember(Name = "eTag", IsRequired = true, EmitDefaultValue = true)] - public string ETag { get; set; } - - /// - /// Gets or Sets HitCount - /// - [DataMember(Name = "hitCount", IsRequired = true, EmitDefaultValue = true)] - public int HitCount { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryCacheBeforeRequestOneOf {\n"); - sb.Append(" Expires: ").Append(Expires).Append("\n"); - sb.Append(" LastAccess: ").Append(LastAccess).Append("\n"); - sb.Append(" ETag: ").Append(ETag).Append("\n"); - sb.Append(" HitCount: ").Append(HitCount).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryCacheBeforeRequestOneOf); - } - - /// - /// Returns true if HarEntryCacheBeforeRequestOneOf instances are equal - /// - /// Instance of HarEntryCacheBeforeRequestOneOf to be compared - /// Boolean - public bool Equals(HarEntryCacheBeforeRequestOneOf input) - { - if (input == null) - { - return false; - } - return - ( - this.Expires == input.Expires || - (this.Expires != null && - this.Expires.Equals(input.Expires)) - ) && - ( - this.LastAccess == input.LastAccess || - (this.LastAccess != null && - this.LastAccess.Equals(input.LastAccess)) - ) && - ( - this.ETag == input.ETag || - (this.ETag != null && - this.ETag.Equals(input.ETag)) - ) && - ( - this.HitCount == input.HitCount || - this.HitCount.Equals(input.HitCount) - ) && - ( - 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.Expires != null) - { - hashCode = (hashCode * 59) + this.Expires.GetHashCode(); - } - if (this.LastAccess != null) - { - hashCode = (hashCode * 59) + this.LastAccess.GetHashCode(); - } - if (this.ETag != null) - { - hashCode = (hashCode * 59) + this.ETag.GetHashCode(); - } - hashCode = (hashCode * 59) + this.HitCount.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequest.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequest.cs deleted file mode 100644 index 0e96288d16..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequest.cs +++ /dev/null @@ -1,337 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryRequest - /// - [DataContract(Name = "HarEntry_request")] - public partial class HarEntryRequest : Dictionary, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryRequest() - { - this.AdditionalProperties = new Dictionary(); - } - /// - /// Initializes a new instance of the class. - /// - /// method (required). - /// url (required). - /// httpVersion (required). - /// cookies (required). - /// headers (required). - /// queryString (required). - /// postData. - /// headersSize (required). - /// bodySize (required). - /// comment. - public HarEntryRequest(string method = default(string), string url = default(string), string httpVersion = default(string), List cookies = default(List), List
headers = default(List
), List queryString = default(List), HarEntryRequestPostData postData = default(HarEntryRequestPostData), int headersSize = default(int), int bodySize = default(int), string comment = default(string)) : base() - { - // to ensure "method" is required (not null) - if (method == null) - { - throw new ArgumentNullException("method is a required property for HarEntryRequest and cannot be null"); - } - this.Method = method; - // to ensure "url" is required (not null) - if (url == null) - { - throw new ArgumentNullException("url is a required property for HarEntryRequest and cannot be null"); - } - this.Url = url; - // to ensure "httpVersion" is required (not null) - if (httpVersion == null) - { - throw new ArgumentNullException("httpVersion is a required property for HarEntryRequest and cannot be null"); - } - this.HttpVersion = httpVersion; - // to ensure "cookies" is required (not null) - if (cookies == null) - { - throw new ArgumentNullException("cookies is a required property for HarEntryRequest and cannot be null"); - } - this.Cookies = cookies; - // to ensure "headers" is required (not null) - if (headers == null) - { - throw new ArgumentNullException("headers is a required property for HarEntryRequest and cannot be null"); - } - this.Headers = headers; - // to ensure "queryString" is required (not null) - if (queryString == null) - { - throw new ArgumentNullException("queryString is a required property for HarEntryRequest and cannot be null"); - } - this.QueryString = queryString; - this.HeadersSize = headersSize; - this.BodySize = bodySize; - this.PostData = postData; - this.Comment = comment; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets Method - /// - [DataMember(Name = "method", IsRequired = true, EmitDefaultValue = true)] - public string Method { get; set; } - - /// - /// Gets or Sets Url - /// - [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] - public string Url { get; set; } - - /// - /// Gets or Sets HttpVersion - /// - [DataMember(Name = "httpVersion", IsRequired = true, EmitDefaultValue = true)] - public string HttpVersion { get; set; } - - /// - /// Gets or Sets Cookies - /// - [DataMember(Name = "cookies", IsRequired = true, EmitDefaultValue = true)] - public List Cookies { get; set; } - - /// - /// Gets or Sets Headers - /// - [DataMember(Name = "headers", IsRequired = true, EmitDefaultValue = true)] - public List
Headers { get; set; } - - /// - /// Gets or Sets QueryString - /// - [DataMember(Name = "queryString", IsRequired = true, EmitDefaultValue = true)] - public List QueryString { get; set; } - - /// - /// Gets or Sets PostData - /// - [DataMember(Name = "postData", EmitDefaultValue = false)] - public HarEntryRequestPostData PostData { get; set; } - - /// - /// Gets or Sets HeadersSize - /// - [DataMember(Name = "headersSize", IsRequired = true, EmitDefaultValue = true)] - public int HeadersSize { get; set; } - - /// - /// Gets or Sets BodySize - /// - [DataMember(Name = "bodySize", IsRequired = true, EmitDefaultValue = true)] - public int BodySize { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { 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 HarEntryRequest {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Method: ").Append(Method).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); - sb.Append(" HttpVersion: ").Append(HttpVersion).Append("\n"); - sb.Append(" Cookies: ").Append(Cookies).Append("\n"); - sb.Append(" Headers: ").Append(Headers).Append("\n"); - sb.Append(" QueryString: ").Append(QueryString).Append("\n"); - sb.Append(" PostData: ").Append(PostData).Append("\n"); - sb.Append(" HeadersSize: ").Append(HeadersSize).Append("\n"); - sb.Append(" BodySize: ").Append(BodySize).Append("\n"); - sb.Append(" Comment: ").Append(Comment).Append("\n"); - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryRequest); - } - - /// - /// Returns true if HarEntryRequest instances are equal - /// - /// Instance of HarEntryRequest to be compared - /// Boolean - public bool Equals(HarEntryRequest input) - { - if (input == null) - { - return false; - } - return base.Equals(input) && - ( - this.Method == input.Method || - (this.Method != null && - this.Method.Equals(input.Method)) - ) && base.Equals(input) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ) && base.Equals(input) && - ( - this.HttpVersion == input.HttpVersion || - (this.HttpVersion != null && - this.HttpVersion.Equals(input.HttpVersion)) - ) && base.Equals(input) && - ( - this.Cookies == input.Cookies || - this.Cookies != null && - input.Cookies != null && - this.Cookies.SequenceEqual(input.Cookies) - ) && base.Equals(input) && - ( - this.Headers == input.Headers || - this.Headers != null && - input.Headers != null && - this.Headers.SequenceEqual(input.Headers) - ) && base.Equals(input) && - ( - this.QueryString == input.QueryString || - this.QueryString != null && - input.QueryString != null && - this.QueryString.SequenceEqual(input.QueryString) - ) && base.Equals(input) && - ( - this.PostData == input.PostData || - (this.PostData != null && - this.PostData.Equals(input.PostData)) - ) && base.Equals(input) && - ( - this.HeadersSize == input.HeadersSize || - this.HeadersSize.Equals(input.HeadersSize) - ) && base.Equals(input) && - ( - this.BodySize == input.BodySize || - this.BodySize.Equals(input.BodySize) - ) && base.Equals(input) && - ( - this.Comment == input.Comment || - (this.Comment != null && - this.Comment.Equals(input.Comment)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - if (this.Method != null) - { - hashCode = (hashCode * 59) + this.Method.GetHashCode(); - } - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - if (this.HttpVersion != null) - { - hashCode = (hashCode * 59) + this.HttpVersion.GetHashCode(); - } - if (this.Cookies != null) - { - hashCode = (hashCode * 59) + this.Cookies.GetHashCode(); - } - if (this.Headers != null) - { - hashCode = (hashCode * 59) + this.Headers.GetHashCode(); - } - if (this.QueryString != null) - { - hashCode = (hashCode * 59) + this.QueryString.GetHashCode(); - } - if (this.PostData != null) - { - hashCode = (hashCode * 59) + this.PostData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.HeadersSize.GetHashCode(); - hashCode = (hashCode * 59) + this.BodySize.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestCookiesInner.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestCookiesInner.cs deleted file mode 100644 index 44d8f43a27..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestCookiesInner.cs +++ /dev/null @@ -1,261 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryRequestCookiesInner - /// - [DataContract(Name = "HarEntry_request_cookies_inner")] - public partial class HarEntryRequestCookiesInner : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryRequestCookiesInner() { } - /// - /// Initializes a new instance of the class. - /// - /// name (required). - /// value (required). - /// path. - /// domain. - /// expires. - /// httpOnly. - /// secure. - /// comment. - public HarEntryRequestCookiesInner(string name = default(string), string value = default(string), string path = default(string), string domain = default(string), string expires = default(string), bool httpOnly = default(bool), bool secure = default(bool), string comment = default(string)) - { - // to ensure "name" is required (not null) - if (name == null) - { - throw new ArgumentNullException("name is a required property for HarEntryRequestCookiesInner and cannot be null"); - } - this.Name = name; - // to ensure "value" is required (not null) - if (value == null) - { - throw new ArgumentNullException("value is a required property for HarEntryRequestCookiesInner and cannot be null"); - } - this.Value = value; - this.Path = path; - this.Domain = domain; - this.Expires = expires; - this.HttpOnly = httpOnly; - this.Secure = secure; - this.Comment = comment; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] - public string Name { get; set; } - - /// - /// Gets or Sets Value - /// - [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] - public string Value { get; set; } - - /// - /// Gets or Sets Path - /// - [DataMember(Name = "path", EmitDefaultValue = false)] - public string Path { get; set; } - - /// - /// Gets or Sets Domain - /// - [DataMember(Name = "domain", EmitDefaultValue = false)] - public string Domain { get; set; } - - /// - /// Gets or Sets Expires - /// - [DataMember(Name = "expires", EmitDefaultValue = false)] - public string Expires { get; set; } - - /// - /// Gets or Sets HttpOnly - /// - [DataMember(Name = "httpOnly", EmitDefaultValue = true)] - public bool HttpOnly { get; set; } - - /// - /// Gets or Sets Secure - /// - [DataMember(Name = "secure", EmitDefaultValue = true)] - public bool Secure { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryRequestCookiesInner {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).Append("\n"); - sb.Append(" Path: ").Append(Path).Append("\n"); - sb.Append(" Domain: ").Append(Domain).Append("\n"); - sb.Append(" Expires: ").Append(Expires).Append("\n"); - sb.Append(" HttpOnly: ").Append(HttpOnly).Append("\n"); - sb.Append(" Secure: ").Append(Secure).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryRequestCookiesInner); - } - - /// - /// Returns true if HarEntryRequestCookiesInner instances are equal - /// - /// Instance of HarEntryRequestCookiesInner to be compared - /// Boolean - public bool Equals(HarEntryRequestCookiesInner input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ) && - ( - this.Path == input.Path || - (this.Path != null && - this.Path.Equals(input.Path)) - ) && - ( - this.Domain == input.Domain || - (this.Domain != null && - this.Domain.Equals(input.Domain)) - ) && - ( - this.Expires == input.Expires || - (this.Expires != null && - this.Expires.Equals(input.Expires)) - ) && - ( - this.HttpOnly == input.HttpOnly || - this.HttpOnly.Equals(input.HttpOnly) - ) && - ( - this.Secure == input.Secure || - this.Secure.Equals(input.Secure) - ) && - ( - 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.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - if (this.Path != null) - { - hashCode = (hashCode * 59) + this.Path.GetHashCode(); - } - if (this.Domain != null) - { - hashCode = (hashCode * 59) + this.Domain.GetHashCode(); - } - if (this.Expires != null) - { - hashCode = (hashCode * 59) + this.Expires.GetHashCode(); - } - hashCode = (hashCode * 59) + this.HttpOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.Secure.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostData.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostData.cs deleted file mode 100644 index 1585e9fb68..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostData.cs +++ /dev/null @@ -1,175 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Posted data info. - /// - [DataContract(Name = "HarEntry_request_postData")] - public partial class HarEntryRequestPostData : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryRequestPostData() { } - /// - /// Initializes a new instance of the class. - /// - /// mimeType (required). - /// text. - /// _params. - public HarEntryRequestPostData(string mimeType = default(string), string text = default(string), List _params = default(List)) - { - // to ensure "mimeType" is required (not null) - if (mimeType == null) - { - throw new ArgumentNullException("mimeType is a required property for HarEntryRequestPostData and cannot be null"); - } - this.MimeType = mimeType; - this.Text = text; - this.Params = _params; - } - - /// - /// Gets or Sets MimeType - /// - [DataMember(Name = "mimeType", IsRequired = true, EmitDefaultValue = true)] - public string MimeType { get; set; } - - /// - /// Gets or Sets Text - /// - [DataMember(Name = "text", EmitDefaultValue = false)] - public string Text { get; set; } - - /// - /// Gets or Sets Params - /// - [DataMember(Name = "params", EmitDefaultValue = false)] - public List Params { 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 HarEntryRequestPostData {\n"); - sb.Append(" MimeType: ").Append(MimeType).Append("\n"); - sb.Append(" Text: ").Append(Text).Append("\n"); - sb.Append(" Params: ").Append(Params).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryRequestPostData); - } - - /// - /// Returns true if HarEntryRequestPostData instances are equal - /// - /// Instance of HarEntryRequestPostData to be compared - /// Boolean - public bool Equals(HarEntryRequestPostData input) - { - if (input == null) - { - return false; - } - return - ( - this.MimeType == input.MimeType || - (this.MimeType != null && - this.MimeType.Equals(input.MimeType)) - ) && - ( - this.Text == input.Text || - (this.Text != null && - this.Text.Equals(input.Text)) - ) && - ( - this.Params == input.Params || - this.Params != null && - input.Params != null && - this.Params.SequenceEqual(input.Params) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MimeType != null) - { - hashCode = (hashCode * 59) + this.MimeType.GetHashCode(); - } - if (this.Text != null) - { - hashCode = (hashCode * 59) + this.Text.GetHashCode(); - } - if (this.Params != null) - { - hashCode = (hashCode * 59) + this.Params.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostDataParamsInner.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostDataParamsInner.cs deleted file mode 100644 index 8143be4d9e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestPostDataParamsInner.cs +++ /dev/null @@ -1,200 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryRequestPostDataParamsInner - /// - [DataContract(Name = "HarEntry_request_postData_params_inner")] - public partial class HarEntryRequestPostDataParamsInner : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// name. - /// value. - /// fileName. - /// contentType. - /// comment. - public HarEntryRequestPostDataParamsInner(string name = default(string), string value = default(string), string fileName = default(string), string contentType = default(string), string comment = default(string)) - { - this.Name = name; - this.Value = value; - this.FileName = fileName; - this.ContentType = contentType; - this.Comment = comment; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Gets or Sets Value - /// - [DataMember(Name = "value", EmitDefaultValue = false)] - public string Value { get; set; } - - /// - /// Gets or Sets FileName - /// - [DataMember(Name = "fileName", EmitDefaultValue = false)] - public string FileName { get; set; } - - /// - /// Gets or Sets ContentType - /// - [DataMember(Name = "contentType", EmitDefaultValue = false)] - public string ContentType { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryRequestPostDataParamsInner {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).Append("\n"); - sb.Append(" FileName: ").Append(FileName).Append("\n"); - sb.Append(" ContentType: ").Append(ContentType).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryRequestPostDataParamsInner); - } - - /// - /// Returns true if HarEntryRequestPostDataParamsInner instances are equal - /// - /// Instance of HarEntryRequestPostDataParamsInner to be compared - /// Boolean - public bool Equals(HarEntryRequestPostDataParamsInner input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ) && - ( - this.FileName == input.FileName || - (this.FileName != null && - this.FileName.Equals(input.FileName)) - ) && - ( - this.ContentType == input.ContentType || - (this.ContentType != null && - this.ContentType.Equals(input.ContentType)) - ) && - ( - 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.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - if (this.FileName != null) - { - hashCode = (hashCode * 59) + this.FileName.GetHashCode(); - } - if (this.ContentType != null) - { - hashCode = (hashCode * 59) + this.ContentType.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestQueryStringInner.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestQueryStringInner.cs deleted file mode 100644 index 567bb67ccd..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryRequestQueryStringInner.cs +++ /dev/null @@ -1,179 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryRequestQueryStringInner - /// - [DataContract(Name = "HarEntry_request_queryString_inner")] - public partial class HarEntryRequestQueryStringInner : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryRequestQueryStringInner() { } - /// - /// Initializes a new instance of the class. - /// - /// name (required). - /// value (required). - /// comment. - public HarEntryRequestQueryStringInner(string name = default(string), string value = default(string), string comment = default(string)) - { - // to ensure "name" is required (not null) - if (name == null) - { - throw new ArgumentNullException("name is a required property for HarEntryRequestQueryStringInner and cannot be null"); - } - this.Name = name; - // to ensure "value" is required (not null) - if (value == null) - { - throw new ArgumentNullException("value is a required property for HarEntryRequestQueryStringInner and cannot be null"); - } - this.Value = value; - this.Comment = comment; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] - public string Name { get; set; } - - /// - /// Gets or Sets Value - /// - [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] - public string Value { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryRequestQueryStringInner {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryRequestQueryStringInner); - } - - /// - /// Returns true if HarEntryRequestQueryStringInner instances are equal - /// - /// Instance of HarEntryRequestQueryStringInner to be compared - /// Boolean - public bool Equals(HarEntryRequestQueryStringInner input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ) && - ( - 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.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryResponse.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryResponse.cs deleted file mode 100644 index 75c1dd73a7..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryResponse.cs +++ /dev/null @@ -1,332 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryResponse - /// - [DataContract(Name = "HarEntry_response")] - public partial class HarEntryResponse : Dictionary, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryResponse() - { - this.AdditionalProperties = new Dictionary(); - } - /// - /// Initializes a new instance of the class. - /// - /// status (required). - /// statusText (required). - /// httpVersion (required). - /// cookies (required). - /// headers (required). - /// content (required). - /// redirectURL (required). - /// headersSize (required). - /// bodySize (required). - /// comment. - public HarEntryResponse(int status = default(int), string statusText = default(string), string httpVersion = default(string), List cookies = default(List), List
headers = default(List
), HarEntryResponseContent content = default(HarEntryResponseContent), string redirectURL = default(string), int headersSize = default(int), int bodySize = default(int), string comment = default(string)) : base() - { - this.Status = status; - // to ensure "statusText" is required (not null) - if (statusText == null) - { - throw new ArgumentNullException("statusText is a required property for HarEntryResponse and cannot be null"); - } - this.StatusText = statusText; - // to ensure "httpVersion" is required (not null) - if (httpVersion == null) - { - throw new ArgumentNullException("httpVersion is a required property for HarEntryResponse and cannot be null"); - } - this.HttpVersion = httpVersion; - // to ensure "cookies" is required (not null) - if (cookies == null) - { - throw new ArgumentNullException("cookies is a required property for HarEntryResponse and cannot be null"); - } - this.Cookies = cookies; - // to ensure "headers" is required (not null) - if (headers == null) - { - throw new ArgumentNullException("headers is a required property for HarEntryResponse and cannot be null"); - } - this.Headers = headers; - // to ensure "content" is required (not null) - if (content == null) - { - throw new ArgumentNullException("content is a required property for HarEntryResponse and cannot be null"); - } - this.Content = content; - // to ensure "redirectURL" is required (not null) - if (redirectURL == null) - { - throw new ArgumentNullException("redirectURL is a required property for HarEntryResponse and cannot be null"); - } - this.RedirectURL = redirectURL; - this.HeadersSize = headersSize; - this.BodySize = bodySize; - this.Comment = comment; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets Status - /// - [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] - public int Status { get; set; } - - /// - /// Gets or Sets StatusText - /// - [DataMember(Name = "statusText", IsRequired = true, EmitDefaultValue = true)] - public string StatusText { get; set; } - - /// - /// Gets or Sets HttpVersion - /// - [DataMember(Name = "httpVersion", IsRequired = true, EmitDefaultValue = true)] - public string HttpVersion { get; set; } - - /// - /// Gets or Sets Cookies - /// - [DataMember(Name = "cookies", IsRequired = true, EmitDefaultValue = true)] - public List Cookies { get; set; } - - /// - /// Gets or Sets Headers - /// - [DataMember(Name = "headers", IsRequired = true, EmitDefaultValue = true)] - public List
Headers { get; set; } - - /// - /// Gets or Sets Content - /// - [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] - public HarEntryResponseContent Content { get; set; } - - /// - /// Gets or Sets RedirectURL - /// - [DataMember(Name = "redirectURL", IsRequired = true, EmitDefaultValue = true)] - public string RedirectURL { get; set; } - - /// - /// Gets or Sets HeadersSize - /// - [DataMember(Name = "headersSize", IsRequired = true, EmitDefaultValue = true)] - public int HeadersSize { get; set; } - - /// - /// Gets or Sets BodySize - /// - [DataMember(Name = "bodySize", IsRequired = true, EmitDefaultValue = true)] - public int BodySize { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { 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 HarEntryResponse {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" StatusText: ").Append(StatusText).Append("\n"); - sb.Append(" HttpVersion: ").Append(HttpVersion).Append("\n"); - sb.Append(" Cookies: ").Append(Cookies).Append("\n"); - sb.Append(" Headers: ").Append(Headers).Append("\n"); - sb.Append(" Content: ").Append(Content).Append("\n"); - sb.Append(" RedirectURL: ").Append(RedirectURL).Append("\n"); - sb.Append(" HeadersSize: ").Append(HeadersSize).Append("\n"); - sb.Append(" BodySize: ").Append(BodySize).Append("\n"); - sb.Append(" Comment: ").Append(Comment).Append("\n"); - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryResponse); - } - - /// - /// Returns true if HarEntryResponse instances are equal - /// - /// Instance of HarEntryResponse to be compared - /// Boolean - public bool Equals(HarEntryResponse input) - { - if (input == null) - { - return false; - } - return base.Equals(input) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ) && base.Equals(input) && - ( - this.StatusText == input.StatusText || - (this.StatusText != null && - this.StatusText.Equals(input.StatusText)) - ) && base.Equals(input) && - ( - this.HttpVersion == input.HttpVersion || - (this.HttpVersion != null && - this.HttpVersion.Equals(input.HttpVersion)) - ) && base.Equals(input) && - ( - this.Cookies == input.Cookies || - this.Cookies != null && - input.Cookies != null && - this.Cookies.SequenceEqual(input.Cookies) - ) && base.Equals(input) && - ( - this.Headers == input.Headers || - this.Headers != null && - input.Headers != null && - this.Headers.SequenceEqual(input.Headers) - ) && base.Equals(input) && - ( - this.Content == input.Content || - (this.Content != null && - this.Content.Equals(input.Content)) - ) && base.Equals(input) && - ( - this.RedirectURL == input.RedirectURL || - (this.RedirectURL != null && - this.RedirectURL.Equals(input.RedirectURL)) - ) && base.Equals(input) && - ( - this.HeadersSize == input.HeadersSize || - this.HeadersSize.Equals(input.HeadersSize) - ) && base.Equals(input) && - ( - this.BodySize == input.BodySize || - this.BodySize.Equals(input.BodySize) - ) && base.Equals(input) && - ( - this.Comment == input.Comment || - (this.Comment != null && - this.Comment.Equals(input.Comment)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - if (this.StatusText != null) - { - hashCode = (hashCode * 59) + this.StatusText.GetHashCode(); - } - if (this.HttpVersion != null) - { - hashCode = (hashCode * 59) + this.HttpVersion.GetHashCode(); - } - if (this.Cookies != null) - { - hashCode = (hashCode * 59) + this.Cookies.GetHashCode(); - } - if (this.Headers != null) - { - hashCode = (hashCode * 59) + this.Headers.GetHashCode(); - } - if (this.Content != null) - { - hashCode = (hashCode * 59) + this.Content.GetHashCode(); - } - if (this.RedirectURL != null) - { - hashCode = (hashCode * 59) + this.RedirectURL.GetHashCode(); - } - hashCode = (hashCode * 59) + this.HeadersSize.GetHashCode(); - hashCode = (hashCode * 59) + this.BodySize.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryResponseContent.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryResponseContent.cs deleted file mode 100644 index a8b55d7e5f..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryResponseContent.cs +++ /dev/null @@ -1,380 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryResponseContent - /// - [DataContract(Name = "HarEntry_response_content")] - public partial class HarEntryResponseContent : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryResponseContent() { } - /// - /// Initializes a new instance of the class. - /// - /// size (required). - /// compression. - /// mimeType (required). - /// text. - /// encoding. - /// videoBufferedPercent (default to -1). - /// videoStallCount (default to -1). - /// videoDecodedByteCount (default to -1). - /// videoWaitingCount (default to -1). - /// videoErrorCount (default to -1). - /// videoDroppedFrames (default to -1). - /// videoTotalFrames (default to -1). - /// videoAudioBytesDecoded (default to -1). - /// comment. - public HarEntryResponseContent(int size = default(int), int compression = default(int), string mimeType = default(string), string text = default(string), string encoding = default(string), long videoBufferedPercent = -1, long videoStallCount = -1, long videoDecodedByteCount = -1, long videoWaitingCount = -1, long videoErrorCount = -1, long videoDroppedFrames = -1, long videoTotalFrames = -1, long videoAudioBytesDecoded = -1, string comment = default(string)) - { - this.Size = size; - // to ensure "mimeType" is required (not null) - if (mimeType == null) - { - throw new ArgumentNullException("mimeType is a required property for HarEntryResponseContent and cannot be null"); - } - this.MimeType = mimeType; - this.Compression = compression; - this.Text = text; - this.Encoding = encoding; - this.VideoBufferedPercent = videoBufferedPercent; - this.VideoStallCount = videoStallCount; - this.VideoDecodedByteCount = videoDecodedByteCount; - this.VideoWaitingCount = videoWaitingCount; - this.VideoErrorCount = videoErrorCount; - this.VideoDroppedFrames = videoDroppedFrames; - this.VideoTotalFrames = videoTotalFrames; - this.VideoAudioBytesDecoded = videoAudioBytesDecoded; - this.Comment = comment; - } - - /// - /// Gets or Sets Size - /// - [DataMember(Name = "size", IsRequired = true, EmitDefaultValue = true)] - public int Size { get; set; } - - /// - /// Gets or Sets Compression - /// - [DataMember(Name = "compression", EmitDefaultValue = false)] - public int Compression { get; set; } - - /// - /// Gets or Sets MimeType - /// - [DataMember(Name = "mimeType", IsRequired = true, EmitDefaultValue = true)] - public string MimeType { get; set; } - - /// - /// Gets or Sets Text - /// - [DataMember(Name = "text", EmitDefaultValue = false)] - public string Text { get; set; } - - /// - /// Gets or Sets Encoding - /// - [DataMember(Name = "encoding", EmitDefaultValue = false)] - public string Encoding { get; set; } - - /// - /// Gets or Sets VideoBufferedPercent - /// - [DataMember(Name = "_videoBufferedPercent", EmitDefaultValue = false)] - public long VideoBufferedPercent { get; set; } - - /// - /// Gets or Sets VideoStallCount - /// - [DataMember(Name = "_videoStallCount", EmitDefaultValue = false)] - public long VideoStallCount { get; set; } - - /// - /// Gets or Sets VideoDecodedByteCount - /// - [DataMember(Name = "_videoDecodedByteCount", EmitDefaultValue = false)] - public long VideoDecodedByteCount { get; set; } - - /// - /// Gets or Sets VideoWaitingCount - /// - [DataMember(Name = "_videoWaitingCount", EmitDefaultValue = false)] - public long VideoWaitingCount { get; set; } - - /// - /// Gets or Sets VideoErrorCount - /// - [DataMember(Name = "_videoErrorCount", EmitDefaultValue = false)] - public long VideoErrorCount { get; set; } - - /// - /// Gets or Sets VideoDroppedFrames - /// - [DataMember(Name = "_videoDroppedFrames", EmitDefaultValue = false)] - public long VideoDroppedFrames { get; set; } - - /// - /// Gets or Sets VideoTotalFrames - /// - [DataMember(Name = "_videoTotalFrames", EmitDefaultValue = false)] - public long VideoTotalFrames { get; set; } - - /// - /// Gets or Sets VideoAudioBytesDecoded - /// - [DataMember(Name = "_videoAudioBytesDecoded", EmitDefaultValue = false)] - public long VideoAudioBytesDecoded { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryResponseContent {\n"); - sb.Append(" Size: ").Append(Size).Append("\n"); - sb.Append(" Compression: ").Append(Compression).Append("\n"); - sb.Append(" MimeType: ").Append(MimeType).Append("\n"); - sb.Append(" Text: ").Append(Text).Append("\n"); - sb.Append(" Encoding: ").Append(Encoding).Append("\n"); - sb.Append(" VideoBufferedPercent: ").Append(VideoBufferedPercent).Append("\n"); - sb.Append(" VideoStallCount: ").Append(VideoStallCount).Append("\n"); - sb.Append(" VideoDecodedByteCount: ").Append(VideoDecodedByteCount).Append("\n"); - sb.Append(" VideoWaitingCount: ").Append(VideoWaitingCount).Append("\n"); - sb.Append(" VideoErrorCount: ").Append(VideoErrorCount).Append("\n"); - sb.Append(" VideoDroppedFrames: ").Append(VideoDroppedFrames).Append("\n"); - sb.Append(" VideoTotalFrames: ").Append(VideoTotalFrames).Append("\n"); - sb.Append(" VideoAudioBytesDecoded: ").Append(VideoAudioBytesDecoded).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryResponseContent); - } - - /// - /// Returns true if HarEntryResponseContent instances are equal - /// - /// Instance of HarEntryResponseContent to be compared - /// Boolean - public bool Equals(HarEntryResponseContent input) - { - if (input == null) - { - return false; - } - return - ( - this.Size == input.Size || - this.Size.Equals(input.Size) - ) && - ( - this.Compression == input.Compression || - this.Compression.Equals(input.Compression) - ) && - ( - this.MimeType == input.MimeType || - (this.MimeType != null && - this.MimeType.Equals(input.MimeType)) - ) && - ( - this.Text == input.Text || - (this.Text != null && - this.Text.Equals(input.Text)) - ) && - ( - this.Encoding == input.Encoding || - (this.Encoding != null && - this.Encoding.Equals(input.Encoding)) - ) && - ( - this.VideoBufferedPercent == input.VideoBufferedPercent || - this.VideoBufferedPercent.Equals(input.VideoBufferedPercent) - ) && - ( - this.VideoStallCount == input.VideoStallCount || - this.VideoStallCount.Equals(input.VideoStallCount) - ) && - ( - this.VideoDecodedByteCount == input.VideoDecodedByteCount || - this.VideoDecodedByteCount.Equals(input.VideoDecodedByteCount) - ) && - ( - this.VideoWaitingCount == input.VideoWaitingCount || - this.VideoWaitingCount.Equals(input.VideoWaitingCount) - ) && - ( - this.VideoErrorCount == input.VideoErrorCount || - this.VideoErrorCount.Equals(input.VideoErrorCount) - ) && - ( - this.VideoDroppedFrames == input.VideoDroppedFrames || - this.VideoDroppedFrames.Equals(input.VideoDroppedFrames) - ) && - ( - this.VideoTotalFrames == input.VideoTotalFrames || - this.VideoTotalFrames.Equals(input.VideoTotalFrames) - ) && - ( - this.VideoAudioBytesDecoded == input.VideoAudioBytesDecoded || - this.VideoAudioBytesDecoded.Equals(input.VideoAudioBytesDecoded) - ) && - ( - 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; - hashCode = (hashCode * 59) + this.Size.GetHashCode(); - hashCode = (hashCode * 59) + this.Compression.GetHashCode(); - if (this.MimeType != null) - { - hashCode = (hashCode * 59) + this.MimeType.GetHashCode(); - } - if (this.Text != null) - { - hashCode = (hashCode * 59) + this.Text.GetHashCode(); - } - if (this.Encoding != null) - { - hashCode = (hashCode * 59) + this.Encoding.GetHashCode(); - } - hashCode = (hashCode * 59) + this.VideoBufferedPercent.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoStallCount.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoDecodedByteCount.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoWaitingCount.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoErrorCount.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoDroppedFrames.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoTotalFrames.GetHashCode(); - hashCode = (hashCode * 59) + this.VideoAudioBytesDecoded.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // VideoBufferedPercent (long) minimum - if (this.VideoBufferedPercent < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoBufferedPercent, must be a value greater than or equal to -1.", new [] { "VideoBufferedPercent" }); - } - - // VideoStallCount (long) minimum - if (this.VideoStallCount < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoStallCount, must be a value greater than or equal to -1.", new [] { "VideoStallCount" }); - } - - // VideoDecodedByteCount (long) minimum - if (this.VideoDecodedByteCount < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoDecodedByteCount, must be a value greater than or equal to -1.", new [] { "VideoDecodedByteCount" }); - } - - // VideoWaitingCount (long) minimum - if (this.VideoWaitingCount < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoWaitingCount, must be a value greater than or equal to -1.", new [] { "VideoWaitingCount" }); - } - - // VideoErrorCount (long) minimum - if (this.VideoErrorCount < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoErrorCount, must be a value greater than or equal to -1.", new [] { "VideoErrorCount" }); - } - - // VideoDroppedFrames (long) minimum - if (this.VideoDroppedFrames < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoDroppedFrames, must be a value greater than or equal to -1.", new [] { "VideoDroppedFrames" }); - } - - // VideoTotalFrames (long) minimum - if (this.VideoTotalFrames < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoTotalFrames, must be a value greater than or equal to -1.", new [] { "VideoTotalFrames" }); - } - - // VideoAudioBytesDecoded (long) minimum - if (this.VideoAudioBytesDecoded < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VideoAudioBytesDecoded, must be a value greater than or equal to -1.", new [] { "VideoAudioBytesDecoded" }); - } - - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryTimings.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryTimings.cs deleted file mode 100644 index b744d0415c..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarEntryTimings.cs +++ /dev/null @@ -1,273 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarEntryTimings - /// - [DataContract(Name = "HarEntry_timings")] - public partial class HarEntryTimings : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarEntryTimings() { } - /// - /// Initializes a new instance of the class. - /// - /// dns (required) (default to -1). - /// connect (required) (default to -1). - /// blocked (required) (default to -1). - /// send (required) (default to -1). - /// wait (required) (default to -1). - /// receive (required) (default to -1). - /// ssl (required) (default to -1). - /// comment. - public HarEntryTimings(long dns = -1, long connect = -1, long blocked = -1, long send = -1, long wait = -1, long receive = -1, long ssl = -1, string comment = default(string)) - { - this.Dns = dns; - this.Connect = connect; - this.Blocked = blocked; - this.Send = send; - this.Wait = wait; - this.Receive = receive; - this.Ssl = ssl; - this.Comment = comment; - } - - /// - /// Gets or Sets Dns - /// - [DataMember(Name = "dns", IsRequired = true, EmitDefaultValue = true)] - public long Dns { get; set; } - - /// - /// Gets or Sets Connect - /// - [DataMember(Name = "connect", IsRequired = true, EmitDefaultValue = true)] - public long Connect { get; set; } - - /// - /// Gets or Sets Blocked - /// - [DataMember(Name = "blocked", IsRequired = true, EmitDefaultValue = true)] - public long Blocked { get; set; } - - /// - /// Gets or Sets Send - /// - [DataMember(Name = "send", IsRequired = true, EmitDefaultValue = true)] - public long Send { get; set; } - - /// - /// Gets or Sets Wait - /// - [DataMember(Name = "wait", IsRequired = true, EmitDefaultValue = true)] - public long Wait { get; set; } - - /// - /// Gets or Sets Receive - /// - [DataMember(Name = "receive", IsRequired = true, EmitDefaultValue = true)] - public long Receive { get; set; } - - /// - /// Gets or Sets Ssl - /// - [DataMember(Name = "ssl", IsRequired = true, EmitDefaultValue = true)] - public long Ssl { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarEntryTimings {\n"); - sb.Append(" Dns: ").Append(Dns).Append("\n"); - sb.Append(" Connect: ").Append(Connect).Append("\n"); - sb.Append(" Blocked: ").Append(Blocked).Append("\n"); - sb.Append(" Send: ").Append(Send).Append("\n"); - sb.Append(" Wait: ").Append(Wait).Append("\n"); - sb.Append(" Receive: ").Append(Receive).Append("\n"); - sb.Append(" Ssl: ").Append(Ssl).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarEntryTimings); - } - - /// - /// Returns true if HarEntryTimings instances are equal - /// - /// Instance of HarEntryTimings to be compared - /// Boolean - public bool Equals(HarEntryTimings input) - { - if (input == null) - { - return false; - } - return - ( - this.Dns == input.Dns || - this.Dns.Equals(input.Dns) - ) && - ( - this.Connect == input.Connect || - this.Connect.Equals(input.Connect) - ) && - ( - this.Blocked == input.Blocked || - this.Blocked.Equals(input.Blocked) - ) && - ( - this.Send == input.Send || - this.Send.Equals(input.Send) - ) && - ( - this.Wait == input.Wait || - this.Wait.Equals(input.Wait) - ) && - ( - this.Receive == input.Receive || - this.Receive.Equals(input.Receive) - ) && - ( - this.Ssl == input.Ssl || - this.Ssl.Equals(input.Ssl) - ) && - ( - 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; - hashCode = (hashCode * 59) + this.Dns.GetHashCode(); - hashCode = (hashCode * 59) + this.Connect.GetHashCode(); - hashCode = (hashCode * 59) + this.Blocked.GetHashCode(); - hashCode = (hashCode * 59) + this.Send.GetHashCode(); - hashCode = (hashCode * 59) + this.Wait.GetHashCode(); - hashCode = (hashCode * 59) + this.Receive.GetHashCode(); - hashCode = (hashCode * 59) + this.Ssl.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Dns (long) minimum - if (this.Dns < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Dns, must be a value greater than or equal to -1.", new [] { "Dns" }); - } - - // Connect (long) minimum - if (this.Connect < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Connect, must be a value greater than or equal to -1.", new [] { "Connect" }); - } - - // Blocked (long) minimum - if (this.Blocked < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Blocked, must be a value greater than or equal to -1.", new [] { "Blocked" }); - } - - // Send (long) minimum - if (this.Send < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Send, must be a value greater than or equal to -1.", new [] { "Send" }); - } - - // Wait (long) minimum - if (this.Wait < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Wait, must be a value greater than or equal to -1.", new [] { "Wait" }); - } - - // Receive (long) minimum - if (this.Receive < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Receive, must be a value greater than or equal to -1.", new [] { "Receive" }); - } - - // Ssl (long) minimum - if (this.Ssl < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Ssl, must be a value greater than or equal to -1.", new [] { "Ssl" }); - } - - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarLog.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarLog.cs deleted file mode 100644 index 5c6d1b00fd..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarLog.cs +++ /dev/null @@ -1,245 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarLog - /// - [DataContract(Name = "Har_log")] - public partial class HarLog : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarLog() { } - /// - /// Initializes a new instance of the class. - /// - /// version (required). - /// creator (required). - /// browser. - /// pages (required). - /// entries (required). - /// comment. - public HarLog(string version = default(string), HarLogCreator creator = default(HarLogCreator), HarLogCreator browser = default(HarLogCreator), List pages = default(List), List entries = default(List), string comment = default(string)) - { - // to ensure "version" is required (not null) - if (version == null) - { - throw new ArgumentNullException("version is a required property for HarLog and cannot be null"); - } - this._Version = version; - // to ensure "creator" is required (not null) - if (creator == null) - { - throw new ArgumentNullException("creator is a required property for HarLog and cannot be null"); - } - this.Creator = creator; - // to ensure "pages" is required (not null) - if (pages == null) - { - throw new ArgumentNullException("pages is a required property for HarLog and cannot be null"); - } - this.Pages = pages; - // to ensure "entries" is required (not null) - if (entries == null) - { - throw new ArgumentNullException("entries is a required property for HarLog and cannot be null"); - } - this.Entries = entries; - this.Browser = browser; - this.Comment = comment; - } - - /// - /// Gets or Sets _Version - /// - [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = true)] - public string _Version { get; set; } - - /// - /// Gets or Sets Creator - /// - [DataMember(Name = "creator", IsRequired = true, EmitDefaultValue = true)] - public HarLogCreator Creator { get; set; } - - /// - /// Gets or Sets Browser - /// - [DataMember(Name = "browser", EmitDefaultValue = false)] - public HarLogCreator Browser { get; set; } - - /// - /// Gets or Sets Pages - /// - [DataMember(Name = "pages", IsRequired = true, EmitDefaultValue = true)] - public List Pages { get; set; } - - /// - /// Gets or Sets Entries - /// - [DataMember(Name = "entries", IsRequired = true, EmitDefaultValue = true)] - public List Entries { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarLog {\n"); - sb.Append(" _Version: ").Append(_Version).Append("\n"); - sb.Append(" Creator: ").Append(Creator).Append("\n"); - sb.Append(" Browser: ").Append(Browser).Append("\n"); - sb.Append(" Pages: ").Append(Pages).Append("\n"); - sb.Append(" Entries: ").Append(Entries).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarLog); - } - - /// - /// Returns true if HarLog instances are equal - /// - /// Instance of HarLog to be compared - /// Boolean - public bool Equals(HarLog input) - { - if (input == null) - { - return false; - } - return - ( - this._Version == input._Version || - (this._Version != null && - this._Version.Equals(input._Version)) - ) && - ( - this.Creator == input.Creator || - (this.Creator != null && - this.Creator.Equals(input.Creator)) - ) && - ( - this.Browser == input.Browser || - (this.Browser != null && - this.Browser.Equals(input.Browser)) - ) && - ( - this.Pages == input.Pages || - this.Pages != null && - input.Pages != null && - this.Pages.SequenceEqual(input.Pages) - ) && - ( - this.Entries == input.Entries || - this.Entries != null && - input.Entries != null && - this.Entries.SequenceEqual(input.Entries) - ) && - ( - 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._Version != null) - { - hashCode = (hashCode * 59) + this._Version.GetHashCode(); - } - if (this.Creator != null) - { - hashCode = (hashCode * 59) + this.Creator.GetHashCode(); - } - if (this.Browser != null) - { - hashCode = (hashCode * 59) + this.Browser.GetHashCode(); - } - if (this.Pages != null) - { - hashCode = (hashCode * 59) + this.Pages.GetHashCode(); - } - if (this.Entries != null) - { - hashCode = (hashCode * 59) + this.Entries.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarLogCreator.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarLogCreator.cs deleted file mode 100644 index 64dab214fd..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/HarLogCreator.cs +++ /dev/null @@ -1,179 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// HarLogCreator - /// - [DataContract(Name = "Har_log_creator")] - public partial class HarLogCreator : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected HarLogCreator() { } - /// - /// Initializes a new instance of the class. - /// - /// name (required). - /// version (required). - /// comment. - public HarLogCreator(string name = default(string), string version = default(string), string comment = default(string)) - { - // to ensure "name" is required (not null) - if (name == null) - { - throw new ArgumentNullException("name is a required property for HarLogCreator and cannot be null"); - } - this.Name = name; - // to ensure "version" is required (not null) - if (version == null) - { - throw new ArgumentNullException("version is a required property for HarLogCreator and cannot be null"); - } - this._Version = version; - this.Comment = comment; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] - public string Name { get; set; } - - /// - /// Gets or Sets _Version - /// - [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = true)] - public string _Version { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 HarLogCreator {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" _Version: ").Append(_Version).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as HarLogCreator); - } - - /// - /// Returns true if HarLogCreator instances are equal - /// - /// Instance of HarLogCreator to be compared - /// Boolean - public bool Equals(HarLogCreator input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this._Version == input._Version || - (this._Version != null && - this._Version.Equals(input._Version)) - ) && - ( - 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.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this._Version != null) - { - hashCode = (hashCode * 59) + this._Version.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Header.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/Header.cs deleted file mode 100644 index b3ec8f2c4f..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Header.cs +++ /dev/null @@ -1,179 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Header - /// - [DataContract(Name = "Header")] - public partial class Header : IEquatable
, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected Header() { } - /// - /// Initializes a new instance of the class. - /// - /// name (required). - /// value (required). - /// comment. - public Header(string name = default(string), string value = default(string), string comment = default(string)) - { - // to ensure "name" is required (not null) - if (name == null) - { - throw new ArgumentNullException("name is a required property for Header and cannot be null"); - } - this.Name = name; - // to ensure "value" is required (not null) - if (value == null) - { - throw new ArgumentNullException("value is a required property for Header and cannot be null"); - } - this.Value = value; - this.Comment = comment; - } - - /// - /// Gets or Sets Name - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] - public string Name { get; set; } - - /// - /// Gets or Sets Value - /// - [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] - public string Value { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { 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 Header {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Header); - } - - /// - /// Returns true if Header instances are equal - /// - /// Instance of Header to be compared - /// Boolean - public bool Equals(Header input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ) && - ( - 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.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/LargestContentfulPaint.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/LargestContentfulPaint.cs deleted file mode 100644 index 6ab2fe1f4a..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/LargestContentfulPaint.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// LargestContentfulPaint - /// - [DataContract(Name = "LargestContentfulPaint")] - public partial class LargestContentfulPaint : Dictionary, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// startTime (default to -1). - /// size (default to -1). - /// domPath (default to ""). - /// tag (default to ""). - public LargestContentfulPaint(long startTime = -1, long size = -1, string domPath = "", string tag = "") : base() - { - this.StartTime = startTime; - this.Size = size; - // use default value if no "domPath" provided - this.DomPath = domPath ?? ""; - // use default value if no "tag" provided - this.Tag = tag ?? ""; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets StartTime - /// - [DataMember(Name = "startTime", EmitDefaultValue = false)] - public long StartTime { get; set; } - - /// - /// Gets or Sets Size - /// - [DataMember(Name = "size", EmitDefaultValue = false)] - public long Size { get; set; } - - /// - /// Gets or Sets DomPath - /// - [DataMember(Name = "domPath", EmitDefaultValue = false)] - public string DomPath { get; set; } - - /// - /// Gets or Sets Tag - /// - [DataMember(Name = "tag", EmitDefaultValue = false)] - public string Tag { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { 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 LargestContentfulPaint {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" StartTime: ").Append(StartTime).Append("\n"); - sb.Append(" Size: ").Append(Size).Append("\n"); - sb.Append(" DomPath: ").Append(DomPath).Append("\n"); - sb.Append(" Tag: ").Append(Tag).Append("\n"); - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as LargestContentfulPaint); - } - - /// - /// Returns true if LargestContentfulPaint instances are equal - /// - /// Instance of LargestContentfulPaint to be compared - /// Boolean - public bool Equals(LargestContentfulPaint input) - { - if (input == null) - { - return false; - } - return base.Equals(input) && - ( - this.StartTime == input.StartTime || - this.StartTime.Equals(input.StartTime) - ) && base.Equals(input) && - ( - this.Size == input.Size || - this.Size.Equals(input.Size) - ) && base.Equals(input) && - ( - this.DomPath == input.DomPath || - (this.DomPath != null && - this.DomPath.Equals(input.DomPath)) - ) && base.Equals(input) && - ( - this.Tag == input.Tag || - (this.Tag != null && - this.Tag.Equals(input.Tag)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - hashCode = (hashCode * 59) + this.StartTime.GetHashCode(); - hashCode = (hashCode * 59) + this.Size.GetHashCode(); - if (this.DomPath != null) - { - hashCode = (hashCode * 59) + this.DomPath.GetHashCode(); - } - if (this.Tag != null) - { - hashCode = (hashCode * 59) + this.Tag.GetHashCode(); - } - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // StartTime (long) minimum - if (this.StartTime < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StartTime, must be a value greater than or equal to -1.", new [] { "StartTime" }); - } - - // Size (long) minimum - if (this.Size < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Size, must be a value greater than or equal to -1.", new [] { "Size" }); - } - - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/MatchCriteria.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/MatchCriteria.cs deleted file mode 100644 index 04cb98b9a6..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/MatchCriteria.cs +++ /dev/null @@ -1,364 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison - /// - [DataContract(Name = "MatchCriteria")] - public partial class MatchCriteria : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Request URL regexp to match. - /// current|all. - /// HTTP Status code to match.. - /// Body content regexp content to match. - /// Content type. - /// Websocket message text to match. - /// requestHeader. - /// requestCookie. - /// responseHeader. - /// responseCookie. - /// Is valid JSON. - /// Has JSON path. - /// Validates against passed JSON schema. - /// If the proxy has NO traffic at all, return error (default to true). - public MatchCriteria(string url = default(string), string page = default(string), string status = default(string), string content = default(string), string contentType = default(string), string websocketMessage = default(string), MatchCriteriaRequestHeader requestHeader = default(MatchCriteriaRequestHeader), MatchCriteriaRequestHeader requestCookie = default(MatchCriteriaRequestHeader), MatchCriteriaRequestHeader responseHeader = default(MatchCriteriaRequestHeader), MatchCriteriaRequestHeader responseCookie = default(MatchCriteriaRequestHeader), bool jsonValid = default(bool), string jsonPath = default(string), string jsonSchema = default(string), bool errorIfNoTraffic = true) - { - this.Url = url; - this.Page = page; - this.Status = status; - this.Content = content; - this.ContentType = contentType; - this.WebsocketMessage = websocketMessage; - this.RequestHeader = requestHeader; - this.RequestCookie = requestCookie; - this.ResponseHeader = responseHeader; - this.ResponseCookie = responseCookie; - this.JsonValid = jsonValid; - this.JsonPath = jsonPath; - this.JsonSchema = jsonSchema; - this.ErrorIfNoTraffic = errorIfNoTraffic; - } - - /// - /// Request URL regexp to match - /// - /// Request URL regexp to match - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } - - /// - /// current|all - /// - /// current|all - [DataMember(Name = "page", EmitDefaultValue = false)] - public string Page { get; set; } - - /// - /// HTTP Status code to match. - /// - /// HTTP Status code to match. - [DataMember(Name = "status", EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// Body content regexp content to match - /// - /// Body content regexp content to match - [DataMember(Name = "content", EmitDefaultValue = false)] - public string Content { get; set; } - - /// - /// Content type - /// - /// Content type - [DataMember(Name = "content_type", EmitDefaultValue = false)] - public string ContentType { get; set; } - - /// - /// Websocket message text to match - /// - /// Websocket message text to match - [DataMember(Name = "websocket_message", EmitDefaultValue = false)] - public string WebsocketMessage { get; set; } - - /// - /// Gets or Sets RequestHeader - /// - [DataMember(Name = "request_header", EmitDefaultValue = false)] - public MatchCriteriaRequestHeader RequestHeader { get; set; } - - /// - /// Gets or Sets RequestCookie - /// - [DataMember(Name = "request_cookie", EmitDefaultValue = false)] - public MatchCriteriaRequestHeader RequestCookie { get; set; } - - /// - /// Gets or Sets ResponseHeader - /// - [DataMember(Name = "response_header", EmitDefaultValue = false)] - public MatchCriteriaRequestHeader ResponseHeader { get; set; } - - /// - /// Gets or Sets ResponseCookie - /// - [DataMember(Name = "response_cookie", EmitDefaultValue = false)] - public MatchCriteriaRequestHeader ResponseCookie { get; set; } - - /// - /// Is valid JSON - /// - /// Is valid JSON - [DataMember(Name = "json_valid", EmitDefaultValue = true)] - public bool JsonValid { get; set; } - - /// - /// Has JSON path - /// - /// Has JSON path - [DataMember(Name = "json_path", EmitDefaultValue = false)] - public string JsonPath { get; set; } - - /// - /// Validates against passed JSON schema - /// - /// Validates against passed JSON schema - [DataMember(Name = "json_schema", EmitDefaultValue = false)] - public string JsonSchema { get; set; } - - /// - /// If the proxy has NO traffic at all, return error - /// - /// If the proxy has NO traffic at all, return error - [DataMember(Name = "error_if_no_traffic", EmitDefaultValue = true)] - public bool ErrorIfNoTraffic { 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 MatchCriteria {\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); - sb.Append(" Page: ").Append(Page).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Content: ").Append(Content).Append("\n"); - sb.Append(" ContentType: ").Append(ContentType).Append("\n"); - sb.Append(" WebsocketMessage: ").Append(WebsocketMessage).Append("\n"); - sb.Append(" RequestHeader: ").Append(RequestHeader).Append("\n"); - sb.Append(" RequestCookie: ").Append(RequestCookie).Append("\n"); - sb.Append(" ResponseHeader: ").Append(ResponseHeader).Append("\n"); - sb.Append(" ResponseCookie: ").Append(ResponseCookie).Append("\n"); - sb.Append(" JsonValid: ").Append(JsonValid).Append("\n"); - sb.Append(" JsonPath: ").Append(JsonPath).Append("\n"); - sb.Append(" JsonSchema: ").Append(JsonSchema).Append("\n"); - sb.Append(" ErrorIfNoTraffic: ").Append(ErrorIfNoTraffic).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MatchCriteria); - } - - /// - /// Returns true if MatchCriteria instances are equal - /// - /// Instance of MatchCriteria to be compared - /// Boolean - public bool Equals(MatchCriteria input) - { - if (input == null) - { - return false; - } - return - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ) && - ( - this.Page == input.Page || - (this.Page != null && - this.Page.Equals(input.Page)) - ) && - ( - this.Status == input.Status || - (this.Status != null && - this.Status.Equals(input.Status)) - ) && - ( - this.Content == input.Content || - (this.Content != null && - this.Content.Equals(input.Content)) - ) && - ( - this.ContentType == input.ContentType || - (this.ContentType != null && - this.ContentType.Equals(input.ContentType)) - ) && - ( - this.WebsocketMessage == input.WebsocketMessage || - (this.WebsocketMessage != null && - this.WebsocketMessage.Equals(input.WebsocketMessage)) - ) && - ( - this.RequestHeader == input.RequestHeader || - (this.RequestHeader != null && - this.RequestHeader.Equals(input.RequestHeader)) - ) && - ( - this.RequestCookie == input.RequestCookie || - (this.RequestCookie != null && - this.RequestCookie.Equals(input.RequestCookie)) - ) && - ( - this.ResponseHeader == input.ResponseHeader || - (this.ResponseHeader != null && - this.ResponseHeader.Equals(input.ResponseHeader)) - ) && - ( - this.ResponseCookie == input.ResponseCookie || - (this.ResponseCookie != null && - this.ResponseCookie.Equals(input.ResponseCookie)) - ) && - ( - this.JsonValid == input.JsonValid || - this.JsonValid.Equals(input.JsonValid) - ) && - ( - this.JsonPath == input.JsonPath || - (this.JsonPath != null && - this.JsonPath.Equals(input.JsonPath)) - ) && - ( - this.JsonSchema == input.JsonSchema || - (this.JsonSchema != null && - this.JsonSchema.Equals(input.JsonSchema)) - ) && - ( - this.ErrorIfNoTraffic == input.ErrorIfNoTraffic || - this.ErrorIfNoTraffic.Equals(input.ErrorIfNoTraffic) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - if (this.Page != null) - { - hashCode = (hashCode * 59) + this.Page.GetHashCode(); - } - if (this.Status != null) - { - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - } - if (this.Content != null) - { - hashCode = (hashCode * 59) + this.Content.GetHashCode(); - } - if (this.ContentType != null) - { - hashCode = (hashCode * 59) + this.ContentType.GetHashCode(); - } - if (this.WebsocketMessage != null) - { - hashCode = (hashCode * 59) + this.WebsocketMessage.GetHashCode(); - } - if (this.RequestHeader != null) - { - hashCode = (hashCode * 59) + this.RequestHeader.GetHashCode(); - } - if (this.RequestCookie != null) - { - hashCode = (hashCode * 59) + this.RequestCookie.GetHashCode(); - } - if (this.ResponseHeader != null) - { - hashCode = (hashCode * 59) + this.ResponseHeader.GetHashCode(); - } - if (this.ResponseCookie != null) - { - hashCode = (hashCode * 59) + this.ResponseCookie.GetHashCode(); - } - hashCode = (hashCode * 59) + this.JsonValid.GetHashCode(); - if (this.JsonPath != null) - { - hashCode = (hashCode * 59) + this.JsonPath.GetHashCode(); - } - if (this.JsonSchema != null) - { - hashCode = (hashCode * 59) + this.JsonSchema.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ErrorIfNoTraffic.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/MatchCriteriaRequestHeader.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/MatchCriteriaRequestHeader.cs deleted file mode 100644 index d66c059605..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/MatchCriteriaRequestHeader.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// MatchCriteriaRequestHeader - /// - [DataContract(Name = "MatchCriteria_request_header")] - public partial class MatchCriteriaRequestHeader : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Name to match. - /// Value to match. - public MatchCriteriaRequestHeader(string name = default(string), string value = default(string)) - { - this.Name = name; - this.Value = value; - } - - /// - /// Name to match - /// - /// Name to match - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Value to match - /// - /// Value to match - [DataMember(Name = "value", EmitDefaultValue = false)] - public string Value { 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 MatchCriteriaRequestHeader {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MatchCriteriaRequestHeader); - } - - /// - /// Returns true if MatchCriteriaRequestHeader instances are equal - /// - /// Instance of MatchCriteriaRequestHeader to be compared - /// Boolean - public bool Equals(MatchCriteriaRequestHeader input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ); - } - - /// - /// 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.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Metric.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/Metric.cs deleted file mode 100644 index 2474feca21..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Metric.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Metric - /// - [DataContract(Name = "Metric")] - public partial class Metric : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Name of Custom Metric to add to the page under _metrics. - /// Value for the metric. - public Metric(string name = default(string), double value = default(double)) - { - this.Name = name; - this.Value = value; - } - - /// - /// Name of Custom Metric to add to the page under _metrics - /// - /// Name of Custom Metric to add to the page under _metrics - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Value for the metric - /// - /// Value for the metric - [DataMember(Name = "value", EmitDefaultValue = false)] - public double Value { 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 Metric {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Metric); - } - - /// - /// Returns true if Metric instances are equal - /// - /// Instance of Metric to be compared - /// Boolean - public bool Equals(Metric input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - this.Value.Equals(input.Value) - ); - } - - /// - /// 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(); - } - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/NameValuePair.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/NameValuePair.cs deleted file mode 100644 index f89ec9915e..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/NameValuePair.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// NameValuePair - /// - [DataContract(Name = "NameValuePair")] - public partial class NameValuePair : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Name to match. - /// Value to match. - public NameValuePair(string name = default(string), string value = default(string)) - { - this.Name = name; - this.Value = value; - } - - /// - /// Name to match - /// - /// Name to match - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Value to match - /// - /// Value to match - [DataMember(Name = "value", EmitDefaultValue = false)] - public string Value { 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 NameValuePair {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Value: ").Append(Value).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as NameValuePair); - } - - /// - /// Returns true if NameValuePair instances are equal - /// - /// Instance of NameValuePair to be compared - /// Boolean - public bool Equals(NameValuePair input) - { - if (input == null) - { - return false; - } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ); - } - - /// - /// 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.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Page.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/Page.cs deleted file mode 100644 index 7005382561..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/Page.cs +++ /dev/null @@ -1,294 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// Page - /// - [DataContract(Name = "Page")] - public partial class Page : Dictionary, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected Page() - { - this.AdditionalProperties = new Dictionary(); - } - /// - /// Initializes a new instance of the class. - /// - /// startedDateTime (required). - /// id (required). - /// title (required). - /// verifications. - /// metrics. - /// errors. - /// pageTimings (required). - /// comment. - public Page(DateTime startedDateTime = default(DateTime), string id = default(string), string title = default(string), List verifications = default(List), List metrics = default(List), List errors = default(List), PageTimings pageTimings = default(PageTimings), string comment = default(string)) : base() - { - this.StartedDateTime = startedDateTime; - // to ensure "id" is required (not null) - if (id == null) - { - throw new ArgumentNullException("id is a required property for Page and cannot be null"); - } - this.Id = id; - // to ensure "title" is required (not null) - if (title == null) - { - throw new ArgumentNullException("title is a required property for Page and cannot be null"); - } - this.Title = title; - // to ensure "pageTimings" is required (not null) - if (pageTimings == null) - { - throw new ArgumentNullException("pageTimings is a required property for Page and cannot be null"); - } - this.PageTimings = pageTimings; - this.Verifications = verifications; - this.Metrics = metrics; - this.Errors = errors; - this.Comment = comment; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets StartedDateTime - /// - [DataMember(Name = "startedDateTime", IsRequired = true, EmitDefaultValue = true)] - public DateTime StartedDateTime { get; set; } - - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] - public string Id { get; set; } - - /// - /// Gets or Sets Title - /// - [DataMember(Name = "title", IsRequired = true, EmitDefaultValue = true)] - public string Title { get; set; } - - /// - /// Gets or Sets Verifications - /// - [DataMember(Name = "_verifications", EmitDefaultValue = false)] - public List Verifications { get; set; } - - /// - /// Gets or Sets Metrics - /// - [DataMember(Name = "_metrics", EmitDefaultValue = false)] - public List Metrics { get; set; } - - /// - /// Gets or Sets Errors - /// - [DataMember(Name = "_errors", EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Gets or Sets PageTimings - /// - [DataMember(Name = "pageTimings", IsRequired = true, EmitDefaultValue = true)] - public PageTimings PageTimings { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { 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 Page {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" StartedDateTime: ").Append(StartedDateTime).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Title: ").Append(Title).Append("\n"); - sb.Append(" Verifications: ").Append(Verifications).Append("\n"); - sb.Append(" Metrics: ").Append(Metrics).Append("\n"); - sb.Append(" Errors: ").Append(Errors).Append("\n"); - sb.Append(" PageTimings: ").Append(PageTimings).Append("\n"); - sb.Append(" Comment: ").Append(Comment).Append("\n"); - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Page); - } - - /// - /// Returns true if Page instances are equal - /// - /// Instance of Page to be compared - /// Boolean - public bool Equals(Page input) - { - if (input == null) - { - return false; - } - return base.Equals(input) && - ( - this.StartedDateTime == input.StartedDateTime || - (this.StartedDateTime != null && - this.StartedDateTime.Equals(input.StartedDateTime)) - ) && base.Equals(input) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && base.Equals(input) && - ( - this.Title == input.Title || - (this.Title != null && - this.Title.Equals(input.Title)) - ) && base.Equals(input) && - ( - this.Verifications == input.Verifications || - this.Verifications != null && - input.Verifications != null && - this.Verifications.SequenceEqual(input.Verifications) - ) && base.Equals(input) && - ( - this.Metrics == input.Metrics || - this.Metrics != null && - input.Metrics != null && - this.Metrics.SequenceEqual(input.Metrics) - ) && base.Equals(input) && - ( - this.Errors == input.Errors || - this.Errors != null && - input.Errors != null && - this.Errors.SequenceEqual(input.Errors) - ) && base.Equals(input) && - ( - this.PageTimings == input.PageTimings || - (this.PageTimings != null && - this.PageTimings.Equals(input.PageTimings)) - ) && base.Equals(input) && - ( - this.Comment == input.Comment || - (this.Comment != null && - this.Comment.Equals(input.Comment)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - if (this.StartedDateTime != null) - { - hashCode = (hashCode * 59) + this.StartedDateTime.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.Title != null) - { - hashCode = (hashCode * 59) + this.Title.GetHashCode(); - } - if (this.Verifications != null) - { - hashCode = (hashCode * 59) + this.Verifications.GetHashCode(); - } - if (this.Metrics != null) - { - hashCode = (hashCode * 59) + this.Metrics.GetHashCode(); - } - if (this.Errors != null) - { - hashCode = (hashCode * 59) + this.Errors.GetHashCode(); - } - if (this.PageTimings != null) - { - hashCode = (hashCode * 59) + this.PageTimings.GetHashCode(); - } - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/PageTiming.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/PageTiming.cs deleted file mode 100644 index 45a76b2100..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/PageTiming.cs +++ /dev/null @@ -1,294 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// PageTiming - /// - [DataContract(Name = "PageTiming")] - public partial class PageTiming : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// onContentLoad per the browser. - /// onLoad per the browser. - /// firstInputDelay from the browser. - /// firstPaint from the browser. - /// cumulativeLayoutShift metric from the browser. - /// largestContentfulPaint from the browser. - /// domInteractive from the browser. - /// firstContentfulPaint from the browser. - /// dns lookup time from the browser. - /// Ssl connect time from the browser. - /// Time to first byte of the page's first request per the browser. - /// Top level href, including hashtag, etc per the browser. - public PageTiming(decimal onContentLoad = default(decimal), decimal onLoad = default(decimal), decimal firstInputDelay = default(decimal), decimal firstPaint = default(decimal), decimal cumulativeLayoutShift = default(decimal), decimal largestContentfulPaint = default(decimal), decimal domInteractive = default(decimal), decimal firstContentfulPaint = default(decimal), decimal dns = default(decimal), decimal ssl = default(decimal), decimal timeToFirstByte = default(decimal), string href = default(string)) - { - this.OnContentLoad = onContentLoad; - this.OnLoad = onLoad; - this.FirstInputDelay = firstInputDelay; - this.FirstPaint = firstPaint; - this.CumulativeLayoutShift = cumulativeLayoutShift; - this.LargestContentfulPaint = largestContentfulPaint; - this.DomInteractive = domInteractive; - this.FirstContentfulPaint = firstContentfulPaint; - this.Dns = dns; - this.Ssl = ssl; - this.TimeToFirstByte = timeToFirstByte; - this.Href = href; - } - - /// - /// onContentLoad per the browser - /// - /// onContentLoad per the browser - [DataMember(Name = "onContentLoad", EmitDefaultValue = false)] - public decimal OnContentLoad { get; set; } - - /// - /// onLoad per the browser - /// - /// onLoad per the browser - [DataMember(Name = "onLoad", EmitDefaultValue = false)] - public decimal OnLoad { get; set; } - - /// - /// firstInputDelay from the browser - /// - /// firstInputDelay from the browser - [DataMember(Name = "_firstInputDelay", EmitDefaultValue = false)] - public decimal FirstInputDelay { get; set; } - - /// - /// firstPaint from the browser - /// - /// firstPaint from the browser - [DataMember(Name = "_firstPaint", EmitDefaultValue = false)] - public decimal FirstPaint { get; set; } - - /// - /// cumulativeLayoutShift metric from the browser - /// - /// cumulativeLayoutShift metric from the browser - [DataMember(Name = "_cumulativeLayoutShift", EmitDefaultValue = false)] - public decimal CumulativeLayoutShift { get; set; } - - /// - /// largestContentfulPaint from the browser - /// - /// largestContentfulPaint from the browser - [DataMember(Name = "_largestContentfulPaint", EmitDefaultValue = false)] - public decimal LargestContentfulPaint { get; set; } - - /// - /// domInteractive from the browser - /// - /// domInteractive from the browser - [DataMember(Name = "_domInteractive", EmitDefaultValue = false)] - public decimal DomInteractive { get; set; } - - /// - /// firstContentfulPaint from the browser - /// - /// firstContentfulPaint from the browser - [DataMember(Name = "_firstContentfulPaint", EmitDefaultValue = false)] - public decimal FirstContentfulPaint { get; set; } - - /// - /// dns lookup time from the browser - /// - /// dns lookup time from the browser - [DataMember(Name = "_dns", EmitDefaultValue = false)] - public decimal Dns { get; set; } - - /// - /// Ssl connect time from the browser - /// - /// Ssl connect time from the browser - [DataMember(Name = "_ssl", EmitDefaultValue = false)] - public decimal Ssl { get; set; } - - /// - /// Time to first byte of the page's first request per the browser - /// - /// Time to first byte of the page's first request per the browser - [DataMember(Name = "_timeToFirstByte", EmitDefaultValue = false)] - public decimal TimeToFirstByte { get; set; } - - /// - /// Top level href, including hashtag, etc per the browser - /// - /// Top level href, including hashtag, etc per the browser - [DataMember(Name = "_href", EmitDefaultValue = false)] - public string Href { 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 PageTiming {\n"); - sb.Append(" OnContentLoad: ").Append(OnContentLoad).Append("\n"); - sb.Append(" OnLoad: ").Append(OnLoad).Append("\n"); - sb.Append(" FirstInputDelay: ").Append(FirstInputDelay).Append("\n"); - sb.Append(" FirstPaint: ").Append(FirstPaint).Append("\n"); - sb.Append(" CumulativeLayoutShift: ").Append(CumulativeLayoutShift).Append("\n"); - sb.Append(" LargestContentfulPaint: ").Append(LargestContentfulPaint).Append("\n"); - sb.Append(" DomInteractive: ").Append(DomInteractive).Append("\n"); - sb.Append(" FirstContentfulPaint: ").Append(FirstContentfulPaint).Append("\n"); - sb.Append(" Dns: ").Append(Dns).Append("\n"); - sb.Append(" Ssl: ").Append(Ssl).Append("\n"); - sb.Append(" TimeToFirstByte: ").Append(TimeToFirstByte).Append("\n"); - sb.Append(" Href: ").Append(Href).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PageTiming); - } - - /// - /// Returns true if PageTiming instances are equal - /// - /// Instance of PageTiming to be compared - /// Boolean - public bool Equals(PageTiming input) - { - if (input == null) - { - return false; - } - return - ( - this.OnContentLoad == input.OnContentLoad || - this.OnContentLoad.Equals(input.OnContentLoad) - ) && - ( - this.OnLoad == input.OnLoad || - this.OnLoad.Equals(input.OnLoad) - ) && - ( - this.FirstInputDelay == input.FirstInputDelay || - this.FirstInputDelay.Equals(input.FirstInputDelay) - ) && - ( - this.FirstPaint == input.FirstPaint || - this.FirstPaint.Equals(input.FirstPaint) - ) && - ( - this.CumulativeLayoutShift == input.CumulativeLayoutShift || - this.CumulativeLayoutShift.Equals(input.CumulativeLayoutShift) - ) && - ( - this.LargestContentfulPaint == input.LargestContentfulPaint || - this.LargestContentfulPaint.Equals(input.LargestContentfulPaint) - ) && - ( - this.DomInteractive == input.DomInteractive || - this.DomInteractive.Equals(input.DomInteractive) - ) && - ( - this.FirstContentfulPaint == input.FirstContentfulPaint || - this.FirstContentfulPaint.Equals(input.FirstContentfulPaint) - ) && - ( - this.Dns == input.Dns || - this.Dns.Equals(input.Dns) - ) && - ( - this.Ssl == input.Ssl || - this.Ssl.Equals(input.Ssl) - ) && - ( - this.TimeToFirstByte == input.TimeToFirstByte || - this.TimeToFirstByte.Equals(input.TimeToFirstByte) - ) && - ( - this.Href == input.Href || - (this.Href != null && - this.Href.Equals(input.Href)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.OnContentLoad.GetHashCode(); - hashCode = (hashCode * 59) + this.OnLoad.GetHashCode(); - hashCode = (hashCode * 59) + this.FirstInputDelay.GetHashCode(); - hashCode = (hashCode * 59) + this.FirstPaint.GetHashCode(); - hashCode = (hashCode * 59) + this.CumulativeLayoutShift.GetHashCode(); - hashCode = (hashCode * 59) + this.LargestContentfulPaint.GetHashCode(); - hashCode = (hashCode * 59) + this.DomInteractive.GetHashCode(); - hashCode = (hashCode * 59) + this.FirstContentfulPaint.GetHashCode(); - hashCode = (hashCode * 59) + this.Dns.GetHashCode(); - hashCode = (hashCode * 59) + this.Ssl.GetHashCode(); - hashCode = (hashCode * 59) + this.TimeToFirstByte.GetHashCode(); - if (this.Href != null) - { - hashCode = (hashCode * 59) + this.Href.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/PageTimings.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/PageTimings.cs deleted file mode 100644 index 9357722335..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/PageTimings.cs +++ /dev/null @@ -1,387 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// PageTimings - /// - [DataContract(Name = "PageTimings")] - public partial class PageTimings : Dictionary, IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected PageTimings() - { - this.AdditionalProperties = new Dictionary(); - } - /// - /// Initializes a new instance of the class. - /// - /// onContentLoad (required) (default to -1). - /// onLoad (required) (default to -1). - /// href (default to ""). - /// dns (default to -1). - /// ssl (default to -1). - /// timeToFirstByte (default to -1). - /// cumulativeLayoutShift (default to -1F). - /// largestContentfulPaint. - /// firstPaint (default to -1). - /// firstInputDelay (default to -1F). - /// domInteractive (default to -1). - /// firstContentfulPaint (default to -1). - /// comment. - public PageTimings(long onContentLoad = -1, long onLoad = -1, string href = "", long dns = -1, long ssl = -1, long timeToFirstByte = -1, float cumulativeLayoutShift = -1F, LargestContentfulPaint largestContentfulPaint = default(LargestContentfulPaint), long firstPaint = -1, float firstInputDelay = -1F, long domInteractive = -1, long firstContentfulPaint = -1, string comment = default(string)) : base() - { - this.OnContentLoad = onContentLoad; - this.OnLoad = onLoad; - // use default value if no "href" provided - this.Href = href ?? ""; - this.Dns = dns; - this.Ssl = ssl; - this.TimeToFirstByte = timeToFirstByte; - this.CumulativeLayoutShift = cumulativeLayoutShift; - this.LargestContentfulPaint = largestContentfulPaint; - this.FirstPaint = firstPaint; - this.FirstInputDelay = firstInputDelay; - this.DomInteractive = domInteractive; - this.FirstContentfulPaint = firstContentfulPaint; - this.Comment = comment; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets OnContentLoad - /// - [DataMember(Name = "onContentLoad", IsRequired = true, EmitDefaultValue = true)] - public long OnContentLoad { get; set; } - - /// - /// Gets or Sets OnLoad - /// - [DataMember(Name = "onLoad", IsRequired = true, EmitDefaultValue = true)] - public long OnLoad { get; set; } - - /// - /// Gets or Sets Href - /// - [DataMember(Name = "_href", EmitDefaultValue = false)] - public string Href { get; set; } - - /// - /// Gets or Sets Dns - /// - [DataMember(Name = "_dns", EmitDefaultValue = false)] - public long Dns { get; set; } - - /// - /// Gets or Sets Ssl - /// - [DataMember(Name = "_ssl", EmitDefaultValue = false)] - public long Ssl { get; set; } - - /// - /// Gets or Sets TimeToFirstByte - /// - [DataMember(Name = "_timeToFirstByte", EmitDefaultValue = false)] - public long TimeToFirstByte { get; set; } - - /// - /// Gets or Sets CumulativeLayoutShift - /// - [DataMember(Name = "_cumulativeLayoutShift", EmitDefaultValue = false)] - public float CumulativeLayoutShift { get; set; } - - /// - /// Gets or Sets LargestContentfulPaint - /// - [DataMember(Name = "_largestContentfulPaint", EmitDefaultValue = false)] - public LargestContentfulPaint LargestContentfulPaint { get; set; } - - /// - /// Gets or Sets FirstPaint - /// - [DataMember(Name = "_firstPaint", EmitDefaultValue = false)] - public long FirstPaint { get; set; } - - /// - /// Gets or Sets FirstInputDelay - /// - [DataMember(Name = "_firstInputDelay", EmitDefaultValue = false)] - public float FirstInputDelay { get; set; } - - /// - /// Gets or Sets DomInteractive - /// - [DataMember(Name = "_domInteractive", EmitDefaultValue = false)] - public long DomInteractive { get; set; } - - /// - /// Gets or Sets FirstContentfulPaint - /// - [DataMember(Name = "_firstContentfulPaint", EmitDefaultValue = false)] - public long FirstContentfulPaint { get; set; } - - /// - /// Gets or Sets Comment - /// - [DataMember(Name = "comment", EmitDefaultValue = false)] - public string Comment { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { 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 PageTimings {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" OnContentLoad: ").Append(OnContentLoad).Append("\n"); - sb.Append(" OnLoad: ").Append(OnLoad).Append("\n"); - sb.Append(" Href: ").Append(Href).Append("\n"); - sb.Append(" Dns: ").Append(Dns).Append("\n"); - sb.Append(" Ssl: ").Append(Ssl).Append("\n"); - sb.Append(" TimeToFirstByte: ").Append(TimeToFirstByte).Append("\n"); - sb.Append(" CumulativeLayoutShift: ").Append(CumulativeLayoutShift).Append("\n"); - sb.Append(" LargestContentfulPaint: ").Append(LargestContentfulPaint).Append("\n"); - sb.Append(" FirstPaint: ").Append(FirstPaint).Append("\n"); - sb.Append(" FirstInputDelay: ").Append(FirstInputDelay).Append("\n"); - sb.Append(" DomInteractive: ").Append(DomInteractive).Append("\n"); - sb.Append(" FirstContentfulPaint: ").Append(FirstContentfulPaint).Append("\n"); - sb.Append(" Comment: ").Append(Comment).Append("\n"); - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PageTimings); - } - - /// - /// Returns true if PageTimings instances are equal - /// - /// Instance of PageTimings to be compared - /// Boolean - public bool Equals(PageTimings input) - { - if (input == null) - { - return false; - } - return base.Equals(input) && - ( - this.OnContentLoad == input.OnContentLoad || - this.OnContentLoad.Equals(input.OnContentLoad) - ) && base.Equals(input) && - ( - this.OnLoad == input.OnLoad || - this.OnLoad.Equals(input.OnLoad) - ) && base.Equals(input) && - ( - this.Href == input.Href || - (this.Href != null && - this.Href.Equals(input.Href)) - ) && base.Equals(input) && - ( - this.Dns == input.Dns || - this.Dns.Equals(input.Dns) - ) && base.Equals(input) && - ( - this.Ssl == input.Ssl || - this.Ssl.Equals(input.Ssl) - ) && base.Equals(input) && - ( - this.TimeToFirstByte == input.TimeToFirstByte || - this.TimeToFirstByte.Equals(input.TimeToFirstByte) - ) && base.Equals(input) && - ( - this.CumulativeLayoutShift == input.CumulativeLayoutShift || - this.CumulativeLayoutShift.Equals(input.CumulativeLayoutShift) - ) && base.Equals(input) && - ( - this.LargestContentfulPaint == input.LargestContentfulPaint || - (this.LargestContentfulPaint != null && - this.LargestContentfulPaint.Equals(input.LargestContentfulPaint)) - ) && base.Equals(input) && - ( - this.FirstPaint == input.FirstPaint || - this.FirstPaint.Equals(input.FirstPaint) - ) && base.Equals(input) && - ( - this.FirstInputDelay == input.FirstInputDelay || - this.FirstInputDelay.Equals(input.FirstInputDelay) - ) && base.Equals(input) && - ( - this.DomInteractive == input.DomInteractive || - this.DomInteractive.Equals(input.DomInteractive) - ) && base.Equals(input) && - ( - this.FirstContentfulPaint == input.FirstContentfulPaint || - this.FirstContentfulPaint.Equals(input.FirstContentfulPaint) - ) && base.Equals(input) && - ( - this.Comment == input.Comment || - (this.Comment != null && - this.Comment.Equals(input.Comment)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - hashCode = (hashCode * 59) + this.OnContentLoad.GetHashCode(); - hashCode = (hashCode * 59) + this.OnLoad.GetHashCode(); - if (this.Href != null) - { - hashCode = (hashCode * 59) + this.Href.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Dns.GetHashCode(); - hashCode = (hashCode * 59) + this.Ssl.GetHashCode(); - hashCode = (hashCode * 59) + this.TimeToFirstByte.GetHashCode(); - hashCode = (hashCode * 59) + this.CumulativeLayoutShift.GetHashCode(); - if (this.LargestContentfulPaint != null) - { - hashCode = (hashCode * 59) + this.LargestContentfulPaint.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FirstPaint.GetHashCode(); - hashCode = (hashCode * 59) + this.FirstInputDelay.GetHashCode(); - hashCode = (hashCode * 59) + this.DomInteractive.GetHashCode(); - hashCode = (hashCode * 59) + this.FirstContentfulPaint.GetHashCode(); - if (this.Comment != null) - { - hashCode = (hashCode * 59) + this.Comment.GetHashCode(); - } - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // OnContentLoad (long) minimum - if (this.OnContentLoad < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for OnContentLoad, must be a value greater than or equal to -1.", new [] { "OnContentLoad" }); - } - - // OnLoad (long) minimum - if (this.OnLoad < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for OnLoad, must be a value greater than or equal to -1.", new [] { "OnLoad" }); - } - - // Dns (long) minimum - if (this.Dns < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Dns, must be a value greater than or equal to -1.", new [] { "Dns" }); - } - - // Ssl (long) minimum - if (this.Ssl < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Ssl, must be a value greater than or equal to -1.", new [] { "Ssl" }); - } - - // TimeToFirstByte (long) minimum - if (this.TimeToFirstByte < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TimeToFirstByte, must be a value greater than or equal to -1.", new [] { "TimeToFirstByte" }); - } - - // CumulativeLayoutShift (float) minimum - if (this.CumulativeLayoutShift < (float)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CumulativeLayoutShift, must be a value greater than or equal to -1.", new [] { "CumulativeLayoutShift" }); - } - - // FirstPaint (long) minimum - if (this.FirstPaint < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for FirstPaint, must be a value greater than or equal to -1.", new [] { "FirstPaint" }); - } - - // FirstInputDelay (float) minimum - if (this.FirstInputDelay < (float)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for FirstInputDelay, must be a value greater than or equal to -1.", new [] { "FirstInputDelay" }); - } - - // DomInteractive (long) minimum - if (this.DomInteractive < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DomInteractive, must be a value greater than or equal to -1.", new [] { "DomInteractive" }); - } - - // FirstContentfulPaint (long) minimum - if (this.FirstContentfulPaint < (long)-1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for FirstContentfulPaint, must be a value greater than or equal to -1.", new [] { "FirstContentfulPaint" }); - } - - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/VerifyResult.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/VerifyResult.cs deleted file mode 100644 index 5eff19035b..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/VerifyResult.cs +++ /dev/null @@ -1,163 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// VerifyResult - /// - [DataContract(Name = "VerifyResult")] - public partial class VerifyResult : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Result True / False. - /// Name. - /// Type. - public VerifyResult(bool result = default(bool), string name = default(string), string type = default(string)) - { - this.Result = result; - this.Name = name; - this.Type = type; - } - - /// - /// Result True / False - /// - /// Result True / False - [DataMember(Name = "result", EmitDefaultValue = true)] - public bool Result { get; set; } - - /// - /// Name - /// - /// Name - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Type - /// - /// Type - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { 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 VerifyResult {\n"); - sb.Append(" Result: ").Append(Result).Append("\n"); - sb.Append(" Name: ").Append(Name).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as VerifyResult); - } - - /// - /// Returns true if VerifyResult instances are equal - /// - /// Instance of VerifyResult to be compared - /// Boolean - public bool Equals(VerifyResult input) - { - if (input == null) - { - return false; - } - return - ( - this.Result == input.Result || - this.Result.Equals(input.Result) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - 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; - hashCode = (hashCode * 59) + this.Result.GetHashCode(); - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/csharp/src/BrowserUpMitmProxyClient/Model/WebSocketMessage.cs b/clients/csharp/src/BrowserUpMitmProxyClient/Model/WebSocketMessage.cs deleted file mode 100644 index e03713006a..0000000000 --- a/clients/csharp/src/BrowserUpMitmProxyClient/Model/WebSocketMessage.cs +++ /dev/null @@ -1,189 +0,0 @@ -/* - * BrowserUp MitmProxy - * - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * 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.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = BrowserUpMitmProxyClient.Client.OpenAPIDateConverter; - -namespace BrowserUpMitmProxyClient.Model -{ - /// - /// WebSocketMessage - /// - [DataContract(Name = "WebSocketMessage")] - public partial class WebSocketMessage : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected WebSocketMessage() { } - /// - /// Initializes a new instance of the class. - /// - /// type (required). - /// opcode (required). - /// data (required). - /// time (required). - public WebSocketMessage(string type = default(string), decimal opcode = default(decimal), string data = default(string), decimal time = default(decimal)) - { - // to ensure "type" is required (not null) - if (type == null) - { - throw new ArgumentNullException("type is a required property for WebSocketMessage and cannot be null"); - } - this.Type = type; - this.Opcode = opcode; - // to ensure "data" is required (not null) - if (data == null) - { - throw new ArgumentNullException("data is a required property for WebSocketMessage and cannot be null"); - } - this.Data = data; - this.Time = time; - } - - /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] - public string Type { get; set; } - - /// - /// Gets or Sets Opcode - /// - [DataMember(Name = "opcode", IsRequired = true, EmitDefaultValue = true)] - public decimal Opcode { get; set; } - - /// - /// Gets or Sets Data - /// - [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] - public string Data { get; set; } - - /// - /// Gets or Sets Time - /// - [DataMember(Name = "time", IsRequired = true, EmitDefaultValue = true)] - public decimal Time { 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 WebSocketMessage {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Opcode: ").Append(Opcode).Append("\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); - sb.Append(" Time: ").Append(Time).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as WebSocketMessage); - } - - /// - /// Returns true if WebSocketMessage instances are equal - /// - /// Instance of WebSocketMessage to be compared - /// Boolean - public bool Equals(WebSocketMessage input) - { - if (input == null) - { - return false; - } - return - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.Opcode == input.Opcode || - this.Opcode.Equals(input.Opcode) - ) && - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ) && - ( - this.Time == input.Time || - this.Time.Equals(input.Time) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Opcode.GetHashCode(); - if (this.Data != null) - { - hashCode = (hashCode * 59) + this.Data.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Time.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/clients/go/.gitignore b/clients/go/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/clients/go/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/clients/csharp/.openapi-generator-ignore b/clients/go/.openapi-generator-ignore similarity index 100% rename from clients/csharp/.openapi-generator-ignore rename to clients/go/.openapi-generator-ignore diff --git a/clients/go/.openapi-generator/FILES b/clients/go/.openapi-generator/FILES new file mode 100644 index 0000000000..30fcbf5377 --- /dev/null +++ b/clients/go/.openapi-generator/FILES @@ -0,0 +1,67 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_browser_up_proxy.go +client.go +configuration.go +docs/Action.md +docs/BrowserUpProxyAPI.md +docs/Error.md +docs/Har.md +docs/HarEntry.md +docs/HarEntryCache.md +docs/HarEntryCacheBeforeRequest.md +docs/HarEntryRequest.md +docs/HarEntryRequestCookiesInner.md +docs/HarEntryRequestPostData.md +docs/HarEntryRequestPostDataParamsInner.md +docs/HarEntryRequestQueryStringInner.md +docs/HarEntryResponse.md +docs/HarEntryResponseContent.md +docs/HarEntryTimings.md +docs/HarLog.md +docs/HarLogCreator.md +docs/Header.md +docs/LargestContentfulPaint.md +docs/MatchCriteria.md +docs/Metric.md +docs/NameValuePair.md +docs/Page.md +docs/PageTiming.md +docs/PageTimings.md +docs/VerifyResult.md +docs/WebSocketMessage.md +git_push.sh +go.mod +go.sum +model_action.go +model_error.go +model_har.go +model_har_entry.go +model_har_entry_cache.go +model_har_entry_cache_before_request.go +model_har_entry_request.go +model_har_entry_request_cookies_inner.go +model_har_entry_request_post_data.go +model_har_entry_request_post_data_params_inner.go +model_har_entry_request_query_string_inner.go +model_har_entry_response.go +model_har_entry_response_content.go +model_har_entry_timings.go +model_har_log.go +model_har_log_creator.go +model_header.go +model_largest_contentful_paint.go +model_match_criteria.go +model_metric.go +model_name_value_pair.go +model_page.go +model_page_timing.go +model_page_timings.go +model_verify_result.go +model_web_socket_message.go +response.go +test/api_browser_up_proxy_test.go +utils.go diff --git a/clients/go/.openapi-generator/VERSION b/clients/go/.openapi-generator/VERSION new file mode 100644 index 0000000000..5f84a81db0 --- /dev/null +++ b/clients/go/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.12.0 diff --git a/clients/go/.travis.yml b/clients/go/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /dev/null +++ b/clients/go/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/clients/go/README.md b/clients/go/README.md new file mode 100644 index 0000000000..485131bd28 --- /dev/null +++ b/clients/go/README.md @@ -0,0 +1,152 @@ +# Go API client for BrowserUpMitmProxyClient + +___ +This is the REST API for controlling the BrowserUp MitmProxy. +The BrowserUp MitmProxy is a swiss army knife for automated testing that +captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. +___ + + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.25 +- Package version: 1.0.0 +- Generator version: 7.12.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```sh +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```go +import BrowserUpMitmProxyClient "github.com/GIT_USER_ID/GIT_REPO_ID" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```go +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `BrowserUpMitmProxyClient.ContextServerIndex` of type `int`. + +```go +ctx := context.WithValue(context.Background(), BrowserUpMitmProxyClient.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `BrowserUpMitmProxyClient.ContextServerVariables` of type `map[string]string`. + +```go +ctx := context.WithValue(context.Background(), BrowserUpMitmProxyClient.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `BrowserUpMitmProxyClient.ContextOperationServerIndices` and `BrowserUpMitmProxyClient.ContextOperationServerVariables` context maps. + +```go +ctx := context.WithValue(context.Background(), BrowserUpMitmProxyClient.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), BrowserUpMitmProxyClient.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:48088* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BrowserUpProxyAPI* | [**AddError**](docs/BrowserUpProxyAPI.md#adderror) | **Post** /har/errors | +*BrowserUpProxyAPI* | [**AddMetric**](docs/BrowserUpProxyAPI.md#addmetric) | **Post** /har/metrics | +*BrowserUpProxyAPI* | [**GetHarLog**](docs/BrowserUpProxyAPI.md#getharlog) | **Get** /har | +*BrowserUpProxyAPI* | [**Healthcheck**](docs/BrowserUpProxyAPI.md#healthcheck) | **Get** /healthcheck | +*BrowserUpProxyAPI* | [**NewPage**](docs/BrowserUpProxyAPI.md#newpage) | **Post** /har/page | +*BrowserUpProxyAPI* | [**ResetHarLog**](docs/BrowserUpProxyAPI.md#resetharlog) | **Put** /har | +*BrowserUpProxyAPI* | [**VerifyNotPresent**](docs/BrowserUpProxyAPI.md#verifynotpresent) | **Post** /verify/not_present/{name} | +*BrowserUpProxyAPI* | [**VerifyPresent**](docs/BrowserUpProxyAPI.md#verifypresent) | **Post** /verify/present/{name} | +*BrowserUpProxyAPI* | [**VerifySLA**](docs/BrowserUpProxyAPI.md#verifysla) | **Post** /verify/sla/{time}/{name} | +*BrowserUpProxyAPI* | [**VerifySize**](docs/BrowserUpProxyAPI.md#verifysize) | **Post** /verify/size/{size}/{name} | + + +## Documentation For Models + + - [Action](docs/Action.md) + - [Error](docs/Error.md) + - [Har](docs/Har.md) + - [HarEntry](docs/HarEntry.md) + - [HarEntryCache](docs/HarEntryCache.md) + - [HarEntryCacheBeforeRequest](docs/HarEntryCacheBeforeRequest.md) + - [HarEntryRequest](docs/HarEntryRequest.md) + - [HarEntryRequestCookiesInner](docs/HarEntryRequestCookiesInner.md) + - [HarEntryRequestPostData](docs/HarEntryRequestPostData.md) + - [HarEntryRequestPostDataParamsInner](docs/HarEntryRequestPostDataParamsInner.md) + - [HarEntryRequestQueryStringInner](docs/HarEntryRequestQueryStringInner.md) + - [HarEntryResponse](docs/HarEntryResponse.md) + - [HarEntryResponseContent](docs/HarEntryResponseContent.md) + - [HarEntryTimings](docs/HarEntryTimings.md) + - [HarLog](docs/HarLog.md) + - [HarLogCreator](docs/HarLogCreator.md) + - [Header](docs/Header.md) + - [LargestContentfulPaint](docs/LargestContentfulPaint.md) + - [MatchCriteria](docs/MatchCriteria.md) + - [Metric](docs/Metric.md) + - [NameValuePair](docs/NameValuePair.md) + - [Page](docs/Page.md) + - [PageTiming](docs/PageTiming.md) + - [PageTimings](docs/PageTimings.md) + - [VerifyResult](docs/VerifyResult.md) + - [WebSocketMessage](docs/WebSocketMessage.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/clients/go/api/openapi.yaml b/clients/go/api/openapi.yaml new file mode 100644 index 0000000000..ac82e6d79e --- /dev/null +++ b/clients/go/api/openapi.yaml @@ -0,0 +1,2154 @@ +openapi: 3.0.3 +info: + description: | + ___ + This is the REST API for controlling the BrowserUp MitmProxy. + The BrowserUp MitmProxy is a swiss army knife for automated testing that + captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. + ___ + title: BrowserUp MitmProxy + version: "1.25" + x-logo: + url: logo.png +servers: +- description: The development API server + url: "http://localhost:{port}/" + variables: + port: + default: "48088" + enum: + - "48088" +tags: +- description: BrowserUp MitmProxy REST API + name: The BrowserUp MitmProxy API +paths: + /har: + get: + description: Get the current HAR. + operationId: getHarLog + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Har' + description: The current Har file. + tags: + - BrowserUpProxy + put: + description: Starts a fresh HAR capture session. + operationId: resetHarLog + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Har' + description: The current Har file. + tags: + - BrowserUpProxy + /har/page: + post: + description: Starts a fresh HAR Page (Step) in the current active HAR to group + requests. + operationId: newPage + parameters: + - description: The unique title for this har page/step. + explode: false + in: path + name: title + required: true + schema: + pattern: "/[a-zA-Z-_]{4,25}/" + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Har' + description: The current Har file. + tags: + - BrowserUpProxy + /verify/present/{name}: + post: + description: Verify at least one matching item is present in the captured traffic + operationId: verifyPresent + parameters: + - description: The unique name for this verification operation + explode: false + in: path + name: name + required: true + schema: + pattern: "/[a-zA-Z-_]{4,25}/" + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MatchCriteria' + description: Match criteria to select requests - response pairs for size tests + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyResult' + description: The traffic conformed to the time criteria. + "422": + description: The MatchCriteria are invalid. + tags: + - BrowserUpProxy + /verify/not_present/{name}: + post: + description: Verify no matching items are present in the captured traffic + operationId: verifyNotPresent + parameters: + - description: The unique name for this verification operation + explode: false + in: path + name: name + required: true + schema: + pattern: "/[a-zA-Z-_]{4,25}/" + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MatchCriteria' + description: Match criteria to select requests - response pairs for size tests + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyResult' + description: The traffic had no matching items + "422": + description: The MatchCriteria are invalid. + tags: + - BrowserUpProxy + /verify/size/{size}/{name}: + post: + description: Verify matching items in the captured traffic meet the size criteria + operationId: verifySize + parameters: + - description: "The size used for comparison, in kilobytes" + explode: false + in: path + name: size + required: true + schema: + minimum: 0 + type: integer + style: simple + - description: The unique name for this verification operation + explode: false + in: path + name: name + required: true + schema: + pattern: "/[a-zA-Z-_]{4,25}/" + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MatchCriteria' + description: Match criteria to select requests - response pairs for size tests + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyResult' + description: The traffic conformed to the size criteria. + "422": + description: The MatchCriteria are invalid. + tags: + - BrowserUpProxy + /verify/sla/{time}/{name}: + post: + description: Verify each traffic item matching the criteria meets is below SLA + time + operationId: verifySLA + parameters: + - description: The time used for comparison + explode: false + in: path + name: time + required: true + schema: + minimum: 0 + type: integer + style: simple + - description: The unique name for this verification operation + explode: false + in: path + name: name + required: true + schema: + pattern: "/[a-zA-Z-_]{4,25}/" + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MatchCriteria' + description: Match criteria to select requests - response pairs for size tests + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyResult' + description: The traffic conformed to the time criteria. + "422": + description: The MatchCriteria are invalid. + tags: + - BrowserUpProxy + /har/errors: + post: + description: Add Custom Error to the captured traffic har + operationId: addError + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Receives an error to track. Internally, the error is stored\ + \ in an array in the har under the _errors key" + required: true + responses: + "204": + description: The Error was added. + "422": + description: The Error was invalid. + tags: + - BrowserUpProxy + /har/metrics: + post: + description: Add Custom Metric to the captured traffic har + operationId: addMetric + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Metric' + description: "Receives a new metric to add. The metric is stored, under the\ + \ hood, in an array in the har under the _metrics key" + required: true + responses: + "204": + description: The metric was added. + "422": + description: The metric was invalid. + tags: + - BrowserUpProxy + /healthcheck: + get: + description: Get the healthcheck + operationId: healthcheck + responses: + "200": + description: OK means all is well. + tags: + - BrowserUpProxy +components: + schemas: + PageTiming: + properties: + onContentLoad: + description: onContentLoad per the browser + type: integer + onLoad: + description: onLoad per the browser + type: integer + _firstInputDelay: + description: firstInputDelay from the browser + type: integer + _firstPaint: + description: firstPaint from the browser + type: integer + _cumulativeLayoutShift: + description: cumulativeLayoutShift metric from the browser + type: integer + _largestContentfulPaint: + description: largestContentfulPaint from the browser + type: integer + _domInteractive: + description: domInteractive from the browser + type: integer + _firstContentfulPaint: + description: firstContentfulPaint from the browser + type: integer + _dns: + description: dns lookup time from the browser + type: integer + _ssl: + description: Ssl connect time from the browser + type: integer + _timeToFirstByte: + description: Time to first byte of the page's first request per the browser + type: integer + _href: + description: "Top level href, including hashtag, etc per the browser" + type: string + _span_id: + description: W3C Trace Context span ID for this page + type: string + _parent_id: + description: W3C Trace Context parent span ID (typically the HAR log span + ID) + type: string + type: object + NameValuePair: + properties: + name: + description: Name to match + type: string + value: + description: Value to match + type: string + type: object + MatchCriteria: + description: |- + A set of criteria for filtering HTTP Requests and Responses. + Criteria are AND based, and use python regular expressions for string comparison + example: + request_cookie: "" + response_cookie: "" + json_path: json_path + error_if_no_traffic: true + url: url + content: content + response_header: "" + content_type: content_type + request_header: "" + json_schema: json_schema + json_valid: true + page: page + websocket_message: websocket_message + status: status + properties: + url: + description: Request URL regexp to match + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + type: string + page: + description: current|all + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + type: string + status: + description: HTTP Status code to match. + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + type: string + content: + description: Body content regexp content to match + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + type: string + content_type: + description: Content type + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + type: string + websocket_message: + description: Websocket message text to match + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + type: string + request_header: + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + request_cookie: + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + response_header: + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + response_cookie: + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html + json_valid: + description: Is valid JSON + type: boolean + json_path: + description: Has JSON path + type: string + json_schema: + description: Validates against passed JSON schema + type: string + error_if_no_traffic: + default: true + description: "If the proxy has NO traffic at all, return error" + type: boolean + type: object + VerifyResult: + example: + result: true + name: name + type: type + properties: + result: + description: Result True / False + type: boolean + name: + description: Name + type: string + type: + description: Type + type: string + type: object + Error: + example: + name: name + details: details + properties: + name: + description: Name of the Error to add. Stored in har under _errors + type: string + details: + description: Short details of the error + type: string + type: object + Metric: + example: + name: name + value: 0 + properties: + name: + description: Name of Custom Metric to add to the page under _metrics + type: string + value: + description: Value for the metric + format: double + type: integer + type: object + LargestContentfulPaint: + additionalProperties: true + example: + size: 0 + domPath: "" + startTime: 0 + tag: "" + properties: + startTime: + default: -1 + format: int64 + minimum: -1 + type: integer + size: + default: -1 + format: int64 + minimum: -1 + type: integer + domPath: + default: "" + type: string + tag: + default: "" + type: string + type: object + WebSocketMessage: + example: + data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + properties: + type: + type: string + opcode: + type: number + data: + type: string + time: + type: number + required: + - data + - opcode + - time + - type + type: object + Header: + example: + name: name + comment: comment + value: value + properties: + name: + type: string + value: + type: string + comment: + type: string + required: + - name + - value + type: object + Action: + additionalProperties: false + properties: + name: + type: string + id: + type: string + className: + type: string + tagName: + type: string + xpath: + type: string + dataAttributes: + type: string + formName: + type: string + content: + type: string + type: object + PageTimings: + additionalProperties: true + example: + _href: "" + _ssl: 0 + _firstPaint: 0 + _cumulativeLayoutShift: -0.29385987 + _dns: 0 + _largestContentfulPaint: + size: 0 + domPath: "" + startTime: 0 + tag: "" + _firstInputDelay: -0.5854392 + _domInteractive: 0 + _timeToFirstByte: 0 + _firstContentfulPaint: 0 + onContentLoad: 0 + onLoad: 0 + comment: comment + properties: + onContentLoad: + default: -1 + format: int64 + minimum: -1 + type: integer + onLoad: + default: -1 + format: int64 + minimum: -1 + type: integer + _href: + default: "" + type: string + _dns: + default: -1 + format: int64 + minimum: -1 + type: integer + _ssl: + default: -1 + format: int64 + minimum: -1 + type: integer + _timeToFirstByte: + default: -1 + format: int64 + minimum: -1 + type: integer + _cumulativeLayoutShift: + default: -1 + format: float + minimum: -1 + type: number + _largestContentfulPaint: + $ref: '#/components/schemas/LargestContentfulPaint' + _firstPaint: + default: -1 + format: int64 + minimum: -1 + type: integer + _firstInputDelay: + default: -1 + format: float + minimum: -1 + type: number + _domInteractive: + default: -1 + format: int64 + minimum: -1 + type: integer + _firstContentfulPaint: + default: -1 + format: int64 + minimum: -1 + type: integer + comment: + type: string + required: + - onContentLoad + - onLoad + type: object + Har: + additionalProperties: true + example: + log: + creator: + name: name + comment: comment + version: version + entries: + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + request: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + method: method + headersSize: 1 + bodySize: 6 + comment: comment + queryString: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + postData: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + url: url + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + cache: + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + comment: comment + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + _webSocketMessages: + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id + response: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + redirectURL: redirectURL + statusText: statusText + headersSize: 6 + bodySize: 1 + comment: comment + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + content: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + status: 7 + _parent_id: _parent_id + timings: + receive: 0 + wait: 0 + blocked: 0 + dns: 0 + comment: comment + send: 0 + ssl: 0 + connect: 0 + connection: connection + comment: comment + time: 0 + pageref: pageref + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + request: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + method: method + headersSize: 1 + bodySize: 6 + comment: comment + queryString: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + postData: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + url: url + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + cache: + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + comment: comment + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + _webSocketMessages: + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id + response: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + redirectURL: redirectURL + statusText: statusText + headersSize: 6 + bodySize: 1 + comment: comment + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + content: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + status: 7 + _parent_id: _parent_id + timings: + receive: 0 + wait: 0 + blocked: 0 + dns: 0 + comment: comment + send: 0 + ssl: 0 + connect: 0 + connection: connection + comment: comment + time: 0 + pageref: pageref + pages: + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + pageTimings: + _href: "" + _ssl: 0 + _firstPaint: 0 + _cumulativeLayoutShift: -0.29385987 + _dns: 0 + _largestContentfulPaint: + size: 0 + domPath: "" + startTime: 0 + tag: "" + _firstInputDelay: -0.5854392 + _domInteractive: 0 + _timeToFirstByte: 0 + _firstContentfulPaint: 0 + onContentLoad: 0 + onLoad: 0 + comment: comment + _span_id: _span_id + _parent_id: _parent_id + comment: comment + id: id + _verifications: + - result: true + name: name + type: type + - result: true + name: name + type: type + title: title + _metrics: + - name: name + value: 0 + - name: name + value: 0 + _errors: + - name: name + details: details + - name: name + details: details + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + pageTimings: + _href: "" + _ssl: 0 + _firstPaint: 0 + _cumulativeLayoutShift: -0.29385987 + _dns: 0 + _largestContentfulPaint: + size: 0 + domPath: "" + startTime: 0 + tag: "" + _firstInputDelay: -0.5854392 + _domInteractive: 0 + _timeToFirstByte: 0 + _firstContentfulPaint: 0 + onContentLoad: 0 + onLoad: 0 + comment: comment + _span_id: _span_id + _parent_id: _parent_id + comment: comment + id: id + _verifications: + - result: true + name: name + type: type + - result: true + name: name + type: type + title: title + _metrics: + - name: name + value: 0 + - name: name + value: 0 + _errors: + - name: name + details: details + - name: name + details: details + _span_id: _span_id + browser: + name: name + comment: comment + version: version + _trace_id: _trace_id + comment: comment + version: version + properties: + log: + $ref: '#/components/schemas/Har_log' + required: + - log + type: object + HarEntry: + example: + startedDateTime: 2000-01-23T04:56:07.000+00:00 + request: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + method: method + headersSize: 1 + bodySize: 6 + comment: comment + queryString: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + postData: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + url: url + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + cache: + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + comment: comment + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + _webSocketMessages: + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id + response: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + redirectURL: redirectURL + statusText: statusText + headersSize: 6 + bodySize: 1 + comment: comment + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + content: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + status: 7 + _parent_id: _parent_id + timings: + receive: 0 + wait: 0 + blocked: 0 + dns: 0 + comment: comment + send: 0 + ssl: 0 + connect: 0 + connection: connection + comment: comment + time: 0 + pageref: pageref + properties: + pageref: + type: string + startedDateTime: + format: date-time + type: string + time: + format: int64 + minimum: 0 + type: integer + request: + $ref: '#/components/schemas/HarEntry_request' + response: + $ref: '#/components/schemas/HarEntry_response' + cache: + $ref: '#/components/schemas/HarEntry_cache' + timings: + $ref: '#/components/schemas/HarEntry_timings' + serverIPAddress: + type: string + _webSocketMessages: + items: + $ref: '#/components/schemas/WebSocketMessage' + type: array + _span_id: + description: W3C Trace Context span ID for this entry + type: string + _parent_id: + description: W3C Trace Context parent span ID (typically the page span ID) + type: string + _trace_id: + description: W3C Trace Context trace ID for distributed tracing + type: string + connection: + type: string + comment: + type: string + required: + - cache + - request + - response + - startedDateTime + - time + - timings + type: object + CustomHarData: + minProperties: 1 + type: object + Page: + additionalProperties: true + example: + startedDateTime: 2000-01-23T04:56:07.000+00:00 + pageTimings: + _href: "" + _ssl: 0 + _firstPaint: 0 + _cumulativeLayoutShift: -0.29385987 + _dns: 0 + _largestContentfulPaint: + size: 0 + domPath: "" + startTime: 0 + tag: "" + _firstInputDelay: -0.5854392 + _domInteractive: 0 + _timeToFirstByte: 0 + _firstContentfulPaint: 0 + onContentLoad: 0 + onLoad: 0 + comment: comment + _span_id: _span_id + _parent_id: _parent_id + comment: comment + id: id + _verifications: + - result: true + name: name + type: type + - result: true + name: name + type: type + title: title + _metrics: + - name: name + value: 0 + - name: name + value: 0 + _errors: + - name: name + details: details + - name: name + details: details + properties: + startedDateTime: + format: date-time + type: string + id: + type: string + title: + type: string + _verifications: + default: [] + items: + $ref: '#/components/schemas/VerifyResult' + type: array + _metrics: + default: [] + items: + $ref: '#/components/schemas/Metric' + type: array + _errors: + default: [] + items: + $ref: '#/components/schemas/Error' + type: array + _span_id: + description: W3C Trace Context span ID for this page + type: string + _parent_id: + description: W3C Trace Context parent span ID (typically the HAR log span + ID) + type: string + pageTimings: + $ref: '#/components/schemas/PageTimings' + comment: + type: string + required: + - id + - pageTimings + - startedDateTime + - title + type: object + Har_log_creator: + example: + name: name + comment: comment + version: version + properties: + name: + type: string + version: + type: string + comment: + type: string + required: + - name + - version + type: object + Har_log: + example: + creator: + name: name + comment: comment + version: version + entries: + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + request: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + method: method + headersSize: 1 + bodySize: 6 + comment: comment + queryString: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + postData: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + url: url + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + cache: + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + comment: comment + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + _webSocketMessages: + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id + response: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + redirectURL: redirectURL + statusText: statusText + headersSize: 6 + bodySize: 1 + comment: comment + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + content: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + status: 7 + _parent_id: _parent_id + timings: + receive: 0 + wait: 0 + blocked: 0 + dns: 0 + comment: comment + send: 0 + ssl: 0 + connect: 0 + connection: connection + comment: comment + time: 0 + pageref: pageref + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + request: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + method: method + headersSize: 1 + bodySize: 6 + comment: comment + queryString: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + postData: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + url: url + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + cache: + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + comment: comment + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + _webSocketMessages: + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + - data: data + time: 7.058770351582356 + type: type + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id + response: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + redirectURL: redirectURL + statusText: statusText + headersSize: 6 + bodySize: 1 + comment: comment + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + content: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + status: 7 + _parent_id: _parent_id + timings: + receive: 0 + wait: 0 + blocked: 0 + dns: 0 + comment: comment + send: 0 + ssl: 0 + connect: 0 + connection: connection + comment: comment + time: 0 + pageref: pageref + pages: + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + pageTimings: + _href: "" + _ssl: 0 + _firstPaint: 0 + _cumulativeLayoutShift: -0.29385987 + _dns: 0 + _largestContentfulPaint: + size: 0 + domPath: "" + startTime: 0 + tag: "" + _firstInputDelay: -0.5854392 + _domInteractive: 0 + _timeToFirstByte: 0 + _firstContentfulPaint: 0 + onContentLoad: 0 + onLoad: 0 + comment: comment + _span_id: _span_id + _parent_id: _parent_id + comment: comment + id: id + _verifications: + - result: true + name: name + type: type + - result: true + name: name + type: type + title: title + _metrics: + - name: name + value: 0 + - name: name + value: 0 + _errors: + - name: name + details: details + - name: name + details: details + - startedDateTime: 2000-01-23T04:56:07.000+00:00 + pageTimings: + _href: "" + _ssl: 0 + _firstPaint: 0 + _cumulativeLayoutShift: -0.29385987 + _dns: 0 + _largestContentfulPaint: + size: 0 + domPath: "" + startTime: 0 + tag: "" + _firstInputDelay: -0.5854392 + _domInteractive: 0 + _timeToFirstByte: 0 + _firstContentfulPaint: 0 + onContentLoad: 0 + onLoad: 0 + comment: comment + _span_id: _span_id + _parent_id: _parent_id + comment: comment + id: id + _verifications: + - result: true + name: name + type: type + - result: true + name: name + type: type + title: title + _metrics: + - name: name + value: 0 + - name: name + value: 0 + _errors: + - name: name + details: details + - name: name + details: details + _span_id: _span_id + browser: + name: name + comment: comment + version: version + _trace_id: _trace_id + comment: comment + version: version + externalDocs: + description: HAR (HTTP Archive) Log Format + url: http://www.softwareishard.com/blog/har-12-spec/ + properties: + version: + type: string + creator: + $ref: '#/components/schemas/Har_log_creator' + browser: + $ref: '#/components/schemas/Har_log_creator' + pages: + items: + $ref: '#/components/schemas/Page' + type: array + entries: + items: + $ref: '#/components/schemas/HarEntry' + type: array + _trace_id: + description: W3C Trace Context trace ID for distributed tracing + type: string + _span_id: + description: W3C Trace Context span ID for this HAR trace root + type: string + comment: + type: string + required: + - creator + - entries + - pages + - version + type: object + HarEntry_request_cookies_inner: + example: + path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + properties: + name: + type: string + value: + type: string + path: + type: string + domain: + type: string + expires: + type: string + httpOnly: + type: boolean + secure: + type: boolean + comment: + type: string + required: + - name + - value + type: object + HarEntry_request_queryString_inner: + example: + name: name + comment: comment + value: value + properties: + name: + type: string + value: + type: string + comment: + type: string + required: + - name + - value + type: object + HarEntry_request_postData_params_inner: + example: + fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + properties: + name: + type: string + value: + type: string + fileName: + type: string + contentType: + type: string + comment: + type: string + type: object + HarEntry_request_postData: + description: Posted data info. + example: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + properties: + mimeType: + type: string + text: + type: string + params: + items: + $ref: '#/components/schemas/HarEntry_request_postData_params_inner' + type: array + required: + - mimeType + HarEntry_request: + additionalProperties: true + example: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + method: method + headersSize: 1 + bodySize: 6 + comment: comment + queryString: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + postData: + mimeType: mimeType + text: text + params: + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + - fileName: fileName + name: name + comment: comment + value: value + contentType: contentType + url: url + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + properties: + method: + type: string + url: + type: string + httpVersion: + type: string + cookies: + items: + $ref: '#/components/schemas/HarEntry_request_cookies_inner' + type: array + headers: + items: + $ref: '#/components/schemas/Header' + type: array + queryString: + items: + $ref: '#/components/schemas/HarEntry_request_queryString_inner' + type: array + postData: + $ref: '#/components/schemas/HarEntry_request_postData' + headersSize: + type: integer + bodySize: + type: integer + comment: + type: string + required: + - bodySize + - cookies + - headers + - headersSize + - httpVersion + - method + - queryString + - url + type: object + HarEntry_response_content: + example: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + properties: + size: + type: integer + compression: + type: integer + mimeType: + type: string + text: + type: string + encoding: + type: string + _videoBufferedPercent: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoStallCount: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoDecodedByteCount: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoWaitingCount: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoErrorCount: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoDroppedFrames: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoTotalFrames: + default: -1 + format: int64 + minimum: -1 + type: integer + _videoAudioBytesDecoded: + default: -1 + format: int64 + minimum: -1 + type: integer + comment: + type: string + required: + - mimeType + - size + type: object + HarEntry_response: + additionalProperties: true + example: + headers: + - name: name + comment: comment + value: value + - name: name + comment: comment + value: value + httpVersion: httpVersion + redirectURL: redirectURL + statusText: statusText + headersSize: 6 + bodySize: 1 + comment: comment + cookies: + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + - path: path + expires: expires + domain: domain + name: name + comment: comment + httpOnly: true + secure: true + value: value + content: + _videoBufferedPercent: 0 + _videoDroppedFrames: 0 + mimeType: mimeType + encoding: encoding + _videoDecodedByteCount: 0 + _videoTotalFrames: 0 + size: 1 + _videoStallCount: 0 + _videoErrorCount: 0 + comment: comment + text: text + _videoAudioBytesDecoded: 0 + compression: 4 + _videoWaitingCount: 0 + status: 7 + properties: + status: + type: integer + statusText: + type: string + httpVersion: + type: string + cookies: + items: + $ref: '#/components/schemas/HarEntry_request_cookies_inner' + type: array + headers: + items: + $ref: '#/components/schemas/Header' + type: array + content: + $ref: '#/components/schemas/HarEntry_response_content' + redirectURL: + type: string + headersSize: + type: integer + bodySize: + type: integer + comment: + type: string + required: + - bodySize + - content + - cookies + - headers + - headersSize + - httpVersion + - redirectURL + - status + - statusText + type: object + HarEntry_cache_beforeRequest: + example: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + nullable: true + properties: + expires: + type: string + lastAccess: + type: string + eTag: + type: string + hitCount: + type: integer + comment: + type: string + required: + - eTag + - hitCount + - lastAccess + type: object + HarEntry_cache: + example: + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + comment: comment + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + properties: + beforeRequest: + $ref: '#/components/schemas/HarEntry_cache_beforeRequest' + afterRequest: + $ref: '#/components/schemas/HarEntry_cache_beforeRequest' + comment: + type: string + HarEntry_timings: + example: + receive: 0 + wait: 0 + blocked: 0 + dns: 0 + comment: comment + send: 0 + ssl: 0 + connect: 0 + properties: + dns: + default: -1 + format: int64 + minimum: -1 + type: integer + connect: + default: -1 + format: int64 + minimum: -1 + type: integer + blocked: + default: -1 + format: int64 + minimum: -1 + type: integer + send: + default: -1 + format: int64 + minimum: -1 + type: integer + wait: + default: -1 + format: int64 + minimum: -1 + type: integer + receive: + default: -1 + format: int64 + minimum: -1 + type: integer + ssl: + default: -1 + format: int64 + minimum: -1 + type: integer + comment: + type: string + required: + - blocked + - connect + - dns + - receive + - send + - ssl + - wait + type: object diff --git a/clients/go/api_browser_up_proxy.go b/clients/go/api_browser_up_proxy.go new file mode 100644 index 0000000000..03c9d907a4 --- /dev/null +++ b/clients/go/api_browser_up_proxy.go @@ -0,0 +1,1087 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// BrowserUpProxyAPIService BrowserUpProxyAPI service +type BrowserUpProxyAPIService service + +type ApiAddErrorRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + error_ *Error +} + +// Receives an error to track. Internally, the error is stored in an array in the har under the _errors key +func (r ApiAddErrorRequest) Error_(error_ Error) ApiAddErrorRequest { + r.error_ = &error_ + return r +} + +func (r ApiAddErrorRequest) Execute() (*http.Response, error) { + return r.ApiService.AddErrorExecute(r) +} + +/* +AddError Method for AddError + +Add Custom Error to the captured traffic har + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddErrorRequest +*/ +func (a *BrowserUpProxyAPIService) AddError(ctx context.Context) ApiAddErrorRequest { + return ApiAddErrorRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *BrowserUpProxyAPIService) AddErrorExecute(r ApiAddErrorRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.AddError") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/har/errors" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.error_ == nil { + return nil, reportError("error_ is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.error_ + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAddMetricRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + metric *Metric +} + +// Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key +func (r ApiAddMetricRequest) Metric(metric Metric) ApiAddMetricRequest { + r.metric = &metric + return r +} + +func (r ApiAddMetricRequest) Execute() (*http.Response, error) { + return r.ApiService.AddMetricExecute(r) +} + +/* +AddMetric Method for AddMetric + +Add Custom Metric to the captured traffic har + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddMetricRequest +*/ +func (a *BrowserUpProxyAPIService) AddMetric(ctx context.Context) ApiAddMetricRequest { + return ApiAddMetricRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *BrowserUpProxyAPIService) AddMetricExecute(r ApiAddMetricRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.AddMetric") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/har/metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.metric == nil { + return nil, reportError("metric is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.metric + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetHarLogRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService +} + +func (r ApiGetHarLogRequest) Execute() (*Har, *http.Response, error) { + return r.ApiService.GetHarLogExecute(r) +} + +/* +GetHarLog Method for GetHarLog + +Get the current HAR. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetHarLogRequest +*/ +func (a *BrowserUpProxyAPIService) GetHarLog(ctx context.Context) ApiGetHarLogRequest { + return ApiGetHarLogRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Har +func (a *BrowserUpProxyAPIService) GetHarLogExecute(r ApiGetHarLogRequest) (*Har, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Har + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.GetHarLog") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/har" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHealthcheckRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService +} + +func (r ApiHealthcheckRequest) Execute() (*http.Response, error) { + return r.ApiService.HealthcheckExecute(r) +} + +/* +Healthcheck Method for Healthcheck + +Get the healthcheck + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHealthcheckRequest +*/ +func (a *BrowserUpProxyAPIService) Healthcheck(ctx context.Context) ApiHealthcheckRequest { + return ApiHealthcheckRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *BrowserUpProxyAPIService) HealthcheckExecute(r ApiHealthcheckRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.Healthcheck") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/healthcheck" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiNewPageRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + title string +} + +func (r ApiNewPageRequest) Execute() (*Har, *http.Response, error) { + return r.ApiService.NewPageExecute(r) +} + +/* +NewPage Method for NewPage + +Starts a fresh HAR Page (Step) in the current active HAR to group requests. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param title The unique title for this har page/step. + @return ApiNewPageRequest +*/ +func (a *BrowserUpProxyAPIService) NewPage(ctx context.Context, title string) ApiNewPageRequest { + return ApiNewPageRequest{ + ApiService: a, + ctx: ctx, + title: title, + } +} + +// Execute executes the request +// @return Har +func (a *BrowserUpProxyAPIService) NewPageExecute(r ApiNewPageRequest) (*Har, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Har + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.NewPage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/har/page" + localVarPath = strings.Replace(localVarPath, "{"+"title"+"}", url.PathEscape(parameterValueToString(r.title, "title")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiResetHarLogRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService +} + +func (r ApiResetHarLogRequest) Execute() (*Har, *http.Response, error) { + return r.ApiService.ResetHarLogExecute(r) +} + +/* +ResetHarLog Method for ResetHarLog + +Starts a fresh HAR capture session. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiResetHarLogRequest +*/ +func (a *BrowserUpProxyAPIService) ResetHarLog(ctx context.Context) ApiResetHarLogRequest { + return ApiResetHarLogRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Har +func (a *BrowserUpProxyAPIService) ResetHarLogExecute(r ApiResetHarLogRequest) (*Har, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Har + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.ResetHarLog") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/har" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVerifyNotPresentRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + name string + matchCriteria *MatchCriteria +} + +// Match criteria to select requests - response pairs for size tests +func (r ApiVerifyNotPresentRequest) MatchCriteria(matchCriteria MatchCriteria) ApiVerifyNotPresentRequest { + r.matchCriteria = &matchCriteria + return r +} + +func (r ApiVerifyNotPresentRequest) Execute() (*VerifyResult, *http.Response, error) { + return r.ApiService.VerifyNotPresentExecute(r) +} + +/* +VerifyNotPresent Method for VerifyNotPresent + +Verify no matching items are present in the captured traffic + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param name The unique name for this verification operation + @return ApiVerifyNotPresentRequest +*/ +func (a *BrowserUpProxyAPIService) VerifyNotPresent(ctx context.Context, name string) ApiVerifyNotPresentRequest { + return ApiVerifyNotPresentRequest{ + ApiService: a, + ctx: ctx, + name: name, + } +} + +// Execute executes the request +// @return VerifyResult +func (a *BrowserUpProxyAPIService) VerifyNotPresentExecute(r ApiVerifyNotPresentRequest) (*VerifyResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VerifyResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.VerifyNotPresent") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/verify/not_present/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.matchCriteria == nil { + return localVarReturnValue, nil, reportError("matchCriteria is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.matchCriteria + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVerifyPresentRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + name string + matchCriteria *MatchCriteria +} + +// Match criteria to select requests - response pairs for size tests +func (r ApiVerifyPresentRequest) MatchCriteria(matchCriteria MatchCriteria) ApiVerifyPresentRequest { + r.matchCriteria = &matchCriteria + return r +} + +func (r ApiVerifyPresentRequest) Execute() (*VerifyResult, *http.Response, error) { + return r.ApiService.VerifyPresentExecute(r) +} + +/* +VerifyPresent Method for VerifyPresent + +Verify at least one matching item is present in the captured traffic + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param name The unique name for this verification operation + @return ApiVerifyPresentRequest +*/ +func (a *BrowserUpProxyAPIService) VerifyPresent(ctx context.Context, name string) ApiVerifyPresentRequest { + return ApiVerifyPresentRequest{ + ApiService: a, + ctx: ctx, + name: name, + } +} + +// Execute executes the request +// @return VerifyResult +func (a *BrowserUpProxyAPIService) VerifyPresentExecute(r ApiVerifyPresentRequest) (*VerifyResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VerifyResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.VerifyPresent") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/verify/present/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.matchCriteria == nil { + return localVarReturnValue, nil, reportError("matchCriteria is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.matchCriteria + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVerifySLARequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + time int32 + name string + matchCriteria *MatchCriteria +} + +// Match criteria to select requests - response pairs for size tests +func (r ApiVerifySLARequest) MatchCriteria(matchCriteria MatchCriteria) ApiVerifySLARequest { + r.matchCriteria = &matchCriteria + return r +} + +func (r ApiVerifySLARequest) Execute() (*VerifyResult, *http.Response, error) { + return r.ApiService.VerifySLAExecute(r) +} + +/* +VerifySLA Method for VerifySLA + +Verify each traffic item matching the criteria meets is below SLA time + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param time The time used for comparison + @param name The unique name for this verification operation + @return ApiVerifySLARequest +*/ +func (a *BrowserUpProxyAPIService) VerifySLA(ctx context.Context, time int32, name string) ApiVerifySLARequest { + return ApiVerifySLARequest{ + ApiService: a, + ctx: ctx, + time: time, + name: name, + } +} + +// Execute executes the request +// @return VerifyResult +func (a *BrowserUpProxyAPIService) VerifySLAExecute(r ApiVerifySLARequest) (*VerifyResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VerifyResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.VerifySLA") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/verify/sla/{time}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"time"+"}", url.PathEscape(parameterValueToString(r.time, "time")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.time < 0 { + return localVarReturnValue, nil, reportError("time must be greater than 0") + } + if r.matchCriteria == nil { + return localVarReturnValue, nil, reportError("matchCriteria is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.matchCriteria + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVerifySizeRequest struct { + ctx context.Context + ApiService *BrowserUpProxyAPIService + size int32 + name string + matchCriteria *MatchCriteria +} + +// Match criteria to select requests - response pairs for size tests +func (r ApiVerifySizeRequest) MatchCriteria(matchCriteria MatchCriteria) ApiVerifySizeRequest { + r.matchCriteria = &matchCriteria + return r +} + +func (r ApiVerifySizeRequest) Execute() (*VerifyResult, *http.Response, error) { + return r.ApiService.VerifySizeExecute(r) +} + +/* +VerifySize Method for VerifySize + +Verify matching items in the captured traffic meet the size criteria + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param size The size used for comparison, in kilobytes + @param name The unique name for this verification operation + @return ApiVerifySizeRequest +*/ +func (a *BrowserUpProxyAPIService) VerifySize(ctx context.Context, size int32, name string) ApiVerifySizeRequest { + return ApiVerifySizeRequest{ + ApiService: a, + ctx: ctx, + size: size, + name: name, + } +} + +// Execute executes the request +// @return VerifyResult +func (a *BrowserUpProxyAPIService) VerifySizeExecute(r ApiVerifySizeRequest) (*VerifyResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VerifyResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BrowserUpProxyAPIService.VerifySize") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/verify/size/{size}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"size"+"}", url.PathEscape(parameterValueToString(r.size, "size")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.size < 0 { + return localVarReturnValue, nil, reportError("size must be greater than 0") + } + if r.matchCriteria == nil { + return localVarReturnValue, nil, reportError("matchCriteria is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.matchCriteria + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/clients/go/client.go b/clients/go/client.go new file mode 100644 index 0000000000..0b65283943 --- /dev/null +++ b/clients/go/client.go @@ -0,0 +1,656 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the BrowserUp MitmProxy API v1.25 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + BrowserUpProxyAPI *BrowserUpProxyAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.BrowserUpProxyAPI = (*BrowserUpProxyAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/clients/go/configuration.go b/clients/go/configuration.go new file mode 100644 index 0000000000..7ab118b5d4 --- /dev/null +++ b/clients/go/configuration.go @@ -0,0 +1,224 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "http://localhost:{port}", + Description: "The development API server", + Variables: map[string]ServerVariable{ + "port": ServerVariable{ + Description: "No description provided", + DefaultValue: "48088", + EnumValues: []string{ + "48088", + }, + }, + }, + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/clients/go/docs/Action.md b/clients/go/docs/Action.md new file mode 100644 index 0000000000..84c3a8a408 --- /dev/null +++ b/clients/go/docs/Action.md @@ -0,0 +1,238 @@ +# Action + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**ClassName** | Pointer to **string** | | [optional] +**TagName** | Pointer to **string** | | [optional] +**Xpath** | Pointer to **string** | | [optional] +**DataAttributes** | Pointer to **string** | | [optional] +**FormName** | Pointer to **string** | | [optional] +**Content** | Pointer to **string** | | [optional] + +## Methods + +### NewAction + +`func NewAction() *Action` + +NewAction instantiates a new Action object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionWithDefaults + +`func NewActionWithDefaults() *Action` + +NewActionWithDefaults instantiates a new Action object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Action) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Action) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Action) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Action) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetId + +`func (o *Action) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Action) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Action) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Action) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetClassName + +`func (o *Action) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Action) GetClassNameOk() (*string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClassName + +`func (o *Action) SetClassName(v string)` + +SetClassName sets ClassName field to given value. + +### HasClassName + +`func (o *Action) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### GetTagName + +`func (o *Action) GetTagName() string` + +GetTagName returns the TagName field if non-nil, zero value otherwise. + +### GetTagNameOk + +`func (o *Action) GetTagNameOk() (*string, bool)` + +GetTagNameOk returns a tuple with the TagName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTagName + +`func (o *Action) SetTagName(v string)` + +SetTagName sets TagName field to given value. + +### HasTagName + +`func (o *Action) HasTagName() bool` + +HasTagName returns a boolean if a field has been set. + +### GetXpath + +`func (o *Action) GetXpath() string` + +GetXpath returns the Xpath field if non-nil, zero value otherwise. + +### GetXpathOk + +`func (o *Action) GetXpathOk() (*string, bool)` + +GetXpathOk returns a tuple with the Xpath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetXpath + +`func (o *Action) SetXpath(v string)` + +SetXpath sets Xpath field to given value. + +### HasXpath + +`func (o *Action) HasXpath() bool` + +HasXpath returns a boolean if a field has been set. + +### GetDataAttributes + +`func (o *Action) GetDataAttributes() string` + +GetDataAttributes returns the DataAttributes field if non-nil, zero value otherwise. + +### GetDataAttributesOk + +`func (o *Action) GetDataAttributesOk() (*string, bool)` + +GetDataAttributesOk returns a tuple with the DataAttributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataAttributes + +`func (o *Action) SetDataAttributes(v string)` + +SetDataAttributes sets DataAttributes field to given value. + +### HasDataAttributes + +`func (o *Action) HasDataAttributes() bool` + +HasDataAttributes returns a boolean if a field has been set. + +### GetFormName + +`func (o *Action) GetFormName() string` + +GetFormName returns the FormName field if non-nil, zero value otherwise. + +### GetFormNameOk + +`func (o *Action) GetFormNameOk() (*string, bool)` + +GetFormNameOk returns a tuple with the FormName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormName + +`func (o *Action) SetFormName(v string)` + +SetFormName sets FormName field to given value. + +### HasFormName + +`func (o *Action) HasFormName() bool` + +HasFormName returns a boolean if a field has been set. + +### GetContent + +`func (o *Action) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *Action) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *Action) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *Action) HasContent() bool` + +HasContent returns a boolean if a field has been set. + + +[[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/clients/go/docs/BrowserUpProxyAPI.md b/clients/go/docs/BrowserUpProxyAPI.md new file mode 100644 index 0000000000..332d7ec1e2 --- /dev/null +++ b/clients/go/docs/BrowserUpProxyAPI.md @@ -0,0 +1,691 @@ +# \BrowserUpProxyAPI + +All URIs are relative to *http://localhost:48088* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddError**](BrowserUpProxyAPI.md#AddError) | **Post** /har/errors | +[**AddMetric**](BrowserUpProxyAPI.md#AddMetric) | **Post** /har/metrics | +[**GetHarLog**](BrowserUpProxyAPI.md#GetHarLog) | **Get** /har | +[**Healthcheck**](BrowserUpProxyAPI.md#Healthcheck) | **Get** /healthcheck | +[**NewPage**](BrowserUpProxyAPI.md#NewPage) | **Post** /har/page | +[**ResetHarLog**](BrowserUpProxyAPI.md#ResetHarLog) | **Put** /har | +[**VerifyNotPresent**](BrowserUpProxyAPI.md#VerifyNotPresent) | **Post** /verify/not_present/{name} | +[**VerifyPresent**](BrowserUpProxyAPI.md#VerifyPresent) | **Post** /verify/present/{name} | +[**VerifySLA**](BrowserUpProxyAPI.md#VerifySLA) | **Post** /verify/sla/{time}/{name} | +[**VerifySize**](BrowserUpProxyAPI.md#VerifySize) | **Post** /verify/size/{size}/{name} | + + + +## AddError + +> AddError(ctx).Error_(error_).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + error_ := *openapiclient.NewError() // Error | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BrowserUpProxyAPI.AddError(context.Background()).Error_(error_).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.AddError``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddErrorRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **error_** | [**Error**](Error.md) | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + +## AddMetric + +> AddMetric(ctx).Metric(metric).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + metric := *openapiclient.NewMetric() // Metric | Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BrowserUpProxyAPI.AddMetric(context.Background()).Metric(metric).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.AddMetric``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddMetricRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **metric** | [**Metric**](Metric.md) | Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + +## GetHarLog + +> Har GetHarLog(ctx).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.GetHarLog(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.GetHarLog``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetHarLog`: Har + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.GetHarLog`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetHarLogRequest struct via the builder pattern + + +### Return type + +[**Har**](Har.md) + +### Authorization + +No authorization required + +### 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) + + +## Healthcheck + +> Healthcheck(ctx).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BrowserUpProxyAPI.Healthcheck(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.Healthcheck``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiHealthcheckRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## NewPage + +> Har NewPage(ctx, title).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + title := "title_example" // string | The unique title for this har page/step. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.NewPage(context.Background(), title).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.NewPage``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `NewPage`: Har + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.NewPage`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**title** | **string** | The unique title for this har page/step. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiNewPageRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Har**](Har.md) + +### Authorization + +No authorization required + +### 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) + + +## ResetHarLog + +> Har ResetHarLog(ctx).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.ResetHarLog(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.ResetHarLog``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ResetHarLog`: Har + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.ResetHarLog`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiResetHarLogRequest struct via the builder pattern + + +### Return type + +[**Har**](Har.md) + +### Authorization + +No authorization required + +### 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) + + +## VerifyNotPresent + +> VerifyResult VerifyNotPresent(ctx, name).MatchCriteria(matchCriteria).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + name := "name_example" // string | The unique name for this verification operation + matchCriteria := *openapiclient.NewMatchCriteria() // MatchCriteria | Match criteria to select requests - response pairs for size tests + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.VerifyNotPresent(context.Background(), name).MatchCriteria(matchCriteria).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.VerifyNotPresent``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `VerifyNotPresent`: VerifyResult + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.VerifyNotPresent`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**name** | **string** | The unique name for this verification operation | + +### Other Parameters + +Other parameters are passed through a pointer to a apiVerifyNotPresentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### 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) + + +## VerifyPresent + +> VerifyResult VerifyPresent(ctx, name).MatchCriteria(matchCriteria).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + name := "name_example" // string | The unique name for this verification operation + matchCriteria := *openapiclient.NewMatchCriteria() // MatchCriteria | Match criteria to select requests - response pairs for size tests + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.VerifyPresent(context.Background(), name).MatchCriteria(matchCriteria).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.VerifyPresent``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `VerifyPresent`: VerifyResult + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.VerifyPresent`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**name** | **string** | The unique name for this verification operation | + +### Other Parameters + +Other parameters are passed through a pointer to a apiVerifyPresentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### 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) + + +## VerifySLA + +> VerifyResult VerifySLA(ctx, time, name).MatchCriteria(matchCriteria).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + time := int32(56) // int32 | The time used for comparison + name := "name_example" // string | The unique name for this verification operation + matchCriteria := *openapiclient.NewMatchCriteria() // MatchCriteria | Match criteria to select requests - response pairs for size tests + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.VerifySLA(context.Background(), time, name).MatchCriteria(matchCriteria).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.VerifySLA``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `VerifySLA`: VerifyResult + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.VerifySLA`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**time** | **int32** | The time used for comparison | +**name** | **string** | The unique name for this verification operation | + +### Other Parameters + +Other parameters are passed through a pointer to a apiVerifySLARequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### 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) + + +## VerifySize + +> VerifyResult VerifySize(ctx, size, name).MatchCriteria(matchCriteria).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + size := int32(56) // int32 | The size used for comparison, in kilobytes + name := "name_example" // string | The unique name for this verification operation + matchCriteria := *openapiclient.NewMatchCriteria() // MatchCriteria | Match criteria to select requests - response pairs for size tests + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BrowserUpProxyAPI.VerifySize(context.Background(), size, name).MatchCriteria(matchCriteria).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BrowserUpProxyAPI.VerifySize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `VerifySize`: VerifyResult + fmt.Fprintf(os.Stdout, "Response from `BrowserUpProxyAPI.VerifySize`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**size** | **int32** | The size used for comparison, in kilobytes | +**name** | **string** | The unique name for this verification operation | + +### Other Parameters + +Other parameters are passed through a pointer to a apiVerifySizeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **matchCriteria** | [**MatchCriteria**](MatchCriteria.md) | Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### 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) + diff --git a/clients/go/docs/Error.md b/clients/go/docs/Error.md new file mode 100644 index 0000000000..52eab16d55 --- /dev/null +++ b/clients/go/docs/Error.md @@ -0,0 +1,82 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Name of the Error to add. Stored in har under _errors | [optional] +**Details** | Pointer to **string** | Short details of the error | [optional] + +## Methods + +### NewError + +`func NewError() *Error` + +NewError instantiates a new Error object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorWithDefaults + +`func NewErrorWithDefaults() *Error` + +NewErrorWithDefaults instantiates a new Error object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Error) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Error) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Error) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Error) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDetails + +`func (o *Error) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *Error) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *Error) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *Error) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + + +[[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/clients/go/docs/Har.md b/clients/go/docs/Har.md new file mode 100644 index 0000000000..1c88565f45 --- /dev/null +++ b/clients/go/docs/Har.md @@ -0,0 +1,51 @@ +# Har + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Log** | [**HarLog**](HarLog.md) | | + +## Methods + +### NewHar + +`func NewHar(log HarLog, ) *Har` + +NewHar instantiates a new Har object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarWithDefaults + +`func NewHarWithDefaults() *Har` + +NewHarWithDefaults instantiates a new Har object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLog + +`func (o *Har) GetLog() HarLog` + +GetLog returns the Log field if non-nil, zero value otherwise. + +### GetLogOk + +`func (o *Har) GetLogOk() (*HarLog, bool)` + +GetLogOk returns a tuple with the Log field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLog + +`func (o *Har) SetLog(v HarLog)` + +SetLog sets Log field to given value. + + + +[[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/clients/go/docs/HarEntry.md b/clients/go/docs/HarEntry.md new file mode 100644 index 0000000000..0838154632 --- /dev/null +++ b/clients/go/docs/HarEntry.md @@ -0,0 +1,364 @@ +# HarEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pageref** | Pointer to **string** | | [optional] +**StartedDateTime** | **time.Time** | | +**Time** | **int64** | | +**Request** | [**HarEntryRequest**](HarEntryRequest.md) | | +**Response** | [**HarEntryResponse**](HarEntryResponse.md) | | +**Cache** | [**HarEntryCache**](HarEntryCache.md) | | +**Timings** | [**HarEntryTimings**](HarEntryTimings.md) | | +**ServerIPAddress** | Pointer to **string** | | [optional] +**WebSocketMessages** | Pointer to [**[]WebSocketMessage**](WebSocketMessage.md) | | [optional] +**SpanId** | Pointer to **string** | W3C Trace Context span ID for this entry | [optional] +**ParentId** | Pointer to **string** | W3C Trace Context parent span ID (typically the page span ID) | [optional] +**TraceId** | Pointer to **string** | W3C Trace Context trace ID for distributed tracing | [optional] +**Connection** | Pointer to **string** | | [optional] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntry + +`func NewHarEntry(startedDateTime time.Time, time int64, request HarEntryRequest, response HarEntryResponse, cache HarEntryCache, timings HarEntryTimings, ) *HarEntry` + +NewHarEntry instantiates a new HarEntry object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryWithDefaults + +`func NewHarEntryWithDefaults() *HarEntry` + +NewHarEntryWithDefaults instantiates a new HarEntry object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPageref + +`func (o *HarEntry) GetPageref() string` + +GetPageref returns the Pageref field if non-nil, zero value otherwise. + +### GetPagerefOk + +`func (o *HarEntry) GetPagerefOk() (*string, bool)` + +GetPagerefOk returns a tuple with the Pageref field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageref + +`func (o *HarEntry) SetPageref(v string)` + +SetPageref sets Pageref field to given value. + +### HasPageref + +`func (o *HarEntry) HasPageref() bool` + +HasPageref returns a boolean if a field has been set. + +### GetStartedDateTime + +`func (o *HarEntry) GetStartedDateTime() time.Time` + +GetStartedDateTime returns the StartedDateTime field if non-nil, zero value otherwise. + +### GetStartedDateTimeOk + +`func (o *HarEntry) GetStartedDateTimeOk() (*time.Time, bool)` + +GetStartedDateTimeOk returns a tuple with the StartedDateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedDateTime + +`func (o *HarEntry) SetStartedDateTime(v time.Time)` + +SetStartedDateTime sets StartedDateTime field to given value. + + +### GetTime + +`func (o *HarEntry) GetTime() int64` + +GetTime returns the Time field if non-nil, zero value otherwise. + +### GetTimeOk + +`func (o *HarEntry) GetTimeOk() (*int64, bool)` + +GetTimeOk returns a tuple with the Time field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTime + +`func (o *HarEntry) SetTime(v int64)` + +SetTime sets Time field to given value. + + +### GetRequest + +`func (o *HarEntry) GetRequest() HarEntryRequest` + +GetRequest returns the Request field if non-nil, zero value otherwise. + +### GetRequestOk + +`func (o *HarEntry) GetRequestOk() (*HarEntryRequest, bool)` + +GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequest + +`func (o *HarEntry) SetRequest(v HarEntryRequest)` + +SetRequest sets Request field to given value. + + +### GetResponse + +`func (o *HarEntry) GetResponse() HarEntryResponse` + +GetResponse returns the Response field if non-nil, zero value otherwise. + +### GetResponseOk + +`func (o *HarEntry) GetResponseOk() (*HarEntryResponse, bool)` + +GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponse + +`func (o *HarEntry) SetResponse(v HarEntryResponse)` + +SetResponse sets Response field to given value. + + +### GetCache + +`func (o *HarEntry) GetCache() HarEntryCache` + +GetCache returns the Cache field if non-nil, zero value otherwise. + +### GetCacheOk + +`func (o *HarEntry) GetCacheOk() (*HarEntryCache, bool)` + +GetCacheOk returns a tuple with the Cache field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCache + +`func (o *HarEntry) SetCache(v HarEntryCache)` + +SetCache sets Cache field to given value. + + +### GetTimings + +`func (o *HarEntry) GetTimings() HarEntryTimings` + +GetTimings returns the Timings field if non-nil, zero value otherwise. + +### GetTimingsOk + +`func (o *HarEntry) GetTimingsOk() (*HarEntryTimings, bool)` + +GetTimingsOk returns a tuple with the Timings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimings + +`func (o *HarEntry) SetTimings(v HarEntryTimings)` + +SetTimings sets Timings field to given value. + + +### GetServerIPAddress + +`func (o *HarEntry) GetServerIPAddress() string` + +GetServerIPAddress returns the ServerIPAddress field if non-nil, zero value otherwise. + +### GetServerIPAddressOk + +`func (o *HarEntry) GetServerIPAddressOk() (*string, bool)` + +GetServerIPAddressOk returns a tuple with the ServerIPAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServerIPAddress + +`func (o *HarEntry) SetServerIPAddress(v string)` + +SetServerIPAddress sets ServerIPAddress field to given value. + +### HasServerIPAddress + +`func (o *HarEntry) HasServerIPAddress() bool` + +HasServerIPAddress returns a boolean if a field has been set. + +### GetWebSocketMessages + +`func (o *HarEntry) GetWebSocketMessages() []WebSocketMessage` + +GetWebSocketMessages returns the WebSocketMessages field if non-nil, zero value otherwise. + +### GetWebSocketMessagesOk + +`func (o *HarEntry) GetWebSocketMessagesOk() (*[]WebSocketMessage, bool)` + +GetWebSocketMessagesOk returns a tuple with the WebSocketMessages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebSocketMessages + +`func (o *HarEntry) SetWebSocketMessages(v []WebSocketMessage)` + +SetWebSocketMessages sets WebSocketMessages field to given value. + +### HasWebSocketMessages + +`func (o *HarEntry) HasWebSocketMessages() bool` + +HasWebSocketMessages returns a boolean if a field has been set. + +### GetSpanId + +`func (o *HarEntry) GetSpanId() string` + +GetSpanId returns the SpanId field if non-nil, zero value otherwise. + +### GetSpanIdOk + +`func (o *HarEntry) GetSpanIdOk() (*string, bool)` + +GetSpanIdOk returns a tuple with the SpanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpanId + +`func (o *HarEntry) SetSpanId(v string)` + +SetSpanId sets SpanId field to given value. + +### HasSpanId + +`func (o *HarEntry) HasSpanId() bool` + +HasSpanId returns a boolean if a field has been set. + +### GetParentId + +`func (o *HarEntry) GetParentId() string` + +GetParentId returns the ParentId field if non-nil, zero value otherwise. + +### GetParentIdOk + +`func (o *HarEntry) GetParentIdOk() (*string, bool)` + +GetParentIdOk returns a tuple with the ParentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentId + +`func (o *HarEntry) SetParentId(v string)` + +SetParentId sets ParentId field to given value. + +### HasParentId + +`func (o *HarEntry) HasParentId() bool` + +HasParentId returns a boolean if a field has been set. + +### GetTraceId + +`func (o *HarEntry) GetTraceId() string` + +GetTraceId returns the TraceId field if non-nil, zero value otherwise. + +### GetTraceIdOk + +`func (o *HarEntry) GetTraceIdOk() (*string, bool)` + +GetTraceIdOk returns a tuple with the TraceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTraceId + +`func (o *HarEntry) SetTraceId(v string)` + +SetTraceId sets TraceId field to given value. + +### HasTraceId + +`func (o *HarEntry) HasTraceId() bool` + +HasTraceId returns a boolean if a field has been set. + +### GetConnection + +`func (o *HarEntry) GetConnection() string` + +GetConnection returns the Connection field if non-nil, zero value otherwise. + +### GetConnectionOk + +`func (o *HarEntry) GetConnectionOk() (*string, bool)` + +GetConnectionOk returns a tuple with the Connection field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnection + +`func (o *HarEntry) SetConnection(v string)` + +SetConnection sets Connection field to given value. + +### HasConnection + +`func (o *HarEntry) HasConnection() bool` + +HasConnection returns a boolean if a field has been set. + +### GetComment + +`func (o *HarEntry) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntry) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntry) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntry) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryCache.md b/clients/go/docs/HarEntryCache.md new file mode 100644 index 0000000000..d17bd916b5 --- /dev/null +++ b/clients/go/docs/HarEntryCache.md @@ -0,0 +1,128 @@ +# HarEntryCache + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BeforeRequest** | Pointer to [**NullableHarEntryCacheBeforeRequest**](HarEntryCacheBeforeRequest.md) | | [optional] +**AfterRequest** | Pointer to [**NullableHarEntryCacheBeforeRequest**](HarEntryCacheBeforeRequest.md) | | [optional] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryCache + +`func NewHarEntryCache() *HarEntryCache` + +NewHarEntryCache instantiates a new HarEntryCache object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryCacheWithDefaults + +`func NewHarEntryCacheWithDefaults() *HarEntryCache` + +NewHarEntryCacheWithDefaults instantiates a new HarEntryCache object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBeforeRequest + +`func (o *HarEntryCache) GetBeforeRequest() HarEntryCacheBeforeRequest` + +GetBeforeRequest returns the BeforeRequest field if non-nil, zero value otherwise. + +### GetBeforeRequestOk + +`func (o *HarEntryCache) GetBeforeRequestOk() (*HarEntryCacheBeforeRequest, bool)` + +GetBeforeRequestOk returns a tuple with the BeforeRequest field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBeforeRequest + +`func (o *HarEntryCache) SetBeforeRequest(v HarEntryCacheBeforeRequest)` + +SetBeforeRequest sets BeforeRequest field to given value. + +### HasBeforeRequest + +`func (o *HarEntryCache) HasBeforeRequest() bool` + +HasBeforeRequest returns a boolean if a field has been set. + +### SetBeforeRequestNil + +`func (o *HarEntryCache) SetBeforeRequestNil(b bool)` + + SetBeforeRequestNil sets the value for BeforeRequest to be an explicit nil + +### UnsetBeforeRequest +`func (o *HarEntryCache) UnsetBeforeRequest()` + +UnsetBeforeRequest ensures that no value is present for BeforeRequest, not even an explicit nil +### GetAfterRequest + +`func (o *HarEntryCache) GetAfterRequest() HarEntryCacheBeforeRequest` + +GetAfterRequest returns the AfterRequest field if non-nil, zero value otherwise. + +### GetAfterRequestOk + +`func (o *HarEntryCache) GetAfterRequestOk() (*HarEntryCacheBeforeRequest, bool)` + +GetAfterRequestOk returns a tuple with the AfterRequest field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAfterRequest + +`func (o *HarEntryCache) SetAfterRequest(v HarEntryCacheBeforeRequest)` + +SetAfterRequest sets AfterRequest field to given value. + +### HasAfterRequest + +`func (o *HarEntryCache) HasAfterRequest() bool` + +HasAfterRequest returns a boolean if a field has been set. + +### SetAfterRequestNil + +`func (o *HarEntryCache) SetAfterRequestNil(b bool)` + + SetAfterRequestNil sets the value for AfterRequest to be an explicit nil + +### UnsetAfterRequest +`func (o *HarEntryCache) UnsetAfterRequest()` + +UnsetAfterRequest ensures that no value is present for AfterRequest, not even an explicit nil +### GetComment + +`func (o *HarEntryCache) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryCache) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryCache) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryCache) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryCacheBeforeRequest.md b/clients/go/docs/HarEntryCacheBeforeRequest.md new file mode 100644 index 0000000000..c04d93f9fd --- /dev/null +++ b/clients/go/docs/HarEntryCacheBeforeRequest.md @@ -0,0 +1,145 @@ +# HarEntryCacheBeforeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Expires** | Pointer to **string** | | [optional] +**LastAccess** | **string** | | +**ETag** | **string** | | +**HitCount** | **int32** | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryCacheBeforeRequest + +`func NewHarEntryCacheBeforeRequest(lastAccess string, eTag string, hitCount int32, ) *HarEntryCacheBeforeRequest` + +NewHarEntryCacheBeforeRequest instantiates a new HarEntryCacheBeforeRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryCacheBeforeRequestWithDefaults + +`func NewHarEntryCacheBeforeRequestWithDefaults() *HarEntryCacheBeforeRequest` + +NewHarEntryCacheBeforeRequestWithDefaults instantiates a new HarEntryCacheBeforeRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExpires + +`func (o *HarEntryCacheBeforeRequest) GetExpires() string` + +GetExpires returns the Expires field if non-nil, zero value otherwise. + +### GetExpiresOk + +`func (o *HarEntryCacheBeforeRequest) GetExpiresOk() (*string, bool)` + +GetExpiresOk returns a tuple with the Expires field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpires + +`func (o *HarEntryCacheBeforeRequest) SetExpires(v string)` + +SetExpires sets Expires field to given value. + +### HasExpires + +`func (o *HarEntryCacheBeforeRequest) HasExpires() bool` + +HasExpires returns a boolean if a field has been set. + +### GetLastAccess + +`func (o *HarEntryCacheBeforeRequest) GetLastAccess() string` + +GetLastAccess returns the LastAccess field if non-nil, zero value otherwise. + +### GetLastAccessOk + +`func (o *HarEntryCacheBeforeRequest) GetLastAccessOk() (*string, bool)` + +GetLastAccessOk returns a tuple with the LastAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastAccess + +`func (o *HarEntryCacheBeforeRequest) SetLastAccess(v string)` + +SetLastAccess sets LastAccess field to given value. + + +### GetETag + +`func (o *HarEntryCacheBeforeRequest) GetETag() string` + +GetETag returns the ETag field if non-nil, zero value otherwise. + +### GetETagOk + +`func (o *HarEntryCacheBeforeRequest) GetETagOk() (*string, bool)` + +GetETagOk returns a tuple with the ETag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetETag + +`func (o *HarEntryCacheBeforeRequest) SetETag(v string)` + +SetETag sets ETag field to given value. + + +### GetHitCount + +`func (o *HarEntryCacheBeforeRequest) GetHitCount() int32` + +GetHitCount returns the HitCount field if non-nil, zero value otherwise. + +### GetHitCountOk + +`func (o *HarEntryCacheBeforeRequest) GetHitCountOk() (*int32, bool)` + +GetHitCountOk returns a tuple with the HitCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHitCount + +`func (o *HarEntryCacheBeforeRequest) SetHitCount(v int32)` + +SetHitCount sets HitCount field to given value. + + +### GetComment + +`func (o *HarEntryCacheBeforeRequest) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryCacheBeforeRequest) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryCacheBeforeRequest) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryCacheBeforeRequest) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryRequest.md b/clients/go/docs/HarEntryRequest.md new file mode 100644 index 0000000000..09a4ff6b03 --- /dev/null +++ b/clients/go/docs/HarEntryRequest.md @@ -0,0 +1,250 @@ +# HarEntryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Method** | **string** | | +**Url** | **string** | | +**HttpVersion** | **string** | | +**Cookies** | [**[]HarEntryRequestCookiesInner**](HarEntryRequestCookiesInner.md) | | +**Headers** | [**[]Header**](Header.md) | | +**QueryString** | [**[]HarEntryRequestQueryStringInner**](HarEntryRequestQueryStringInner.md) | | +**PostData** | Pointer to [**HarEntryRequestPostData**](HarEntryRequestPostData.md) | | [optional] +**HeadersSize** | **int32** | | +**BodySize** | **int32** | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryRequest + +`func NewHarEntryRequest(method string, url string, httpVersion string, cookies []HarEntryRequestCookiesInner, headers []Header, queryString []HarEntryRequestQueryStringInner, headersSize int32, bodySize int32, ) *HarEntryRequest` + +NewHarEntryRequest instantiates a new HarEntryRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryRequestWithDefaults + +`func NewHarEntryRequestWithDefaults() *HarEntryRequest` + +NewHarEntryRequestWithDefaults instantiates a new HarEntryRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMethod + +`func (o *HarEntryRequest) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *HarEntryRequest) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *HarEntryRequest) SetMethod(v string)` + +SetMethod sets Method field to given value. + + +### GetUrl + +`func (o *HarEntryRequest) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *HarEntryRequest) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *HarEntryRequest) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### GetHttpVersion + +`func (o *HarEntryRequest) GetHttpVersion() string` + +GetHttpVersion returns the HttpVersion field if non-nil, zero value otherwise. + +### GetHttpVersionOk + +`func (o *HarEntryRequest) GetHttpVersionOk() (*string, bool)` + +GetHttpVersionOk returns a tuple with the HttpVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHttpVersion + +`func (o *HarEntryRequest) SetHttpVersion(v string)` + +SetHttpVersion sets HttpVersion field to given value. + + +### GetCookies + +`func (o *HarEntryRequest) GetCookies() []HarEntryRequestCookiesInner` + +GetCookies returns the Cookies field if non-nil, zero value otherwise. + +### GetCookiesOk + +`func (o *HarEntryRequest) GetCookiesOk() (*[]HarEntryRequestCookiesInner, bool)` + +GetCookiesOk returns a tuple with the Cookies field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCookies + +`func (o *HarEntryRequest) SetCookies(v []HarEntryRequestCookiesInner)` + +SetCookies sets Cookies field to given value. + + +### GetHeaders + +`func (o *HarEntryRequest) GetHeaders() []Header` + +GetHeaders returns the Headers field if non-nil, zero value otherwise. + +### GetHeadersOk + +`func (o *HarEntryRequest) GetHeadersOk() (*[]Header, bool)` + +GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeaders + +`func (o *HarEntryRequest) SetHeaders(v []Header)` + +SetHeaders sets Headers field to given value. + + +### GetQueryString + +`func (o *HarEntryRequest) GetQueryString() []HarEntryRequestQueryStringInner` + +GetQueryString returns the QueryString field if non-nil, zero value otherwise. + +### GetQueryStringOk + +`func (o *HarEntryRequest) GetQueryStringOk() (*[]HarEntryRequestQueryStringInner, bool)` + +GetQueryStringOk returns a tuple with the QueryString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueryString + +`func (o *HarEntryRequest) SetQueryString(v []HarEntryRequestQueryStringInner)` + +SetQueryString sets QueryString field to given value. + + +### GetPostData + +`func (o *HarEntryRequest) GetPostData() HarEntryRequestPostData` + +GetPostData returns the PostData field if non-nil, zero value otherwise. + +### GetPostDataOk + +`func (o *HarEntryRequest) GetPostDataOk() (*HarEntryRequestPostData, bool)` + +GetPostDataOk returns a tuple with the PostData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostData + +`func (o *HarEntryRequest) SetPostData(v HarEntryRequestPostData)` + +SetPostData sets PostData field to given value. + +### HasPostData + +`func (o *HarEntryRequest) HasPostData() bool` + +HasPostData returns a boolean if a field has been set. + +### GetHeadersSize + +`func (o *HarEntryRequest) GetHeadersSize() int32` + +GetHeadersSize returns the HeadersSize field if non-nil, zero value otherwise. + +### GetHeadersSizeOk + +`func (o *HarEntryRequest) GetHeadersSizeOk() (*int32, bool)` + +GetHeadersSizeOk returns a tuple with the HeadersSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadersSize + +`func (o *HarEntryRequest) SetHeadersSize(v int32)` + +SetHeadersSize sets HeadersSize field to given value. + + +### GetBodySize + +`func (o *HarEntryRequest) GetBodySize() int32` + +GetBodySize returns the BodySize field if non-nil, zero value otherwise. + +### GetBodySizeOk + +`func (o *HarEntryRequest) GetBodySizeOk() (*int32, bool)` + +GetBodySizeOk returns a tuple with the BodySize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBodySize + +`func (o *HarEntryRequest) SetBodySize(v int32)` + +SetBodySize sets BodySize field to given value. + + +### GetComment + +`func (o *HarEntryRequest) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryRequest) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryRequest) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryRequest) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryRequestCookiesInner.md b/clients/go/docs/HarEntryRequestCookiesInner.md new file mode 100644 index 0000000000..690268783e --- /dev/null +++ b/clients/go/docs/HarEntryRequestCookiesInner.md @@ -0,0 +1,228 @@ +# HarEntryRequestCookiesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | **string** | | +**Path** | Pointer to **string** | | [optional] +**Domain** | Pointer to **string** | | [optional] +**Expires** | Pointer to **string** | | [optional] +**HttpOnly** | Pointer to **bool** | | [optional] +**Secure** | Pointer to **bool** | | [optional] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryRequestCookiesInner + +`func NewHarEntryRequestCookiesInner(name string, value string, ) *HarEntryRequestCookiesInner` + +NewHarEntryRequestCookiesInner instantiates a new HarEntryRequestCookiesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryRequestCookiesInnerWithDefaults + +`func NewHarEntryRequestCookiesInnerWithDefaults() *HarEntryRequestCookiesInner` + +NewHarEntryRequestCookiesInnerWithDefaults instantiates a new HarEntryRequestCookiesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *HarEntryRequestCookiesInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *HarEntryRequestCookiesInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *HarEntryRequestCookiesInner) SetName(v string)` + +SetName sets Name field to given value. + + +### GetValue + +`func (o *HarEntryRequestCookiesInner) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *HarEntryRequestCookiesInner) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *HarEntryRequestCookiesInner) SetValue(v string)` + +SetValue sets Value field to given value. + + +### GetPath + +`func (o *HarEntryRequestCookiesInner) GetPath() string` + +GetPath returns the Path field if non-nil, zero value otherwise. + +### GetPathOk + +`func (o *HarEntryRequestCookiesInner) GetPathOk() (*string, bool)` + +GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPath + +`func (o *HarEntryRequestCookiesInner) SetPath(v string)` + +SetPath sets Path field to given value. + +### HasPath + +`func (o *HarEntryRequestCookiesInner) HasPath() bool` + +HasPath returns a boolean if a field has been set. + +### GetDomain + +`func (o *HarEntryRequestCookiesInner) GetDomain() string` + +GetDomain returns the Domain field if non-nil, zero value otherwise. + +### GetDomainOk + +`func (o *HarEntryRequestCookiesInner) GetDomainOk() (*string, bool)` + +GetDomainOk returns a tuple with the Domain field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDomain + +`func (o *HarEntryRequestCookiesInner) SetDomain(v string)` + +SetDomain sets Domain field to given value. + +### HasDomain + +`func (o *HarEntryRequestCookiesInner) HasDomain() bool` + +HasDomain returns a boolean if a field has been set. + +### GetExpires + +`func (o *HarEntryRequestCookiesInner) GetExpires() string` + +GetExpires returns the Expires field if non-nil, zero value otherwise. + +### GetExpiresOk + +`func (o *HarEntryRequestCookiesInner) GetExpiresOk() (*string, bool)` + +GetExpiresOk returns a tuple with the Expires field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpires + +`func (o *HarEntryRequestCookiesInner) SetExpires(v string)` + +SetExpires sets Expires field to given value. + +### HasExpires + +`func (o *HarEntryRequestCookiesInner) HasExpires() bool` + +HasExpires returns a boolean if a field has been set. + +### GetHttpOnly + +`func (o *HarEntryRequestCookiesInner) GetHttpOnly() bool` + +GetHttpOnly returns the HttpOnly field if non-nil, zero value otherwise. + +### GetHttpOnlyOk + +`func (o *HarEntryRequestCookiesInner) GetHttpOnlyOk() (*bool, bool)` + +GetHttpOnlyOk returns a tuple with the HttpOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHttpOnly + +`func (o *HarEntryRequestCookiesInner) SetHttpOnly(v bool)` + +SetHttpOnly sets HttpOnly field to given value. + +### HasHttpOnly + +`func (o *HarEntryRequestCookiesInner) HasHttpOnly() bool` + +HasHttpOnly returns a boolean if a field has been set. + +### GetSecure + +`func (o *HarEntryRequestCookiesInner) GetSecure() bool` + +GetSecure returns the Secure field if non-nil, zero value otherwise. + +### GetSecureOk + +`func (o *HarEntryRequestCookiesInner) GetSecureOk() (*bool, bool)` + +GetSecureOk returns a tuple with the Secure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecure + +`func (o *HarEntryRequestCookiesInner) SetSecure(v bool)` + +SetSecure sets Secure field to given value. + +### HasSecure + +`func (o *HarEntryRequestCookiesInner) HasSecure() bool` + +HasSecure returns a boolean if a field has been set. + +### GetComment + +`func (o *HarEntryRequestCookiesInner) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryRequestCookiesInner) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryRequestCookiesInner) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryRequestCookiesInner) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryRequestPostData.md b/clients/go/docs/HarEntryRequestPostData.md new file mode 100644 index 0000000000..c8f68e41a0 --- /dev/null +++ b/clients/go/docs/HarEntryRequestPostData.md @@ -0,0 +1,103 @@ +# HarEntryRequestPostData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MimeType** | **string** | | +**Text** | Pointer to **string** | | [optional] +**Params** | Pointer to [**[]HarEntryRequestPostDataParamsInner**](HarEntryRequestPostDataParamsInner.md) | | [optional] + +## Methods + +### NewHarEntryRequestPostData + +`func NewHarEntryRequestPostData(mimeType string, ) *HarEntryRequestPostData` + +NewHarEntryRequestPostData instantiates a new HarEntryRequestPostData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryRequestPostDataWithDefaults + +`func NewHarEntryRequestPostDataWithDefaults() *HarEntryRequestPostData` + +NewHarEntryRequestPostDataWithDefaults instantiates a new HarEntryRequestPostData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMimeType + +`func (o *HarEntryRequestPostData) GetMimeType() string` + +GetMimeType returns the MimeType field if non-nil, zero value otherwise. + +### GetMimeTypeOk + +`func (o *HarEntryRequestPostData) GetMimeTypeOk() (*string, bool)` + +GetMimeTypeOk returns a tuple with the MimeType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMimeType + +`func (o *HarEntryRequestPostData) SetMimeType(v string)` + +SetMimeType sets MimeType field to given value. + + +### GetText + +`func (o *HarEntryRequestPostData) GetText() string` + +GetText returns the Text field if non-nil, zero value otherwise. + +### GetTextOk + +`func (o *HarEntryRequestPostData) GetTextOk() (*string, bool)` + +GetTextOk returns a tuple with the Text field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetText + +`func (o *HarEntryRequestPostData) SetText(v string)` + +SetText sets Text field to given value. + +### HasText + +`func (o *HarEntryRequestPostData) HasText() bool` + +HasText returns a boolean if a field has been set. + +### GetParams + +`func (o *HarEntryRequestPostData) GetParams() []HarEntryRequestPostDataParamsInner` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *HarEntryRequestPostData) GetParamsOk() (*[]HarEntryRequestPostDataParamsInner, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *HarEntryRequestPostData) SetParams(v []HarEntryRequestPostDataParamsInner)` + +SetParams sets Params field to given value. + +### HasParams + +`func (o *HarEntryRequestPostData) HasParams() bool` + +HasParams returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryRequestPostDataParamsInner.md b/clients/go/docs/HarEntryRequestPostDataParamsInner.md new file mode 100644 index 0000000000..206c874638 --- /dev/null +++ b/clients/go/docs/HarEntryRequestPostDataParamsInner.md @@ -0,0 +1,160 @@ +# HarEntryRequestPostDataParamsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Value** | Pointer to **string** | | [optional] +**FileName** | Pointer to **string** | | [optional] +**ContentType** | Pointer to **string** | | [optional] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryRequestPostDataParamsInner + +`func NewHarEntryRequestPostDataParamsInner() *HarEntryRequestPostDataParamsInner` + +NewHarEntryRequestPostDataParamsInner instantiates a new HarEntryRequestPostDataParamsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryRequestPostDataParamsInnerWithDefaults + +`func NewHarEntryRequestPostDataParamsInnerWithDefaults() *HarEntryRequestPostDataParamsInner` + +NewHarEntryRequestPostDataParamsInnerWithDefaults instantiates a new HarEntryRequestPostDataParamsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *HarEntryRequestPostDataParamsInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *HarEntryRequestPostDataParamsInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *HarEntryRequestPostDataParamsInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *HarEntryRequestPostDataParamsInner) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetValue + +`func (o *HarEntryRequestPostDataParamsInner) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *HarEntryRequestPostDataParamsInner) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *HarEntryRequestPostDataParamsInner) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *HarEntryRequestPostDataParamsInner) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetFileName + +`func (o *HarEntryRequestPostDataParamsInner) GetFileName() string` + +GetFileName returns the FileName field if non-nil, zero value otherwise. + +### GetFileNameOk + +`func (o *HarEntryRequestPostDataParamsInner) GetFileNameOk() (*string, bool)` + +GetFileNameOk returns a tuple with the FileName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFileName + +`func (o *HarEntryRequestPostDataParamsInner) SetFileName(v string)` + +SetFileName sets FileName field to given value. + +### HasFileName + +`func (o *HarEntryRequestPostDataParamsInner) HasFileName() bool` + +HasFileName returns a boolean if a field has been set. + +### GetContentType + +`func (o *HarEntryRequestPostDataParamsInner) GetContentType() string` + +GetContentType returns the ContentType field if non-nil, zero value otherwise. + +### GetContentTypeOk + +`func (o *HarEntryRequestPostDataParamsInner) GetContentTypeOk() (*string, bool)` + +GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContentType + +`func (o *HarEntryRequestPostDataParamsInner) SetContentType(v string)` + +SetContentType sets ContentType field to given value. + +### HasContentType + +`func (o *HarEntryRequestPostDataParamsInner) HasContentType() bool` + +HasContentType returns a boolean if a field has been set. + +### GetComment + +`func (o *HarEntryRequestPostDataParamsInner) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryRequestPostDataParamsInner) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryRequestPostDataParamsInner) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryRequestPostDataParamsInner) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryRequestQueryStringInner.md b/clients/go/docs/HarEntryRequestQueryStringInner.md new file mode 100644 index 0000000000..1b38132f42 --- /dev/null +++ b/clients/go/docs/HarEntryRequestQueryStringInner.md @@ -0,0 +1,98 @@ +# HarEntryRequestQueryStringInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | **string** | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryRequestQueryStringInner + +`func NewHarEntryRequestQueryStringInner(name string, value string, ) *HarEntryRequestQueryStringInner` + +NewHarEntryRequestQueryStringInner instantiates a new HarEntryRequestQueryStringInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryRequestQueryStringInnerWithDefaults + +`func NewHarEntryRequestQueryStringInnerWithDefaults() *HarEntryRequestQueryStringInner` + +NewHarEntryRequestQueryStringInnerWithDefaults instantiates a new HarEntryRequestQueryStringInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *HarEntryRequestQueryStringInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *HarEntryRequestQueryStringInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *HarEntryRequestQueryStringInner) SetName(v string)` + +SetName sets Name field to given value. + + +### GetValue + +`func (o *HarEntryRequestQueryStringInner) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *HarEntryRequestQueryStringInner) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *HarEntryRequestQueryStringInner) SetValue(v string)` + +SetValue sets Value field to given value. + + +### GetComment + +`func (o *HarEntryRequestQueryStringInner) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryRequestQueryStringInner) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryRequestQueryStringInner) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryRequestQueryStringInner) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryResponse.md b/clients/go/docs/HarEntryResponse.md new file mode 100644 index 0000000000..b4a029767d --- /dev/null +++ b/clients/go/docs/HarEntryResponse.md @@ -0,0 +1,245 @@ +# HarEntryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **int32** | | +**StatusText** | **string** | | +**HttpVersion** | **string** | | +**Cookies** | [**[]HarEntryRequestCookiesInner**](HarEntryRequestCookiesInner.md) | | +**Headers** | [**[]Header**](Header.md) | | +**Content** | [**HarEntryResponseContent**](HarEntryResponseContent.md) | | +**RedirectURL** | **string** | | +**HeadersSize** | **int32** | | +**BodySize** | **int32** | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryResponse + +`func NewHarEntryResponse(status int32, statusText string, httpVersion string, cookies []HarEntryRequestCookiesInner, headers []Header, content HarEntryResponseContent, redirectURL string, headersSize int32, bodySize int32, ) *HarEntryResponse` + +NewHarEntryResponse instantiates a new HarEntryResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryResponseWithDefaults + +`func NewHarEntryResponseWithDefaults() *HarEntryResponse` + +NewHarEntryResponseWithDefaults instantiates a new HarEntryResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *HarEntryResponse) GetStatus() int32` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *HarEntryResponse) GetStatusOk() (*int32, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *HarEntryResponse) SetStatus(v int32)` + +SetStatus sets Status field to given value. + + +### GetStatusText + +`func (o *HarEntryResponse) GetStatusText() string` + +GetStatusText returns the StatusText field if non-nil, zero value otherwise. + +### GetStatusTextOk + +`func (o *HarEntryResponse) GetStatusTextOk() (*string, bool)` + +GetStatusTextOk returns a tuple with the StatusText field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusText + +`func (o *HarEntryResponse) SetStatusText(v string)` + +SetStatusText sets StatusText field to given value. + + +### GetHttpVersion + +`func (o *HarEntryResponse) GetHttpVersion() string` + +GetHttpVersion returns the HttpVersion field if non-nil, zero value otherwise. + +### GetHttpVersionOk + +`func (o *HarEntryResponse) GetHttpVersionOk() (*string, bool)` + +GetHttpVersionOk returns a tuple with the HttpVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHttpVersion + +`func (o *HarEntryResponse) SetHttpVersion(v string)` + +SetHttpVersion sets HttpVersion field to given value. + + +### GetCookies + +`func (o *HarEntryResponse) GetCookies() []HarEntryRequestCookiesInner` + +GetCookies returns the Cookies field if non-nil, zero value otherwise. + +### GetCookiesOk + +`func (o *HarEntryResponse) GetCookiesOk() (*[]HarEntryRequestCookiesInner, bool)` + +GetCookiesOk returns a tuple with the Cookies field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCookies + +`func (o *HarEntryResponse) SetCookies(v []HarEntryRequestCookiesInner)` + +SetCookies sets Cookies field to given value. + + +### GetHeaders + +`func (o *HarEntryResponse) GetHeaders() []Header` + +GetHeaders returns the Headers field if non-nil, zero value otherwise. + +### GetHeadersOk + +`func (o *HarEntryResponse) GetHeadersOk() (*[]Header, bool)` + +GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeaders + +`func (o *HarEntryResponse) SetHeaders(v []Header)` + +SetHeaders sets Headers field to given value. + + +### GetContent + +`func (o *HarEntryResponse) GetContent() HarEntryResponseContent` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *HarEntryResponse) GetContentOk() (*HarEntryResponseContent, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *HarEntryResponse) SetContent(v HarEntryResponseContent)` + +SetContent sets Content field to given value. + + +### GetRedirectURL + +`func (o *HarEntryResponse) GetRedirectURL() string` + +GetRedirectURL returns the RedirectURL field if non-nil, zero value otherwise. + +### GetRedirectURLOk + +`func (o *HarEntryResponse) GetRedirectURLOk() (*string, bool)` + +GetRedirectURLOk returns a tuple with the RedirectURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectURL + +`func (o *HarEntryResponse) SetRedirectURL(v string)` + +SetRedirectURL sets RedirectURL field to given value. + + +### GetHeadersSize + +`func (o *HarEntryResponse) GetHeadersSize() int32` + +GetHeadersSize returns the HeadersSize field if non-nil, zero value otherwise. + +### GetHeadersSizeOk + +`func (o *HarEntryResponse) GetHeadersSizeOk() (*int32, bool)` + +GetHeadersSizeOk returns a tuple with the HeadersSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadersSize + +`func (o *HarEntryResponse) SetHeadersSize(v int32)` + +SetHeadersSize sets HeadersSize field to given value. + + +### GetBodySize + +`func (o *HarEntryResponse) GetBodySize() int32` + +GetBodySize returns the BodySize field if non-nil, zero value otherwise. + +### GetBodySizeOk + +`func (o *HarEntryResponse) GetBodySizeOk() (*int32, bool)` + +GetBodySizeOk returns a tuple with the BodySize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBodySize + +`func (o *HarEntryResponse) SetBodySize(v int32)` + +SetBodySize sets BodySize field to given value. + + +### GetComment + +`func (o *HarEntryResponse) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryResponse) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryResponse) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryResponse) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryResponseContent.md b/clients/go/docs/HarEntryResponseContent.md new file mode 100644 index 0000000000..a833d8dfff --- /dev/null +++ b/clients/go/docs/HarEntryResponseContent.md @@ -0,0 +1,384 @@ +# HarEntryResponseContent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Size** | **int32** | | +**Compression** | Pointer to **int32** | | [optional] +**MimeType** | **string** | | +**Text** | Pointer to **string** | | [optional] +**Encoding** | Pointer to **string** | | [optional] +**VideoBufferedPercent** | Pointer to **int64** | | [optional] [default to -1] +**VideoStallCount** | Pointer to **int64** | | [optional] [default to -1] +**VideoDecodedByteCount** | Pointer to **int64** | | [optional] [default to -1] +**VideoWaitingCount** | Pointer to **int64** | | [optional] [default to -1] +**VideoErrorCount** | Pointer to **int64** | | [optional] [default to -1] +**VideoDroppedFrames** | Pointer to **int64** | | [optional] [default to -1] +**VideoTotalFrames** | Pointer to **int64** | | [optional] [default to -1] +**VideoAudioBytesDecoded** | Pointer to **int64** | | [optional] [default to -1] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryResponseContent + +`func NewHarEntryResponseContent(size int32, mimeType string, ) *HarEntryResponseContent` + +NewHarEntryResponseContent instantiates a new HarEntryResponseContent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryResponseContentWithDefaults + +`func NewHarEntryResponseContentWithDefaults() *HarEntryResponseContent` + +NewHarEntryResponseContentWithDefaults instantiates a new HarEntryResponseContent object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSize + +`func (o *HarEntryResponseContent) GetSize() int32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *HarEntryResponseContent) GetSizeOk() (*int32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *HarEntryResponseContent) SetSize(v int32)` + +SetSize sets Size field to given value. + + +### GetCompression + +`func (o *HarEntryResponseContent) GetCompression() int32` + +GetCompression returns the Compression field if non-nil, zero value otherwise. + +### GetCompressionOk + +`func (o *HarEntryResponseContent) GetCompressionOk() (*int32, bool)` + +GetCompressionOk returns a tuple with the Compression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompression + +`func (o *HarEntryResponseContent) SetCompression(v int32)` + +SetCompression sets Compression field to given value. + +### HasCompression + +`func (o *HarEntryResponseContent) HasCompression() bool` + +HasCompression returns a boolean if a field has been set. + +### GetMimeType + +`func (o *HarEntryResponseContent) GetMimeType() string` + +GetMimeType returns the MimeType field if non-nil, zero value otherwise. + +### GetMimeTypeOk + +`func (o *HarEntryResponseContent) GetMimeTypeOk() (*string, bool)` + +GetMimeTypeOk returns a tuple with the MimeType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMimeType + +`func (o *HarEntryResponseContent) SetMimeType(v string)` + +SetMimeType sets MimeType field to given value. + + +### GetText + +`func (o *HarEntryResponseContent) GetText() string` + +GetText returns the Text field if non-nil, zero value otherwise. + +### GetTextOk + +`func (o *HarEntryResponseContent) GetTextOk() (*string, bool)` + +GetTextOk returns a tuple with the Text field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetText + +`func (o *HarEntryResponseContent) SetText(v string)` + +SetText sets Text field to given value. + +### HasText + +`func (o *HarEntryResponseContent) HasText() bool` + +HasText returns a boolean if a field has been set. + +### GetEncoding + +`func (o *HarEntryResponseContent) GetEncoding() string` + +GetEncoding returns the Encoding field if non-nil, zero value otherwise. + +### GetEncodingOk + +`func (o *HarEntryResponseContent) GetEncodingOk() (*string, bool)` + +GetEncodingOk returns a tuple with the Encoding field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncoding + +`func (o *HarEntryResponseContent) SetEncoding(v string)` + +SetEncoding sets Encoding field to given value. + +### HasEncoding + +`func (o *HarEntryResponseContent) HasEncoding() bool` + +HasEncoding returns a boolean if a field has been set. + +### GetVideoBufferedPercent + +`func (o *HarEntryResponseContent) GetVideoBufferedPercent() int64` + +GetVideoBufferedPercent returns the VideoBufferedPercent field if non-nil, zero value otherwise. + +### GetVideoBufferedPercentOk + +`func (o *HarEntryResponseContent) GetVideoBufferedPercentOk() (*int64, bool)` + +GetVideoBufferedPercentOk returns a tuple with the VideoBufferedPercent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoBufferedPercent + +`func (o *HarEntryResponseContent) SetVideoBufferedPercent(v int64)` + +SetVideoBufferedPercent sets VideoBufferedPercent field to given value. + +### HasVideoBufferedPercent + +`func (o *HarEntryResponseContent) HasVideoBufferedPercent() bool` + +HasVideoBufferedPercent returns a boolean if a field has been set. + +### GetVideoStallCount + +`func (o *HarEntryResponseContent) GetVideoStallCount() int64` + +GetVideoStallCount returns the VideoStallCount field if non-nil, zero value otherwise. + +### GetVideoStallCountOk + +`func (o *HarEntryResponseContent) GetVideoStallCountOk() (*int64, bool)` + +GetVideoStallCountOk returns a tuple with the VideoStallCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoStallCount + +`func (o *HarEntryResponseContent) SetVideoStallCount(v int64)` + +SetVideoStallCount sets VideoStallCount field to given value. + +### HasVideoStallCount + +`func (o *HarEntryResponseContent) HasVideoStallCount() bool` + +HasVideoStallCount returns a boolean if a field has been set. + +### GetVideoDecodedByteCount + +`func (o *HarEntryResponseContent) GetVideoDecodedByteCount() int64` + +GetVideoDecodedByteCount returns the VideoDecodedByteCount field if non-nil, zero value otherwise. + +### GetVideoDecodedByteCountOk + +`func (o *HarEntryResponseContent) GetVideoDecodedByteCountOk() (*int64, bool)` + +GetVideoDecodedByteCountOk returns a tuple with the VideoDecodedByteCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoDecodedByteCount + +`func (o *HarEntryResponseContent) SetVideoDecodedByteCount(v int64)` + +SetVideoDecodedByteCount sets VideoDecodedByteCount field to given value. + +### HasVideoDecodedByteCount + +`func (o *HarEntryResponseContent) HasVideoDecodedByteCount() bool` + +HasVideoDecodedByteCount returns a boolean if a field has been set. + +### GetVideoWaitingCount + +`func (o *HarEntryResponseContent) GetVideoWaitingCount() int64` + +GetVideoWaitingCount returns the VideoWaitingCount field if non-nil, zero value otherwise. + +### GetVideoWaitingCountOk + +`func (o *HarEntryResponseContent) GetVideoWaitingCountOk() (*int64, bool)` + +GetVideoWaitingCountOk returns a tuple with the VideoWaitingCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoWaitingCount + +`func (o *HarEntryResponseContent) SetVideoWaitingCount(v int64)` + +SetVideoWaitingCount sets VideoWaitingCount field to given value. + +### HasVideoWaitingCount + +`func (o *HarEntryResponseContent) HasVideoWaitingCount() bool` + +HasVideoWaitingCount returns a boolean if a field has been set. + +### GetVideoErrorCount + +`func (o *HarEntryResponseContent) GetVideoErrorCount() int64` + +GetVideoErrorCount returns the VideoErrorCount field if non-nil, zero value otherwise. + +### GetVideoErrorCountOk + +`func (o *HarEntryResponseContent) GetVideoErrorCountOk() (*int64, bool)` + +GetVideoErrorCountOk returns a tuple with the VideoErrorCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoErrorCount + +`func (o *HarEntryResponseContent) SetVideoErrorCount(v int64)` + +SetVideoErrorCount sets VideoErrorCount field to given value. + +### HasVideoErrorCount + +`func (o *HarEntryResponseContent) HasVideoErrorCount() bool` + +HasVideoErrorCount returns a boolean if a field has been set. + +### GetVideoDroppedFrames + +`func (o *HarEntryResponseContent) GetVideoDroppedFrames() int64` + +GetVideoDroppedFrames returns the VideoDroppedFrames field if non-nil, zero value otherwise. + +### GetVideoDroppedFramesOk + +`func (o *HarEntryResponseContent) GetVideoDroppedFramesOk() (*int64, bool)` + +GetVideoDroppedFramesOk returns a tuple with the VideoDroppedFrames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoDroppedFrames + +`func (o *HarEntryResponseContent) SetVideoDroppedFrames(v int64)` + +SetVideoDroppedFrames sets VideoDroppedFrames field to given value. + +### HasVideoDroppedFrames + +`func (o *HarEntryResponseContent) HasVideoDroppedFrames() bool` + +HasVideoDroppedFrames returns a boolean if a field has been set. + +### GetVideoTotalFrames + +`func (o *HarEntryResponseContent) GetVideoTotalFrames() int64` + +GetVideoTotalFrames returns the VideoTotalFrames field if non-nil, zero value otherwise. + +### GetVideoTotalFramesOk + +`func (o *HarEntryResponseContent) GetVideoTotalFramesOk() (*int64, bool)` + +GetVideoTotalFramesOk returns a tuple with the VideoTotalFrames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoTotalFrames + +`func (o *HarEntryResponseContent) SetVideoTotalFrames(v int64)` + +SetVideoTotalFrames sets VideoTotalFrames field to given value. + +### HasVideoTotalFrames + +`func (o *HarEntryResponseContent) HasVideoTotalFrames() bool` + +HasVideoTotalFrames returns a boolean if a field has been set. + +### GetVideoAudioBytesDecoded + +`func (o *HarEntryResponseContent) GetVideoAudioBytesDecoded() int64` + +GetVideoAudioBytesDecoded returns the VideoAudioBytesDecoded field if non-nil, zero value otherwise. + +### GetVideoAudioBytesDecodedOk + +`func (o *HarEntryResponseContent) GetVideoAudioBytesDecodedOk() (*int64, bool)` + +GetVideoAudioBytesDecodedOk returns a tuple with the VideoAudioBytesDecoded field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoAudioBytesDecoded + +`func (o *HarEntryResponseContent) SetVideoAudioBytesDecoded(v int64)` + +SetVideoAudioBytesDecoded sets VideoAudioBytesDecoded field to given value. + +### HasVideoAudioBytesDecoded + +`func (o *HarEntryResponseContent) HasVideoAudioBytesDecoded() bool` + +HasVideoAudioBytesDecoded returns a boolean if a field has been set. + +### GetComment + +`func (o *HarEntryResponseContent) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryResponseContent) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryResponseContent) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryResponseContent) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarEntryTimings.md b/clients/go/docs/HarEntryTimings.md new file mode 100644 index 0000000000..6a95603b13 --- /dev/null +++ b/clients/go/docs/HarEntryTimings.md @@ -0,0 +1,203 @@ +# HarEntryTimings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dns** | **int64** | | [default to -1] +**Connect** | **int64** | | [default to -1] +**Blocked** | **int64** | | [default to -1] +**Send** | **int64** | | [default to -1] +**Wait** | **int64** | | [default to -1] +**Receive** | **int64** | | [default to -1] +**Ssl** | **int64** | | [default to -1] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarEntryTimings + +`func NewHarEntryTimings(dns int64, connect int64, blocked int64, send int64, wait int64, receive int64, ssl int64, ) *HarEntryTimings` + +NewHarEntryTimings instantiates a new HarEntryTimings object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarEntryTimingsWithDefaults + +`func NewHarEntryTimingsWithDefaults() *HarEntryTimings` + +NewHarEntryTimingsWithDefaults instantiates a new HarEntryTimings object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDns + +`func (o *HarEntryTimings) GetDns() int64` + +GetDns returns the Dns field if non-nil, zero value otherwise. + +### GetDnsOk + +`func (o *HarEntryTimings) GetDnsOk() (*int64, bool)` + +GetDnsOk returns a tuple with the Dns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDns + +`func (o *HarEntryTimings) SetDns(v int64)` + +SetDns sets Dns field to given value. + + +### GetConnect + +`func (o *HarEntryTimings) GetConnect() int64` + +GetConnect returns the Connect field if non-nil, zero value otherwise. + +### GetConnectOk + +`func (o *HarEntryTimings) GetConnectOk() (*int64, bool)` + +GetConnectOk returns a tuple with the Connect field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnect + +`func (o *HarEntryTimings) SetConnect(v int64)` + +SetConnect sets Connect field to given value. + + +### GetBlocked + +`func (o *HarEntryTimings) GetBlocked() int64` + +GetBlocked returns the Blocked field if non-nil, zero value otherwise. + +### GetBlockedOk + +`func (o *HarEntryTimings) GetBlockedOk() (*int64, bool)` + +GetBlockedOk returns a tuple with the Blocked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlocked + +`func (o *HarEntryTimings) SetBlocked(v int64)` + +SetBlocked sets Blocked field to given value. + + +### GetSend + +`func (o *HarEntryTimings) GetSend() int64` + +GetSend returns the Send field if non-nil, zero value otherwise. + +### GetSendOk + +`func (o *HarEntryTimings) GetSendOk() (*int64, bool)` + +GetSendOk returns a tuple with the Send field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSend + +`func (o *HarEntryTimings) SetSend(v int64)` + +SetSend sets Send field to given value. + + +### GetWait + +`func (o *HarEntryTimings) GetWait() int64` + +GetWait returns the Wait field if non-nil, zero value otherwise. + +### GetWaitOk + +`func (o *HarEntryTimings) GetWaitOk() (*int64, bool)` + +GetWaitOk returns a tuple with the Wait field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWait + +`func (o *HarEntryTimings) SetWait(v int64)` + +SetWait sets Wait field to given value. + + +### GetReceive + +`func (o *HarEntryTimings) GetReceive() int64` + +GetReceive returns the Receive field if non-nil, zero value otherwise. + +### GetReceiveOk + +`func (o *HarEntryTimings) GetReceiveOk() (*int64, bool)` + +GetReceiveOk returns a tuple with the Receive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceive + +`func (o *HarEntryTimings) SetReceive(v int64)` + +SetReceive sets Receive field to given value. + + +### GetSsl + +`func (o *HarEntryTimings) GetSsl() int64` + +GetSsl returns the Ssl field if non-nil, zero value otherwise. + +### GetSslOk + +`func (o *HarEntryTimings) GetSslOk() (*int64, bool)` + +GetSslOk returns a tuple with the Ssl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSsl + +`func (o *HarEntryTimings) SetSsl(v int64)` + +SetSsl sets Ssl field to given value. + + +### GetComment + +`func (o *HarEntryTimings) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarEntryTimings) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarEntryTimings) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarEntryTimings) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarLog.md b/clients/go/docs/HarLog.md new file mode 100644 index 0000000000..f94039bec3 --- /dev/null +++ b/clients/go/docs/HarLog.md @@ -0,0 +1,218 @@ +# HarLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Version** | **string** | | +**Creator** | [**HarLogCreator**](HarLogCreator.md) | | +**Browser** | Pointer to [**HarLogCreator**](HarLogCreator.md) | | [optional] +**Pages** | [**[]Page**](Page.md) | | +**Entries** | [**[]HarEntry**](HarEntry.md) | | +**TraceId** | Pointer to **string** | W3C Trace Context trace ID for distributed tracing | [optional] +**SpanId** | Pointer to **string** | W3C Trace Context span ID for this HAR trace root | [optional] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarLog + +`func NewHarLog(version string, creator HarLogCreator, pages []Page, entries []HarEntry, ) *HarLog` + +NewHarLog instantiates a new HarLog object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarLogWithDefaults + +`func NewHarLogWithDefaults() *HarLog` + +NewHarLogWithDefaults instantiates a new HarLog object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVersion + +`func (o *HarLog) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *HarLog) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *HarLog) SetVersion(v string)` + +SetVersion sets Version field to given value. + + +### GetCreator + +`func (o *HarLog) GetCreator() HarLogCreator` + +GetCreator returns the Creator field if non-nil, zero value otherwise. + +### GetCreatorOk + +`func (o *HarLog) GetCreatorOk() (*HarLogCreator, bool)` + +GetCreatorOk returns a tuple with the Creator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreator + +`func (o *HarLog) SetCreator(v HarLogCreator)` + +SetCreator sets Creator field to given value. + + +### GetBrowser + +`func (o *HarLog) GetBrowser() HarLogCreator` + +GetBrowser returns the Browser field if non-nil, zero value otherwise. + +### GetBrowserOk + +`func (o *HarLog) GetBrowserOk() (*HarLogCreator, bool)` + +GetBrowserOk returns a tuple with the Browser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowser + +`func (o *HarLog) SetBrowser(v HarLogCreator)` + +SetBrowser sets Browser field to given value. + +### HasBrowser + +`func (o *HarLog) HasBrowser() bool` + +HasBrowser returns a boolean if a field has been set. + +### GetPages + +`func (o *HarLog) GetPages() []Page` + +GetPages returns the Pages field if non-nil, zero value otherwise. + +### GetPagesOk + +`func (o *HarLog) GetPagesOk() (*[]Page, bool)` + +GetPagesOk returns a tuple with the Pages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPages + +`func (o *HarLog) SetPages(v []Page)` + +SetPages sets Pages field to given value. + + +### GetEntries + +`func (o *HarLog) GetEntries() []HarEntry` + +GetEntries returns the Entries field if non-nil, zero value otherwise. + +### GetEntriesOk + +`func (o *HarLog) GetEntriesOk() (*[]HarEntry, bool)` + +GetEntriesOk returns a tuple with the Entries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntries + +`func (o *HarLog) SetEntries(v []HarEntry)` + +SetEntries sets Entries field to given value. + + +### GetTraceId + +`func (o *HarLog) GetTraceId() string` + +GetTraceId returns the TraceId field if non-nil, zero value otherwise. + +### GetTraceIdOk + +`func (o *HarLog) GetTraceIdOk() (*string, bool)` + +GetTraceIdOk returns a tuple with the TraceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTraceId + +`func (o *HarLog) SetTraceId(v string)` + +SetTraceId sets TraceId field to given value. + +### HasTraceId + +`func (o *HarLog) HasTraceId() bool` + +HasTraceId returns a boolean if a field has been set. + +### GetSpanId + +`func (o *HarLog) GetSpanId() string` + +GetSpanId returns the SpanId field if non-nil, zero value otherwise. + +### GetSpanIdOk + +`func (o *HarLog) GetSpanIdOk() (*string, bool)` + +GetSpanIdOk returns a tuple with the SpanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpanId + +`func (o *HarLog) SetSpanId(v string)` + +SetSpanId sets SpanId field to given value. + +### HasSpanId + +`func (o *HarLog) HasSpanId() bool` + +HasSpanId returns a boolean if a field has been set. + +### GetComment + +`func (o *HarLog) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarLog) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarLog) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarLog) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/HarLogCreator.md b/clients/go/docs/HarLogCreator.md new file mode 100644 index 0000000000..38b4972a52 --- /dev/null +++ b/clients/go/docs/HarLogCreator.md @@ -0,0 +1,98 @@ +# HarLogCreator + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Version** | **string** | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHarLogCreator + +`func NewHarLogCreator(name string, version string, ) *HarLogCreator` + +NewHarLogCreator instantiates a new HarLogCreator object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHarLogCreatorWithDefaults + +`func NewHarLogCreatorWithDefaults() *HarLogCreator` + +NewHarLogCreatorWithDefaults instantiates a new HarLogCreator object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *HarLogCreator) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *HarLogCreator) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *HarLogCreator) SetName(v string)` + +SetName sets Name field to given value. + + +### GetVersion + +`func (o *HarLogCreator) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *HarLogCreator) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *HarLogCreator) SetVersion(v string)` + +SetVersion sets Version field to given value. + + +### GetComment + +`func (o *HarLogCreator) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *HarLogCreator) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *HarLogCreator) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *HarLogCreator) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/Header.md b/clients/go/docs/Header.md new file mode 100644 index 0000000000..bcdc2da859 --- /dev/null +++ b/clients/go/docs/Header.md @@ -0,0 +1,98 @@ +# Header + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | **string** | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewHeader + +`func NewHeader(name string, value string, ) *Header` + +NewHeader instantiates a new Header object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHeaderWithDefaults + +`func NewHeaderWithDefaults() *Header` + +NewHeaderWithDefaults instantiates a new Header object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Header) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Header) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Header) SetName(v string)` + +SetName sets Name field to given value. + + +### GetValue + +`func (o *Header) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *Header) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *Header) SetValue(v string)` + +SetValue sets Value field to given value. + + +### GetComment + +`func (o *Header) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *Header) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *Header) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *Header) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/LargestContentfulPaint.md b/clients/go/docs/LargestContentfulPaint.md new file mode 100644 index 0000000000..117dd71c86 --- /dev/null +++ b/clients/go/docs/LargestContentfulPaint.md @@ -0,0 +1,134 @@ +# LargestContentfulPaint + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartTime** | Pointer to **int64** | | [optional] [default to -1] +**Size** | Pointer to **int64** | | [optional] [default to -1] +**DomPath** | Pointer to **string** | | [optional] [default to ""] +**Tag** | Pointer to **string** | | [optional] [default to ""] + +## Methods + +### NewLargestContentfulPaint + +`func NewLargestContentfulPaint() *LargestContentfulPaint` + +NewLargestContentfulPaint instantiates a new LargestContentfulPaint object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLargestContentfulPaintWithDefaults + +`func NewLargestContentfulPaintWithDefaults() *LargestContentfulPaint` + +NewLargestContentfulPaintWithDefaults instantiates a new LargestContentfulPaint object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartTime + +`func (o *LargestContentfulPaint) GetStartTime() int64` + +GetStartTime returns the StartTime field if non-nil, zero value otherwise. + +### GetStartTimeOk + +`func (o *LargestContentfulPaint) GetStartTimeOk() (*int64, bool)` + +GetStartTimeOk returns a tuple with the StartTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartTime + +`func (o *LargestContentfulPaint) SetStartTime(v int64)` + +SetStartTime sets StartTime field to given value. + +### HasStartTime + +`func (o *LargestContentfulPaint) HasStartTime() bool` + +HasStartTime returns a boolean if a field has been set. + +### GetSize + +`func (o *LargestContentfulPaint) GetSize() int64` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *LargestContentfulPaint) GetSizeOk() (*int64, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *LargestContentfulPaint) SetSize(v int64)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *LargestContentfulPaint) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetDomPath + +`func (o *LargestContentfulPaint) GetDomPath() string` + +GetDomPath returns the DomPath field if non-nil, zero value otherwise. + +### GetDomPathOk + +`func (o *LargestContentfulPaint) GetDomPathOk() (*string, bool)` + +GetDomPathOk returns a tuple with the DomPath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDomPath + +`func (o *LargestContentfulPaint) SetDomPath(v string)` + +SetDomPath sets DomPath field to given value. + +### HasDomPath + +`func (o *LargestContentfulPaint) HasDomPath() bool` + +HasDomPath returns a boolean if a field has been set. + +### GetTag + +`func (o *LargestContentfulPaint) GetTag() string` + +GetTag returns the Tag field if non-nil, zero value otherwise. + +### GetTagOk + +`func (o *LargestContentfulPaint) GetTagOk() (*string, bool)` + +GetTagOk returns a tuple with the Tag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTag + +`func (o *LargestContentfulPaint) SetTag(v string)` + +SetTag sets Tag field to given value. + +### HasTag + +`func (o *LargestContentfulPaint) HasTag() bool` + +HasTag returns a boolean if a field has been set. + + +[[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/clients/go/docs/MatchCriteria.md b/clients/go/docs/MatchCriteria.md new file mode 100644 index 0000000000..f1f9db997b --- /dev/null +++ b/clients/go/docs/MatchCriteria.md @@ -0,0 +1,394 @@ +# MatchCriteria + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | Pointer to **string** | Request URL regexp to match | [optional] +**Page** | Pointer to **string** | current|all | [optional] +**Status** | Pointer to **string** | HTTP Status code to match. | [optional] +**Content** | Pointer to **string** | Body content regexp content to match | [optional] +**ContentType** | Pointer to **string** | Content type | [optional] +**WebsocketMessage** | Pointer to **string** | Websocket message text to match | [optional] +**RequestHeader** | Pointer to [**NameValuePair**](NameValuePair.md) | | [optional] +**RequestCookie** | Pointer to [**NameValuePair**](NameValuePair.md) | | [optional] +**ResponseHeader** | Pointer to [**NameValuePair**](NameValuePair.md) | | [optional] +**ResponseCookie** | Pointer to [**NameValuePair**](NameValuePair.md) | | [optional] +**JsonValid** | Pointer to **bool** | Is valid JSON | [optional] +**JsonPath** | Pointer to **string** | Has JSON path | [optional] +**JsonSchema** | Pointer to **string** | Validates against passed JSON schema | [optional] +**ErrorIfNoTraffic** | Pointer to **bool** | If the proxy has NO traffic at all, return error | [optional] [default to true] + +## Methods + +### NewMatchCriteria + +`func NewMatchCriteria() *MatchCriteria` + +NewMatchCriteria instantiates a new MatchCriteria object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMatchCriteriaWithDefaults + +`func NewMatchCriteriaWithDefaults() *MatchCriteria` + +NewMatchCriteriaWithDefaults instantiates a new MatchCriteria object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUrl + +`func (o *MatchCriteria) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *MatchCriteria) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *MatchCriteria) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *MatchCriteria) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetPage + +`func (o *MatchCriteria) GetPage() string` + +GetPage returns the Page field if non-nil, zero value otherwise. + +### GetPageOk + +`func (o *MatchCriteria) GetPageOk() (*string, bool)` + +GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPage + +`func (o *MatchCriteria) SetPage(v string)` + +SetPage sets Page field to given value. + +### HasPage + +`func (o *MatchCriteria) HasPage() bool` + +HasPage returns a boolean if a field has been set. + +### GetStatus + +`func (o *MatchCriteria) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *MatchCriteria) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *MatchCriteria) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *MatchCriteria) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetContent + +`func (o *MatchCriteria) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *MatchCriteria) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *MatchCriteria) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *MatchCriteria) HasContent() bool` + +HasContent returns a boolean if a field has been set. + +### GetContentType + +`func (o *MatchCriteria) GetContentType() string` + +GetContentType returns the ContentType field if non-nil, zero value otherwise. + +### GetContentTypeOk + +`func (o *MatchCriteria) GetContentTypeOk() (*string, bool)` + +GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContentType + +`func (o *MatchCriteria) SetContentType(v string)` + +SetContentType sets ContentType field to given value. + +### HasContentType + +`func (o *MatchCriteria) HasContentType() bool` + +HasContentType returns a boolean if a field has been set. + +### GetWebsocketMessage + +`func (o *MatchCriteria) GetWebsocketMessage() string` + +GetWebsocketMessage returns the WebsocketMessage field if non-nil, zero value otherwise. + +### GetWebsocketMessageOk + +`func (o *MatchCriteria) GetWebsocketMessageOk() (*string, bool)` + +GetWebsocketMessageOk returns a tuple with the WebsocketMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebsocketMessage + +`func (o *MatchCriteria) SetWebsocketMessage(v string)` + +SetWebsocketMessage sets WebsocketMessage field to given value. + +### HasWebsocketMessage + +`func (o *MatchCriteria) HasWebsocketMessage() bool` + +HasWebsocketMessage returns a boolean if a field has been set. + +### GetRequestHeader + +`func (o *MatchCriteria) GetRequestHeader() NameValuePair` + +GetRequestHeader returns the RequestHeader field if non-nil, zero value otherwise. + +### GetRequestHeaderOk + +`func (o *MatchCriteria) GetRequestHeaderOk() (*NameValuePair, bool)` + +GetRequestHeaderOk returns a tuple with the RequestHeader field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestHeader + +`func (o *MatchCriteria) SetRequestHeader(v NameValuePair)` + +SetRequestHeader sets RequestHeader field to given value. + +### HasRequestHeader + +`func (o *MatchCriteria) HasRequestHeader() bool` + +HasRequestHeader returns a boolean if a field has been set. + +### GetRequestCookie + +`func (o *MatchCriteria) GetRequestCookie() NameValuePair` + +GetRequestCookie returns the RequestCookie field if non-nil, zero value otherwise. + +### GetRequestCookieOk + +`func (o *MatchCriteria) GetRequestCookieOk() (*NameValuePair, bool)` + +GetRequestCookieOk returns a tuple with the RequestCookie field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestCookie + +`func (o *MatchCriteria) SetRequestCookie(v NameValuePair)` + +SetRequestCookie sets RequestCookie field to given value. + +### HasRequestCookie + +`func (o *MatchCriteria) HasRequestCookie() bool` + +HasRequestCookie returns a boolean if a field has been set. + +### GetResponseHeader + +`func (o *MatchCriteria) GetResponseHeader() NameValuePair` + +GetResponseHeader returns the ResponseHeader field if non-nil, zero value otherwise. + +### GetResponseHeaderOk + +`func (o *MatchCriteria) GetResponseHeaderOk() (*NameValuePair, bool)` + +GetResponseHeaderOk returns a tuple with the ResponseHeader field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseHeader + +`func (o *MatchCriteria) SetResponseHeader(v NameValuePair)` + +SetResponseHeader sets ResponseHeader field to given value. + +### HasResponseHeader + +`func (o *MatchCriteria) HasResponseHeader() bool` + +HasResponseHeader returns a boolean if a field has been set. + +### GetResponseCookie + +`func (o *MatchCriteria) GetResponseCookie() NameValuePair` + +GetResponseCookie returns the ResponseCookie field if non-nil, zero value otherwise. + +### GetResponseCookieOk + +`func (o *MatchCriteria) GetResponseCookieOk() (*NameValuePair, bool)` + +GetResponseCookieOk returns a tuple with the ResponseCookie field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseCookie + +`func (o *MatchCriteria) SetResponseCookie(v NameValuePair)` + +SetResponseCookie sets ResponseCookie field to given value. + +### HasResponseCookie + +`func (o *MatchCriteria) HasResponseCookie() bool` + +HasResponseCookie returns a boolean if a field has been set. + +### GetJsonValid + +`func (o *MatchCriteria) GetJsonValid() bool` + +GetJsonValid returns the JsonValid field if non-nil, zero value otherwise. + +### GetJsonValidOk + +`func (o *MatchCriteria) GetJsonValidOk() (*bool, bool)` + +GetJsonValidOk returns a tuple with the JsonValid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJsonValid + +`func (o *MatchCriteria) SetJsonValid(v bool)` + +SetJsonValid sets JsonValid field to given value. + +### HasJsonValid + +`func (o *MatchCriteria) HasJsonValid() bool` + +HasJsonValid returns a boolean if a field has been set. + +### GetJsonPath + +`func (o *MatchCriteria) GetJsonPath() string` + +GetJsonPath returns the JsonPath field if non-nil, zero value otherwise. + +### GetJsonPathOk + +`func (o *MatchCriteria) GetJsonPathOk() (*string, bool)` + +GetJsonPathOk returns a tuple with the JsonPath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJsonPath + +`func (o *MatchCriteria) SetJsonPath(v string)` + +SetJsonPath sets JsonPath field to given value. + +### HasJsonPath + +`func (o *MatchCriteria) HasJsonPath() bool` + +HasJsonPath returns a boolean if a field has been set. + +### GetJsonSchema + +`func (o *MatchCriteria) GetJsonSchema() string` + +GetJsonSchema returns the JsonSchema field if non-nil, zero value otherwise. + +### GetJsonSchemaOk + +`func (o *MatchCriteria) GetJsonSchemaOk() (*string, bool)` + +GetJsonSchemaOk returns a tuple with the JsonSchema field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJsonSchema + +`func (o *MatchCriteria) SetJsonSchema(v string)` + +SetJsonSchema sets JsonSchema field to given value. + +### HasJsonSchema + +`func (o *MatchCriteria) HasJsonSchema() bool` + +HasJsonSchema returns a boolean if a field has been set. + +### GetErrorIfNoTraffic + +`func (o *MatchCriteria) GetErrorIfNoTraffic() bool` + +GetErrorIfNoTraffic returns the ErrorIfNoTraffic field if non-nil, zero value otherwise. + +### GetErrorIfNoTrafficOk + +`func (o *MatchCriteria) GetErrorIfNoTrafficOk() (*bool, bool)` + +GetErrorIfNoTrafficOk returns a tuple with the ErrorIfNoTraffic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorIfNoTraffic + +`func (o *MatchCriteria) SetErrorIfNoTraffic(v bool)` + +SetErrorIfNoTraffic sets ErrorIfNoTraffic field to given value. + +### HasErrorIfNoTraffic + +`func (o *MatchCriteria) HasErrorIfNoTraffic() bool` + +HasErrorIfNoTraffic returns a boolean if a field has been set. + + +[[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/clients/go/docs/Metric.md b/clients/go/docs/Metric.md new file mode 100644 index 0000000000..bae89bca3b --- /dev/null +++ b/clients/go/docs/Metric.md @@ -0,0 +1,82 @@ +# Metric + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Name of Custom Metric to add to the page under _metrics | [optional] +**Value** | Pointer to **int32** | Value for the metric | [optional] + +## Methods + +### NewMetric + +`func NewMetric() *Metric` + +NewMetric instantiates a new Metric object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetricWithDefaults + +`func NewMetricWithDefaults() *Metric` + +NewMetricWithDefaults instantiates a new Metric object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Metric) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Metric) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Metric) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Metric) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetValue + +`func (o *Metric) GetValue() int32` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *Metric) GetValueOk() (*int32, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *Metric) SetValue(v int32)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *Metric) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[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/clients/go/docs/NameValuePair.md b/clients/go/docs/NameValuePair.md new file mode 100644 index 0000000000..3d1066067f --- /dev/null +++ b/clients/go/docs/NameValuePair.md @@ -0,0 +1,82 @@ +# NameValuePair + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Name to match | [optional] +**Value** | Pointer to **string** | Value to match | [optional] + +## Methods + +### NewNameValuePair + +`func NewNameValuePair() *NameValuePair` + +NewNameValuePair instantiates a new NameValuePair object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNameValuePairWithDefaults + +`func NewNameValuePairWithDefaults() *NameValuePair` + +NewNameValuePairWithDefaults instantiates a new NameValuePair object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *NameValuePair) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *NameValuePair) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *NameValuePair) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *NameValuePair) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetValue + +`func (o *NameValuePair) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *NameValuePair) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *NameValuePair) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *NameValuePair) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[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/clients/go/docs/Page.md b/clients/go/docs/Page.md new file mode 100644 index 0000000000..1b0267599c --- /dev/null +++ b/clients/go/docs/Page.md @@ -0,0 +1,270 @@ +# Page + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartedDateTime** | **time.Time** | | +**Id** | **string** | | +**Title** | **string** | | +**Verifications** | Pointer to [**[]VerifyResult**](VerifyResult.md) | | [optional] [default to []] +**Metrics** | Pointer to [**[]Metric**](Metric.md) | | [optional] [default to []] +**Errors** | Pointer to [**[]Error**](Error.md) | | [optional] [default to []] +**SpanId** | Pointer to **string** | W3C Trace Context span ID for this page | [optional] +**ParentId** | Pointer to **string** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] +**PageTimings** | [**PageTimings**](PageTimings.md) | | +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewPage + +`func NewPage(startedDateTime time.Time, id string, title string, pageTimings PageTimings, ) *Page` + +NewPage instantiates a new Page object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPageWithDefaults + +`func NewPageWithDefaults() *Page` + +NewPageWithDefaults instantiates a new Page object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartedDateTime + +`func (o *Page) GetStartedDateTime() time.Time` + +GetStartedDateTime returns the StartedDateTime field if non-nil, zero value otherwise. + +### GetStartedDateTimeOk + +`func (o *Page) GetStartedDateTimeOk() (*time.Time, bool)` + +GetStartedDateTimeOk returns a tuple with the StartedDateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedDateTime + +`func (o *Page) SetStartedDateTime(v time.Time)` + +SetStartedDateTime sets StartedDateTime field to given value. + + +### GetId + +`func (o *Page) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Page) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Page) SetId(v string)` + +SetId sets Id field to given value. + + +### GetTitle + +`func (o *Page) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *Page) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *Page) SetTitle(v string)` + +SetTitle sets Title field to given value. + + +### GetVerifications + +`func (o *Page) GetVerifications() []VerifyResult` + +GetVerifications returns the Verifications field if non-nil, zero value otherwise. + +### GetVerificationsOk + +`func (o *Page) GetVerificationsOk() (*[]VerifyResult, bool)` + +GetVerificationsOk returns a tuple with the Verifications field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVerifications + +`func (o *Page) SetVerifications(v []VerifyResult)` + +SetVerifications sets Verifications field to given value. + +### HasVerifications + +`func (o *Page) HasVerifications() bool` + +HasVerifications returns a boolean if a field has been set. + +### GetMetrics + +`func (o *Page) GetMetrics() []Metric` + +GetMetrics returns the Metrics field if non-nil, zero value otherwise. + +### GetMetricsOk + +`func (o *Page) GetMetricsOk() (*[]Metric, bool)` + +GetMetricsOk returns a tuple with the Metrics field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetrics + +`func (o *Page) SetMetrics(v []Metric)` + +SetMetrics sets Metrics field to given value. + +### HasMetrics + +`func (o *Page) HasMetrics() bool` + +HasMetrics returns a boolean if a field has been set. + +### GetErrors + +`func (o *Page) GetErrors() []Error` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *Page) GetErrorsOk() (*[]Error, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *Page) SetErrors(v []Error)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *Page) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### GetSpanId + +`func (o *Page) GetSpanId() string` + +GetSpanId returns the SpanId field if non-nil, zero value otherwise. + +### GetSpanIdOk + +`func (o *Page) GetSpanIdOk() (*string, bool)` + +GetSpanIdOk returns a tuple with the SpanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpanId + +`func (o *Page) SetSpanId(v string)` + +SetSpanId sets SpanId field to given value. + +### HasSpanId + +`func (o *Page) HasSpanId() bool` + +HasSpanId returns a boolean if a field has been set. + +### GetParentId + +`func (o *Page) GetParentId() string` + +GetParentId returns the ParentId field if non-nil, zero value otherwise. + +### GetParentIdOk + +`func (o *Page) GetParentIdOk() (*string, bool)` + +GetParentIdOk returns a tuple with the ParentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentId + +`func (o *Page) SetParentId(v string)` + +SetParentId sets ParentId field to given value. + +### HasParentId + +`func (o *Page) HasParentId() bool` + +HasParentId returns a boolean if a field has been set. + +### GetPageTimings + +`func (o *Page) GetPageTimings() PageTimings` + +GetPageTimings returns the PageTimings field if non-nil, zero value otherwise. + +### GetPageTimingsOk + +`func (o *Page) GetPageTimingsOk() (*PageTimings, bool)` + +GetPageTimingsOk returns a tuple with the PageTimings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageTimings + +`func (o *Page) SetPageTimings(v PageTimings)` + +SetPageTimings sets PageTimings field to given value. + + +### GetComment + +`func (o *Page) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *Page) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *Page) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *Page) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/PageTiming.md b/clients/go/docs/PageTiming.md new file mode 100644 index 0000000000..29ede075aa --- /dev/null +++ b/clients/go/docs/PageTiming.md @@ -0,0 +1,394 @@ +# PageTiming + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OnContentLoad** | Pointer to **int32** | onContentLoad per the browser | [optional] +**OnLoad** | Pointer to **int32** | onLoad per the browser | [optional] +**FirstInputDelay** | Pointer to **int32** | firstInputDelay from the browser | [optional] +**FirstPaint** | Pointer to **int32** | firstPaint from the browser | [optional] +**CumulativeLayoutShift** | Pointer to **int32** | cumulativeLayoutShift metric from the browser | [optional] +**LargestContentfulPaint** | Pointer to **int32** | largestContentfulPaint from the browser | [optional] +**DomInteractive** | Pointer to **int32** | domInteractive from the browser | [optional] +**FirstContentfulPaint** | Pointer to **int32** | firstContentfulPaint from the browser | [optional] +**Dns** | Pointer to **int32** | dns lookup time from the browser | [optional] +**Ssl** | Pointer to **int32** | Ssl connect time from the browser | [optional] +**TimeToFirstByte** | Pointer to **int32** | Time to first byte of the page's first request per the browser | [optional] +**Href** | Pointer to **string** | Top level href, including hashtag, etc per the browser | [optional] +**SpanId** | Pointer to **string** | W3C Trace Context span ID for this page | [optional] +**ParentId** | Pointer to **string** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] + +## Methods + +### NewPageTiming + +`func NewPageTiming() *PageTiming` + +NewPageTiming instantiates a new PageTiming object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPageTimingWithDefaults + +`func NewPageTimingWithDefaults() *PageTiming` + +NewPageTimingWithDefaults instantiates a new PageTiming object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOnContentLoad + +`func (o *PageTiming) GetOnContentLoad() int32` + +GetOnContentLoad returns the OnContentLoad field if non-nil, zero value otherwise. + +### GetOnContentLoadOk + +`func (o *PageTiming) GetOnContentLoadOk() (*int32, bool)` + +GetOnContentLoadOk returns a tuple with the OnContentLoad field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnContentLoad + +`func (o *PageTiming) SetOnContentLoad(v int32)` + +SetOnContentLoad sets OnContentLoad field to given value. + +### HasOnContentLoad + +`func (o *PageTiming) HasOnContentLoad() bool` + +HasOnContentLoad returns a boolean if a field has been set. + +### GetOnLoad + +`func (o *PageTiming) GetOnLoad() int32` + +GetOnLoad returns the OnLoad field if non-nil, zero value otherwise. + +### GetOnLoadOk + +`func (o *PageTiming) GetOnLoadOk() (*int32, bool)` + +GetOnLoadOk returns a tuple with the OnLoad field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnLoad + +`func (o *PageTiming) SetOnLoad(v int32)` + +SetOnLoad sets OnLoad field to given value. + +### HasOnLoad + +`func (o *PageTiming) HasOnLoad() bool` + +HasOnLoad returns a boolean if a field has been set. + +### GetFirstInputDelay + +`func (o *PageTiming) GetFirstInputDelay() int32` + +GetFirstInputDelay returns the FirstInputDelay field if non-nil, zero value otherwise. + +### GetFirstInputDelayOk + +`func (o *PageTiming) GetFirstInputDelayOk() (*int32, bool)` + +GetFirstInputDelayOk returns a tuple with the FirstInputDelay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstInputDelay + +`func (o *PageTiming) SetFirstInputDelay(v int32)` + +SetFirstInputDelay sets FirstInputDelay field to given value. + +### HasFirstInputDelay + +`func (o *PageTiming) HasFirstInputDelay() bool` + +HasFirstInputDelay returns a boolean if a field has been set. + +### GetFirstPaint + +`func (o *PageTiming) GetFirstPaint() int32` + +GetFirstPaint returns the FirstPaint field if non-nil, zero value otherwise. + +### GetFirstPaintOk + +`func (o *PageTiming) GetFirstPaintOk() (*int32, bool)` + +GetFirstPaintOk returns a tuple with the FirstPaint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstPaint + +`func (o *PageTiming) SetFirstPaint(v int32)` + +SetFirstPaint sets FirstPaint field to given value. + +### HasFirstPaint + +`func (o *PageTiming) HasFirstPaint() bool` + +HasFirstPaint returns a boolean if a field has been set. + +### GetCumulativeLayoutShift + +`func (o *PageTiming) GetCumulativeLayoutShift() int32` + +GetCumulativeLayoutShift returns the CumulativeLayoutShift field if non-nil, zero value otherwise. + +### GetCumulativeLayoutShiftOk + +`func (o *PageTiming) GetCumulativeLayoutShiftOk() (*int32, bool)` + +GetCumulativeLayoutShiftOk returns a tuple with the CumulativeLayoutShift field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCumulativeLayoutShift + +`func (o *PageTiming) SetCumulativeLayoutShift(v int32)` + +SetCumulativeLayoutShift sets CumulativeLayoutShift field to given value. + +### HasCumulativeLayoutShift + +`func (o *PageTiming) HasCumulativeLayoutShift() bool` + +HasCumulativeLayoutShift returns a boolean if a field has been set. + +### GetLargestContentfulPaint + +`func (o *PageTiming) GetLargestContentfulPaint() int32` + +GetLargestContentfulPaint returns the LargestContentfulPaint field if non-nil, zero value otherwise. + +### GetLargestContentfulPaintOk + +`func (o *PageTiming) GetLargestContentfulPaintOk() (*int32, bool)` + +GetLargestContentfulPaintOk returns a tuple with the LargestContentfulPaint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLargestContentfulPaint + +`func (o *PageTiming) SetLargestContentfulPaint(v int32)` + +SetLargestContentfulPaint sets LargestContentfulPaint field to given value. + +### HasLargestContentfulPaint + +`func (o *PageTiming) HasLargestContentfulPaint() bool` + +HasLargestContentfulPaint returns a boolean if a field has been set. + +### GetDomInteractive + +`func (o *PageTiming) GetDomInteractive() int32` + +GetDomInteractive returns the DomInteractive field if non-nil, zero value otherwise. + +### GetDomInteractiveOk + +`func (o *PageTiming) GetDomInteractiveOk() (*int32, bool)` + +GetDomInteractiveOk returns a tuple with the DomInteractive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDomInteractive + +`func (o *PageTiming) SetDomInteractive(v int32)` + +SetDomInteractive sets DomInteractive field to given value. + +### HasDomInteractive + +`func (o *PageTiming) HasDomInteractive() bool` + +HasDomInteractive returns a boolean if a field has been set. + +### GetFirstContentfulPaint + +`func (o *PageTiming) GetFirstContentfulPaint() int32` + +GetFirstContentfulPaint returns the FirstContentfulPaint field if non-nil, zero value otherwise. + +### GetFirstContentfulPaintOk + +`func (o *PageTiming) GetFirstContentfulPaintOk() (*int32, bool)` + +GetFirstContentfulPaintOk returns a tuple with the FirstContentfulPaint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstContentfulPaint + +`func (o *PageTiming) SetFirstContentfulPaint(v int32)` + +SetFirstContentfulPaint sets FirstContentfulPaint field to given value. + +### HasFirstContentfulPaint + +`func (o *PageTiming) HasFirstContentfulPaint() bool` + +HasFirstContentfulPaint returns a boolean if a field has been set. + +### GetDns + +`func (o *PageTiming) GetDns() int32` + +GetDns returns the Dns field if non-nil, zero value otherwise. + +### GetDnsOk + +`func (o *PageTiming) GetDnsOk() (*int32, bool)` + +GetDnsOk returns a tuple with the Dns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDns + +`func (o *PageTiming) SetDns(v int32)` + +SetDns sets Dns field to given value. + +### HasDns + +`func (o *PageTiming) HasDns() bool` + +HasDns returns a boolean if a field has been set. + +### GetSsl + +`func (o *PageTiming) GetSsl() int32` + +GetSsl returns the Ssl field if non-nil, zero value otherwise. + +### GetSslOk + +`func (o *PageTiming) GetSslOk() (*int32, bool)` + +GetSslOk returns a tuple with the Ssl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSsl + +`func (o *PageTiming) SetSsl(v int32)` + +SetSsl sets Ssl field to given value. + +### HasSsl + +`func (o *PageTiming) HasSsl() bool` + +HasSsl returns a boolean if a field has been set. + +### GetTimeToFirstByte + +`func (o *PageTiming) GetTimeToFirstByte() int32` + +GetTimeToFirstByte returns the TimeToFirstByte field if non-nil, zero value otherwise. + +### GetTimeToFirstByteOk + +`func (o *PageTiming) GetTimeToFirstByteOk() (*int32, bool)` + +GetTimeToFirstByteOk returns a tuple with the TimeToFirstByte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeToFirstByte + +`func (o *PageTiming) SetTimeToFirstByte(v int32)` + +SetTimeToFirstByte sets TimeToFirstByte field to given value. + +### HasTimeToFirstByte + +`func (o *PageTiming) HasTimeToFirstByte() bool` + +HasTimeToFirstByte returns a boolean if a field has been set. + +### GetHref + +`func (o *PageTiming) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *PageTiming) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *PageTiming) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *PageTiming) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetSpanId + +`func (o *PageTiming) GetSpanId() string` + +GetSpanId returns the SpanId field if non-nil, zero value otherwise. + +### GetSpanIdOk + +`func (o *PageTiming) GetSpanIdOk() (*string, bool)` + +GetSpanIdOk returns a tuple with the SpanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpanId + +`func (o *PageTiming) SetSpanId(v string)` + +SetSpanId sets SpanId field to given value. + +### HasSpanId + +`func (o *PageTiming) HasSpanId() bool` + +HasSpanId returns a boolean if a field has been set. + +### GetParentId + +`func (o *PageTiming) GetParentId() string` + +GetParentId returns the ParentId field if non-nil, zero value otherwise. + +### GetParentIdOk + +`func (o *PageTiming) GetParentIdOk() (*string, bool)` + +GetParentIdOk returns a tuple with the ParentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentId + +`func (o *PageTiming) SetParentId(v string)` + +SetParentId sets ParentId field to given value. + +### HasParentId + +`func (o *PageTiming) HasParentId() bool` + +HasParentId returns a boolean if a field has been set. + + +[[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/clients/go/docs/PageTimings.md b/clients/go/docs/PageTimings.md new file mode 100644 index 0000000000..1e67b7fb92 --- /dev/null +++ b/clients/go/docs/PageTimings.md @@ -0,0 +1,358 @@ +# PageTimings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OnContentLoad** | **int64** | | [default to -1] +**OnLoad** | **int64** | | [default to -1] +**Href** | Pointer to **string** | | [optional] [default to ""] +**Dns** | Pointer to **int64** | | [optional] [default to -1] +**Ssl** | Pointer to **int64** | | [optional] [default to -1] +**TimeToFirstByte** | Pointer to **int64** | | [optional] [default to -1] +**CumulativeLayoutShift** | Pointer to **float32** | | [optional] [default to -1] +**LargestContentfulPaint** | Pointer to [**LargestContentfulPaint**](LargestContentfulPaint.md) | | [optional] +**FirstPaint** | Pointer to **int64** | | [optional] [default to -1] +**FirstInputDelay** | Pointer to **float32** | | [optional] [default to -1] +**DomInteractive** | Pointer to **int64** | | [optional] [default to -1] +**FirstContentfulPaint** | Pointer to **int64** | | [optional] [default to -1] +**Comment** | Pointer to **string** | | [optional] + +## Methods + +### NewPageTimings + +`func NewPageTimings(onContentLoad int64, onLoad int64, ) *PageTimings` + +NewPageTimings instantiates a new PageTimings object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPageTimingsWithDefaults + +`func NewPageTimingsWithDefaults() *PageTimings` + +NewPageTimingsWithDefaults instantiates a new PageTimings object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOnContentLoad + +`func (o *PageTimings) GetOnContentLoad() int64` + +GetOnContentLoad returns the OnContentLoad field if non-nil, zero value otherwise. + +### GetOnContentLoadOk + +`func (o *PageTimings) GetOnContentLoadOk() (*int64, bool)` + +GetOnContentLoadOk returns a tuple with the OnContentLoad field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnContentLoad + +`func (o *PageTimings) SetOnContentLoad(v int64)` + +SetOnContentLoad sets OnContentLoad field to given value. + + +### GetOnLoad + +`func (o *PageTimings) GetOnLoad() int64` + +GetOnLoad returns the OnLoad field if non-nil, zero value otherwise. + +### GetOnLoadOk + +`func (o *PageTimings) GetOnLoadOk() (*int64, bool)` + +GetOnLoadOk returns a tuple with the OnLoad field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnLoad + +`func (o *PageTimings) SetOnLoad(v int64)` + +SetOnLoad sets OnLoad field to given value. + + +### GetHref + +`func (o *PageTimings) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *PageTimings) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *PageTimings) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *PageTimings) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetDns + +`func (o *PageTimings) GetDns() int64` + +GetDns returns the Dns field if non-nil, zero value otherwise. + +### GetDnsOk + +`func (o *PageTimings) GetDnsOk() (*int64, bool)` + +GetDnsOk returns a tuple with the Dns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDns + +`func (o *PageTimings) SetDns(v int64)` + +SetDns sets Dns field to given value. + +### HasDns + +`func (o *PageTimings) HasDns() bool` + +HasDns returns a boolean if a field has been set. + +### GetSsl + +`func (o *PageTimings) GetSsl() int64` + +GetSsl returns the Ssl field if non-nil, zero value otherwise. + +### GetSslOk + +`func (o *PageTimings) GetSslOk() (*int64, bool)` + +GetSslOk returns a tuple with the Ssl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSsl + +`func (o *PageTimings) SetSsl(v int64)` + +SetSsl sets Ssl field to given value. + +### HasSsl + +`func (o *PageTimings) HasSsl() bool` + +HasSsl returns a boolean if a field has been set. + +### GetTimeToFirstByte + +`func (o *PageTimings) GetTimeToFirstByte() int64` + +GetTimeToFirstByte returns the TimeToFirstByte field if non-nil, zero value otherwise. + +### GetTimeToFirstByteOk + +`func (o *PageTimings) GetTimeToFirstByteOk() (*int64, bool)` + +GetTimeToFirstByteOk returns a tuple with the TimeToFirstByte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeToFirstByte + +`func (o *PageTimings) SetTimeToFirstByte(v int64)` + +SetTimeToFirstByte sets TimeToFirstByte field to given value. + +### HasTimeToFirstByte + +`func (o *PageTimings) HasTimeToFirstByte() bool` + +HasTimeToFirstByte returns a boolean if a field has been set. + +### GetCumulativeLayoutShift + +`func (o *PageTimings) GetCumulativeLayoutShift() float32` + +GetCumulativeLayoutShift returns the CumulativeLayoutShift field if non-nil, zero value otherwise. + +### GetCumulativeLayoutShiftOk + +`func (o *PageTimings) GetCumulativeLayoutShiftOk() (*float32, bool)` + +GetCumulativeLayoutShiftOk returns a tuple with the CumulativeLayoutShift field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCumulativeLayoutShift + +`func (o *PageTimings) SetCumulativeLayoutShift(v float32)` + +SetCumulativeLayoutShift sets CumulativeLayoutShift field to given value. + +### HasCumulativeLayoutShift + +`func (o *PageTimings) HasCumulativeLayoutShift() bool` + +HasCumulativeLayoutShift returns a boolean if a field has been set. + +### GetLargestContentfulPaint + +`func (o *PageTimings) GetLargestContentfulPaint() LargestContentfulPaint` + +GetLargestContentfulPaint returns the LargestContentfulPaint field if non-nil, zero value otherwise. + +### GetLargestContentfulPaintOk + +`func (o *PageTimings) GetLargestContentfulPaintOk() (*LargestContentfulPaint, bool)` + +GetLargestContentfulPaintOk returns a tuple with the LargestContentfulPaint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLargestContentfulPaint + +`func (o *PageTimings) SetLargestContentfulPaint(v LargestContentfulPaint)` + +SetLargestContentfulPaint sets LargestContentfulPaint field to given value. + +### HasLargestContentfulPaint + +`func (o *PageTimings) HasLargestContentfulPaint() bool` + +HasLargestContentfulPaint returns a boolean if a field has been set. + +### GetFirstPaint + +`func (o *PageTimings) GetFirstPaint() int64` + +GetFirstPaint returns the FirstPaint field if non-nil, zero value otherwise. + +### GetFirstPaintOk + +`func (o *PageTimings) GetFirstPaintOk() (*int64, bool)` + +GetFirstPaintOk returns a tuple with the FirstPaint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstPaint + +`func (o *PageTimings) SetFirstPaint(v int64)` + +SetFirstPaint sets FirstPaint field to given value. + +### HasFirstPaint + +`func (o *PageTimings) HasFirstPaint() bool` + +HasFirstPaint returns a boolean if a field has been set. + +### GetFirstInputDelay + +`func (o *PageTimings) GetFirstInputDelay() float32` + +GetFirstInputDelay returns the FirstInputDelay field if non-nil, zero value otherwise. + +### GetFirstInputDelayOk + +`func (o *PageTimings) GetFirstInputDelayOk() (*float32, bool)` + +GetFirstInputDelayOk returns a tuple with the FirstInputDelay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstInputDelay + +`func (o *PageTimings) SetFirstInputDelay(v float32)` + +SetFirstInputDelay sets FirstInputDelay field to given value. + +### HasFirstInputDelay + +`func (o *PageTimings) HasFirstInputDelay() bool` + +HasFirstInputDelay returns a boolean if a field has been set. + +### GetDomInteractive + +`func (o *PageTimings) GetDomInteractive() int64` + +GetDomInteractive returns the DomInteractive field if non-nil, zero value otherwise. + +### GetDomInteractiveOk + +`func (o *PageTimings) GetDomInteractiveOk() (*int64, bool)` + +GetDomInteractiveOk returns a tuple with the DomInteractive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDomInteractive + +`func (o *PageTimings) SetDomInteractive(v int64)` + +SetDomInteractive sets DomInteractive field to given value. + +### HasDomInteractive + +`func (o *PageTimings) HasDomInteractive() bool` + +HasDomInteractive returns a boolean if a field has been set. + +### GetFirstContentfulPaint + +`func (o *PageTimings) GetFirstContentfulPaint() int64` + +GetFirstContentfulPaint returns the FirstContentfulPaint field if non-nil, zero value otherwise. + +### GetFirstContentfulPaintOk + +`func (o *PageTimings) GetFirstContentfulPaintOk() (*int64, bool)` + +GetFirstContentfulPaintOk returns a tuple with the FirstContentfulPaint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstContentfulPaint + +`func (o *PageTimings) SetFirstContentfulPaint(v int64)` + +SetFirstContentfulPaint sets FirstContentfulPaint field to given value. + +### HasFirstContentfulPaint + +`func (o *PageTimings) HasFirstContentfulPaint() bool` + +HasFirstContentfulPaint returns a boolean if a field has been set. + +### GetComment + +`func (o *PageTimings) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *PageTimings) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *PageTimings) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *PageTimings) HasComment() bool` + +HasComment returns a boolean if a field has been set. + + +[[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/clients/go/docs/VerifyResult.md b/clients/go/docs/VerifyResult.md new file mode 100644 index 0000000000..dd0f2cf3e2 --- /dev/null +++ b/clients/go/docs/VerifyResult.md @@ -0,0 +1,108 @@ +# VerifyResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to **bool** | Result True / False | [optional] +**Name** | Pointer to **string** | Name | [optional] +**Type** | Pointer to **string** | Type | [optional] + +## Methods + +### NewVerifyResult + +`func NewVerifyResult() *VerifyResult` + +NewVerifyResult instantiates a new VerifyResult object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVerifyResultWithDefaults + +`func NewVerifyResultWithDefaults() *VerifyResult` + +NewVerifyResultWithDefaults instantiates a new VerifyResult object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetResult + +`func (o *VerifyResult) GetResult() bool` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *VerifyResult) GetResultOk() (*bool, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *VerifyResult) SetResult(v bool)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *VerifyResult) HasResult() bool` + +HasResult returns a boolean if a field has been set. + +### GetName + +`func (o *VerifyResult) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VerifyResult) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VerifyResult) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VerifyResult) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetType + +`func (o *VerifyResult) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VerifyResult) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VerifyResult) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VerifyResult) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[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/clients/go/docs/WebSocketMessage.md b/clients/go/docs/WebSocketMessage.md new file mode 100644 index 0000000000..992ec577a3 --- /dev/null +++ b/clients/go/docs/WebSocketMessage.md @@ -0,0 +1,114 @@ +# WebSocketMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | +**Opcode** | **float32** | | +**Data** | **string** | | +**Time** | **float32** | | + +## Methods + +### NewWebSocketMessage + +`func NewWebSocketMessage(type_ string, opcode float32, data string, time float32, ) *WebSocketMessage` + +NewWebSocketMessage instantiates a new WebSocketMessage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebSocketMessageWithDefaults + +`func NewWebSocketMessageWithDefaults() *WebSocketMessage` + +NewWebSocketMessageWithDefaults instantiates a new WebSocketMessage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *WebSocketMessage) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *WebSocketMessage) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *WebSocketMessage) SetType(v string)` + +SetType sets Type field to given value. + + +### GetOpcode + +`func (o *WebSocketMessage) GetOpcode() float32` + +GetOpcode returns the Opcode field if non-nil, zero value otherwise. + +### GetOpcodeOk + +`func (o *WebSocketMessage) GetOpcodeOk() (*float32, bool)` + +GetOpcodeOk returns a tuple with the Opcode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpcode + +`func (o *WebSocketMessage) SetOpcode(v float32)` + +SetOpcode sets Opcode field to given value. + + +### GetData + +`func (o *WebSocketMessage) GetData() string` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *WebSocketMessage) GetDataOk() (*string, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *WebSocketMessage) SetData(v string)` + +SetData sets Data field to given value. + + +### GetTime + +`func (o *WebSocketMessage) GetTime() float32` + +GetTime returns the Time field if non-nil, zero value otherwise. + +### GetTimeOk + +`func (o *WebSocketMessage) GetTimeOk() (*float32, bool)` + +GetTimeOk returns a tuple with the Time field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTime + +`func (o *WebSocketMessage) SetTime(v float32)` + +SetTime sets Time field to given value. + + + +[[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/clients/csharp/git_push.sh b/clients/go/git_push.sh similarity index 100% rename from clients/csharp/git_push.sh rename to clients/go/git_push.sh diff --git a/clients/go/go.mod b/clients/go/go.mod new file mode 100644 index 0000000000..7fca7eee92 --- /dev/null +++ b/clients/go/go.mod @@ -0,0 +1,6 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +go 1.18 + +require ( +) diff --git a/clients/go/go.sum b/clients/go/go.sum new file mode 100644 index 0000000000..c966c8ddfd --- /dev/null +++ b/clients/go/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/clients/go/model_action.go b/clients/go/model_action.go new file mode 100644 index 0000000000..a594ae5163 --- /dev/null +++ b/clients/go/model_action.go @@ -0,0 +1,378 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the Action type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Action{} + +// Action struct for Action +type Action struct { + Name *string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + ClassName *string `json:"className,omitempty"` + TagName *string `json:"tagName,omitempty"` + Xpath *string `json:"xpath,omitempty"` + DataAttributes *string `json:"dataAttributes,omitempty"` + FormName *string `json:"formName,omitempty"` + Content *string `json:"content,omitempty"` +} + +// NewAction instantiates a new Action object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAction() *Action { + this := Action{} + return &this +} + +// NewActionWithDefaults instantiates a new Action object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionWithDefaults() *Action { + this := Action{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Action) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Action) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Action) SetName(v string) { + o.Name = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Action) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Action) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Action) SetId(v string) { + o.Id = &v +} + +// GetClassName returns the ClassName field value if set, zero value otherwise. +func (o *Action) GetClassName() string { + if o == nil || IsNil(o.ClassName) { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetClassNameOk() (*string, bool) { + if o == nil || IsNil(o.ClassName) { + return nil, false + } + return o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Action) HasClassName() bool { + if o != nil && !IsNil(o.ClassName) { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Action) SetClassName(v string) { + o.ClassName = &v +} + +// GetTagName returns the TagName field value if set, zero value otherwise. +func (o *Action) GetTagName() string { + if o == nil || IsNil(o.TagName) { + var ret string + return ret + } + return *o.TagName +} + +// GetTagNameOk returns a tuple with the TagName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetTagNameOk() (*string, bool) { + if o == nil || IsNil(o.TagName) { + return nil, false + } + return o.TagName, true +} + +// HasTagName returns a boolean if a field has been set. +func (o *Action) HasTagName() bool { + if o != nil && !IsNil(o.TagName) { + return true + } + + return false +} + +// SetTagName gets a reference to the given string and assigns it to the TagName field. +func (o *Action) SetTagName(v string) { + o.TagName = &v +} + +// GetXpath returns the Xpath field value if set, zero value otherwise. +func (o *Action) GetXpath() string { + if o == nil || IsNil(o.Xpath) { + var ret string + return ret + } + return *o.Xpath +} + +// GetXpathOk returns a tuple with the Xpath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetXpathOk() (*string, bool) { + if o == nil || IsNil(o.Xpath) { + return nil, false + } + return o.Xpath, true +} + +// HasXpath returns a boolean if a field has been set. +func (o *Action) HasXpath() bool { + if o != nil && !IsNil(o.Xpath) { + return true + } + + return false +} + +// SetXpath gets a reference to the given string and assigns it to the Xpath field. +func (o *Action) SetXpath(v string) { + o.Xpath = &v +} + +// GetDataAttributes returns the DataAttributes field value if set, zero value otherwise. +func (o *Action) GetDataAttributes() string { + if o == nil || IsNil(o.DataAttributes) { + var ret string + return ret + } + return *o.DataAttributes +} + +// GetDataAttributesOk returns a tuple with the DataAttributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetDataAttributesOk() (*string, bool) { + if o == nil || IsNil(o.DataAttributes) { + return nil, false + } + return o.DataAttributes, true +} + +// HasDataAttributes returns a boolean if a field has been set. +func (o *Action) HasDataAttributes() bool { + if o != nil && !IsNil(o.DataAttributes) { + return true + } + + return false +} + +// SetDataAttributes gets a reference to the given string and assigns it to the DataAttributes field. +func (o *Action) SetDataAttributes(v string) { + o.DataAttributes = &v +} + +// GetFormName returns the FormName field value if set, zero value otherwise. +func (o *Action) GetFormName() string { + if o == nil || IsNil(o.FormName) { + var ret string + return ret + } + return *o.FormName +} + +// GetFormNameOk returns a tuple with the FormName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetFormNameOk() (*string, bool) { + if o == nil || IsNil(o.FormName) { + return nil, false + } + return o.FormName, true +} + +// HasFormName returns a boolean if a field has been set. +func (o *Action) HasFormName() bool { + if o != nil && !IsNil(o.FormName) { + return true + } + + return false +} + +// SetFormName gets a reference to the given string and assigns it to the FormName field. +func (o *Action) SetFormName(v string) { + o.FormName = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *Action) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *Action) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *Action) SetContent(v string) { + o.Content = &v +} + +func (o Action) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Action) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ClassName) { + toSerialize["className"] = o.ClassName + } + if !IsNil(o.TagName) { + toSerialize["tagName"] = o.TagName + } + if !IsNil(o.Xpath) { + toSerialize["xpath"] = o.Xpath + } + if !IsNil(o.DataAttributes) { + toSerialize["dataAttributes"] = o.DataAttributes + } + if !IsNil(o.FormName) { + toSerialize["formName"] = o.FormName + } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + return toSerialize, nil +} + +type NullableAction struct { + value *Action + isSet bool +} + +func (v NullableAction) Get() *Action { + return v.value +} + +func (v *NullableAction) Set(val *Action) { + v.value = val + v.isSet = true +} + +func (v NullableAction) IsSet() bool { + return v.isSet +} + +func (v *NullableAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAction(val *Action) *NullableAction { + return &NullableAction{value: val, isSet: true} +} + +func (v NullableAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_error.go b/clients/go/model_error.go new file mode 100644 index 0000000000..cb1d345232 --- /dev/null +++ b/clients/go/model_error.go @@ -0,0 +1,164 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + // Name of the Error to add. Stored in har under _errors + Name *string `json:"name,omitempty"` + // Short details of the error + Details *string `json:"details,omitempty"` +} + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError() *Error { + this := Error{} + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Error) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Error) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Error) SetName(v string) { + o.Name = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Error) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *Error) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *Error) SetDetails(v string) { + o.Details = &v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + return toSerialize, nil +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har.go b/clients/go/model_har.go new file mode 100644 index 0000000000..11aa93ad7a --- /dev/null +++ b/clients/go/model_har.go @@ -0,0 +1,168 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "fmt" +) + +// checks if the Har type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Har{} + +// Har struct for Har +type Har struct { + Log HarLog `json:"log"` + AdditionalProperties map[string]interface{} +} + +type _Har Har + +// NewHar instantiates a new Har object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHar(log HarLog) *Har { + this := Har{} + this.Log = log + return &this +} + +// NewHarWithDefaults instantiates a new Har object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarWithDefaults() *Har { + this := Har{} + return &this +} + +// GetLog returns the Log field value +func (o *Har) GetLog() HarLog { + if o == nil { + var ret HarLog + return ret + } + + return o.Log +} + +// GetLogOk returns a tuple with the Log field value +// and a boolean to check if the value has been set. +func (o *Har) GetLogOk() (*HarLog, bool) { + if o == nil { + return nil, false + } + return &o.Log, true +} + +// SetLog sets field value +func (o *Har) SetLog(v HarLog) { + o.Log = v +} + +func (o Har) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Har) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["log"] = o.Log + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Har) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "log", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHar := _Har{} + + err = json.Unmarshal(data, &varHar) + + if err != nil { + return err + } + + *o = Har(varHar) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "log") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHar struct { + value *Har + isSet bool +} + +func (v NullableHar) Get() *Har { + return v.value +} + +func (v *NullableHar) Set(val *Har) { + v.value = val + v.isSet = true +} + +func (v NullableHar) IsSet() bool { + return v.isSet +} + +func (v *NullableHar) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHar(val *Har) *NullableHar { + return &NullableHar{value: val, isSet: true} +} + +func (v NullableHar) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHar) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry.go b/clients/go/model_har_entry.go new file mode 100644 index 0000000000..37bccd07a9 --- /dev/null +++ b/clients/go/model_har_entry.go @@ -0,0 +1,590 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the HarEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntry{} + +// HarEntry struct for HarEntry +type HarEntry struct { + Pageref *string `json:"pageref,omitempty"` + StartedDateTime time.Time `json:"startedDateTime"` + Time int64 `json:"time"` + Request HarEntryRequest `json:"request"` + Response HarEntryResponse `json:"response"` + Cache HarEntryCache `json:"cache"` + Timings HarEntryTimings `json:"timings"` + ServerIPAddress *string `json:"serverIPAddress,omitempty"` + WebSocketMessages []WebSocketMessage `json:"_webSocketMessages,omitempty"` + // W3C Trace Context span ID for this entry + SpanId *string `json:"_span_id,omitempty"` + // W3C Trace Context parent span ID (typically the page span ID) + ParentId *string `json:"_parent_id,omitempty"` + // W3C Trace Context trace ID for distributed tracing + TraceId *string `json:"_trace_id,omitempty"` + Connection *string `json:"connection,omitempty"` + Comment *string `json:"comment,omitempty"` +} + +type _HarEntry HarEntry + +// NewHarEntry instantiates a new HarEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntry(startedDateTime time.Time, time int64, request HarEntryRequest, response HarEntryResponse, cache HarEntryCache, timings HarEntryTimings) *HarEntry { + this := HarEntry{} + this.StartedDateTime = startedDateTime + this.Time = time + this.Request = request + this.Response = response + this.Cache = cache + this.Timings = timings + return &this +} + +// NewHarEntryWithDefaults instantiates a new HarEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryWithDefaults() *HarEntry { + this := HarEntry{} + return &this +} + +// GetPageref returns the Pageref field value if set, zero value otherwise. +func (o *HarEntry) GetPageref() string { + if o == nil || IsNil(o.Pageref) { + var ret string + return ret + } + return *o.Pageref +} + +// GetPagerefOk returns a tuple with the Pageref field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetPagerefOk() (*string, bool) { + if o == nil || IsNil(o.Pageref) { + return nil, false + } + return o.Pageref, true +} + +// HasPageref returns a boolean if a field has been set. +func (o *HarEntry) HasPageref() bool { + if o != nil && !IsNil(o.Pageref) { + return true + } + + return false +} + +// SetPageref gets a reference to the given string and assigns it to the Pageref field. +func (o *HarEntry) SetPageref(v string) { + o.Pageref = &v +} + +// GetStartedDateTime returns the StartedDateTime field value +func (o *HarEntry) GetStartedDateTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedDateTime +} + +// GetStartedDateTimeOk returns a tuple with the StartedDateTime field value +// and a boolean to check if the value has been set. +func (o *HarEntry) GetStartedDateTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedDateTime, true +} + +// SetStartedDateTime sets field value +func (o *HarEntry) SetStartedDateTime(v time.Time) { + o.StartedDateTime = v +} + +// GetTime returns the Time field value +func (o *HarEntry) GetTime() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Time +} + +// GetTimeOk returns a tuple with the Time field value +// and a boolean to check if the value has been set. +func (o *HarEntry) GetTimeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Time, true +} + +// SetTime sets field value +func (o *HarEntry) SetTime(v int64) { + o.Time = v +} + +// GetRequest returns the Request field value +func (o *HarEntry) GetRequest() HarEntryRequest { + if o == nil { + var ret HarEntryRequest + return ret + } + + return o.Request +} + +// GetRequestOk returns a tuple with the Request field value +// and a boolean to check if the value has been set. +func (o *HarEntry) GetRequestOk() (*HarEntryRequest, bool) { + if o == nil { + return nil, false + } + return &o.Request, true +} + +// SetRequest sets field value +func (o *HarEntry) SetRequest(v HarEntryRequest) { + o.Request = v +} + +// GetResponse returns the Response field value +func (o *HarEntry) GetResponse() HarEntryResponse { + if o == nil { + var ret HarEntryResponse + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +func (o *HarEntry) GetResponseOk() (*HarEntryResponse, bool) { + if o == nil { + return nil, false + } + return &o.Response, true +} + +// SetResponse sets field value +func (o *HarEntry) SetResponse(v HarEntryResponse) { + o.Response = v +} + +// GetCache returns the Cache field value +func (o *HarEntry) GetCache() HarEntryCache { + if o == nil { + var ret HarEntryCache + return ret + } + + return o.Cache +} + +// GetCacheOk returns a tuple with the Cache field value +// and a boolean to check if the value has been set. +func (o *HarEntry) GetCacheOk() (*HarEntryCache, bool) { + if o == nil { + return nil, false + } + return &o.Cache, true +} + +// SetCache sets field value +func (o *HarEntry) SetCache(v HarEntryCache) { + o.Cache = v +} + +// GetTimings returns the Timings field value +func (o *HarEntry) GetTimings() HarEntryTimings { + if o == nil { + var ret HarEntryTimings + return ret + } + + return o.Timings +} + +// GetTimingsOk returns a tuple with the Timings field value +// and a boolean to check if the value has been set. +func (o *HarEntry) GetTimingsOk() (*HarEntryTimings, bool) { + if o == nil { + return nil, false + } + return &o.Timings, true +} + +// SetTimings sets field value +func (o *HarEntry) SetTimings(v HarEntryTimings) { + o.Timings = v +} + +// GetServerIPAddress returns the ServerIPAddress field value if set, zero value otherwise. +func (o *HarEntry) GetServerIPAddress() string { + if o == nil || IsNil(o.ServerIPAddress) { + var ret string + return ret + } + return *o.ServerIPAddress +} + +// GetServerIPAddressOk returns a tuple with the ServerIPAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetServerIPAddressOk() (*string, bool) { + if o == nil || IsNil(o.ServerIPAddress) { + return nil, false + } + return o.ServerIPAddress, true +} + +// HasServerIPAddress returns a boolean if a field has been set. +func (o *HarEntry) HasServerIPAddress() bool { + if o != nil && !IsNil(o.ServerIPAddress) { + return true + } + + return false +} + +// SetServerIPAddress gets a reference to the given string and assigns it to the ServerIPAddress field. +func (o *HarEntry) SetServerIPAddress(v string) { + o.ServerIPAddress = &v +} + +// GetWebSocketMessages returns the WebSocketMessages field value if set, zero value otherwise. +func (o *HarEntry) GetWebSocketMessages() []WebSocketMessage { + if o == nil || IsNil(o.WebSocketMessages) { + var ret []WebSocketMessage + return ret + } + return o.WebSocketMessages +} + +// GetWebSocketMessagesOk returns a tuple with the WebSocketMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetWebSocketMessagesOk() ([]WebSocketMessage, bool) { + if o == nil || IsNil(o.WebSocketMessages) { + return nil, false + } + return o.WebSocketMessages, true +} + +// HasWebSocketMessages returns a boolean if a field has been set. +func (o *HarEntry) HasWebSocketMessages() bool { + if o != nil && !IsNil(o.WebSocketMessages) { + return true + } + + return false +} + +// SetWebSocketMessages gets a reference to the given []WebSocketMessage and assigns it to the WebSocketMessages field. +func (o *HarEntry) SetWebSocketMessages(v []WebSocketMessage) { + o.WebSocketMessages = v +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *HarEntry) GetSpanId() string { + if o == nil || IsNil(o.SpanId) { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetSpanIdOk() (*string, bool) { + if o == nil || IsNil(o.SpanId) { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *HarEntry) HasSpanId() bool { + if o != nil && !IsNil(o.SpanId) { + return true + } + + return false +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *HarEntry) SetSpanId(v string) { + o.SpanId = &v +} + +// GetParentId returns the ParentId field value if set, zero value otherwise. +func (o *HarEntry) GetParentId() string { + if o == nil || IsNil(o.ParentId) { + var ret string + return ret + } + return *o.ParentId +} + +// GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetParentIdOk() (*string, bool) { + if o == nil || IsNil(o.ParentId) { + return nil, false + } + return o.ParentId, true +} + +// HasParentId returns a boolean if a field has been set. +func (o *HarEntry) HasParentId() bool { + if o != nil && !IsNil(o.ParentId) { + return true + } + + return false +} + +// SetParentId gets a reference to the given string and assigns it to the ParentId field. +func (o *HarEntry) SetParentId(v string) { + o.ParentId = &v +} + +// GetTraceId returns the TraceId field value if set, zero value otherwise. +func (o *HarEntry) GetTraceId() string { + if o == nil || IsNil(o.TraceId) { + var ret string + return ret + } + return *o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetTraceIdOk() (*string, bool) { + if o == nil || IsNil(o.TraceId) { + return nil, false + } + return o.TraceId, true +} + +// HasTraceId returns a boolean if a field has been set. +func (o *HarEntry) HasTraceId() bool { + if o != nil && !IsNil(o.TraceId) { + return true + } + + return false +} + +// SetTraceId gets a reference to the given string and assigns it to the TraceId field. +func (o *HarEntry) SetTraceId(v string) { + o.TraceId = &v +} + +// GetConnection returns the Connection field value if set, zero value otherwise. +func (o *HarEntry) GetConnection() string { + if o == nil || IsNil(o.Connection) { + var ret string + return ret + } + return *o.Connection +} + +// GetConnectionOk returns a tuple with the Connection field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetConnectionOk() (*string, bool) { + if o == nil || IsNil(o.Connection) { + return nil, false + } + return o.Connection, true +} + +// HasConnection returns a boolean if a field has been set. +func (o *HarEntry) HasConnection() bool { + if o != nil && !IsNil(o.Connection) { + return true + } + + return false +} + +// SetConnection gets a reference to the given string and assigns it to the Connection field. +func (o *HarEntry) SetConnection(v string) { + o.Connection = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntry) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntry) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntry) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntry) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntry) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pageref) { + toSerialize["pageref"] = o.Pageref + } + toSerialize["startedDateTime"] = o.StartedDateTime + toSerialize["time"] = o.Time + toSerialize["request"] = o.Request + toSerialize["response"] = o.Response + toSerialize["cache"] = o.Cache + toSerialize["timings"] = o.Timings + if !IsNil(o.ServerIPAddress) { + toSerialize["serverIPAddress"] = o.ServerIPAddress + } + if !IsNil(o.WebSocketMessages) { + toSerialize["_webSocketMessages"] = o.WebSocketMessages + } + if !IsNil(o.SpanId) { + toSerialize["_span_id"] = o.SpanId + } + if !IsNil(o.ParentId) { + toSerialize["_parent_id"] = o.ParentId + } + if !IsNil(o.TraceId) { + toSerialize["_trace_id"] = o.TraceId + } + if !IsNil(o.Connection) { + toSerialize["connection"] = o.Connection + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startedDateTime", + "time", + "request", + "response", + "cache", + "timings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntry := _HarEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntry) + + if err != nil { + return err + } + + *o = HarEntry(varHarEntry) + + return err +} + +type NullableHarEntry struct { + value *HarEntry + isSet bool +} + +func (v NullableHarEntry) Get() *HarEntry { + return v.value +} + +func (v *NullableHarEntry) Set(val *HarEntry) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntry(val *HarEntry) *NullableHarEntry { + return &NullableHarEntry{value: val, isSet: true} +} + +func (v NullableHarEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_cache.go b/clients/go/model_har_entry_cache.go new file mode 100644 index 0000000000..164ec58cad --- /dev/null +++ b/clients/go/model_har_entry_cache.go @@ -0,0 +1,218 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the HarEntryCache type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryCache{} + +// HarEntryCache struct for HarEntryCache +type HarEntryCache struct { + BeforeRequest NullableHarEntryCacheBeforeRequest `json:"beforeRequest,omitempty"` + AfterRequest NullableHarEntryCacheBeforeRequest `json:"afterRequest,omitempty"` + Comment *string `json:"comment,omitempty"` +} + +// NewHarEntryCache instantiates a new HarEntryCache object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryCache() *HarEntryCache { + this := HarEntryCache{} + return &this +} + +// NewHarEntryCacheWithDefaults instantiates a new HarEntryCache object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryCacheWithDefaults() *HarEntryCache { + this := HarEntryCache{} + return &this +} + +// GetBeforeRequest returns the BeforeRequest field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *HarEntryCache) GetBeforeRequest() HarEntryCacheBeforeRequest { + if o == nil || IsNil(o.BeforeRequest.Get()) { + var ret HarEntryCacheBeforeRequest + return ret + } + return *o.BeforeRequest.Get() +} + +// GetBeforeRequestOk returns a tuple with the BeforeRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *HarEntryCache) GetBeforeRequestOk() (*HarEntryCacheBeforeRequest, bool) { + if o == nil { + return nil, false + } + return o.BeforeRequest.Get(), o.BeforeRequest.IsSet() +} + +// HasBeforeRequest returns a boolean if a field has been set. +func (o *HarEntryCache) HasBeforeRequest() bool { + if o != nil && o.BeforeRequest.IsSet() { + return true + } + + return false +} + +// SetBeforeRequest gets a reference to the given NullableHarEntryCacheBeforeRequest and assigns it to the BeforeRequest field. +func (o *HarEntryCache) SetBeforeRequest(v HarEntryCacheBeforeRequest) { + o.BeforeRequest.Set(&v) +} +// SetBeforeRequestNil sets the value for BeforeRequest to be an explicit nil +func (o *HarEntryCache) SetBeforeRequestNil() { + o.BeforeRequest.Set(nil) +} + +// UnsetBeforeRequest ensures that no value is present for BeforeRequest, not even an explicit nil +func (o *HarEntryCache) UnsetBeforeRequest() { + o.BeforeRequest.Unset() +} + +// GetAfterRequest returns the AfterRequest field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *HarEntryCache) GetAfterRequest() HarEntryCacheBeforeRequest { + if o == nil || IsNil(o.AfterRequest.Get()) { + var ret HarEntryCacheBeforeRequest + return ret + } + return *o.AfterRequest.Get() +} + +// GetAfterRequestOk returns a tuple with the AfterRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *HarEntryCache) GetAfterRequestOk() (*HarEntryCacheBeforeRequest, bool) { + if o == nil { + return nil, false + } + return o.AfterRequest.Get(), o.AfterRequest.IsSet() +} + +// HasAfterRequest returns a boolean if a field has been set. +func (o *HarEntryCache) HasAfterRequest() bool { + if o != nil && o.AfterRequest.IsSet() { + return true + } + + return false +} + +// SetAfterRequest gets a reference to the given NullableHarEntryCacheBeforeRequest and assigns it to the AfterRequest field. +func (o *HarEntryCache) SetAfterRequest(v HarEntryCacheBeforeRequest) { + o.AfterRequest.Set(&v) +} +// SetAfterRequestNil sets the value for AfterRequest to be an explicit nil +func (o *HarEntryCache) SetAfterRequestNil() { + o.AfterRequest.Set(nil) +} + +// UnsetAfterRequest ensures that no value is present for AfterRequest, not even an explicit nil +func (o *HarEntryCache) UnsetAfterRequest() { + o.AfterRequest.Unset() +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryCache) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryCache) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryCache) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryCache) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryCache) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryCache) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.BeforeRequest.IsSet() { + toSerialize["beforeRequest"] = o.BeforeRequest.Get() + } + if o.AfterRequest.IsSet() { + toSerialize["afterRequest"] = o.AfterRequest.Get() + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +type NullableHarEntryCache struct { + value *HarEntryCache + isSet bool +} + +func (v NullableHarEntryCache) Get() *HarEntryCache { + return v.value +} + +func (v *NullableHarEntryCache) Set(val *HarEntryCache) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryCache) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryCache) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryCache(val *HarEntryCache) *NullableHarEntryCache { + return &NullableHarEntryCache{value: val, isSet: true} +} + +func (v NullableHarEntryCache) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryCache) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_cache_before_request.go b/clients/go/model_har_entry_cache_before_request.go new file mode 100644 index 0000000000..fe606531dd --- /dev/null +++ b/clients/go/model_har_entry_cache_before_request.go @@ -0,0 +1,286 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarEntryCacheBeforeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryCacheBeforeRequest{} + +// HarEntryCacheBeforeRequest struct for HarEntryCacheBeforeRequest +type HarEntryCacheBeforeRequest struct { + Expires *string `json:"expires,omitempty"` + LastAccess string `json:"lastAccess"` + ETag string `json:"eTag"` + HitCount int32 `json:"hitCount"` + Comment *string `json:"comment,omitempty"` +} + +type _HarEntryCacheBeforeRequest HarEntryCacheBeforeRequest + +// NewHarEntryCacheBeforeRequest instantiates a new HarEntryCacheBeforeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryCacheBeforeRequest(lastAccess string, eTag string, hitCount int32) *HarEntryCacheBeforeRequest { + this := HarEntryCacheBeforeRequest{} + this.LastAccess = lastAccess + this.ETag = eTag + this.HitCount = hitCount + return &this +} + +// NewHarEntryCacheBeforeRequestWithDefaults instantiates a new HarEntryCacheBeforeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryCacheBeforeRequestWithDefaults() *HarEntryCacheBeforeRequest { + this := HarEntryCacheBeforeRequest{} + return &this +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *HarEntryCacheBeforeRequest) GetExpires() string { + if o == nil || IsNil(o.Expires) { + var ret string + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryCacheBeforeRequest) GetExpiresOk() (*string, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *HarEntryCacheBeforeRequest) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given string and assigns it to the Expires field. +func (o *HarEntryCacheBeforeRequest) SetExpires(v string) { + o.Expires = &v +} + +// GetLastAccess returns the LastAccess field value +func (o *HarEntryCacheBeforeRequest) GetLastAccess() string { + if o == nil { + var ret string + return ret + } + + return o.LastAccess +} + +// GetLastAccessOk returns a tuple with the LastAccess field value +// and a boolean to check if the value has been set. +func (o *HarEntryCacheBeforeRequest) GetLastAccessOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastAccess, true +} + +// SetLastAccess sets field value +func (o *HarEntryCacheBeforeRequest) SetLastAccess(v string) { + o.LastAccess = v +} + +// GetETag returns the ETag field value +func (o *HarEntryCacheBeforeRequest) GetETag() string { + if o == nil { + var ret string + return ret + } + + return o.ETag +} + +// GetETagOk returns a tuple with the ETag field value +// and a boolean to check if the value has been set. +func (o *HarEntryCacheBeforeRequest) GetETagOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ETag, true +} + +// SetETag sets field value +func (o *HarEntryCacheBeforeRequest) SetETag(v string) { + o.ETag = v +} + +// GetHitCount returns the HitCount field value +func (o *HarEntryCacheBeforeRequest) GetHitCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HitCount +} + +// GetHitCountOk returns a tuple with the HitCount field value +// and a boolean to check if the value has been set. +func (o *HarEntryCacheBeforeRequest) GetHitCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HitCount, true +} + +// SetHitCount sets field value +func (o *HarEntryCacheBeforeRequest) SetHitCount(v int32) { + o.HitCount = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryCacheBeforeRequest) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryCacheBeforeRequest) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryCacheBeforeRequest) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryCacheBeforeRequest) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryCacheBeforeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryCacheBeforeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + toSerialize["lastAccess"] = o.LastAccess + toSerialize["eTag"] = o.ETag + toSerialize["hitCount"] = o.HitCount + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarEntryCacheBeforeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "lastAccess", + "eTag", + "hitCount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryCacheBeforeRequest := _HarEntryCacheBeforeRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntryCacheBeforeRequest) + + if err != nil { + return err + } + + *o = HarEntryCacheBeforeRequest(varHarEntryCacheBeforeRequest) + + return err +} + +type NullableHarEntryCacheBeforeRequest struct { + value *HarEntryCacheBeforeRequest + isSet bool +} + +func (v NullableHarEntryCacheBeforeRequest) Get() *HarEntryCacheBeforeRequest { + return v.value +} + +func (v *NullableHarEntryCacheBeforeRequest) Set(val *HarEntryCacheBeforeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryCacheBeforeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryCacheBeforeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryCacheBeforeRequest(val *HarEntryCacheBeforeRequest) *NullableHarEntryCacheBeforeRequest { + return &NullableHarEntryCacheBeforeRequest{value: val, isSet: true} +} + +func (v NullableHarEntryCacheBeforeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryCacheBeforeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_request.go b/clients/go/model_har_entry_request.go new file mode 100644 index 0000000000..409ae48f4c --- /dev/null +++ b/clients/go/model_har_entry_request.go @@ -0,0 +1,445 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "fmt" +) + +// checks if the HarEntryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryRequest{} + +// HarEntryRequest struct for HarEntryRequest +type HarEntryRequest struct { + Method string `json:"method"` + Url string `json:"url"` + HttpVersion string `json:"httpVersion"` + Cookies []HarEntryRequestCookiesInner `json:"cookies"` + Headers []Header `json:"headers"` + QueryString []HarEntryRequestQueryStringInner `json:"queryString"` + PostData *HarEntryRequestPostData `json:"postData,omitempty"` + HeadersSize int32 `json:"headersSize"` + BodySize int32 `json:"bodySize"` + Comment *string `json:"comment,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _HarEntryRequest HarEntryRequest + +// NewHarEntryRequest instantiates a new HarEntryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryRequest(method string, url string, httpVersion string, cookies []HarEntryRequestCookiesInner, headers []Header, queryString []HarEntryRequestQueryStringInner, headersSize int32, bodySize int32) *HarEntryRequest { + this := HarEntryRequest{} + this.Method = method + this.Url = url + this.HttpVersion = httpVersion + this.Cookies = cookies + this.Headers = headers + this.QueryString = queryString + this.HeadersSize = headersSize + this.BodySize = bodySize + return &this +} + +// NewHarEntryRequestWithDefaults instantiates a new HarEntryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryRequestWithDefaults() *HarEntryRequest { + this := HarEntryRequest{} + return &this +} + +// GetMethod returns the Method field value +func (o *HarEntryRequest) GetMethod() string { + if o == nil { + var ret string + return ret + } + + return o.Method +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Method, true +} + +// SetMethod sets field value +func (o *HarEntryRequest) SetMethod(v string) { + o.Method = v +} + +// GetUrl returns the Url field value +func (o *HarEntryRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *HarEntryRequest) SetUrl(v string) { + o.Url = v +} + +// GetHttpVersion returns the HttpVersion field value +func (o *HarEntryRequest) GetHttpVersion() string { + if o == nil { + var ret string + return ret + } + + return o.HttpVersion +} + +// GetHttpVersionOk returns a tuple with the HttpVersion field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetHttpVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HttpVersion, true +} + +// SetHttpVersion sets field value +func (o *HarEntryRequest) SetHttpVersion(v string) { + o.HttpVersion = v +} + +// GetCookies returns the Cookies field value +func (o *HarEntryRequest) GetCookies() []HarEntryRequestCookiesInner { + if o == nil { + var ret []HarEntryRequestCookiesInner + return ret + } + + return o.Cookies +} + +// GetCookiesOk returns a tuple with the Cookies field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetCookiesOk() ([]HarEntryRequestCookiesInner, bool) { + if o == nil { + return nil, false + } + return o.Cookies, true +} + +// SetCookies sets field value +func (o *HarEntryRequest) SetCookies(v []HarEntryRequestCookiesInner) { + o.Cookies = v +} + +// GetHeaders returns the Headers field value +func (o *HarEntryRequest) GetHeaders() []Header { + if o == nil { + var ret []Header + return ret + } + + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetHeadersOk() ([]Header, bool) { + if o == nil { + return nil, false + } + return o.Headers, true +} + +// SetHeaders sets field value +func (o *HarEntryRequest) SetHeaders(v []Header) { + o.Headers = v +} + +// GetQueryString returns the QueryString field value +func (o *HarEntryRequest) GetQueryString() []HarEntryRequestQueryStringInner { + if o == nil { + var ret []HarEntryRequestQueryStringInner + return ret + } + + return o.QueryString +} + +// GetQueryStringOk returns a tuple with the QueryString field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetQueryStringOk() ([]HarEntryRequestQueryStringInner, bool) { + if o == nil { + return nil, false + } + return o.QueryString, true +} + +// SetQueryString sets field value +func (o *HarEntryRequest) SetQueryString(v []HarEntryRequestQueryStringInner) { + o.QueryString = v +} + +// GetPostData returns the PostData field value if set, zero value otherwise. +func (o *HarEntryRequest) GetPostData() HarEntryRequestPostData { + if o == nil || IsNil(o.PostData) { + var ret HarEntryRequestPostData + return ret + } + return *o.PostData +} + +// GetPostDataOk returns a tuple with the PostData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetPostDataOk() (*HarEntryRequestPostData, bool) { + if o == nil || IsNil(o.PostData) { + return nil, false + } + return o.PostData, true +} + +// HasPostData returns a boolean if a field has been set. +func (o *HarEntryRequest) HasPostData() bool { + if o != nil && !IsNil(o.PostData) { + return true + } + + return false +} + +// SetPostData gets a reference to the given HarEntryRequestPostData and assigns it to the PostData field. +func (o *HarEntryRequest) SetPostData(v HarEntryRequestPostData) { + o.PostData = &v +} + +// GetHeadersSize returns the HeadersSize field value +func (o *HarEntryRequest) GetHeadersSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HeadersSize +} + +// GetHeadersSizeOk returns a tuple with the HeadersSize field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetHeadersSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HeadersSize, true +} + +// SetHeadersSize sets field value +func (o *HarEntryRequest) SetHeadersSize(v int32) { + o.HeadersSize = v +} + +// GetBodySize returns the BodySize field value +func (o *HarEntryRequest) GetBodySize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BodySize +} + +// GetBodySizeOk returns a tuple with the BodySize field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetBodySizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BodySize, true +} + +// SetBodySize sets field value +func (o *HarEntryRequest) SetBodySize(v int32) { + o.BodySize = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryRequest) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequest) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryRequest) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryRequest) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["method"] = o.Method + toSerialize["url"] = o.Url + toSerialize["httpVersion"] = o.HttpVersion + toSerialize["cookies"] = o.Cookies + toSerialize["headers"] = o.Headers + toSerialize["queryString"] = o.QueryString + if !IsNil(o.PostData) { + toSerialize["postData"] = o.PostData + } + toSerialize["headersSize"] = o.HeadersSize + toSerialize["bodySize"] = o.BodySize + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *HarEntryRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "method", + "url", + "httpVersion", + "cookies", + "headers", + "queryString", + "headersSize", + "bodySize", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryRequest := _HarEntryRequest{} + + err = json.Unmarshal(data, &varHarEntryRequest) + + if err != nil { + return err + } + + *o = HarEntryRequest(varHarEntryRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "method") + delete(additionalProperties, "url") + delete(additionalProperties, "httpVersion") + delete(additionalProperties, "cookies") + delete(additionalProperties, "headers") + delete(additionalProperties, "queryString") + delete(additionalProperties, "postData") + delete(additionalProperties, "headersSize") + delete(additionalProperties, "bodySize") + delete(additionalProperties, "comment") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHarEntryRequest struct { + value *HarEntryRequest + isSet bool +} + +func (v NullableHarEntryRequest) Get() *HarEntryRequest { + return v.value +} + +func (v *NullableHarEntryRequest) Set(val *HarEntryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryRequest(val *HarEntryRequest) *NullableHarEntryRequest { + return &NullableHarEntryRequest{value: val, isSet: true} +} + +func (v NullableHarEntryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_request_cookies_inner.go b/clients/go/model_har_entry_request_cookies_inner.go new file mode 100644 index 0000000000..09ffe4e6ed --- /dev/null +++ b/clients/go/model_har_entry_request_cookies_inner.go @@ -0,0 +1,402 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarEntryRequestCookiesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryRequestCookiesInner{} + +// HarEntryRequestCookiesInner struct for HarEntryRequestCookiesInner +type HarEntryRequestCookiesInner struct { + Name string `json:"name"` + Value string `json:"value"` + Path *string `json:"path,omitempty"` + Domain *string `json:"domain,omitempty"` + Expires *string `json:"expires,omitempty"` + HttpOnly *bool `json:"httpOnly,omitempty"` + Secure *bool `json:"secure,omitempty"` + Comment *string `json:"comment,omitempty"` +} + +type _HarEntryRequestCookiesInner HarEntryRequestCookiesInner + +// NewHarEntryRequestCookiesInner instantiates a new HarEntryRequestCookiesInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryRequestCookiesInner(name string, value string) *HarEntryRequestCookiesInner { + this := HarEntryRequestCookiesInner{} + this.Name = name + this.Value = value + return &this +} + +// NewHarEntryRequestCookiesInnerWithDefaults instantiates a new HarEntryRequestCookiesInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryRequestCookiesInnerWithDefaults() *HarEntryRequestCookiesInner { + this := HarEntryRequestCookiesInner{} + return &this +} + +// GetName returns the Name field value +func (o *HarEntryRequestCookiesInner) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *HarEntryRequestCookiesInner) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value +func (o *HarEntryRequestCookiesInner) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *HarEntryRequestCookiesInner) SetValue(v string) { + o.Value = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *HarEntryRequestCookiesInner) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *HarEntryRequestCookiesInner) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *HarEntryRequestCookiesInner) SetPath(v string) { + o.Path = &v +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *HarEntryRequestCookiesInner) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *HarEntryRequestCookiesInner) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *HarEntryRequestCookiesInner) SetDomain(v string) { + o.Domain = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *HarEntryRequestCookiesInner) GetExpires() string { + if o == nil || IsNil(o.Expires) { + var ret string + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetExpiresOk() (*string, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *HarEntryRequestCookiesInner) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given string and assigns it to the Expires field. +func (o *HarEntryRequestCookiesInner) SetExpires(v string) { + o.Expires = &v +} + +// GetHttpOnly returns the HttpOnly field value if set, zero value otherwise. +func (o *HarEntryRequestCookiesInner) GetHttpOnly() bool { + if o == nil || IsNil(o.HttpOnly) { + var ret bool + return ret + } + return *o.HttpOnly +} + +// GetHttpOnlyOk returns a tuple with the HttpOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetHttpOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.HttpOnly) { + return nil, false + } + return o.HttpOnly, true +} + +// HasHttpOnly returns a boolean if a field has been set. +func (o *HarEntryRequestCookiesInner) HasHttpOnly() bool { + if o != nil && !IsNil(o.HttpOnly) { + return true + } + + return false +} + +// SetHttpOnly gets a reference to the given bool and assigns it to the HttpOnly field. +func (o *HarEntryRequestCookiesInner) SetHttpOnly(v bool) { + o.HttpOnly = &v +} + +// GetSecure returns the Secure field value if set, zero value otherwise. +func (o *HarEntryRequestCookiesInner) GetSecure() bool { + if o == nil || IsNil(o.Secure) { + var ret bool + return ret + } + return *o.Secure +} + +// GetSecureOk returns a tuple with the Secure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetSecureOk() (*bool, bool) { + if o == nil || IsNil(o.Secure) { + return nil, false + } + return o.Secure, true +} + +// HasSecure returns a boolean if a field has been set. +func (o *HarEntryRequestCookiesInner) HasSecure() bool { + if o != nil && !IsNil(o.Secure) { + return true + } + + return false +} + +// SetSecure gets a reference to the given bool and assigns it to the Secure field. +func (o *HarEntryRequestCookiesInner) SetSecure(v bool) { + o.Secure = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryRequestCookiesInner) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestCookiesInner) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryRequestCookiesInner) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryRequestCookiesInner) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryRequestCookiesInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryRequestCookiesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["value"] = o.Value + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + if !IsNil(o.HttpOnly) { + toSerialize["httpOnly"] = o.HttpOnly + } + if !IsNil(o.Secure) { + toSerialize["secure"] = o.Secure + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarEntryRequestCookiesInner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryRequestCookiesInner := _HarEntryRequestCookiesInner{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntryRequestCookiesInner) + + if err != nil { + return err + } + + *o = HarEntryRequestCookiesInner(varHarEntryRequestCookiesInner) + + return err +} + +type NullableHarEntryRequestCookiesInner struct { + value *HarEntryRequestCookiesInner + isSet bool +} + +func (v NullableHarEntryRequestCookiesInner) Get() *HarEntryRequestCookiesInner { + return v.value +} + +func (v *NullableHarEntryRequestCookiesInner) Set(val *HarEntryRequestCookiesInner) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryRequestCookiesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryRequestCookiesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryRequestCookiesInner(val *HarEntryRequestCookiesInner) *NullableHarEntryRequestCookiesInner { + return &NullableHarEntryRequestCookiesInner{value: val, isSet: true} +} + +func (v NullableHarEntryRequestCookiesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryRequestCookiesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_request_post_data.go b/clients/go/model_har_entry_request_post_data.go new file mode 100644 index 0000000000..e3fb3a622f --- /dev/null +++ b/clients/go/model_har_entry_request_post_data.go @@ -0,0 +1,230 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarEntryRequestPostData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryRequestPostData{} + +// HarEntryRequestPostData Posted data info. +type HarEntryRequestPostData struct { + MimeType string `json:"mimeType"` + Text *string `json:"text,omitempty"` + Params []HarEntryRequestPostDataParamsInner `json:"params,omitempty"` +} + +type _HarEntryRequestPostData HarEntryRequestPostData + +// NewHarEntryRequestPostData instantiates a new HarEntryRequestPostData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryRequestPostData(mimeType string) *HarEntryRequestPostData { + this := HarEntryRequestPostData{} + this.MimeType = mimeType + return &this +} + +// NewHarEntryRequestPostDataWithDefaults instantiates a new HarEntryRequestPostData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryRequestPostDataWithDefaults() *HarEntryRequestPostData { + this := HarEntryRequestPostData{} + return &this +} + +// GetMimeType returns the MimeType field value +func (o *HarEntryRequestPostData) GetMimeType() string { + if o == nil { + var ret string + return ret + } + + return o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostData) GetMimeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MimeType, true +} + +// SetMimeType sets field value +func (o *HarEntryRequestPostData) SetMimeType(v string) { + o.MimeType = v +} + +// GetText returns the Text field value if set, zero value otherwise. +func (o *HarEntryRequestPostData) GetText() string { + if o == nil || IsNil(o.Text) { + var ret string + return ret + } + return *o.Text +} + +// GetTextOk returns a tuple with the Text field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostData) GetTextOk() (*string, bool) { + if o == nil || IsNil(o.Text) { + return nil, false + } + return o.Text, true +} + +// HasText returns a boolean if a field has been set. +func (o *HarEntryRequestPostData) HasText() bool { + if o != nil && !IsNil(o.Text) { + return true + } + + return false +} + +// SetText gets a reference to the given string and assigns it to the Text field. +func (o *HarEntryRequestPostData) SetText(v string) { + o.Text = &v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *HarEntryRequestPostData) GetParams() []HarEntryRequestPostDataParamsInner { + if o == nil || IsNil(o.Params) { + var ret []HarEntryRequestPostDataParamsInner + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostData) GetParamsOk() ([]HarEntryRequestPostDataParamsInner, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *HarEntryRequestPostData) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []HarEntryRequestPostDataParamsInner and assigns it to the Params field. +func (o *HarEntryRequestPostData) SetParams(v []HarEntryRequestPostDataParamsInner) { + o.Params = v +} + +func (o HarEntryRequestPostData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryRequestPostData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["mimeType"] = o.MimeType + if !IsNil(o.Text) { + toSerialize["text"] = o.Text + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +func (o *HarEntryRequestPostData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "mimeType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryRequestPostData := _HarEntryRequestPostData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntryRequestPostData) + + if err != nil { + return err + } + + *o = HarEntryRequestPostData(varHarEntryRequestPostData) + + return err +} + +type NullableHarEntryRequestPostData struct { + value *HarEntryRequestPostData + isSet bool +} + +func (v NullableHarEntryRequestPostData) Get() *HarEntryRequestPostData { + return v.value +} + +func (v *NullableHarEntryRequestPostData) Set(val *HarEntryRequestPostData) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryRequestPostData) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryRequestPostData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryRequestPostData(val *HarEntryRequestPostData) *NullableHarEntryRequestPostData { + return &NullableHarEntryRequestPostData{value: val, isSet: true} +} + +func (v NullableHarEntryRequestPostData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryRequestPostData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_request_post_data_params_inner.go b/clients/go/model_har_entry_request_post_data_params_inner.go new file mode 100644 index 0000000000..426e364fff --- /dev/null +++ b/clients/go/model_har_entry_request_post_data_params_inner.go @@ -0,0 +1,270 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the HarEntryRequestPostDataParamsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryRequestPostDataParamsInner{} + +// HarEntryRequestPostDataParamsInner struct for HarEntryRequestPostDataParamsInner +type HarEntryRequestPostDataParamsInner struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + FileName *string `json:"fileName,omitempty"` + ContentType *string `json:"contentType,omitempty"` + Comment *string `json:"comment,omitempty"` +} + +// NewHarEntryRequestPostDataParamsInner instantiates a new HarEntryRequestPostDataParamsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryRequestPostDataParamsInner() *HarEntryRequestPostDataParamsInner { + this := HarEntryRequestPostDataParamsInner{} + return &this +} + +// NewHarEntryRequestPostDataParamsInnerWithDefaults instantiates a new HarEntryRequestPostDataParamsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryRequestPostDataParamsInnerWithDefaults() *HarEntryRequestPostDataParamsInner { + this := HarEntryRequestPostDataParamsInner{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *HarEntryRequestPostDataParamsInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostDataParamsInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *HarEntryRequestPostDataParamsInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *HarEntryRequestPostDataParamsInner) SetName(v string) { + o.Name = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *HarEntryRequestPostDataParamsInner) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostDataParamsInner) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *HarEntryRequestPostDataParamsInner) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *HarEntryRequestPostDataParamsInner) SetValue(v string) { + o.Value = &v +} + +// GetFileName returns the FileName field value if set, zero value otherwise. +func (o *HarEntryRequestPostDataParamsInner) GetFileName() string { + if o == nil || IsNil(o.FileName) { + var ret string + return ret + } + return *o.FileName +} + +// GetFileNameOk returns a tuple with the FileName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostDataParamsInner) GetFileNameOk() (*string, bool) { + if o == nil || IsNil(o.FileName) { + return nil, false + } + return o.FileName, true +} + +// HasFileName returns a boolean if a field has been set. +func (o *HarEntryRequestPostDataParamsInner) HasFileName() bool { + if o != nil && !IsNil(o.FileName) { + return true + } + + return false +} + +// SetFileName gets a reference to the given string and assigns it to the FileName field. +func (o *HarEntryRequestPostDataParamsInner) SetFileName(v string) { + o.FileName = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *HarEntryRequestPostDataParamsInner) GetContentType() string { + if o == nil || IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostDataParamsInner) GetContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *HarEntryRequestPostDataParamsInner) HasContentType() bool { + if o != nil && !IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *HarEntryRequestPostDataParamsInner) SetContentType(v string) { + o.ContentType = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryRequestPostDataParamsInner) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestPostDataParamsInner) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryRequestPostDataParamsInner) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryRequestPostDataParamsInner) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryRequestPostDataParamsInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryRequestPostDataParamsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.FileName) { + toSerialize["fileName"] = o.FileName + } + if !IsNil(o.ContentType) { + toSerialize["contentType"] = o.ContentType + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +type NullableHarEntryRequestPostDataParamsInner struct { + value *HarEntryRequestPostDataParamsInner + isSet bool +} + +func (v NullableHarEntryRequestPostDataParamsInner) Get() *HarEntryRequestPostDataParamsInner { + return v.value +} + +func (v *NullableHarEntryRequestPostDataParamsInner) Set(val *HarEntryRequestPostDataParamsInner) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryRequestPostDataParamsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryRequestPostDataParamsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryRequestPostDataParamsInner(val *HarEntryRequestPostDataParamsInner) *NullableHarEntryRequestPostDataParamsInner { + return &NullableHarEntryRequestPostDataParamsInner{value: val, isSet: true} +} + +func (v NullableHarEntryRequestPostDataParamsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryRequestPostDataParamsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_request_query_string_inner.go b/clients/go/model_har_entry_request_query_string_inner.go new file mode 100644 index 0000000000..b46f3b8e85 --- /dev/null +++ b/clients/go/model_har_entry_request_query_string_inner.go @@ -0,0 +1,222 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarEntryRequestQueryStringInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryRequestQueryStringInner{} + +// HarEntryRequestQueryStringInner struct for HarEntryRequestQueryStringInner +type HarEntryRequestQueryStringInner struct { + Name string `json:"name"` + Value string `json:"value"` + Comment *string `json:"comment,omitempty"` +} + +type _HarEntryRequestQueryStringInner HarEntryRequestQueryStringInner + +// NewHarEntryRequestQueryStringInner instantiates a new HarEntryRequestQueryStringInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryRequestQueryStringInner(name string, value string) *HarEntryRequestQueryStringInner { + this := HarEntryRequestQueryStringInner{} + this.Name = name + this.Value = value + return &this +} + +// NewHarEntryRequestQueryStringInnerWithDefaults instantiates a new HarEntryRequestQueryStringInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryRequestQueryStringInnerWithDefaults() *HarEntryRequestQueryStringInner { + this := HarEntryRequestQueryStringInner{} + return &this +} + +// GetName returns the Name field value +func (o *HarEntryRequestQueryStringInner) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequestQueryStringInner) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *HarEntryRequestQueryStringInner) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value +func (o *HarEntryRequestQueryStringInner) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *HarEntryRequestQueryStringInner) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *HarEntryRequestQueryStringInner) SetValue(v string) { + o.Value = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryRequestQueryStringInner) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryRequestQueryStringInner) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryRequestQueryStringInner) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryRequestQueryStringInner) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryRequestQueryStringInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryRequestQueryStringInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["value"] = o.Value + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarEntryRequestQueryStringInner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryRequestQueryStringInner := _HarEntryRequestQueryStringInner{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntryRequestQueryStringInner) + + if err != nil { + return err + } + + *o = HarEntryRequestQueryStringInner(varHarEntryRequestQueryStringInner) + + return err +} + +type NullableHarEntryRequestQueryStringInner struct { + value *HarEntryRequestQueryStringInner + isSet bool +} + +func (v NullableHarEntryRequestQueryStringInner) Get() *HarEntryRequestQueryStringInner { + return v.value +} + +func (v *NullableHarEntryRequestQueryStringInner) Set(val *HarEntryRequestQueryStringInner) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryRequestQueryStringInner) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryRequestQueryStringInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryRequestQueryStringInner(val *HarEntryRequestQueryStringInner) *NullableHarEntryRequestQueryStringInner { + return &NullableHarEntryRequestQueryStringInner{value: val, isSet: true} +} + +func (v NullableHarEntryRequestQueryStringInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryRequestQueryStringInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_response.go b/clients/go/model_har_entry_response.go new file mode 100644 index 0000000000..bd55c328a8 --- /dev/null +++ b/clients/go/model_har_entry_response.go @@ -0,0 +1,437 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "fmt" +) + +// checks if the HarEntryResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryResponse{} + +// HarEntryResponse struct for HarEntryResponse +type HarEntryResponse struct { + Status int32 `json:"status"` + StatusText string `json:"statusText"` + HttpVersion string `json:"httpVersion"` + Cookies []HarEntryRequestCookiesInner `json:"cookies"` + Headers []Header `json:"headers"` + Content HarEntryResponseContent `json:"content"` + RedirectURL string `json:"redirectURL"` + HeadersSize int32 `json:"headersSize"` + BodySize int32 `json:"bodySize"` + Comment *string `json:"comment,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _HarEntryResponse HarEntryResponse + +// NewHarEntryResponse instantiates a new HarEntryResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryResponse(status int32, statusText string, httpVersion string, cookies []HarEntryRequestCookiesInner, headers []Header, content HarEntryResponseContent, redirectURL string, headersSize int32, bodySize int32) *HarEntryResponse { + this := HarEntryResponse{} + this.Status = status + this.StatusText = statusText + this.HttpVersion = httpVersion + this.Cookies = cookies + this.Headers = headers + this.Content = content + this.RedirectURL = redirectURL + this.HeadersSize = headersSize + this.BodySize = bodySize + return &this +} + +// NewHarEntryResponseWithDefaults instantiates a new HarEntryResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryResponseWithDefaults() *HarEntryResponse { + this := HarEntryResponse{} + return &this +} + +// GetStatus returns the Status field value +func (o *HarEntryResponse) GetStatus() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetStatusOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *HarEntryResponse) SetStatus(v int32) { + o.Status = v +} + +// GetStatusText returns the StatusText field value +func (o *HarEntryResponse) GetStatusText() string { + if o == nil { + var ret string + return ret + } + + return o.StatusText +} + +// GetStatusTextOk returns a tuple with the StatusText field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetStatusTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StatusText, true +} + +// SetStatusText sets field value +func (o *HarEntryResponse) SetStatusText(v string) { + o.StatusText = v +} + +// GetHttpVersion returns the HttpVersion field value +func (o *HarEntryResponse) GetHttpVersion() string { + if o == nil { + var ret string + return ret + } + + return o.HttpVersion +} + +// GetHttpVersionOk returns a tuple with the HttpVersion field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetHttpVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HttpVersion, true +} + +// SetHttpVersion sets field value +func (o *HarEntryResponse) SetHttpVersion(v string) { + o.HttpVersion = v +} + +// GetCookies returns the Cookies field value +func (o *HarEntryResponse) GetCookies() []HarEntryRequestCookiesInner { + if o == nil { + var ret []HarEntryRequestCookiesInner + return ret + } + + return o.Cookies +} + +// GetCookiesOk returns a tuple with the Cookies field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetCookiesOk() ([]HarEntryRequestCookiesInner, bool) { + if o == nil { + return nil, false + } + return o.Cookies, true +} + +// SetCookies sets field value +func (o *HarEntryResponse) SetCookies(v []HarEntryRequestCookiesInner) { + o.Cookies = v +} + +// GetHeaders returns the Headers field value +func (o *HarEntryResponse) GetHeaders() []Header { + if o == nil { + var ret []Header + return ret + } + + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetHeadersOk() ([]Header, bool) { + if o == nil { + return nil, false + } + return o.Headers, true +} + +// SetHeaders sets field value +func (o *HarEntryResponse) SetHeaders(v []Header) { + o.Headers = v +} + +// GetContent returns the Content field value +func (o *HarEntryResponse) GetContent() HarEntryResponseContent { + if o == nil { + var ret HarEntryResponseContent + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetContentOk() (*HarEntryResponseContent, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *HarEntryResponse) SetContent(v HarEntryResponseContent) { + o.Content = v +} + +// GetRedirectURL returns the RedirectURL field value +func (o *HarEntryResponse) GetRedirectURL() string { + if o == nil { + var ret string + return ret + } + + return o.RedirectURL +} + +// GetRedirectURLOk returns a tuple with the RedirectURL field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetRedirectURLOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RedirectURL, true +} + +// SetRedirectURL sets field value +func (o *HarEntryResponse) SetRedirectURL(v string) { + o.RedirectURL = v +} + +// GetHeadersSize returns the HeadersSize field value +func (o *HarEntryResponse) GetHeadersSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HeadersSize +} + +// GetHeadersSizeOk returns a tuple with the HeadersSize field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetHeadersSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HeadersSize, true +} + +// SetHeadersSize sets field value +func (o *HarEntryResponse) SetHeadersSize(v int32) { + o.HeadersSize = v +} + +// GetBodySize returns the BodySize field value +func (o *HarEntryResponse) GetBodySize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BodySize +} + +// GetBodySizeOk returns a tuple with the BodySize field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetBodySizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BodySize, true +} + +// SetBodySize sets field value +func (o *HarEntryResponse) SetBodySize(v int32) { + o.BodySize = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryResponse) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponse) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryResponse) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryResponse) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["statusText"] = o.StatusText + toSerialize["httpVersion"] = o.HttpVersion + toSerialize["cookies"] = o.Cookies + toSerialize["headers"] = o.Headers + toSerialize["content"] = o.Content + toSerialize["redirectURL"] = o.RedirectURL + toSerialize["headersSize"] = o.HeadersSize + toSerialize["bodySize"] = o.BodySize + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *HarEntryResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + "statusText", + "httpVersion", + "cookies", + "headers", + "content", + "redirectURL", + "headersSize", + "bodySize", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryResponse := _HarEntryResponse{} + + err = json.Unmarshal(data, &varHarEntryResponse) + + if err != nil { + return err + } + + *o = HarEntryResponse(varHarEntryResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "statusText") + delete(additionalProperties, "httpVersion") + delete(additionalProperties, "cookies") + delete(additionalProperties, "headers") + delete(additionalProperties, "content") + delete(additionalProperties, "redirectURL") + delete(additionalProperties, "headersSize") + delete(additionalProperties, "bodySize") + delete(additionalProperties, "comment") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHarEntryResponse struct { + value *HarEntryResponse + isSet bool +} + +func (v NullableHarEntryResponse) Get() *HarEntryResponse { + return v.value +} + +func (v *NullableHarEntryResponse) Set(val *HarEntryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryResponse(val *HarEntryResponse) *NullableHarEntryResponse { + return &NullableHarEntryResponse{value: val, isSet: true} +} + +func (v NullableHarEntryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_response_content.go b/clients/go/model_har_entry_response_content.go new file mode 100644 index 0000000000..1009a47816 --- /dev/null +++ b/clients/go/model_har_entry_response_content.go @@ -0,0 +1,650 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarEntryResponseContent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryResponseContent{} + +// HarEntryResponseContent struct for HarEntryResponseContent +type HarEntryResponseContent struct { + Size int32 `json:"size"` + Compression *int32 `json:"compression,omitempty"` + MimeType string `json:"mimeType"` + Text *string `json:"text,omitempty"` + Encoding *string `json:"encoding,omitempty"` + VideoBufferedPercent *int64 `json:"_videoBufferedPercent,omitempty"` + VideoStallCount *int64 `json:"_videoStallCount,omitempty"` + VideoDecodedByteCount *int64 `json:"_videoDecodedByteCount,omitempty"` + VideoWaitingCount *int64 `json:"_videoWaitingCount,omitempty"` + VideoErrorCount *int64 `json:"_videoErrorCount,omitempty"` + VideoDroppedFrames *int64 `json:"_videoDroppedFrames,omitempty"` + VideoTotalFrames *int64 `json:"_videoTotalFrames,omitempty"` + VideoAudioBytesDecoded *int64 `json:"_videoAudioBytesDecoded,omitempty"` + Comment *string `json:"comment,omitempty"` +} + +type _HarEntryResponseContent HarEntryResponseContent + +// NewHarEntryResponseContent instantiates a new HarEntryResponseContent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryResponseContent(size int32, mimeType string) *HarEntryResponseContent { + this := HarEntryResponseContent{} + this.Size = size + this.MimeType = mimeType + var videoBufferedPercent int64 = -1 + this.VideoBufferedPercent = &videoBufferedPercent + var videoStallCount int64 = -1 + this.VideoStallCount = &videoStallCount + var videoDecodedByteCount int64 = -1 + this.VideoDecodedByteCount = &videoDecodedByteCount + var videoWaitingCount int64 = -1 + this.VideoWaitingCount = &videoWaitingCount + var videoErrorCount int64 = -1 + this.VideoErrorCount = &videoErrorCount + var videoDroppedFrames int64 = -1 + this.VideoDroppedFrames = &videoDroppedFrames + var videoTotalFrames int64 = -1 + this.VideoTotalFrames = &videoTotalFrames + var videoAudioBytesDecoded int64 = -1 + this.VideoAudioBytesDecoded = &videoAudioBytesDecoded + return &this +} + +// NewHarEntryResponseContentWithDefaults instantiates a new HarEntryResponseContent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryResponseContentWithDefaults() *HarEntryResponseContent { + this := HarEntryResponseContent{} + var videoBufferedPercent int64 = -1 + this.VideoBufferedPercent = &videoBufferedPercent + var videoStallCount int64 = -1 + this.VideoStallCount = &videoStallCount + var videoDecodedByteCount int64 = -1 + this.VideoDecodedByteCount = &videoDecodedByteCount + var videoWaitingCount int64 = -1 + this.VideoWaitingCount = &videoWaitingCount + var videoErrorCount int64 = -1 + this.VideoErrorCount = &videoErrorCount + var videoDroppedFrames int64 = -1 + this.VideoDroppedFrames = &videoDroppedFrames + var videoTotalFrames int64 = -1 + this.VideoTotalFrames = &videoTotalFrames + var videoAudioBytesDecoded int64 = -1 + this.VideoAudioBytesDecoded = &videoAudioBytesDecoded + return &this +} + +// GetSize returns the Size field value +func (o *HarEntryResponseContent) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *HarEntryResponseContent) SetSize(v int32) { + o.Size = v +} + +// GetCompression returns the Compression field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetCompression() int32 { + if o == nil || IsNil(o.Compression) { + var ret int32 + return ret + } + return *o.Compression +} + +// GetCompressionOk returns a tuple with the Compression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetCompressionOk() (*int32, bool) { + if o == nil || IsNil(o.Compression) { + return nil, false + } + return o.Compression, true +} + +// HasCompression returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasCompression() bool { + if o != nil && !IsNil(o.Compression) { + return true + } + + return false +} + +// SetCompression gets a reference to the given int32 and assigns it to the Compression field. +func (o *HarEntryResponseContent) SetCompression(v int32) { + o.Compression = &v +} + +// GetMimeType returns the MimeType field value +func (o *HarEntryResponseContent) GetMimeType() string { + if o == nil { + var ret string + return ret + } + + return o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetMimeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MimeType, true +} + +// SetMimeType sets field value +func (o *HarEntryResponseContent) SetMimeType(v string) { + o.MimeType = v +} + +// GetText returns the Text field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetText() string { + if o == nil || IsNil(o.Text) { + var ret string + return ret + } + return *o.Text +} + +// GetTextOk returns a tuple with the Text field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetTextOk() (*string, bool) { + if o == nil || IsNil(o.Text) { + return nil, false + } + return o.Text, true +} + +// HasText returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasText() bool { + if o != nil && !IsNil(o.Text) { + return true + } + + return false +} + +// SetText gets a reference to the given string and assigns it to the Text field. +func (o *HarEntryResponseContent) SetText(v string) { + o.Text = &v +} + +// GetEncoding returns the Encoding field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetEncoding() string { + if o == nil || IsNil(o.Encoding) { + var ret string + return ret + } + return *o.Encoding +} + +// GetEncodingOk returns a tuple with the Encoding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetEncodingOk() (*string, bool) { + if o == nil || IsNil(o.Encoding) { + return nil, false + } + return o.Encoding, true +} + +// HasEncoding returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasEncoding() bool { + if o != nil && !IsNil(o.Encoding) { + return true + } + + return false +} + +// SetEncoding gets a reference to the given string and assigns it to the Encoding field. +func (o *HarEntryResponseContent) SetEncoding(v string) { + o.Encoding = &v +} + +// GetVideoBufferedPercent returns the VideoBufferedPercent field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoBufferedPercent() int64 { + if o == nil || IsNil(o.VideoBufferedPercent) { + var ret int64 + return ret + } + return *o.VideoBufferedPercent +} + +// GetVideoBufferedPercentOk returns a tuple with the VideoBufferedPercent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoBufferedPercentOk() (*int64, bool) { + if o == nil || IsNil(o.VideoBufferedPercent) { + return nil, false + } + return o.VideoBufferedPercent, true +} + +// HasVideoBufferedPercent returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoBufferedPercent() bool { + if o != nil && !IsNil(o.VideoBufferedPercent) { + return true + } + + return false +} + +// SetVideoBufferedPercent gets a reference to the given int64 and assigns it to the VideoBufferedPercent field. +func (o *HarEntryResponseContent) SetVideoBufferedPercent(v int64) { + o.VideoBufferedPercent = &v +} + +// GetVideoStallCount returns the VideoStallCount field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoStallCount() int64 { + if o == nil || IsNil(o.VideoStallCount) { + var ret int64 + return ret + } + return *o.VideoStallCount +} + +// GetVideoStallCountOk returns a tuple with the VideoStallCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoStallCountOk() (*int64, bool) { + if o == nil || IsNil(o.VideoStallCount) { + return nil, false + } + return o.VideoStallCount, true +} + +// HasVideoStallCount returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoStallCount() bool { + if o != nil && !IsNil(o.VideoStallCount) { + return true + } + + return false +} + +// SetVideoStallCount gets a reference to the given int64 and assigns it to the VideoStallCount field. +func (o *HarEntryResponseContent) SetVideoStallCount(v int64) { + o.VideoStallCount = &v +} + +// GetVideoDecodedByteCount returns the VideoDecodedByteCount field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoDecodedByteCount() int64 { + if o == nil || IsNil(o.VideoDecodedByteCount) { + var ret int64 + return ret + } + return *o.VideoDecodedByteCount +} + +// GetVideoDecodedByteCountOk returns a tuple with the VideoDecodedByteCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoDecodedByteCountOk() (*int64, bool) { + if o == nil || IsNil(o.VideoDecodedByteCount) { + return nil, false + } + return o.VideoDecodedByteCount, true +} + +// HasVideoDecodedByteCount returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoDecodedByteCount() bool { + if o != nil && !IsNil(o.VideoDecodedByteCount) { + return true + } + + return false +} + +// SetVideoDecodedByteCount gets a reference to the given int64 and assigns it to the VideoDecodedByteCount field. +func (o *HarEntryResponseContent) SetVideoDecodedByteCount(v int64) { + o.VideoDecodedByteCount = &v +} + +// GetVideoWaitingCount returns the VideoWaitingCount field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoWaitingCount() int64 { + if o == nil || IsNil(o.VideoWaitingCount) { + var ret int64 + return ret + } + return *o.VideoWaitingCount +} + +// GetVideoWaitingCountOk returns a tuple with the VideoWaitingCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoWaitingCountOk() (*int64, bool) { + if o == nil || IsNil(o.VideoWaitingCount) { + return nil, false + } + return o.VideoWaitingCount, true +} + +// HasVideoWaitingCount returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoWaitingCount() bool { + if o != nil && !IsNil(o.VideoWaitingCount) { + return true + } + + return false +} + +// SetVideoWaitingCount gets a reference to the given int64 and assigns it to the VideoWaitingCount field. +func (o *HarEntryResponseContent) SetVideoWaitingCount(v int64) { + o.VideoWaitingCount = &v +} + +// GetVideoErrorCount returns the VideoErrorCount field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoErrorCount() int64 { + if o == nil || IsNil(o.VideoErrorCount) { + var ret int64 + return ret + } + return *o.VideoErrorCount +} + +// GetVideoErrorCountOk returns a tuple with the VideoErrorCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoErrorCountOk() (*int64, bool) { + if o == nil || IsNil(o.VideoErrorCount) { + return nil, false + } + return o.VideoErrorCount, true +} + +// HasVideoErrorCount returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoErrorCount() bool { + if o != nil && !IsNil(o.VideoErrorCount) { + return true + } + + return false +} + +// SetVideoErrorCount gets a reference to the given int64 and assigns it to the VideoErrorCount field. +func (o *HarEntryResponseContent) SetVideoErrorCount(v int64) { + o.VideoErrorCount = &v +} + +// GetVideoDroppedFrames returns the VideoDroppedFrames field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoDroppedFrames() int64 { + if o == nil || IsNil(o.VideoDroppedFrames) { + var ret int64 + return ret + } + return *o.VideoDroppedFrames +} + +// GetVideoDroppedFramesOk returns a tuple with the VideoDroppedFrames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoDroppedFramesOk() (*int64, bool) { + if o == nil || IsNil(o.VideoDroppedFrames) { + return nil, false + } + return o.VideoDroppedFrames, true +} + +// HasVideoDroppedFrames returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoDroppedFrames() bool { + if o != nil && !IsNil(o.VideoDroppedFrames) { + return true + } + + return false +} + +// SetVideoDroppedFrames gets a reference to the given int64 and assigns it to the VideoDroppedFrames field. +func (o *HarEntryResponseContent) SetVideoDroppedFrames(v int64) { + o.VideoDroppedFrames = &v +} + +// GetVideoTotalFrames returns the VideoTotalFrames field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoTotalFrames() int64 { + if o == nil || IsNil(o.VideoTotalFrames) { + var ret int64 + return ret + } + return *o.VideoTotalFrames +} + +// GetVideoTotalFramesOk returns a tuple with the VideoTotalFrames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoTotalFramesOk() (*int64, bool) { + if o == nil || IsNil(o.VideoTotalFrames) { + return nil, false + } + return o.VideoTotalFrames, true +} + +// HasVideoTotalFrames returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoTotalFrames() bool { + if o != nil && !IsNil(o.VideoTotalFrames) { + return true + } + + return false +} + +// SetVideoTotalFrames gets a reference to the given int64 and assigns it to the VideoTotalFrames field. +func (o *HarEntryResponseContent) SetVideoTotalFrames(v int64) { + o.VideoTotalFrames = &v +} + +// GetVideoAudioBytesDecoded returns the VideoAudioBytesDecoded field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetVideoAudioBytesDecoded() int64 { + if o == nil || IsNil(o.VideoAudioBytesDecoded) { + var ret int64 + return ret + } + return *o.VideoAudioBytesDecoded +} + +// GetVideoAudioBytesDecodedOk returns a tuple with the VideoAudioBytesDecoded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetVideoAudioBytesDecodedOk() (*int64, bool) { + if o == nil || IsNil(o.VideoAudioBytesDecoded) { + return nil, false + } + return o.VideoAudioBytesDecoded, true +} + +// HasVideoAudioBytesDecoded returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasVideoAudioBytesDecoded() bool { + if o != nil && !IsNil(o.VideoAudioBytesDecoded) { + return true + } + + return false +} + +// SetVideoAudioBytesDecoded gets a reference to the given int64 and assigns it to the VideoAudioBytesDecoded field. +func (o *HarEntryResponseContent) SetVideoAudioBytesDecoded(v int64) { + o.VideoAudioBytesDecoded = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryResponseContent) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryResponseContent) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryResponseContent) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryResponseContent) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryResponseContent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryResponseContent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["size"] = o.Size + if !IsNil(o.Compression) { + toSerialize["compression"] = o.Compression + } + toSerialize["mimeType"] = o.MimeType + if !IsNil(o.Text) { + toSerialize["text"] = o.Text + } + if !IsNil(o.Encoding) { + toSerialize["encoding"] = o.Encoding + } + if !IsNil(o.VideoBufferedPercent) { + toSerialize["_videoBufferedPercent"] = o.VideoBufferedPercent + } + if !IsNil(o.VideoStallCount) { + toSerialize["_videoStallCount"] = o.VideoStallCount + } + if !IsNil(o.VideoDecodedByteCount) { + toSerialize["_videoDecodedByteCount"] = o.VideoDecodedByteCount + } + if !IsNil(o.VideoWaitingCount) { + toSerialize["_videoWaitingCount"] = o.VideoWaitingCount + } + if !IsNil(o.VideoErrorCount) { + toSerialize["_videoErrorCount"] = o.VideoErrorCount + } + if !IsNil(o.VideoDroppedFrames) { + toSerialize["_videoDroppedFrames"] = o.VideoDroppedFrames + } + if !IsNil(o.VideoTotalFrames) { + toSerialize["_videoTotalFrames"] = o.VideoTotalFrames + } + if !IsNil(o.VideoAudioBytesDecoded) { + toSerialize["_videoAudioBytesDecoded"] = o.VideoAudioBytesDecoded + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarEntryResponseContent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "size", + "mimeType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryResponseContent := _HarEntryResponseContent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntryResponseContent) + + if err != nil { + return err + } + + *o = HarEntryResponseContent(varHarEntryResponseContent) + + return err +} + +type NullableHarEntryResponseContent struct { + value *HarEntryResponseContent + isSet bool +} + +func (v NullableHarEntryResponseContent) Get() *HarEntryResponseContent { + return v.value +} + +func (v *NullableHarEntryResponseContent) Set(val *HarEntryResponseContent) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryResponseContent) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryResponseContent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryResponseContent(val *HarEntryResponseContent) *NullableHarEntryResponseContent { + return &NullableHarEntryResponseContent{value: val, isSet: true} +} + +func (v NullableHarEntryResponseContent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryResponseContent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_entry_timings.go b/clients/go/model_har_entry_timings.go new file mode 100644 index 0000000000..35541b3ed1 --- /dev/null +++ b/clients/go/model_har_entry_timings.go @@ -0,0 +1,376 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarEntryTimings type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarEntryTimings{} + +// HarEntryTimings struct for HarEntryTimings +type HarEntryTimings struct { + Dns int64 `json:"dns"` + Connect int64 `json:"connect"` + Blocked int64 `json:"blocked"` + Send int64 `json:"send"` + Wait int64 `json:"wait"` + Receive int64 `json:"receive"` + Ssl int64 `json:"ssl"` + Comment *string `json:"comment,omitempty"` +} + +type _HarEntryTimings HarEntryTimings + +// NewHarEntryTimings instantiates a new HarEntryTimings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarEntryTimings(dns int64, connect int64, blocked int64, send int64, wait int64, receive int64, ssl int64) *HarEntryTimings { + this := HarEntryTimings{} + this.Dns = dns + this.Connect = connect + this.Blocked = blocked + this.Send = send + this.Wait = wait + this.Receive = receive + this.Ssl = ssl + return &this +} + +// NewHarEntryTimingsWithDefaults instantiates a new HarEntryTimings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarEntryTimingsWithDefaults() *HarEntryTimings { + this := HarEntryTimings{} + var dns int64 = -1 + this.Dns = dns + var connect int64 = -1 + this.Connect = connect + var blocked int64 = -1 + this.Blocked = blocked + var send int64 = -1 + this.Send = send + var wait int64 = -1 + this.Wait = wait + var receive int64 = -1 + this.Receive = receive + var ssl int64 = -1 + this.Ssl = ssl + return &this +} + +// GetDns returns the Dns field value +func (o *HarEntryTimings) GetDns() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Dns +} + +// GetDnsOk returns a tuple with the Dns field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetDnsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Dns, true +} + +// SetDns sets field value +func (o *HarEntryTimings) SetDns(v int64) { + o.Dns = v +} + +// GetConnect returns the Connect field value +func (o *HarEntryTimings) GetConnect() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Connect +} + +// GetConnectOk returns a tuple with the Connect field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetConnectOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Connect, true +} + +// SetConnect sets field value +func (o *HarEntryTimings) SetConnect(v int64) { + o.Connect = v +} + +// GetBlocked returns the Blocked field value +func (o *HarEntryTimings) GetBlocked() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Blocked +} + +// GetBlockedOk returns a tuple with the Blocked field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetBlockedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Blocked, true +} + +// SetBlocked sets field value +func (o *HarEntryTimings) SetBlocked(v int64) { + o.Blocked = v +} + +// GetSend returns the Send field value +func (o *HarEntryTimings) GetSend() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Send +} + +// GetSendOk returns a tuple with the Send field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetSendOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Send, true +} + +// SetSend sets field value +func (o *HarEntryTimings) SetSend(v int64) { + o.Send = v +} + +// GetWait returns the Wait field value +func (o *HarEntryTimings) GetWait() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Wait +} + +// GetWaitOk returns a tuple with the Wait field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetWaitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Wait, true +} + +// SetWait sets field value +func (o *HarEntryTimings) SetWait(v int64) { + o.Wait = v +} + +// GetReceive returns the Receive field value +func (o *HarEntryTimings) GetReceive() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Receive +} + +// GetReceiveOk returns a tuple with the Receive field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetReceiveOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Receive, true +} + +// SetReceive sets field value +func (o *HarEntryTimings) SetReceive(v int64) { + o.Receive = v +} + +// GetSsl returns the Ssl field value +func (o *HarEntryTimings) GetSsl() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Ssl +} + +// GetSslOk returns a tuple with the Ssl field value +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetSslOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Ssl, true +} + +// SetSsl sets field value +func (o *HarEntryTimings) SetSsl(v int64) { + o.Ssl = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarEntryTimings) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarEntryTimings) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarEntryTimings) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarEntryTimings) SetComment(v string) { + o.Comment = &v +} + +func (o HarEntryTimings) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarEntryTimings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["dns"] = o.Dns + toSerialize["connect"] = o.Connect + toSerialize["blocked"] = o.Blocked + toSerialize["send"] = o.Send + toSerialize["wait"] = o.Wait + toSerialize["receive"] = o.Receive + toSerialize["ssl"] = o.Ssl + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarEntryTimings) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "dns", + "connect", + "blocked", + "send", + "wait", + "receive", + "ssl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarEntryTimings := _HarEntryTimings{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarEntryTimings) + + if err != nil { + return err + } + + *o = HarEntryTimings(varHarEntryTimings) + + return err +} + +type NullableHarEntryTimings struct { + value *HarEntryTimings + isSet bool +} + +func (v NullableHarEntryTimings) Get() *HarEntryTimings { + return v.value +} + +func (v *NullableHarEntryTimings) Set(val *HarEntryTimings) { + v.value = val + v.isSet = true +} + +func (v NullableHarEntryTimings) IsSet() bool { + return v.isSet +} + +func (v *NullableHarEntryTimings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarEntryTimings(val *HarEntryTimings) *NullableHarEntryTimings { + return &NullableHarEntryTimings{value: val, isSet: true} +} + +func (v NullableHarEntryTimings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarEntryTimings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_log.go b/clients/go/model_har_log.go new file mode 100644 index 0000000000..27aecf2295 --- /dev/null +++ b/clients/go/model_har_log.go @@ -0,0 +1,388 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarLog{} + +// HarLog struct for HarLog +type HarLog struct { + Version string `json:"version"` + Creator HarLogCreator `json:"creator"` + Browser *HarLogCreator `json:"browser,omitempty"` + Pages []Page `json:"pages"` + Entries []HarEntry `json:"entries"` + // W3C Trace Context trace ID for distributed tracing + TraceId *string `json:"_trace_id,omitempty"` + // W3C Trace Context span ID for this HAR trace root + SpanId *string `json:"_span_id,omitempty"` + Comment *string `json:"comment,omitempty"` +} + +type _HarLog HarLog + +// NewHarLog instantiates a new HarLog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarLog(version string, creator HarLogCreator, pages []Page, entries []HarEntry) *HarLog { + this := HarLog{} + this.Version = version + this.Creator = creator + this.Pages = pages + this.Entries = entries + return &this +} + +// NewHarLogWithDefaults instantiates a new HarLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarLogWithDefaults() *HarLog { + this := HarLog{} + return &this +} + +// GetVersion returns the Version field value +func (o *HarLog) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *HarLog) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *HarLog) SetVersion(v string) { + o.Version = v +} + +// GetCreator returns the Creator field value +func (o *HarLog) GetCreator() HarLogCreator { + if o == nil { + var ret HarLogCreator + return ret + } + + return o.Creator +} + +// GetCreatorOk returns a tuple with the Creator field value +// and a boolean to check if the value has been set. +func (o *HarLog) GetCreatorOk() (*HarLogCreator, bool) { + if o == nil { + return nil, false + } + return &o.Creator, true +} + +// SetCreator sets field value +func (o *HarLog) SetCreator(v HarLogCreator) { + o.Creator = v +} + +// GetBrowser returns the Browser field value if set, zero value otherwise. +func (o *HarLog) GetBrowser() HarLogCreator { + if o == nil || IsNil(o.Browser) { + var ret HarLogCreator + return ret + } + return *o.Browser +} + +// GetBrowserOk returns a tuple with the Browser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarLog) GetBrowserOk() (*HarLogCreator, bool) { + if o == nil || IsNil(o.Browser) { + return nil, false + } + return o.Browser, true +} + +// HasBrowser returns a boolean if a field has been set. +func (o *HarLog) HasBrowser() bool { + if o != nil && !IsNil(o.Browser) { + return true + } + + return false +} + +// SetBrowser gets a reference to the given HarLogCreator and assigns it to the Browser field. +func (o *HarLog) SetBrowser(v HarLogCreator) { + o.Browser = &v +} + +// GetPages returns the Pages field value +func (o *HarLog) GetPages() []Page { + if o == nil { + var ret []Page + return ret + } + + return o.Pages +} + +// GetPagesOk returns a tuple with the Pages field value +// and a boolean to check if the value has been set. +func (o *HarLog) GetPagesOk() ([]Page, bool) { + if o == nil { + return nil, false + } + return o.Pages, true +} + +// SetPages sets field value +func (o *HarLog) SetPages(v []Page) { + o.Pages = v +} + +// GetEntries returns the Entries field value +func (o *HarLog) GetEntries() []HarEntry { + if o == nil { + var ret []HarEntry + return ret + } + + return o.Entries +} + +// GetEntriesOk returns a tuple with the Entries field value +// and a boolean to check if the value has been set. +func (o *HarLog) GetEntriesOk() ([]HarEntry, bool) { + if o == nil { + return nil, false + } + return o.Entries, true +} + +// SetEntries sets field value +func (o *HarLog) SetEntries(v []HarEntry) { + o.Entries = v +} + +// GetTraceId returns the TraceId field value if set, zero value otherwise. +func (o *HarLog) GetTraceId() string { + if o == nil || IsNil(o.TraceId) { + var ret string + return ret + } + return *o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarLog) GetTraceIdOk() (*string, bool) { + if o == nil || IsNil(o.TraceId) { + return nil, false + } + return o.TraceId, true +} + +// HasTraceId returns a boolean if a field has been set. +func (o *HarLog) HasTraceId() bool { + if o != nil && !IsNil(o.TraceId) { + return true + } + + return false +} + +// SetTraceId gets a reference to the given string and assigns it to the TraceId field. +func (o *HarLog) SetTraceId(v string) { + o.TraceId = &v +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *HarLog) GetSpanId() string { + if o == nil || IsNil(o.SpanId) { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarLog) GetSpanIdOk() (*string, bool) { + if o == nil || IsNil(o.SpanId) { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *HarLog) HasSpanId() bool { + if o != nil && !IsNil(o.SpanId) { + return true + } + + return false +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *HarLog) SetSpanId(v string) { + o.SpanId = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarLog) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarLog) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarLog) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarLog) SetComment(v string) { + o.Comment = &v +} + +func (o HarLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["version"] = o.Version + toSerialize["creator"] = o.Creator + if !IsNil(o.Browser) { + toSerialize["browser"] = o.Browser + } + toSerialize["pages"] = o.Pages + toSerialize["entries"] = o.Entries + if !IsNil(o.TraceId) { + toSerialize["_trace_id"] = o.TraceId + } + if !IsNil(o.SpanId) { + toSerialize["_span_id"] = o.SpanId + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarLog) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "version", + "creator", + "pages", + "entries", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarLog := _HarLog{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarLog) + + if err != nil { + return err + } + + *o = HarLog(varHarLog) + + return err +} + +type NullableHarLog struct { + value *HarLog + isSet bool +} + +func (v NullableHarLog) Get() *HarLog { + return v.value +} + +func (v *NullableHarLog) Set(val *HarLog) { + v.value = val + v.isSet = true +} + +func (v NullableHarLog) IsSet() bool { + return v.isSet +} + +func (v *NullableHarLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarLog(val *HarLog) *NullableHarLog { + return &NullableHarLog{value: val, isSet: true} +} + +func (v NullableHarLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_har_log_creator.go b/clients/go/model_har_log_creator.go new file mode 100644 index 0000000000..5a3132b930 --- /dev/null +++ b/clients/go/model_har_log_creator.go @@ -0,0 +1,222 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HarLogCreator type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HarLogCreator{} + +// HarLogCreator struct for HarLogCreator +type HarLogCreator struct { + Name string `json:"name"` + Version string `json:"version"` + Comment *string `json:"comment,omitempty"` +} + +type _HarLogCreator HarLogCreator + +// NewHarLogCreator instantiates a new HarLogCreator object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHarLogCreator(name string, version string) *HarLogCreator { + this := HarLogCreator{} + this.Name = name + this.Version = version + return &this +} + +// NewHarLogCreatorWithDefaults instantiates a new HarLogCreator object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHarLogCreatorWithDefaults() *HarLogCreator { + this := HarLogCreator{} + return &this +} + +// GetName returns the Name field value +func (o *HarLogCreator) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *HarLogCreator) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *HarLogCreator) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value +func (o *HarLogCreator) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *HarLogCreator) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *HarLogCreator) SetVersion(v string) { + o.Version = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *HarLogCreator) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HarLogCreator) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *HarLogCreator) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *HarLogCreator) SetComment(v string) { + o.Comment = &v +} + +func (o HarLogCreator) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HarLogCreator) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["version"] = o.Version + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *HarLogCreator) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHarLogCreator := _HarLogCreator{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHarLogCreator) + + if err != nil { + return err + } + + *o = HarLogCreator(varHarLogCreator) + + return err +} + +type NullableHarLogCreator struct { + value *HarLogCreator + isSet bool +} + +func (v NullableHarLogCreator) Get() *HarLogCreator { + return v.value +} + +func (v *NullableHarLogCreator) Set(val *HarLogCreator) { + v.value = val + v.isSet = true +} + +func (v NullableHarLogCreator) IsSet() bool { + return v.isSet +} + +func (v *NullableHarLogCreator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHarLogCreator(val *HarLogCreator) *NullableHarLogCreator { + return &NullableHarLogCreator{value: val, isSet: true} +} + +func (v NullableHarLogCreator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHarLogCreator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_header.go b/clients/go/model_header.go new file mode 100644 index 0000000000..349d268923 --- /dev/null +++ b/clients/go/model_header.go @@ -0,0 +1,222 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Header type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Header{} + +// Header struct for Header +type Header struct { + Name string `json:"name"` + Value string `json:"value"` + Comment *string `json:"comment,omitempty"` +} + +type _Header Header + +// NewHeader instantiates a new Header object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHeader(name string, value string) *Header { + this := Header{} + this.Name = name + this.Value = value + return &this +} + +// NewHeaderWithDefaults instantiates a new Header object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHeaderWithDefaults() *Header { + this := Header{} + return &this +} + +// GetName returns the Name field value +func (o *Header) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Header) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Header) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value +func (o *Header) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Header) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Header) SetValue(v string) { + o.Value = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *Header) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Header) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *Header) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *Header) SetComment(v string) { + o.Comment = &v +} + +func (o Header) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Header) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["value"] = o.Value + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + return toSerialize, nil +} + +func (o *Header) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHeader := _Header{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHeader) + + if err != nil { + return err + } + + *o = Header(varHeader) + + return err +} + +type NullableHeader struct { + value *Header + isSet bool +} + +func (v NullableHeader) Get() *Header { + return v.value +} + +func (v *NullableHeader) Set(val *Header) { + v.value = val + v.isSet = true +} + +func (v NullableHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHeader(val *Header) *NullableHeader { + return &NullableHeader{value: val, isSet: true} +} + +func (v NullableHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_largest_contentful_paint.go b/clients/go/model_largest_contentful_paint.go new file mode 100644 index 0000000000..792e04c407 --- /dev/null +++ b/clients/go/model_largest_contentful_paint.go @@ -0,0 +1,282 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the LargestContentfulPaint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LargestContentfulPaint{} + +// LargestContentfulPaint struct for LargestContentfulPaint +type LargestContentfulPaint struct { + StartTime *int64 `json:"startTime,omitempty"` + Size *int64 `json:"size,omitempty"` + DomPath *string `json:"domPath,omitempty"` + Tag *string `json:"tag,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LargestContentfulPaint LargestContentfulPaint + +// NewLargestContentfulPaint instantiates a new LargestContentfulPaint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLargestContentfulPaint() *LargestContentfulPaint { + this := LargestContentfulPaint{} + var startTime int64 = -1 + this.StartTime = &startTime + var size int64 = -1 + this.Size = &size + var domPath string = "" + this.DomPath = &domPath + var tag string = "" + this.Tag = &tag + return &this +} + +// NewLargestContentfulPaintWithDefaults instantiates a new LargestContentfulPaint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLargestContentfulPaintWithDefaults() *LargestContentfulPaint { + this := LargestContentfulPaint{} + var startTime int64 = -1 + this.StartTime = &startTime + var size int64 = -1 + this.Size = &size + var domPath string = "" + this.DomPath = &domPath + var tag string = "" + this.Tag = &tag + return &this +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *LargestContentfulPaint) GetStartTime() int64 { + if o == nil || IsNil(o.StartTime) { + var ret int64 + return ret + } + return *o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LargestContentfulPaint) GetStartTimeOk() (*int64, bool) { + if o == nil || IsNil(o.StartTime) { + return nil, false + } + return o.StartTime, true +} + +// HasStartTime returns a boolean if a field has been set. +func (o *LargestContentfulPaint) HasStartTime() bool { + if o != nil && !IsNil(o.StartTime) { + return true + } + + return false +} + +// SetStartTime gets a reference to the given int64 and assigns it to the StartTime field. +func (o *LargestContentfulPaint) SetStartTime(v int64) { + o.StartTime = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *LargestContentfulPaint) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LargestContentfulPaint) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *LargestContentfulPaint) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *LargestContentfulPaint) SetSize(v int64) { + o.Size = &v +} + +// GetDomPath returns the DomPath field value if set, zero value otherwise. +func (o *LargestContentfulPaint) GetDomPath() string { + if o == nil || IsNil(o.DomPath) { + var ret string + return ret + } + return *o.DomPath +} + +// GetDomPathOk returns a tuple with the DomPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LargestContentfulPaint) GetDomPathOk() (*string, bool) { + if o == nil || IsNil(o.DomPath) { + return nil, false + } + return o.DomPath, true +} + +// HasDomPath returns a boolean if a field has been set. +func (o *LargestContentfulPaint) HasDomPath() bool { + if o != nil && !IsNil(o.DomPath) { + return true + } + + return false +} + +// SetDomPath gets a reference to the given string and assigns it to the DomPath field. +func (o *LargestContentfulPaint) SetDomPath(v string) { + o.DomPath = &v +} + +// GetTag returns the Tag field value if set, zero value otherwise. +func (o *LargestContentfulPaint) GetTag() string { + if o == nil || IsNil(o.Tag) { + var ret string + return ret + } + return *o.Tag +} + +// GetTagOk returns a tuple with the Tag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LargestContentfulPaint) GetTagOk() (*string, bool) { + if o == nil || IsNil(o.Tag) { + return nil, false + } + return o.Tag, true +} + +// HasTag returns a boolean if a field has been set. +func (o *LargestContentfulPaint) HasTag() bool { + if o != nil && !IsNil(o.Tag) { + return true + } + + return false +} + +// SetTag gets a reference to the given string and assigns it to the Tag field. +func (o *LargestContentfulPaint) SetTag(v string) { + o.Tag = &v +} + +func (o LargestContentfulPaint) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LargestContentfulPaint) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.StartTime) { + toSerialize["startTime"] = o.StartTime + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.DomPath) { + toSerialize["domPath"] = o.DomPath + } + if !IsNil(o.Tag) { + toSerialize["tag"] = o.Tag + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LargestContentfulPaint) UnmarshalJSON(data []byte) (err error) { + varLargestContentfulPaint := _LargestContentfulPaint{} + + err = json.Unmarshal(data, &varLargestContentfulPaint) + + if err != nil { + return err + } + + *o = LargestContentfulPaint(varLargestContentfulPaint) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "startTime") + delete(additionalProperties, "size") + delete(additionalProperties, "domPath") + delete(additionalProperties, "tag") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLargestContentfulPaint struct { + value *LargestContentfulPaint + isSet bool +} + +func (v NullableLargestContentfulPaint) Get() *LargestContentfulPaint { + return v.value +} + +func (v *NullableLargestContentfulPaint) Set(val *LargestContentfulPaint) { + v.value = val + v.isSet = true +} + +func (v NullableLargestContentfulPaint) IsSet() bool { + return v.isSet +} + +func (v *NullableLargestContentfulPaint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLargestContentfulPaint(val *LargestContentfulPaint) *NullableLargestContentfulPaint { + return &NullableLargestContentfulPaint{value: val, isSet: true} +} + +func (v NullableLargestContentfulPaint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLargestContentfulPaint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_match_criteria.go b/clients/go/model_match_criteria.go new file mode 100644 index 0000000000..a378ee0074 --- /dev/null +++ b/clients/go/model_match_criteria.go @@ -0,0 +1,608 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the MatchCriteria type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MatchCriteria{} + +// MatchCriteria A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison +type MatchCriteria struct { + // Request URL regexp to match + Url *string `json:"url,omitempty"` + // current|all + Page *string `json:"page,omitempty"` + // HTTP Status code to match. + Status *string `json:"status,omitempty"` + // Body content regexp content to match + Content *string `json:"content,omitempty"` + // Content type + ContentType *string `json:"content_type,omitempty"` + // Websocket message text to match + WebsocketMessage *string `json:"websocket_message,omitempty"` + RequestHeader *NameValuePair `json:"request_header,omitempty"` + RequestCookie *NameValuePair `json:"request_cookie,omitempty"` + ResponseHeader *NameValuePair `json:"response_header,omitempty"` + ResponseCookie *NameValuePair `json:"response_cookie,omitempty"` + // Is valid JSON + JsonValid *bool `json:"json_valid,omitempty"` + // Has JSON path + JsonPath *string `json:"json_path,omitempty"` + // Validates against passed JSON schema + JsonSchema *string `json:"json_schema,omitempty"` + // If the proxy has NO traffic at all, return error + ErrorIfNoTraffic *bool `json:"error_if_no_traffic,omitempty"` +} + +// NewMatchCriteria instantiates a new MatchCriteria object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMatchCriteria() *MatchCriteria { + this := MatchCriteria{} + var errorIfNoTraffic bool = true + this.ErrorIfNoTraffic = &errorIfNoTraffic + return &this +} + +// NewMatchCriteriaWithDefaults instantiates a new MatchCriteria object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMatchCriteriaWithDefaults() *MatchCriteria { + this := MatchCriteria{} + var errorIfNoTraffic bool = true + this.ErrorIfNoTraffic = &errorIfNoTraffic + return &this +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *MatchCriteria) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *MatchCriteria) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *MatchCriteria) SetUrl(v string) { + o.Url = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *MatchCriteria) GetPage() string { + if o == nil || IsNil(o.Page) { + var ret string + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetPageOk() (*string, bool) { + if o == nil || IsNil(o.Page) { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *MatchCriteria) HasPage() bool { + if o != nil && !IsNil(o.Page) { + return true + } + + return false +} + +// SetPage gets a reference to the given string and assigns it to the Page field. +func (o *MatchCriteria) SetPage(v string) { + o.Page = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *MatchCriteria) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *MatchCriteria) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *MatchCriteria) SetStatus(v string) { + o.Status = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *MatchCriteria) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *MatchCriteria) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *MatchCriteria) SetContent(v string) { + o.Content = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *MatchCriteria) GetContentType() string { + if o == nil || IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *MatchCriteria) HasContentType() bool { + if o != nil && !IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *MatchCriteria) SetContentType(v string) { + o.ContentType = &v +} + +// GetWebsocketMessage returns the WebsocketMessage field value if set, zero value otherwise. +func (o *MatchCriteria) GetWebsocketMessage() string { + if o == nil || IsNil(o.WebsocketMessage) { + var ret string + return ret + } + return *o.WebsocketMessage +} + +// GetWebsocketMessageOk returns a tuple with the WebsocketMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetWebsocketMessageOk() (*string, bool) { + if o == nil || IsNil(o.WebsocketMessage) { + return nil, false + } + return o.WebsocketMessage, true +} + +// HasWebsocketMessage returns a boolean if a field has been set. +func (o *MatchCriteria) HasWebsocketMessage() bool { + if o != nil && !IsNil(o.WebsocketMessage) { + return true + } + + return false +} + +// SetWebsocketMessage gets a reference to the given string and assigns it to the WebsocketMessage field. +func (o *MatchCriteria) SetWebsocketMessage(v string) { + o.WebsocketMessage = &v +} + +// GetRequestHeader returns the RequestHeader field value if set, zero value otherwise. +func (o *MatchCriteria) GetRequestHeader() NameValuePair { + if o == nil || IsNil(o.RequestHeader) { + var ret NameValuePair + return ret + } + return *o.RequestHeader +} + +// GetRequestHeaderOk returns a tuple with the RequestHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetRequestHeaderOk() (*NameValuePair, bool) { + if o == nil || IsNil(o.RequestHeader) { + return nil, false + } + return o.RequestHeader, true +} + +// HasRequestHeader returns a boolean if a field has been set. +func (o *MatchCriteria) HasRequestHeader() bool { + if o != nil && !IsNil(o.RequestHeader) { + return true + } + + return false +} + +// SetRequestHeader gets a reference to the given NameValuePair and assigns it to the RequestHeader field. +func (o *MatchCriteria) SetRequestHeader(v NameValuePair) { + o.RequestHeader = &v +} + +// GetRequestCookie returns the RequestCookie field value if set, zero value otherwise. +func (o *MatchCriteria) GetRequestCookie() NameValuePair { + if o == nil || IsNil(o.RequestCookie) { + var ret NameValuePair + return ret + } + return *o.RequestCookie +} + +// GetRequestCookieOk returns a tuple with the RequestCookie field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetRequestCookieOk() (*NameValuePair, bool) { + if o == nil || IsNil(o.RequestCookie) { + return nil, false + } + return o.RequestCookie, true +} + +// HasRequestCookie returns a boolean if a field has been set. +func (o *MatchCriteria) HasRequestCookie() bool { + if o != nil && !IsNil(o.RequestCookie) { + return true + } + + return false +} + +// SetRequestCookie gets a reference to the given NameValuePair and assigns it to the RequestCookie field. +func (o *MatchCriteria) SetRequestCookie(v NameValuePair) { + o.RequestCookie = &v +} + +// GetResponseHeader returns the ResponseHeader field value if set, zero value otherwise. +func (o *MatchCriteria) GetResponseHeader() NameValuePair { + if o == nil || IsNil(o.ResponseHeader) { + var ret NameValuePair + return ret + } + return *o.ResponseHeader +} + +// GetResponseHeaderOk returns a tuple with the ResponseHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetResponseHeaderOk() (*NameValuePair, bool) { + if o == nil || IsNil(o.ResponseHeader) { + return nil, false + } + return o.ResponseHeader, true +} + +// HasResponseHeader returns a boolean if a field has been set. +func (o *MatchCriteria) HasResponseHeader() bool { + if o != nil && !IsNil(o.ResponseHeader) { + return true + } + + return false +} + +// SetResponseHeader gets a reference to the given NameValuePair and assigns it to the ResponseHeader field. +func (o *MatchCriteria) SetResponseHeader(v NameValuePair) { + o.ResponseHeader = &v +} + +// GetResponseCookie returns the ResponseCookie field value if set, zero value otherwise. +func (o *MatchCriteria) GetResponseCookie() NameValuePair { + if o == nil || IsNil(o.ResponseCookie) { + var ret NameValuePair + return ret + } + return *o.ResponseCookie +} + +// GetResponseCookieOk returns a tuple with the ResponseCookie field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetResponseCookieOk() (*NameValuePair, bool) { + if o == nil || IsNil(o.ResponseCookie) { + return nil, false + } + return o.ResponseCookie, true +} + +// HasResponseCookie returns a boolean if a field has been set. +func (o *MatchCriteria) HasResponseCookie() bool { + if o != nil && !IsNil(o.ResponseCookie) { + return true + } + + return false +} + +// SetResponseCookie gets a reference to the given NameValuePair and assigns it to the ResponseCookie field. +func (o *MatchCriteria) SetResponseCookie(v NameValuePair) { + o.ResponseCookie = &v +} + +// GetJsonValid returns the JsonValid field value if set, zero value otherwise. +func (o *MatchCriteria) GetJsonValid() bool { + if o == nil || IsNil(o.JsonValid) { + var ret bool + return ret + } + return *o.JsonValid +} + +// GetJsonValidOk returns a tuple with the JsonValid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetJsonValidOk() (*bool, bool) { + if o == nil || IsNil(o.JsonValid) { + return nil, false + } + return o.JsonValid, true +} + +// HasJsonValid returns a boolean if a field has been set. +func (o *MatchCriteria) HasJsonValid() bool { + if o != nil && !IsNil(o.JsonValid) { + return true + } + + return false +} + +// SetJsonValid gets a reference to the given bool and assigns it to the JsonValid field. +func (o *MatchCriteria) SetJsonValid(v bool) { + o.JsonValid = &v +} + +// GetJsonPath returns the JsonPath field value if set, zero value otherwise. +func (o *MatchCriteria) GetJsonPath() string { + if o == nil || IsNil(o.JsonPath) { + var ret string + return ret + } + return *o.JsonPath +} + +// GetJsonPathOk returns a tuple with the JsonPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetJsonPathOk() (*string, bool) { + if o == nil || IsNil(o.JsonPath) { + return nil, false + } + return o.JsonPath, true +} + +// HasJsonPath returns a boolean if a field has been set. +func (o *MatchCriteria) HasJsonPath() bool { + if o != nil && !IsNil(o.JsonPath) { + return true + } + + return false +} + +// SetJsonPath gets a reference to the given string and assigns it to the JsonPath field. +func (o *MatchCriteria) SetJsonPath(v string) { + o.JsonPath = &v +} + +// GetJsonSchema returns the JsonSchema field value if set, zero value otherwise. +func (o *MatchCriteria) GetJsonSchema() string { + if o == nil || IsNil(o.JsonSchema) { + var ret string + return ret + } + return *o.JsonSchema +} + +// GetJsonSchemaOk returns a tuple with the JsonSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetJsonSchemaOk() (*string, bool) { + if o == nil || IsNil(o.JsonSchema) { + return nil, false + } + return o.JsonSchema, true +} + +// HasJsonSchema returns a boolean if a field has been set. +func (o *MatchCriteria) HasJsonSchema() bool { + if o != nil && !IsNil(o.JsonSchema) { + return true + } + + return false +} + +// SetJsonSchema gets a reference to the given string and assigns it to the JsonSchema field. +func (o *MatchCriteria) SetJsonSchema(v string) { + o.JsonSchema = &v +} + +// GetErrorIfNoTraffic returns the ErrorIfNoTraffic field value if set, zero value otherwise. +func (o *MatchCriteria) GetErrorIfNoTraffic() bool { + if o == nil || IsNil(o.ErrorIfNoTraffic) { + var ret bool + return ret + } + return *o.ErrorIfNoTraffic +} + +// GetErrorIfNoTrafficOk returns a tuple with the ErrorIfNoTraffic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MatchCriteria) GetErrorIfNoTrafficOk() (*bool, bool) { + if o == nil || IsNil(o.ErrorIfNoTraffic) { + return nil, false + } + return o.ErrorIfNoTraffic, true +} + +// HasErrorIfNoTraffic returns a boolean if a field has been set. +func (o *MatchCriteria) HasErrorIfNoTraffic() bool { + if o != nil && !IsNil(o.ErrorIfNoTraffic) { + return true + } + + return false +} + +// SetErrorIfNoTraffic gets a reference to the given bool and assigns it to the ErrorIfNoTraffic field. +func (o *MatchCriteria) SetErrorIfNoTraffic(v bool) { + o.ErrorIfNoTraffic = &v +} + +func (o MatchCriteria) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MatchCriteria) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !IsNil(o.Page) { + toSerialize["page"] = o.Page + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + if !IsNil(o.ContentType) { + toSerialize["content_type"] = o.ContentType + } + if !IsNil(o.WebsocketMessage) { + toSerialize["websocket_message"] = o.WebsocketMessage + } + if !IsNil(o.RequestHeader) { + toSerialize["request_header"] = o.RequestHeader + } + if !IsNil(o.RequestCookie) { + toSerialize["request_cookie"] = o.RequestCookie + } + if !IsNil(o.ResponseHeader) { + toSerialize["response_header"] = o.ResponseHeader + } + if !IsNil(o.ResponseCookie) { + toSerialize["response_cookie"] = o.ResponseCookie + } + if !IsNil(o.JsonValid) { + toSerialize["json_valid"] = o.JsonValid + } + if !IsNil(o.JsonPath) { + toSerialize["json_path"] = o.JsonPath + } + if !IsNil(o.JsonSchema) { + toSerialize["json_schema"] = o.JsonSchema + } + if !IsNil(o.ErrorIfNoTraffic) { + toSerialize["error_if_no_traffic"] = o.ErrorIfNoTraffic + } + return toSerialize, nil +} + +type NullableMatchCriteria struct { + value *MatchCriteria + isSet bool +} + +func (v NullableMatchCriteria) Get() *MatchCriteria { + return v.value +} + +func (v *NullableMatchCriteria) Set(val *MatchCriteria) { + v.value = val + v.isSet = true +} + +func (v NullableMatchCriteria) IsSet() bool { + return v.isSet +} + +func (v *NullableMatchCriteria) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMatchCriteria(val *MatchCriteria) *NullableMatchCriteria { + return &NullableMatchCriteria{value: val, isSet: true} +} + +func (v NullableMatchCriteria) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMatchCriteria) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_metric.go b/clients/go/model_metric.go new file mode 100644 index 0000000000..07bcdc051e --- /dev/null +++ b/clients/go/model_metric.go @@ -0,0 +1,164 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the Metric type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Metric{} + +// Metric struct for Metric +type Metric struct { + // Name of Custom Metric to add to the page under _metrics + Name *string `json:"name,omitempty"` + // Value for the metric + Value *int32 `json:"value,omitempty"` +} + +// NewMetric instantiates a new Metric object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetric() *Metric { + this := Metric{} + return &this +} + +// NewMetricWithDefaults instantiates a new Metric object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetricWithDefaults() *Metric { + this := Metric{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Metric) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metric) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Metric) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Metric) SetName(v string) { + o.Name = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *Metric) GetValue() int32 { + if o == nil || IsNil(o.Value) { + var ret int32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metric) GetValueOk() (*int32, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *Metric) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given int32 and assigns it to the Value field. +func (o *Metric) SetValue(v int32) { + o.Value = &v +} + +func (o Metric) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Metric) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableMetric struct { + value *Metric + isSet bool +} + +func (v NullableMetric) Get() *Metric { + return v.value +} + +func (v *NullableMetric) Set(val *Metric) { + v.value = val + v.isSet = true +} + +func (v NullableMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetric(val *Metric) *NullableMetric { + return &NullableMetric{value: val, isSet: true} +} + +func (v NullableMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_name_value_pair.go b/clients/go/model_name_value_pair.go new file mode 100644 index 0000000000..abade6585f --- /dev/null +++ b/clients/go/model_name_value_pair.go @@ -0,0 +1,164 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the NameValuePair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NameValuePair{} + +// NameValuePair struct for NameValuePair +type NameValuePair struct { + // Name to match + Name *string `json:"name,omitempty"` + // Value to match + Value *string `json:"value,omitempty"` +} + +// NewNameValuePair instantiates a new NameValuePair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNameValuePair() *NameValuePair { + this := NameValuePair{} + return &this +} + +// NewNameValuePairWithDefaults instantiates a new NameValuePair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNameValuePairWithDefaults() *NameValuePair { + this := NameValuePair{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NameValuePair) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameValuePair) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NameValuePair) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NameValuePair) SetName(v string) { + o.Name = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *NameValuePair) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameValuePair) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *NameValuePair) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *NameValuePair) SetValue(v string) { + o.Value = &v +} + +func (o NameValuePair) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NameValuePair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableNameValuePair struct { + value *NameValuePair + isSet bool +} + +func (v NullableNameValuePair) Get() *NameValuePair { + return v.value +} + +func (v *NullableNameValuePair) Set(val *NameValuePair) { + v.value = val + v.isSet = true +} + +func (v NullableNameValuePair) IsSet() bool { + return v.isSet +} + +func (v *NullableNameValuePair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNameValuePair(val *NameValuePair) *NullableNameValuePair { + return &NullableNameValuePair{value: val, isSet: true} +} + +func (v NullableNameValuePair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNameValuePair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_page.go b/clients/go/model_page.go new file mode 100644 index 0000000000..0de931dae2 --- /dev/null +++ b/clients/go/model_page.go @@ -0,0 +1,480 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the Page type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Page{} + +// Page struct for Page +type Page struct { + StartedDateTime time.Time `json:"startedDateTime"` + Id string `json:"id"` + Title string `json:"title"` + Verifications []VerifyResult `json:"_verifications,omitempty"` + Metrics []Metric `json:"_metrics,omitempty"` + Errors []Error `json:"_errors,omitempty"` + // W3C Trace Context span ID for this page + SpanId *string `json:"_span_id,omitempty"` + // W3C Trace Context parent span ID (typically the HAR log span ID) + ParentId *string `json:"_parent_id,omitempty"` + PageTimings PageTimings `json:"pageTimings"` + Comment *string `json:"comment,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Page Page + +// NewPage instantiates a new Page object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPage(startedDateTime time.Time, id string, title string, pageTimings PageTimings) *Page { + this := Page{} + this.StartedDateTime = startedDateTime + this.Id = id + this.Title = title + this.PageTimings = pageTimings + return &this +} + +// NewPageWithDefaults instantiates a new Page object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPageWithDefaults() *Page { + this := Page{} + return &this +} + +// GetStartedDateTime returns the StartedDateTime field value +func (o *Page) GetStartedDateTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedDateTime +} + +// GetStartedDateTimeOk returns a tuple with the StartedDateTime field value +// and a boolean to check if the value has been set. +func (o *Page) GetStartedDateTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedDateTime, true +} + +// SetStartedDateTime sets field value +func (o *Page) SetStartedDateTime(v time.Time) { + o.StartedDateTime = v +} + +// GetId returns the Id field value +func (o *Page) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Page) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Page) SetId(v string) { + o.Id = v +} + +// GetTitle returns the Title field value +func (o *Page) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *Page) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *Page) SetTitle(v string) { + o.Title = v +} + +// GetVerifications returns the Verifications field value if set, zero value otherwise. +func (o *Page) GetVerifications() []VerifyResult { + if o == nil || IsNil(o.Verifications) { + var ret []VerifyResult + return ret + } + return o.Verifications +} + +// GetVerificationsOk returns a tuple with the Verifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Page) GetVerificationsOk() ([]VerifyResult, bool) { + if o == nil || IsNil(o.Verifications) { + return nil, false + } + return o.Verifications, true +} + +// HasVerifications returns a boolean if a field has been set. +func (o *Page) HasVerifications() bool { + if o != nil && !IsNil(o.Verifications) { + return true + } + + return false +} + +// SetVerifications gets a reference to the given []VerifyResult and assigns it to the Verifications field. +func (o *Page) SetVerifications(v []VerifyResult) { + o.Verifications = v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise. +func (o *Page) GetMetrics() []Metric { + if o == nil || IsNil(o.Metrics) { + var ret []Metric + return ret + } + return o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Page) GetMetricsOk() ([]Metric, bool) { + if o == nil || IsNil(o.Metrics) { + return nil, false + } + return o.Metrics, true +} + +// HasMetrics returns a boolean if a field has been set. +func (o *Page) HasMetrics() bool { + if o != nil && !IsNil(o.Metrics) { + return true + } + + return false +} + +// SetMetrics gets a reference to the given []Metric and assigns it to the Metrics field. +func (o *Page) SetMetrics(v []Metric) { + o.Metrics = v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Page) GetErrors() []Error { + if o == nil || IsNil(o.Errors) { + var ret []Error + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Page) GetErrorsOk() ([]Error, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Page) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []Error and assigns it to the Errors field. +func (o *Page) SetErrors(v []Error) { + o.Errors = v +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *Page) GetSpanId() string { + if o == nil || IsNil(o.SpanId) { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Page) GetSpanIdOk() (*string, bool) { + if o == nil || IsNil(o.SpanId) { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *Page) HasSpanId() bool { + if o != nil && !IsNil(o.SpanId) { + return true + } + + return false +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *Page) SetSpanId(v string) { + o.SpanId = &v +} + +// GetParentId returns the ParentId field value if set, zero value otherwise. +func (o *Page) GetParentId() string { + if o == nil || IsNil(o.ParentId) { + var ret string + return ret + } + return *o.ParentId +} + +// GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Page) GetParentIdOk() (*string, bool) { + if o == nil || IsNil(o.ParentId) { + return nil, false + } + return o.ParentId, true +} + +// HasParentId returns a boolean if a field has been set. +func (o *Page) HasParentId() bool { + if o != nil && !IsNil(o.ParentId) { + return true + } + + return false +} + +// SetParentId gets a reference to the given string and assigns it to the ParentId field. +func (o *Page) SetParentId(v string) { + o.ParentId = &v +} + +// GetPageTimings returns the PageTimings field value +func (o *Page) GetPageTimings() PageTimings { + if o == nil { + var ret PageTimings + return ret + } + + return o.PageTimings +} + +// GetPageTimingsOk returns a tuple with the PageTimings field value +// and a boolean to check if the value has been set. +func (o *Page) GetPageTimingsOk() (*PageTimings, bool) { + if o == nil { + return nil, false + } + return &o.PageTimings, true +} + +// SetPageTimings sets field value +func (o *Page) SetPageTimings(v PageTimings) { + o.PageTimings = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *Page) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Page) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *Page) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *Page) SetComment(v string) { + o.Comment = &v +} + +func (o Page) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Page) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startedDateTime"] = o.StartedDateTime + toSerialize["id"] = o.Id + toSerialize["title"] = o.Title + if !IsNil(o.Verifications) { + toSerialize["_verifications"] = o.Verifications + } + if !IsNil(o.Metrics) { + toSerialize["_metrics"] = o.Metrics + } + if !IsNil(o.Errors) { + toSerialize["_errors"] = o.Errors + } + if !IsNil(o.SpanId) { + toSerialize["_span_id"] = o.SpanId + } + if !IsNil(o.ParentId) { + toSerialize["_parent_id"] = o.ParentId + } + toSerialize["pageTimings"] = o.PageTimings + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Page) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startedDateTime", + "id", + "title", + "pageTimings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPage := _Page{} + + err = json.Unmarshal(data, &varPage) + + if err != nil { + return err + } + + *o = Page(varPage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "startedDateTime") + delete(additionalProperties, "id") + delete(additionalProperties, "title") + delete(additionalProperties, "_verifications") + delete(additionalProperties, "_metrics") + delete(additionalProperties, "_errors") + delete(additionalProperties, "_span_id") + delete(additionalProperties, "_parent_id") + delete(additionalProperties, "pageTimings") + delete(additionalProperties, "comment") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePage struct { + value *Page + isSet bool +} + +func (v NullablePage) Get() *Page { + return v.value +} + +func (v *NullablePage) Set(val *Page) { + v.value = val + v.isSet = true +} + +func (v NullablePage) IsSet() bool { + return v.isSet +} + +func (v *NullablePage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePage(val *Page) *NullablePage { + return &NullablePage{value: val, isSet: true} +} + +func (v NullablePage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_page_timing.go b/clients/go/model_page_timing.go new file mode 100644 index 0000000000..c3d147cf78 --- /dev/null +++ b/clients/go/model_page_timing.go @@ -0,0 +1,608 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the PageTiming type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PageTiming{} + +// PageTiming struct for PageTiming +type PageTiming struct { + // onContentLoad per the browser + OnContentLoad *int32 `json:"onContentLoad,omitempty"` + // onLoad per the browser + OnLoad *int32 `json:"onLoad,omitempty"` + // firstInputDelay from the browser + FirstInputDelay *int32 `json:"_firstInputDelay,omitempty"` + // firstPaint from the browser + FirstPaint *int32 `json:"_firstPaint,omitempty"` + // cumulativeLayoutShift metric from the browser + CumulativeLayoutShift *int32 `json:"_cumulativeLayoutShift,omitempty"` + // largestContentfulPaint from the browser + LargestContentfulPaint *int32 `json:"_largestContentfulPaint,omitempty"` + // domInteractive from the browser + DomInteractive *int32 `json:"_domInteractive,omitempty"` + // firstContentfulPaint from the browser + FirstContentfulPaint *int32 `json:"_firstContentfulPaint,omitempty"` + // dns lookup time from the browser + Dns *int32 `json:"_dns,omitempty"` + // Ssl connect time from the browser + Ssl *int32 `json:"_ssl,omitempty"` + // Time to first byte of the page's first request per the browser + TimeToFirstByte *int32 `json:"_timeToFirstByte,omitempty"` + // Top level href, including hashtag, etc per the browser + Href *string `json:"_href,omitempty"` + // W3C Trace Context span ID for this page + SpanId *string `json:"_span_id,omitempty"` + // W3C Trace Context parent span ID (typically the HAR log span ID) + ParentId *string `json:"_parent_id,omitempty"` +} + +// NewPageTiming instantiates a new PageTiming object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPageTiming() *PageTiming { + this := PageTiming{} + return &this +} + +// NewPageTimingWithDefaults instantiates a new PageTiming object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPageTimingWithDefaults() *PageTiming { + this := PageTiming{} + return &this +} + +// GetOnContentLoad returns the OnContentLoad field value if set, zero value otherwise. +func (o *PageTiming) GetOnContentLoad() int32 { + if o == nil || IsNil(o.OnContentLoad) { + var ret int32 + return ret + } + return *o.OnContentLoad +} + +// GetOnContentLoadOk returns a tuple with the OnContentLoad field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetOnContentLoadOk() (*int32, bool) { + if o == nil || IsNil(o.OnContentLoad) { + return nil, false + } + return o.OnContentLoad, true +} + +// HasOnContentLoad returns a boolean if a field has been set. +func (o *PageTiming) HasOnContentLoad() bool { + if o != nil && !IsNil(o.OnContentLoad) { + return true + } + + return false +} + +// SetOnContentLoad gets a reference to the given int32 and assigns it to the OnContentLoad field. +func (o *PageTiming) SetOnContentLoad(v int32) { + o.OnContentLoad = &v +} + +// GetOnLoad returns the OnLoad field value if set, zero value otherwise. +func (o *PageTiming) GetOnLoad() int32 { + if o == nil || IsNil(o.OnLoad) { + var ret int32 + return ret + } + return *o.OnLoad +} + +// GetOnLoadOk returns a tuple with the OnLoad field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetOnLoadOk() (*int32, bool) { + if o == nil || IsNil(o.OnLoad) { + return nil, false + } + return o.OnLoad, true +} + +// HasOnLoad returns a boolean if a field has been set. +func (o *PageTiming) HasOnLoad() bool { + if o != nil && !IsNil(o.OnLoad) { + return true + } + + return false +} + +// SetOnLoad gets a reference to the given int32 and assigns it to the OnLoad field. +func (o *PageTiming) SetOnLoad(v int32) { + o.OnLoad = &v +} + +// GetFirstInputDelay returns the FirstInputDelay field value if set, zero value otherwise. +func (o *PageTiming) GetFirstInputDelay() int32 { + if o == nil || IsNil(o.FirstInputDelay) { + var ret int32 + return ret + } + return *o.FirstInputDelay +} + +// GetFirstInputDelayOk returns a tuple with the FirstInputDelay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetFirstInputDelayOk() (*int32, bool) { + if o == nil || IsNil(o.FirstInputDelay) { + return nil, false + } + return o.FirstInputDelay, true +} + +// HasFirstInputDelay returns a boolean if a field has been set. +func (o *PageTiming) HasFirstInputDelay() bool { + if o != nil && !IsNil(o.FirstInputDelay) { + return true + } + + return false +} + +// SetFirstInputDelay gets a reference to the given int32 and assigns it to the FirstInputDelay field. +func (o *PageTiming) SetFirstInputDelay(v int32) { + o.FirstInputDelay = &v +} + +// GetFirstPaint returns the FirstPaint field value if set, zero value otherwise. +func (o *PageTiming) GetFirstPaint() int32 { + if o == nil || IsNil(o.FirstPaint) { + var ret int32 + return ret + } + return *o.FirstPaint +} + +// GetFirstPaintOk returns a tuple with the FirstPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetFirstPaintOk() (*int32, bool) { + if o == nil || IsNil(o.FirstPaint) { + return nil, false + } + return o.FirstPaint, true +} + +// HasFirstPaint returns a boolean if a field has been set. +func (o *PageTiming) HasFirstPaint() bool { + if o != nil && !IsNil(o.FirstPaint) { + return true + } + + return false +} + +// SetFirstPaint gets a reference to the given int32 and assigns it to the FirstPaint field. +func (o *PageTiming) SetFirstPaint(v int32) { + o.FirstPaint = &v +} + +// GetCumulativeLayoutShift returns the CumulativeLayoutShift field value if set, zero value otherwise. +func (o *PageTiming) GetCumulativeLayoutShift() int32 { + if o == nil || IsNil(o.CumulativeLayoutShift) { + var ret int32 + return ret + } + return *o.CumulativeLayoutShift +} + +// GetCumulativeLayoutShiftOk returns a tuple with the CumulativeLayoutShift field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetCumulativeLayoutShiftOk() (*int32, bool) { + if o == nil || IsNil(o.CumulativeLayoutShift) { + return nil, false + } + return o.CumulativeLayoutShift, true +} + +// HasCumulativeLayoutShift returns a boolean if a field has been set. +func (o *PageTiming) HasCumulativeLayoutShift() bool { + if o != nil && !IsNil(o.CumulativeLayoutShift) { + return true + } + + return false +} + +// SetCumulativeLayoutShift gets a reference to the given int32 and assigns it to the CumulativeLayoutShift field. +func (o *PageTiming) SetCumulativeLayoutShift(v int32) { + o.CumulativeLayoutShift = &v +} + +// GetLargestContentfulPaint returns the LargestContentfulPaint field value if set, zero value otherwise. +func (o *PageTiming) GetLargestContentfulPaint() int32 { + if o == nil || IsNil(o.LargestContentfulPaint) { + var ret int32 + return ret + } + return *o.LargestContentfulPaint +} + +// GetLargestContentfulPaintOk returns a tuple with the LargestContentfulPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetLargestContentfulPaintOk() (*int32, bool) { + if o == nil || IsNil(o.LargestContentfulPaint) { + return nil, false + } + return o.LargestContentfulPaint, true +} + +// HasLargestContentfulPaint returns a boolean if a field has been set. +func (o *PageTiming) HasLargestContentfulPaint() bool { + if o != nil && !IsNil(o.LargestContentfulPaint) { + return true + } + + return false +} + +// SetLargestContentfulPaint gets a reference to the given int32 and assigns it to the LargestContentfulPaint field. +func (o *PageTiming) SetLargestContentfulPaint(v int32) { + o.LargestContentfulPaint = &v +} + +// GetDomInteractive returns the DomInteractive field value if set, zero value otherwise. +func (o *PageTiming) GetDomInteractive() int32 { + if o == nil || IsNil(o.DomInteractive) { + var ret int32 + return ret + } + return *o.DomInteractive +} + +// GetDomInteractiveOk returns a tuple with the DomInteractive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetDomInteractiveOk() (*int32, bool) { + if o == nil || IsNil(o.DomInteractive) { + return nil, false + } + return o.DomInteractive, true +} + +// HasDomInteractive returns a boolean if a field has been set. +func (o *PageTiming) HasDomInteractive() bool { + if o != nil && !IsNil(o.DomInteractive) { + return true + } + + return false +} + +// SetDomInteractive gets a reference to the given int32 and assigns it to the DomInteractive field. +func (o *PageTiming) SetDomInteractive(v int32) { + o.DomInteractive = &v +} + +// GetFirstContentfulPaint returns the FirstContentfulPaint field value if set, zero value otherwise. +func (o *PageTiming) GetFirstContentfulPaint() int32 { + if o == nil || IsNil(o.FirstContentfulPaint) { + var ret int32 + return ret + } + return *o.FirstContentfulPaint +} + +// GetFirstContentfulPaintOk returns a tuple with the FirstContentfulPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetFirstContentfulPaintOk() (*int32, bool) { + if o == nil || IsNil(o.FirstContentfulPaint) { + return nil, false + } + return o.FirstContentfulPaint, true +} + +// HasFirstContentfulPaint returns a boolean if a field has been set. +func (o *PageTiming) HasFirstContentfulPaint() bool { + if o != nil && !IsNil(o.FirstContentfulPaint) { + return true + } + + return false +} + +// SetFirstContentfulPaint gets a reference to the given int32 and assigns it to the FirstContentfulPaint field. +func (o *PageTiming) SetFirstContentfulPaint(v int32) { + o.FirstContentfulPaint = &v +} + +// GetDns returns the Dns field value if set, zero value otherwise. +func (o *PageTiming) GetDns() int32 { + if o == nil || IsNil(o.Dns) { + var ret int32 + return ret + } + return *o.Dns +} + +// GetDnsOk returns a tuple with the Dns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetDnsOk() (*int32, bool) { + if o == nil || IsNil(o.Dns) { + return nil, false + } + return o.Dns, true +} + +// HasDns returns a boolean if a field has been set. +func (o *PageTiming) HasDns() bool { + if o != nil && !IsNil(o.Dns) { + return true + } + + return false +} + +// SetDns gets a reference to the given int32 and assigns it to the Dns field. +func (o *PageTiming) SetDns(v int32) { + o.Dns = &v +} + +// GetSsl returns the Ssl field value if set, zero value otherwise. +func (o *PageTiming) GetSsl() int32 { + if o == nil || IsNil(o.Ssl) { + var ret int32 + return ret + } + return *o.Ssl +} + +// GetSslOk returns a tuple with the Ssl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetSslOk() (*int32, bool) { + if o == nil || IsNil(o.Ssl) { + return nil, false + } + return o.Ssl, true +} + +// HasSsl returns a boolean if a field has been set. +func (o *PageTiming) HasSsl() bool { + if o != nil && !IsNil(o.Ssl) { + return true + } + + return false +} + +// SetSsl gets a reference to the given int32 and assigns it to the Ssl field. +func (o *PageTiming) SetSsl(v int32) { + o.Ssl = &v +} + +// GetTimeToFirstByte returns the TimeToFirstByte field value if set, zero value otherwise. +func (o *PageTiming) GetTimeToFirstByte() int32 { + if o == nil || IsNil(o.TimeToFirstByte) { + var ret int32 + return ret + } + return *o.TimeToFirstByte +} + +// GetTimeToFirstByteOk returns a tuple with the TimeToFirstByte field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetTimeToFirstByteOk() (*int32, bool) { + if o == nil || IsNil(o.TimeToFirstByte) { + return nil, false + } + return o.TimeToFirstByte, true +} + +// HasTimeToFirstByte returns a boolean if a field has been set. +func (o *PageTiming) HasTimeToFirstByte() bool { + if o != nil && !IsNil(o.TimeToFirstByte) { + return true + } + + return false +} + +// SetTimeToFirstByte gets a reference to the given int32 and assigns it to the TimeToFirstByte field. +func (o *PageTiming) SetTimeToFirstByte(v int32) { + o.TimeToFirstByte = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *PageTiming) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *PageTiming) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *PageTiming) SetHref(v string) { + o.Href = &v +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *PageTiming) GetSpanId() string { + if o == nil || IsNil(o.SpanId) { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetSpanIdOk() (*string, bool) { + if o == nil || IsNil(o.SpanId) { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *PageTiming) HasSpanId() bool { + if o != nil && !IsNil(o.SpanId) { + return true + } + + return false +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *PageTiming) SetSpanId(v string) { + o.SpanId = &v +} + +// GetParentId returns the ParentId field value if set, zero value otherwise. +func (o *PageTiming) GetParentId() string { + if o == nil || IsNil(o.ParentId) { + var ret string + return ret + } + return *o.ParentId +} + +// GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTiming) GetParentIdOk() (*string, bool) { + if o == nil || IsNil(o.ParentId) { + return nil, false + } + return o.ParentId, true +} + +// HasParentId returns a boolean if a field has been set. +func (o *PageTiming) HasParentId() bool { + if o != nil && !IsNil(o.ParentId) { + return true + } + + return false +} + +// SetParentId gets a reference to the given string and assigns it to the ParentId field. +func (o *PageTiming) SetParentId(v string) { + o.ParentId = &v +} + +func (o PageTiming) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PageTiming) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OnContentLoad) { + toSerialize["onContentLoad"] = o.OnContentLoad + } + if !IsNil(o.OnLoad) { + toSerialize["onLoad"] = o.OnLoad + } + if !IsNil(o.FirstInputDelay) { + toSerialize["_firstInputDelay"] = o.FirstInputDelay + } + if !IsNil(o.FirstPaint) { + toSerialize["_firstPaint"] = o.FirstPaint + } + if !IsNil(o.CumulativeLayoutShift) { + toSerialize["_cumulativeLayoutShift"] = o.CumulativeLayoutShift + } + if !IsNil(o.LargestContentfulPaint) { + toSerialize["_largestContentfulPaint"] = o.LargestContentfulPaint + } + if !IsNil(o.DomInteractive) { + toSerialize["_domInteractive"] = o.DomInteractive + } + if !IsNil(o.FirstContentfulPaint) { + toSerialize["_firstContentfulPaint"] = o.FirstContentfulPaint + } + if !IsNil(o.Dns) { + toSerialize["_dns"] = o.Dns + } + if !IsNil(o.Ssl) { + toSerialize["_ssl"] = o.Ssl + } + if !IsNil(o.TimeToFirstByte) { + toSerialize["_timeToFirstByte"] = o.TimeToFirstByte + } + if !IsNil(o.Href) { + toSerialize["_href"] = o.Href + } + if !IsNil(o.SpanId) { + toSerialize["_span_id"] = o.SpanId + } + if !IsNil(o.ParentId) { + toSerialize["_parent_id"] = o.ParentId + } + return toSerialize, nil +} + +type NullablePageTiming struct { + value *PageTiming + isSet bool +} + +func (v NullablePageTiming) Get() *PageTiming { + return v.value +} + +func (v *NullablePageTiming) Set(val *PageTiming) { + v.value = val + v.isSet = true +} + +func (v NullablePageTiming) IsSet() bool { + return v.isSet +} + +func (v *NullablePageTiming) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePageTiming(val *PageTiming) *NullablePageTiming { + return &NullablePageTiming{value: val, isSet: true} +} + +func (v NullablePageTiming) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePageTiming) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_page_timings.go b/clients/go/model_page_timings.go new file mode 100644 index 0000000000..9e7c9638e3 --- /dev/null +++ b/clients/go/model_page_timings.go @@ -0,0 +1,644 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "fmt" +) + +// checks if the PageTimings type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PageTimings{} + +// PageTimings struct for PageTimings +type PageTimings struct { + OnContentLoad int64 `json:"onContentLoad"` + OnLoad int64 `json:"onLoad"` + Href *string `json:"_href,omitempty"` + Dns *int64 `json:"_dns,omitempty"` + Ssl *int64 `json:"_ssl,omitempty"` + TimeToFirstByte *int64 `json:"_timeToFirstByte,omitempty"` + CumulativeLayoutShift *float32 `json:"_cumulativeLayoutShift,omitempty"` + LargestContentfulPaint *LargestContentfulPaint `json:"_largestContentfulPaint,omitempty"` + FirstPaint *int64 `json:"_firstPaint,omitempty"` + FirstInputDelay *float32 `json:"_firstInputDelay,omitempty"` + DomInteractive *int64 `json:"_domInteractive,omitempty"` + FirstContentfulPaint *int64 `json:"_firstContentfulPaint,omitempty"` + Comment *string `json:"comment,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PageTimings PageTimings + +// NewPageTimings instantiates a new PageTimings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPageTimings(onContentLoad int64, onLoad int64) *PageTimings { + this := PageTimings{} + this.OnContentLoad = onContentLoad + this.OnLoad = onLoad + var href string = "" + this.Href = &href + var dns int64 = -1 + this.Dns = &dns + var ssl int64 = -1 + this.Ssl = &ssl + var timeToFirstByte int64 = -1 + this.TimeToFirstByte = &timeToFirstByte + var cumulativeLayoutShift float32 = -1 + this.CumulativeLayoutShift = &cumulativeLayoutShift + var firstPaint int64 = -1 + this.FirstPaint = &firstPaint + var firstInputDelay float32 = -1 + this.FirstInputDelay = &firstInputDelay + var domInteractive int64 = -1 + this.DomInteractive = &domInteractive + var firstContentfulPaint int64 = -1 + this.FirstContentfulPaint = &firstContentfulPaint + return &this +} + +// NewPageTimingsWithDefaults instantiates a new PageTimings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPageTimingsWithDefaults() *PageTimings { + this := PageTimings{} + var onContentLoad int64 = -1 + this.OnContentLoad = onContentLoad + var onLoad int64 = -1 + this.OnLoad = onLoad + var href string = "" + this.Href = &href + var dns int64 = -1 + this.Dns = &dns + var ssl int64 = -1 + this.Ssl = &ssl + var timeToFirstByte int64 = -1 + this.TimeToFirstByte = &timeToFirstByte + var cumulativeLayoutShift float32 = -1 + this.CumulativeLayoutShift = &cumulativeLayoutShift + var firstPaint int64 = -1 + this.FirstPaint = &firstPaint + var firstInputDelay float32 = -1 + this.FirstInputDelay = &firstInputDelay + var domInteractive int64 = -1 + this.DomInteractive = &domInteractive + var firstContentfulPaint int64 = -1 + this.FirstContentfulPaint = &firstContentfulPaint + return &this +} + +// GetOnContentLoad returns the OnContentLoad field value +func (o *PageTimings) GetOnContentLoad() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.OnContentLoad +} + +// GetOnContentLoadOk returns a tuple with the OnContentLoad field value +// and a boolean to check if the value has been set. +func (o *PageTimings) GetOnContentLoadOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OnContentLoad, true +} + +// SetOnContentLoad sets field value +func (o *PageTimings) SetOnContentLoad(v int64) { + o.OnContentLoad = v +} + +// GetOnLoad returns the OnLoad field value +func (o *PageTimings) GetOnLoad() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.OnLoad +} + +// GetOnLoadOk returns a tuple with the OnLoad field value +// and a boolean to check if the value has been set. +func (o *PageTimings) GetOnLoadOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OnLoad, true +} + +// SetOnLoad sets field value +func (o *PageTimings) SetOnLoad(v int64) { + o.OnLoad = v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *PageTimings) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *PageTimings) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *PageTimings) SetHref(v string) { + o.Href = &v +} + +// GetDns returns the Dns field value if set, zero value otherwise. +func (o *PageTimings) GetDns() int64 { + if o == nil || IsNil(o.Dns) { + var ret int64 + return ret + } + return *o.Dns +} + +// GetDnsOk returns a tuple with the Dns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetDnsOk() (*int64, bool) { + if o == nil || IsNil(o.Dns) { + return nil, false + } + return o.Dns, true +} + +// HasDns returns a boolean if a field has been set. +func (o *PageTimings) HasDns() bool { + if o != nil && !IsNil(o.Dns) { + return true + } + + return false +} + +// SetDns gets a reference to the given int64 and assigns it to the Dns field. +func (o *PageTimings) SetDns(v int64) { + o.Dns = &v +} + +// GetSsl returns the Ssl field value if set, zero value otherwise. +func (o *PageTimings) GetSsl() int64 { + if o == nil || IsNil(o.Ssl) { + var ret int64 + return ret + } + return *o.Ssl +} + +// GetSslOk returns a tuple with the Ssl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetSslOk() (*int64, bool) { + if o == nil || IsNil(o.Ssl) { + return nil, false + } + return o.Ssl, true +} + +// HasSsl returns a boolean if a field has been set. +func (o *PageTimings) HasSsl() bool { + if o != nil && !IsNil(o.Ssl) { + return true + } + + return false +} + +// SetSsl gets a reference to the given int64 and assigns it to the Ssl field. +func (o *PageTimings) SetSsl(v int64) { + o.Ssl = &v +} + +// GetTimeToFirstByte returns the TimeToFirstByte field value if set, zero value otherwise. +func (o *PageTimings) GetTimeToFirstByte() int64 { + if o == nil || IsNil(o.TimeToFirstByte) { + var ret int64 + return ret + } + return *o.TimeToFirstByte +} + +// GetTimeToFirstByteOk returns a tuple with the TimeToFirstByte field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetTimeToFirstByteOk() (*int64, bool) { + if o == nil || IsNil(o.TimeToFirstByte) { + return nil, false + } + return o.TimeToFirstByte, true +} + +// HasTimeToFirstByte returns a boolean if a field has been set. +func (o *PageTimings) HasTimeToFirstByte() bool { + if o != nil && !IsNil(o.TimeToFirstByte) { + return true + } + + return false +} + +// SetTimeToFirstByte gets a reference to the given int64 and assigns it to the TimeToFirstByte field. +func (o *PageTimings) SetTimeToFirstByte(v int64) { + o.TimeToFirstByte = &v +} + +// GetCumulativeLayoutShift returns the CumulativeLayoutShift field value if set, zero value otherwise. +func (o *PageTimings) GetCumulativeLayoutShift() float32 { + if o == nil || IsNil(o.CumulativeLayoutShift) { + var ret float32 + return ret + } + return *o.CumulativeLayoutShift +} + +// GetCumulativeLayoutShiftOk returns a tuple with the CumulativeLayoutShift field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetCumulativeLayoutShiftOk() (*float32, bool) { + if o == nil || IsNil(o.CumulativeLayoutShift) { + return nil, false + } + return o.CumulativeLayoutShift, true +} + +// HasCumulativeLayoutShift returns a boolean if a field has been set. +func (o *PageTimings) HasCumulativeLayoutShift() bool { + if o != nil && !IsNil(o.CumulativeLayoutShift) { + return true + } + + return false +} + +// SetCumulativeLayoutShift gets a reference to the given float32 and assigns it to the CumulativeLayoutShift field. +func (o *PageTimings) SetCumulativeLayoutShift(v float32) { + o.CumulativeLayoutShift = &v +} + +// GetLargestContentfulPaint returns the LargestContentfulPaint field value if set, zero value otherwise. +func (o *PageTimings) GetLargestContentfulPaint() LargestContentfulPaint { + if o == nil || IsNil(o.LargestContentfulPaint) { + var ret LargestContentfulPaint + return ret + } + return *o.LargestContentfulPaint +} + +// GetLargestContentfulPaintOk returns a tuple with the LargestContentfulPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetLargestContentfulPaintOk() (*LargestContentfulPaint, bool) { + if o == nil || IsNil(o.LargestContentfulPaint) { + return nil, false + } + return o.LargestContentfulPaint, true +} + +// HasLargestContentfulPaint returns a boolean if a field has been set. +func (o *PageTimings) HasLargestContentfulPaint() bool { + if o != nil && !IsNil(o.LargestContentfulPaint) { + return true + } + + return false +} + +// SetLargestContentfulPaint gets a reference to the given LargestContentfulPaint and assigns it to the LargestContentfulPaint field. +func (o *PageTimings) SetLargestContentfulPaint(v LargestContentfulPaint) { + o.LargestContentfulPaint = &v +} + +// GetFirstPaint returns the FirstPaint field value if set, zero value otherwise. +func (o *PageTimings) GetFirstPaint() int64 { + if o == nil || IsNil(o.FirstPaint) { + var ret int64 + return ret + } + return *o.FirstPaint +} + +// GetFirstPaintOk returns a tuple with the FirstPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetFirstPaintOk() (*int64, bool) { + if o == nil || IsNil(o.FirstPaint) { + return nil, false + } + return o.FirstPaint, true +} + +// HasFirstPaint returns a boolean if a field has been set. +func (o *PageTimings) HasFirstPaint() bool { + if o != nil && !IsNil(o.FirstPaint) { + return true + } + + return false +} + +// SetFirstPaint gets a reference to the given int64 and assigns it to the FirstPaint field. +func (o *PageTimings) SetFirstPaint(v int64) { + o.FirstPaint = &v +} + +// GetFirstInputDelay returns the FirstInputDelay field value if set, zero value otherwise. +func (o *PageTimings) GetFirstInputDelay() float32 { + if o == nil || IsNil(o.FirstInputDelay) { + var ret float32 + return ret + } + return *o.FirstInputDelay +} + +// GetFirstInputDelayOk returns a tuple with the FirstInputDelay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetFirstInputDelayOk() (*float32, bool) { + if o == nil || IsNil(o.FirstInputDelay) { + return nil, false + } + return o.FirstInputDelay, true +} + +// HasFirstInputDelay returns a boolean if a field has been set. +func (o *PageTimings) HasFirstInputDelay() bool { + if o != nil && !IsNil(o.FirstInputDelay) { + return true + } + + return false +} + +// SetFirstInputDelay gets a reference to the given float32 and assigns it to the FirstInputDelay field. +func (o *PageTimings) SetFirstInputDelay(v float32) { + o.FirstInputDelay = &v +} + +// GetDomInteractive returns the DomInteractive field value if set, zero value otherwise. +func (o *PageTimings) GetDomInteractive() int64 { + if o == nil || IsNil(o.DomInteractive) { + var ret int64 + return ret + } + return *o.DomInteractive +} + +// GetDomInteractiveOk returns a tuple with the DomInteractive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetDomInteractiveOk() (*int64, bool) { + if o == nil || IsNil(o.DomInteractive) { + return nil, false + } + return o.DomInteractive, true +} + +// HasDomInteractive returns a boolean if a field has been set. +func (o *PageTimings) HasDomInteractive() bool { + if o != nil && !IsNil(o.DomInteractive) { + return true + } + + return false +} + +// SetDomInteractive gets a reference to the given int64 and assigns it to the DomInteractive field. +func (o *PageTimings) SetDomInteractive(v int64) { + o.DomInteractive = &v +} + +// GetFirstContentfulPaint returns the FirstContentfulPaint field value if set, zero value otherwise. +func (o *PageTimings) GetFirstContentfulPaint() int64 { + if o == nil || IsNil(o.FirstContentfulPaint) { + var ret int64 + return ret + } + return *o.FirstContentfulPaint +} + +// GetFirstContentfulPaintOk returns a tuple with the FirstContentfulPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetFirstContentfulPaintOk() (*int64, bool) { + if o == nil || IsNil(o.FirstContentfulPaint) { + return nil, false + } + return o.FirstContentfulPaint, true +} + +// HasFirstContentfulPaint returns a boolean if a field has been set. +func (o *PageTimings) HasFirstContentfulPaint() bool { + if o != nil && !IsNil(o.FirstContentfulPaint) { + return true + } + + return false +} + +// SetFirstContentfulPaint gets a reference to the given int64 and assigns it to the FirstContentfulPaint field. +func (o *PageTimings) SetFirstContentfulPaint(v int64) { + o.FirstContentfulPaint = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *PageTimings) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PageTimings) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *PageTimings) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *PageTimings) SetComment(v string) { + o.Comment = &v +} + +func (o PageTimings) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PageTimings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["onContentLoad"] = o.OnContentLoad + toSerialize["onLoad"] = o.OnLoad + if !IsNil(o.Href) { + toSerialize["_href"] = o.Href + } + if !IsNil(o.Dns) { + toSerialize["_dns"] = o.Dns + } + if !IsNil(o.Ssl) { + toSerialize["_ssl"] = o.Ssl + } + if !IsNil(o.TimeToFirstByte) { + toSerialize["_timeToFirstByte"] = o.TimeToFirstByte + } + if !IsNil(o.CumulativeLayoutShift) { + toSerialize["_cumulativeLayoutShift"] = o.CumulativeLayoutShift + } + if !IsNil(o.LargestContentfulPaint) { + toSerialize["_largestContentfulPaint"] = o.LargestContentfulPaint + } + if !IsNil(o.FirstPaint) { + toSerialize["_firstPaint"] = o.FirstPaint + } + if !IsNil(o.FirstInputDelay) { + toSerialize["_firstInputDelay"] = o.FirstInputDelay + } + if !IsNil(o.DomInteractive) { + toSerialize["_domInteractive"] = o.DomInteractive + } + if !IsNil(o.FirstContentfulPaint) { + toSerialize["_firstContentfulPaint"] = o.FirstContentfulPaint + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PageTimings) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "onContentLoad", + "onLoad", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPageTimings := _PageTimings{} + + err = json.Unmarshal(data, &varPageTimings) + + if err != nil { + return err + } + + *o = PageTimings(varPageTimings) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "onContentLoad") + delete(additionalProperties, "onLoad") + delete(additionalProperties, "_href") + delete(additionalProperties, "_dns") + delete(additionalProperties, "_ssl") + delete(additionalProperties, "_timeToFirstByte") + delete(additionalProperties, "_cumulativeLayoutShift") + delete(additionalProperties, "_largestContentfulPaint") + delete(additionalProperties, "_firstPaint") + delete(additionalProperties, "_firstInputDelay") + delete(additionalProperties, "_domInteractive") + delete(additionalProperties, "_firstContentfulPaint") + delete(additionalProperties, "comment") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePageTimings struct { + value *PageTimings + isSet bool +} + +func (v NullablePageTimings) Get() *PageTimings { + return v.value +} + +func (v *NullablePageTimings) Set(val *PageTimings) { + v.value = val + v.isSet = true +} + +func (v NullablePageTimings) IsSet() bool { + return v.isSet +} + +func (v *NullablePageTimings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePageTimings(val *PageTimings) *NullablePageTimings { + return &NullablePageTimings{value: val, isSet: true} +} + +func (v NullablePageTimings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePageTimings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_verify_result.go b/clients/go/model_verify_result.go new file mode 100644 index 0000000000..deee5198ad --- /dev/null +++ b/clients/go/model_verify_result.go @@ -0,0 +1,201 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" +) + +// checks if the VerifyResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VerifyResult{} + +// VerifyResult struct for VerifyResult +type VerifyResult struct { + // Result True / False + Result *bool `json:"result,omitempty"` + // Name + Name *string `json:"name,omitempty"` + // Type + Type *string `json:"type,omitempty"` +} + +// NewVerifyResult instantiates a new VerifyResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVerifyResult() *VerifyResult { + this := VerifyResult{} + return &this +} + +// NewVerifyResultWithDefaults instantiates a new VerifyResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVerifyResultWithDefaults() *VerifyResult { + this := VerifyResult{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *VerifyResult) GetResult() bool { + if o == nil || IsNil(o.Result) { + var ret bool + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerifyResult) GetResultOk() (*bool, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *VerifyResult) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given bool and assigns it to the Result field. +func (o *VerifyResult) SetResult(v bool) { + o.Result = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VerifyResult) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerifyResult) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VerifyResult) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VerifyResult) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VerifyResult) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerifyResult) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VerifyResult) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *VerifyResult) SetType(v string) { + o.Type = &v +} + +func (o VerifyResult) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerifyResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableVerifyResult struct { + value *VerifyResult + isSet bool +} + +func (v NullableVerifyResult) Get() *VerifyResult { + return v.value +} + +func (v *NullableVerifyResult) Set(val *VerifyResult) { + v.value = val + v.isSet = true +} + +func (v NullableVerifyResult) IsSet() bool { + return v.isSet +} + +func (v *NullableVerifyResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVerifyResult(val *VerifyResult) *NullableVerifyResult { + return &NullableVerifyResult{value: val, isSet: true} +} + +func (v NullableVerifyResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVerifyResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/model_web_socket_message.go b/clients/go/model_web_socket_message.go new file mode 100644 index 0000000000..479d3ef4a2 --- /dev/null +++ b/clients/go/model_web_socket_message.go @@ -0,0 +1,242 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the WebSocketMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebSocketMessage{} + +// WebSocketMessage struct for WebSocketMessage +type WebSocketMessage struct { + Type string `json:"type"` + Opcode float32 `json:"opcode"` + Data string `json:"data"` + Time float32 `json:"time"` +} + +type _WebSocketMessage WebSocketMessage + +// NewWebSocketMessage instantiates a new WebSocketMessage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebSocketMessage(type_ string, opcode float32, data string, time float32) *WebSocketMessage { + this := WebSocketMessage{} + this.Type = type_ + this.Opcode = opcode + this.Data = data + this.Time = time + return &this +} + +// NewWebSocketMessageWithDefaults instantiates a new WebSocketMessage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebSocketMessageWithDefaults() *WebSocketMessage { + this := WebSocketMessage{} + return &this +} + +// GetType returns the Type field value +func (o *WebSocketMessage) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WebSocketMessage) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WebSocketMessage) SetType(v string) { + o.Type = v +} + +// GetOpcode returns the Opcode field value +func (o *WebSocketMessage) GetOpcode() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Opcode +} + +// GetOpcodeOk returns a tuple with the Opcode field value +// and a boolean to check if the value has been set. +func (o *WebSocketMessage) GetOpcodeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Opcode, true +} + +// SetOpcode sets field value +func (o *WebSocketMessage) SetOpcode(v float32) { + o.Opcode = v +} + +// GetData returns the Data field value +func (o *WebSocketMessage) GetData() string { + if o == nil { + var ret string + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *WebSocketMessage) GetDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *WebSocketMessage) SetData(v string) { + o.Data = v +} + +// GetTime returns the Time field value +func (o *WebSocketMessage) GetTime() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Time +} + +// GetTimeOk returns a tuple with the Time field value +// and a boolean to check if the value has been set. +func (o *WebSocketMessage) GetTimeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Time, true +} + +// SetTime sets field value +func (o *WebSocketMessage) SetTime(v float32) { + o.Time = v +} + +func (o WebSocketMessage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebSocketMessage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["opcode"] = o.Opcode + toSerialize["data"] = o.Data + toSerialize["time"] = o.Time + return toSerialize, nil +} + +func (o *WebSocketMessage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "opcode", + "data", + "time", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebSocketMessage := _WebSocketMessage{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebSocketMessage) + + if err != nil { + return err + } + + *o = WebSocketMessage(varWebSocketMessage) + + return err +} + +type NullableWebSocketMessage struct { + value *WebSocketMessage + isSet bool +} + +func (v NullableWebSocketMessage) Get() *WebSocketMessage { + return v.value +} + +func (v *NullableWebSocketMessage) Set(val *WebSocketMessage) { + v.value = val + v.isSet = true +} + +func (v NullableWebSocketMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableWebSocketMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebSocketMessage(val *WebSocketMessage) *NullableWebSocketMessage { + return &NullableWebSocketMessage{value: val, isSet: true} +} + +func (v NullableWebSocketMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebSocketMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/go/response.go b/clients/go/response.go new file mode 100644 index 0000000000..8082c1ad61 --- /dev/null +++ b/clients/go/response.go @@ -0,0 +1,47 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/clients/go/test/api_browser_up_proxy_test.go b/clients/go/test/api_browser_up_proxy_test.go new file mode 100644 index 0000000000..79fd1fba75 --- /dev/null +++ b/clients/go/test/api_browser_up_proxy_test.go @@ -0,0 +1,154 @@ +/* +BrowserUp MitmProxy + +Testing BrowserUpProxyAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package BrowserUpMitmProxyClient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func Test_BrowserUpMitmProxyClient_BrowserUpProxyAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test BrowserUpProxyAPIService AddError", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.BrowserUpProxyAPI.AddError(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService AddMetric", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.BrowserUpProxyAPI.AddMetric(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService GetHarLog", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.GetHarLog(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService Healthcheck", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.BrowserUpProxyAPI.Healthcheck(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService NewPage", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var title string + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.NewPage(context.Background(), title).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService ResetHarLog", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.ResetHarLog(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService VerifyNotPresent", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var name string + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.VerifyNotPresent(context.Background(), name).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService VerifyPresent", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var name string + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.VerifyPresent(context.Background(), name).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService VerifySLA", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var time int32 + var name string + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.VerifySLA(context.Background(), time, name).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BrowserUpProxyAPIService VerifySize", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var size int32 + var name string + + resp, httpRes, err := apiClient.BrowserUpProxyAPI.VerifySize(context.Background(), size, name).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/clients/go/utils.go b/clients/go/utils.go new file mode 100644 index 0000000000..2418f0f85a --- /dev/null +++ b/clients/go/utils.go @@ -0,0 +1,361 @@ +/* +BrowserUp MitmProxy + +___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + +API version: 1.25 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package BrowserUpMitmProxyClient + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/clients/java/.github/workflows/maven.yml b/clients/java/.github/workflows/maven.yml index 0a06fa3161..0f3095aa35 100644 --- a/clients/java/.github/workflows/maven.yml +++ b/clients/java/.github/workflows/maven.yml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'temurin' diff --git a/clients/java/.openapi-generator/FILES b/clients/java/.openapi-generator/FILES index 2804164d4a..aafd7938a6 100644 --- a/clients/java/.openapi-generator/FILES +++ b/clients/java/.openapi-generator/FILES @@ -13,7 +13,6 @@ docs/Har.md docs/HarEntry.md docs/HarEntryCache.md docs/HarEntryCacheBeforeRequest.md -docs/HarEntryCacheBeforeRequestOneOf.md docs/HarEntryRequest.md docs/HarEntryRequestCookiesInner.md docs/HarEntryRequestPostData.md @@ -27,7 +26,6 @@ docs/HarLogCreator.md docs/Header.md docs/LargestContentfulPaint.md docs/MatchCriteria.md -docs/MatchCriteriaRequestHeader.md docs/Metric.md docs/NameValuePair.md docs/Page.md @@ -58,7 +56,6 @@ src/main/java/com/browserup/proxy_client/Har.java src/main/java/com/browserup/proxy_client/HarEntry.java src/main/java/com/browserup/proxy_client/HarEntryCache.java src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequest.java -src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOf.java src/main/java/com/browserup/proxy_client/HarEntryRequest.java src/main/java/com/browserup/proxy_client/HarEntryRequestCookiesInner.java src/main/java/com/browserup/proxy_client/HarEntryRequestPostData.java @@ -73,7 +70,6 @@ src/main/java/com/browserup/proxy_client/Header.java src/main/java/com/browserup/proxy_client/JSON.java src/main/java/com/browserup/proxy_client/LargestContentfulPaint.java src/main/java/com/browserup/proxy_client/MatchCriteria.java -src/main/java/com/browserup/proxy_client/MatchCriteriaRequestHeader.java src/main/java/com/browserup/proxy_client/Metric.java src/main/java/com/browserup/proxy_client/NameValuePair.java src/main/java/com/browserup/proxy_client/Page.java @@ -94,7 +90,6 @@ src/main/java/com/browserup/proxy_client/auth/HttpBearerAuth.java src/test/java/com/browserup/proxy/api/BrowserUpProxyApiTest.java src/test/java/com/browserup/proxy_client/ActionTest.java src/test/java/com/browserup/proxy_client/ErrorTest.java -src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOfTest.java src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestTest.java src/test/java/com/browserup/proxy_client/HarEntryCacheTest.java src/test/java/com/browserup/proxy_client/HarEntryRequestCookiesInnerTest.java @@ -111,7 +106,6 @@ src/test/java/com/browserup/proxy_client/HarLogTest.java src/test/java/com/browserup/proxy_client/HarTest.java src/test/java/com/browserup/proxy_client/HeaderTest.java src/test/java/com/browserup/proxy_client/LargestContentfulPaintTest.java -src/test/java/com/browserup/proxy_client/MatchCriteriaRequestHeaderTest.java src/test/java/com/browserup/proxy_client/MatchCriteriaTest.java src/test/java/com/browserup/proxy_client/MetricTest.java src/test/java/com/browserup/proxy_client/NameValuePairTest.java diff --git a/clients/java/.openapi-generator/VERSION b/clients/java/.openapi-generator/VERSION index c0be8a7992..5f84a81db0 100644 --- a/clients/java/.openapi-generator/VERSION +++ b/clients/java/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +7.12.0 diff --git a/clients/java/README.md b/clients/java/README.md index a3b8b07c97..357a2084c4 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -1,7 +1,8 @@ # browserup-mitmproxy-client BrowserUp MitmProxy -- API version: 1.24 +- API version: 1.25 + - Generator version: 7.12.0 ___ This is the REST API for controlling the BrowserUp MitmProxy. @@ -87,7 +88,7 @@ Please follow the [installation](#installation) instruction and execute the foll import com.browserup.proxy_client.ApiClient; import com.browserup.proxy_client.ApiException; import com.browserup.proxy_client.Configuration; -import com.browserup.proxy_client.models.*; +import com.browserup.proxy_client.*; import com.browserup.proxy.api.BrowserUpProxyApi; public class Example { @@ -137,7 +138,6 @@ Class | Method | HTTP request | Description - [HarEntry](docs/HarEntry.md) - [HarEntryCache](docs/HarEntryCache.md) - [HarEntryCacheBeforeRequest](docs/HarEntryCacheBeforeRequest.md) - - [HarEntryCacheBeforeRequestOneOf](docs/HarEntryCacheBeforeRequestOneOf.md) - [HarEntryRequest](docs/HarEntryRequest.md) - [HarEntryRequestCookiesInner](docs/HarEntryRequestCookiesInner.md) - [HarEntryRequestPostData](docs/HarEntryRequestPostData.md) @@ -151,7 +151,6 @@ Class | Method | HTTP request | Description - [Header](docs/Header.md) - [LargestContentfulPaint](docs/LargestContentfulPaint.md) - [MatchCriteria](docs/MatchCriteria.md) - - [MatchCriteriaRequestHeader](docs/MatchCriteriaRequestHeader.md) - [Metric](docs/Metric.md) - [NameValuePair](docs/NameValuePair.md) - [Page](docs/Page.md) @@ -161,10 +160,11 @@ Class | Method | HTTP request | Description - [WebSocketMessage](docs/WebSocketMessage.md) + ## Documentation for Authorization -All endpoints do not require authorization. -Authentication schemes defined for the API: +Endpoints do not require authorization. + ## Recommendation diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index 04e7a6f573..186c7c67e4 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -7,7 +7,7 @@ info: captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ title: BrowserUp MitmProxy - version: "1.24" + version: "1.25" x-logo: url: logo.png servers: @@ -35,7 +35,8 @@ paths: description: The current Har file. tags: - BrowserUpProxy - x-accepts: application/json + x-accepts: + - application/json put: description: Starts a fresh HAR capture session. operationId: resetHarLog @@ -48,7 +49,8 @@ paths: description: The current Har file. tags: - BrowserUpProxy - x-accepts: application/json + x-accepts: + - application/json /har/page: post: description: Starts a fresh HAR Page (Step) in the current active HAR to group @@ -73,7 +75,8 @@ paths: description: The current Har file. tags: - BrowserUpProxy - x-accepts: application/json + x-accepts: + - application/json /verify/present/{name}: post: description: Verify at least one matching item is present in the captured traffic @@ -107,7 +110,8 @@ paths: tags: - BrowserUpProxy x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /verify/not_present/{name}: post: description: Verify no matching items are present in the captured traffic @@ -141,7 +145,8 @@ paths: tags: - BrowserUpProxy x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /verify/size/{size}/{name}: post: description: Verify matching items in the captured traffic meet the size criteria @@ -184,7 +189,8 @@ paths: tags: - BrowserUpProxy x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /verify/sla/{time}/{name}: post: description: Verify each traffic item matching the criteria meets is below SLA @@ -228,7 +234,8 @@ paths: tags: - BrowserUpProxy x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /har/errors: post: description: Add Custom Error to the captured traffic har @@ -249,7 +256,8 @@ paths: tags: - BrowserUpProxy x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /har/metrics: post: description: Add Custom Metric to the captured traffic har @@ -270,7 +278,8 @@ paths: tags: - BrowserUpProxy x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /healthcheck: get: description: Get the healthcheck @@ -280,47 +289,55 @@ paths: description: OK means all is well. tags: - BrowserUpProxy - x-accepts: application/json + x-accepts: + - application/json components: schemas: PageTiming: properties: onContentLoad: description: onContentLoad per the browser - type: number + type: integer onLoad: description: onLoad per the browser - type: number + type: integer _firstInputDelay: description: firstInputDelay from the browser - type: number + type: integer _firstPaint: description: firstPaint from the browser - type: number + type: integer _cumulativeLayoutShift: description: cumulativeLayoutShift metric from the browser - type: number + type: integer _largestContentfulPaint: description: largestContentfulPaint from the browser - type: number + type: integer _domInteractive: description: domInteractive from the browser - type: number + type: integer _firstContentfulPaint: description: firstContentfulPaint from the browser - type: number + type: integer _dns: description: dns lookup time from the browser - type: number + type: integer _ssl: description: Ssl connect time from the browser - type: number + type: integer _timeToFirstByte: description: Time to first byte of the page's first request per the browser - type: number + type: integer _href: description: "Top level href, including hashtag, etc per the browser" type: string + _span_id: + description: W3C Trace Context span ID for this page + type: string + _parent_id: + description: W3C Trace Context parent span ID (typically the HAR log span + ID) + type: string type: object NameValuePair: properties: @@ -336,15 +353,15 @@ components: A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison example: - request_cookie: null - response_cookie: null + request_cookie: "" + response_cookie: "" json_path: json_path error_if_no_traffic: true url: url content: content - response_header: null + response_header: "" content_type: content_type - request_header: null + request_header: "" json_schema: json_schema json_valid: true page: page @@ -388,13 +405,29 @@ components: url: https://docs.python.org/3/howto/regex.html type: string request_header: - $ref: '#/components/schemas/MatchCriteria_request_header' + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html request_cookie: - $ref: '#/components/schemas/MatchCriteria_request_header' + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html response_header: - $ref: '#/components/schemas/MatchCriteria_request_header' + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html response_cookie: - $ref: '#/components/schemas/MatchCriteria_request_header' + allOf: + - $ref: '#/components/schemas/NameValuePair' + externalDocs: + description: Python Regex + url: https://docs.python.org/3/howto/regex.html json_valid: description: Is valid JSON type: boolean @@ -440,7 +473,7 @@ components: Metric: example: name: name - value: 0.8008281904610115 + value: 0 properties: name: description: Name of Custom Metric to add to the page under _metrics @@ -448,15 +481,15 @@ components: value: description: Value for the metric format: double - type: number + type: integer type: object LargestContentfulPaint: additionalProperties: true example: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" properties: startTime: default: -1 @@ -478,9 +511,9 @@ components: WebSocketMessage: example: data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 properties: type: type: string @@ -535,16 +568,16 @@ components: PageTimings: additionalProperties: true example: - _href: _href + _href: "" _ssl: 0 _firstPaint: 0 _cumulativeLayoutShift: -0.29385987 _dns: 0 _largestContentfulPaint: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" _firstInputDelay: -0.5854392 _domInteractive: 0 _timeToFirstByte: 0 @@ -677,18 +710,31 @@ components: secure: true value: value cache: - afterRequest: null + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment comment: comment - beforeRequest: null + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment _webSocketMessages: - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id response: headers: - name: name @@ -736,7 +782,7 @@ components: compression: 4 _videoWaitingCount: 0 status: 7 - serverIPAddress: serverIPAddress + _parent_id: _parent_id timings: receive: 0 wait: 0 @@ -804,18 +850,31 @@ components: secure: true value: value cache: - afterRequest: null + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment comment: comment - beforeRequest: null + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment _webSocketMessages: - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id response: headers: - name: name @@ -863,7 +922,7 @@ components: compression: 4 _videoWaitingCount: 0 status: 7 - serverIPAddress: serverIPAddress + _parent_id: _parent_id timings: receive: 0 wait: 0 @@ -880,16 +939,16 @@ components: pages: - startedDateTime: 2000-01-23T04:56:07.000+00:00 pageTimings: - _href: _href + _href: "" _ssl: 0 _firstPaint: 0 _cumulativeLayoutShift: -0.29385987 _dns: 0 _largestContentfulPaint: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" _firstInputDelay: -0.5854392 _domInteractive: 0 _timeToFirstByte: 0 @@ -897,6 +956,8 @@ components: onContentLoad: 0 onLoad: 0 comment: comment + _span_id: _span_id + _parent_id: _parent_id comment: comment id: id _verifications: @@ -909,9 +970,9 @@ components: title: title _metrics: - name: name - value: 0.8008281904610115 + value: 0 - name: name - value: 0.8008281904610115 + value: 0 _errors: - name: name details: details @@ -919,16 +980,16 @@ components: details: details - startedDateTime: 2000-01-23T04:56:07.000+00:00 pageTimings: - _href: _href + _href: "" _ssl: 0 _firstPaint: 0 _cumulativeLayoutShift: -0.29385987 _dns: 0 _largestContentfulPaint: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" _firstInputDelay: -0.5854392 _domInteractive: 0 _timeToFirstByte: 0 @@ -936,6 +997,8 @@ components: onContentLoad: 0 onLoad: 0 comment: comment + _span_id: _span_id + _parent_id: _parent_id comment: comment id: id _verifications: @@ -948,18 +1011,20 @@ components: title: title _metrics: - name: name - value: 0.8008281904610115 + value: 0 - name: name - value: 0.8008281904610115 + value: 0 _errors: - name: name details: details - name: name details: details + _span_id: _span_id browser: name: name comment: comment version: version + _trace_id: _trace_id comment: comment version: version properties: @@ -1024,18 +1089,31 @@ components: secure: true value: value cache: - afterRequest: null + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment comment: comment - beforeRequest: null + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment _webSocketMessages: - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id response: headers: - name: name @@ -1083,7 +1161,7 @@ components: compression: 4 _videoWaitingCount: 0 status: 7 - serverIPAddress: serverIPAddress + _parent_id: _parent_id timings: receive: 0 wait: 0 @@ -1121,6 +1199,15 @@ components: items: $ref: '#/components/schemas/WebSocketMessage' type: array + _span_id: + description: W3C Trace Context span ID for this entry + type: string + _parent_id: + description: W3C Trace Context parent span ID (typically the page span ID) + type: string + _trace_id: + description: W3C Trace Context trace ID for distributed tracing + type: string connection: type: string comment: @@ -1141,16 +1228,16 @@ components: example: startedDateTime: 2000-01-23T04:56:07.000+00:00 pageTimings: - _href: _href + _href: "" _ssl: 0 _firstPaint: 0 _cumulativeLayoutShift: -0.29385987 _dns: 0 _largestContentfulPaint: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" _firstInputDelay: -0.5854392 _domInteractive: 0 _timeToFirstByte: 0 @@ -1158,6 +1245,8 @@ components: onContentLoad: 0 onLoad: 0 comment: comment + _span_id: _span_id + _parent_id: _parent_id comment: comment id: id _verifications: @@ -1170,9 +1259,9 @@ components: title: title _metrics: - name: name - value: 0.8008281904610115 + value: 0 - name: name - value: 0.8008281904610115 + value: 0 _errors: - name: name details: details @@ -1201,6 +1290,13 @@ components: items: $ref: '#/components/schemas/Error' type: array + _span_id: + description: W3C Trace Context span ID for this page + type: string + _parent_id: + description: W3C Trace Context parent span ID (typically the HAR log span + ID) + type: string pageTimings: $ref: '#/components/schemas/PageTimings' comment: @@ -1211,12 +1307,6 @@ components: - startedDateTime - title type: object - MatchCriteria_request_header: - allOf: - - $ref: '#/components/schemas/NameValuePair' - externalDocs: - description: Python Regex - url: https://docs.python.org/3/howto/regex.html Har_log_creator: example: name: name @@ -1294,18 +1384,31 @@ components: secure: true value: value cache: - afterRequest: null + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment comment: comment - beforeRequest: null + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment _webSocketMessages: - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id response: headers: - name: name @@ -1353,7 +1456,7 @@ components: compression: 4 _videoWaitingCount: 0 status: 7 - serverIPAddress: serverIPAddress + _parent_id: _parent_id timings: receive: 0 wait: 0 @@ -1421,18 +1524,31 @@ components: secure: true value: value cache: - afterRequest: null + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment comment: comment - beforeRequest: null + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment _webSocketMessages: - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 - data: data - time: 0.8851374739011653 + time: 7.058770351582356 type: type - opcode: 7.143538047012306 + opcode: 0.8851374739011653 + serverIPAddress: serverIPAddress + _trace_id: _trace_id + _span_id: _span_id response: headers: - name: name @@ -1480,7 +1596,7 @@ components: compression: 4 _videoWaitingCount: 0 status: 7 - serverIPAddress: serverIPAddress + _parent_id: _parent_id timings: receive: 0 wait: 0 @@ -1497,16 +1613,16 @@ components: pages: - startedDateTime: 2000-01-23T04:56:07.000+00:00 pageTimings: - _href: _href + _href: "" _ssl: 0 _firstPaint: 0 _cumulativeLayoutShift: -0.29385987 _dns: 0 _largestContentfulPaint: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" _firstInputDelay: -0.5854392 _domInteractive: 0 _timeToFirstByte: 0 @@ -1514,6 +1630,8 @@ components: onContentLoad: 0 onLoad: 0 comment: comment + _span_id: _span_id + _parent_id: _parent_id comment: comment id: id _verifications: @@ -1526,9 +1644,9 @@ components: title: title _metrics: - name: name - value: 0.8008281904610115 + value: 0 - name: name - value: 0.8008281904610115 + value: 0 _errors: - name: name details: details @@ -1536,16 +1654,16 @@ components: details: details - startedDateTime: 2000-01-23T04:56:07.000+00:00 pageTimings: - _href: _href + _href: "" _ssl: 0 _firstPaint: 0 _cumulativeLayoutShift: -0.29385987 _dns: 0 _largestContentfulPaint: size: 0 - domPath: domPath + domPath: "" startTime: 0 - tag: tag + tag: "" _firstInputDelay: -0.5854392 _domInteractive: 0 _timeToFirstByte: 0 @@ -1553,6 +1671,8 @@ components: onContentLoad: 0 onLoad: 0 comment: comment + _span_id: _span_id + _parent_id: _parent_id comment: comment id: id _verifications: @@ -1565,18 +1685,20 @@ components: title: title _metrics: - name: name - value: 0.8008281904610115 + value: 0 - name: name - value: 0.8008281904610115 + value: 0 _errors: - name: name details: details - name: name details: details + _span_id: _span_id browser: name: name comment: comment version: version + _trace_id: _trace_id comment: comment version: version externalDocs: @@ -1597,6 +1719,12 @@ components: items: $ref: '#/components/schemas/HarEntry' type: array + _trace_id: + description: W3C Trace Context trace ID for distributed tracing + type: string + _span_id: + description: W3C Trace Context span ID for this HAR trace root + type: string comment: type: string required: @@ -1947,7 +2075,14 @@ components: - status - statusText type: object - HarEntry_cache_beforeRequest_oneOf: + HarEntry_cache_beforeRequest: + example: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment + nullable: true properties: expires: type: string @@ -1964,15 +2099,21 @@ components: - hitCount - lastAccess type: object - HarEntry_cache_beforeRequest: - oneOf: - - type: "null" - - $ref: '#/components/schemas/HarEntry_cache_beforeRequest_oneOf' HarEntry_cache: example: - afterRequest: null + afterRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment comment: comment - beforeRequest: null + beforeRequest: + expires: expires + hitCount: 2 + lastAccess: lastAccess + eTag: eTag + comment: comment properties: beforeRequest: $ref: '#/components/schemas/HarEntry_cache_beforeRequest' diff --git a/clients/java/build.gradle b/clients/java/build.gradle index 588f8560a1..3ba3879a2c 100644 --- a/clients/java/build.gradle +++ b/clients/java/build.gradle @@ -62,9 +62,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task) } } @@ -150,18 +150,17 @@ ext { dependencies { implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.10.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' implementation 'com.google.code.gson:gson:2.9.1' - implementation 'io.gsonfire:gson-fire:1.8.5' - implementation 'javax.ws.rs:jsr311-api:1.1.1' - implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.4' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/clients/java/build.sbt b/clients/java/build.sbt index 917606cc3d..409df7ff21 100644 --- a/clients/java/build.sbt +++ b/clients/java/build.sbt @@ -10,18 +10,17 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.10.0", - "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", - "javax.ws.rs" % "jsr311-api" % "1.1.1", - "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.4", - "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/clients/java/docs/BrowserUpProxyApi.md b/clients/java/docs/BrowserUpProxyApi.md index 061fea4e43..fbcc69741f 100644 --- a/clients/java/docs/BrowserUpProxyApi.md +++ b/clients/java/docs/BrowserUpProxyApi.md @@ -16,7 +16,7 @@ All URIs are relative to *http://localhost:48088* | [**verifySize**](BrowserUpProxyApi.md#verifySize) | **POST** /verify/size/{size}/{name} | | - + # **addError** > addError(error) @@ -78,7 +78,7 @@ No authorization required | **204** | The Error was added. | - | | **422** | The Error was invalid. | - | - + # **addMetric** > addMetric(metric) @@ -140,7 +140,7 @@ No authorization required | **204** | The metric was added. | - | | **422** | The metric was invalid. | - | - + # **getHarLog** > Har getHarLog() @@ -198,7 +198,7 @@ No authorization required |-------------|-------------|------------------| | **200** | The current Har file. | - | - + # **healthcheck** > healthcheck() @@ -255,7 +255,7 @@ No authorization required |-------------|-------------|------------------| | **200** | OK means all is well. | - | - + # **newPage** > Har newPage(title) @@ -317,7 +317,7 @@ No authorization required |-------------|-------------|------------------| | **200** | The current Har file. | - | - + # **resetHarLog** > Har resetHarLog() @@ -375,7 +375,7 @@ No authorization required |-------------|-------------|------------------| | **200** | The current Har file. | - | - + # **verifyNotPresent** > VerifyResult verifyNotPresent(name, matchCriteria) @@ -440,7 +440,7 @@ No authorization required | **200** | The traffic had no matching items | - | | **422** | The MatchCriteria are invalid. | - | - + # **verifyPresent** > VerifyResult verifyPresent(name, matchCriteria) @@ -505,7 +505,7 @@ No authorization required | **200** | The traffic conformed to the time criteria. | - | | **422** | The MatchCriteria are invalid. | - | - + # **verifySLA** > VerifyResult verifySLA(time, name, matchCriteria) @@ -572,7 +572,7 @@ No authorization required | **200** | The traffic conformed to the time criteria. | - | | **422** | The MatchCriteria are invalid. | - | - + # **verifySize** > VerifyResult verifySize(size, name, matchCriteria) diff --git a/clients/java/docs/HarEntry.md b/clients/java/docs/HarEntry.md index ebfbf735b6..3d3fa85ce2 100644 --- a/clients/java/docs/HarEntry.md +++ b/clients/java/docs/HarEntry.md @@ -16,6 +16,9 @@ |**timings** | [**HarEntryTimings**](HarEntryTimings.md) | | | |**serverIPAddress** | **String** | | [optional] | |**webSocketMessages** | [**List<WebSocketMessage>**](WebSocketMessage.md) | | [optional] | +|**spanId** | **String** | W3C Trace Context span ID for this entry | [optional] | +|**parentId** | **String** | W3C Trace Context parent span ID (typically the page span ID) | [optional] | +|**traceId** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] | |**connection** | **String** | | [optional] | |**comment** | **String** | | [optional] | diff --git a/clients/java/docs/HarEntryCacheBeforeRequestOneOf.md b/clients/java/docs/HarEntryCacheBeforeRequestOneOf.md deleted file mode 100644 index 06cb1a8433..0000000000 --- a/clients/java/docs/HarEntryCacheBeforeRequestOneOf.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# HarEntryCacheBeforeRequestOneOf - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**expires** | **String** | | [optional] | -|**lastAccess** | **String** | | | -|**eTag** | **String** | | | -|**hitCount** | **Integer** | | | -|**comment** | **String** | | [optional] | - - - diff --git a/clients/java/docs/HarLog.md b/clients/java/docs/HarLog.md index fe901a9eb6..4ae1bb7ad7 100644 --- a/clients/java/docs/HarLog.md +++ b/clients/java/docs/HarLog.md @@ -12,6 +12,8 @@ |**browser** | [**HarLogCreator**](HarLogCreator.md) | | [optional] | |**pages** | **List<Page>** | | | |**entries** | [**List<HarEntry>**](HarEntry.md) | | | +|**traceId** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] | +|**spanId** | **String** | W3C Trace Context span ID for this HAR trace root | [optional] | |**comment** | **String** | | [optional] | diff --git a/clients/java/docs/MatchCriteria.md b/clients/java/docs/MatchCriteria.md index 233045b7a9..0f8e959650 100644 --- a/clients/java/docs/MatchCriteria.md +++ b/clients/java/docs/MatchCriteria.md @@ -14,10 +14,10 @@ A set of criteria for filtering HTTP Requests and Responses. |**content** | **String** | Body content regexp content to match | [optional] | |**contentType** | **String** | Content type | [optional] | |**websocketMessage** | **String** | Websocket message text to match | [optional] | -|**requestHeader** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | -|**requestCookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | -|**responseHeader** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | -|**responseCookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | +|**requestHeader** | [**NameValuePair**](NameValuePair.md) | | [optional] | +|**requestCookie** | [**NameValuePair**](NameValuePair.md) | | [optional] | +|**responseHeader** | [**NameValuePair**](NameValuePair.md) | | [optional] | +|**responseCookie** | [**NameValuePair**](NameValuePair.md) | | [optional] | |**jsonValid** | **Boolean** | Is valid JSON | [optional] | |**jsonPath** | **String** | Has JSON path | [optional] | |**jsonSchema** | **String** | Validates against passed JSON schema | [optional] | diff --git a/clients/java/docs/MatchCriteriaRequestHeader.md b/clients/java/docs/MatchCriteriaRequestHeader.md deleted file mode 100644 index 7bcbf738b8..0000000000 --- a/clients/java/docs/MatchCriteriaRequestHeader.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# MatchCriteriaRequestHeader - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name to match | [optional] | -|**value** | **String** | Value to match | [optional] | - - - diff --git a/clients/java/docs/Metric.md b/clients/java/docs/Metric.md index e84b32f6d5..76c54e9923 100644 --- a/clients/java/docs/Metric.md +++ b/clients/java/docs/Metric.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**name** | **String** | Name of Custom Metric to add to the page under _metrics | [optional] | -|**value** | **Double** | Value for the metric | [optional] | +|**value** | **Integer** | Value for the metric | [optional] | diff --git a/clients/java/docs/Page.md b/clients/java/docs/Page.md index 19b65f6387..cfa5eb92c3 100644 --- a/clients/java/docs/Page.md +++ b/clients/java/docs/Page.md @@ -13,6 +13,8 @@ |**verifications** | [**List<VerifyResult>**](VerifyResult.md) | | [optional] | |**metrics** | [**List<Metric>**](Metric.md) | | [optional] | |**errors** | [**List<Error>**](Error.md) | | [optional] | +|**spanId** | **String** | W3C Trace Context span ID for this page | [optional] | +|**parentId** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] | |**pageTimings** | **PageTimings** | | | |**comment** | **String** | | [optional] | diff --git a/clients/java/docs/PageTiming.md b/clients/java/docs/PageTiming.md index 53e143d891..0148db8fe3 100644 --- a/clients/java/docs/PageTiming.md +++ b/clients/java/docs/PageTiming.md @@ -7,18 +7,20 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**onContentLoad** | **BigDecimal** | onContentLoad per the browser | [optional] | -|**onLoad** | **BigDecimal** | onLoad per the browser | [optional] | -|**firstInputDelay** | **BigDecimal** | firstInputDelay from the browser | [optional] | -|**firstPaint** | **BigDecimal** | firstPaint from the browser | [optional] | -|**cumulativeLayoutShift** | **BigDecimal** | cumulativeLayoutShift metric from the browser | [optional] | -|**largestContentfulPaint** | **BigDecimal** | largestContentfulPaint from the browser | [optional] | -|**domInteractive** | **BigDecimal** | domInteractive from the browser | [optional] | -|**firstContentfulPaint** | **BigDecimal** | firstContentfulPaint from the browser | [optional] | -|**dns** | **BigDecimal** | dns lookup time from the browser | [optional] | -|**ssl** | **BigDecimal** | Ssl connect time from the browser | [optional] | -|**timeToFirstByte** | **BigDecimal** | Time to first byte of the page's first request per the browser | [optional] | +|**onContentLoad** | **Integer** | onContentLoad per the browser | [optional] | +|**onLoad** | **Integer** | onLoad per the browser | [optional] | +|**firstInputDelay** | **Integer** | firstInputDelay from the browser | [optional] | +|**firstPaint** | **Integer** | firstPaint from the browser | [optional] | +|**cumulativeLayoutShift** | **Integer** | cumulativeLayoutShift metric from the browser | [optional] | +|**largestContentfulPaint** | **Integer** | largestContentfulPaint from the browser | [optional] | +|**domInteractive** | **Integer** | domInteractive from the browser | [optional] | +|**firstContentfulPaint** | **Integer** | firstContentfulPaint from the browser | [optional] | +|**dns** | **Integer** | dns lookup time from the browser | [optional] | +|**ssl** | **Integer** | Ssl connect time from the browser | [optional] | +|**timeToFirstByte** | **Integer** | Time to first byte of the page's first request per the browser | [optional] | |**href** | **String** | Top level href, including hashtag, etc per the browser | [optional] | +|**spanId** | **String** | W3C Trace Context span ID for this page | [optional] | +|**parentId** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] | diff --git a/clients/java/gradle/wrapper/gradle-wrapper.jar b/clients/java/gradle/wrapper/gradle-wrapper.jar index 7454180f2a..e6441136f3 100644 Binary files a/clients/java/gradle/wrapper/gradle-wrapper.jar and b/clients/java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/clients/java/gradle/wrapper/gradle-wrapper.properties b/clients/java/gradle/wrapper/gradle-wrapper.properties index ffed3a254e..b82aa23a4f 100644 --- a/clients/java/gradle/wrapper/gradle-wrapper.properties +++ b/clients/java/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/clients/java/gradlew b/clients/java/gradlew index 005bcde042..9d0ce634cb 100755 --- a/clients/java/gradlew +++ b/clients/java/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/clients/java/gradlew.bat b/clients/java/gradlew.bat index 6a68175eb7..25da30dbde 100644 --- a/clients/java/gradlew.bat +++ b/clients/java/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/clients/java/pom.xml b/clients/java/pom.xml index 30211e5c14..9876966b32 100644 --- a/clients/java/pom.xml +++ b/clients/java/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.4.1 enforce-maven @@ -72,12 +72,12 @@ maven-surefire-plugin 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -93,7 +93,7 @@ maven-dependency-plugin - 3.3.0 + 3.6.1 package @@ -124,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.5.0 add_sources @@ -155,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.6.3 attach-javadocs @@ -178,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources @@ -241,7 +241,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.1 sign-artifacts @@ -300,16 +300,10 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -324,30 +318,23 @@ ${junit-platform-runner.version} test - - org.mockito - mockito-core - ${mockito-core-version} - test - 1.8 ${java.version} ${java.version} - 1.8.5 - 1.6.6 - 4.10.0 - 2.9.1 - 3.12.0 - 0.2.4 + 1.9.0 + 4.12.0 + 2.10.1 + 3.17.0 + 0.2.6 1.3.5 - 5.9.1 - 1.9.1 - 3.12.4 - 2.1.1 + 2.0.2 + 5.10.3 + 1.10.0 + 2.1.6 1.1.1 UTF-8 - 2.27.2 + 2.43.0 diff --git a/clients/java/src/main/java/com/browserup/proxy/api/BrowserUpProxyApi.java b/clients/java/src/main/java/com/browserup/proxy/api/BrowserUpProxyApi.java index c46960d488..76620fe2b0 100644 --- a/clients/java/src/main/java/com/browserup/proxy/api/BrowserUpProxyApi.java +++ b/clients/java/src/main/java/com/browserup/proxy/api/BrowserUpProxyApi.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -38,7 +38,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class BrowserUpProxyApi { private ApiClient localVarApiClient; @@ -84,7 +83,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+ @@ -151,7 +151,8 @@ private okhttp3.Call addErrorValidateBeforeCall(Error error, final ApiCallback _ * @param error Receives an error to track. Internally, the error is stored in an array in the har under the _errors key (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
204 The Error was added. -
422 The Error was invalid. -
+
+ @@ -168,7 +169,8 @@ public void addError(Error error) throws ApiException { * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
204 The Error was added. -
422 The Error was invalid. -
+
+ @@ -187,7 +189,8 @@ public ApiResponse addErrorWithHttpInfo(Error error) throws ApiException { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
204 The Error was added. -
422 The Error was invalid. -
+
+ @@ -206,7 +209,8 @@ public okhttp3.Call addErrorAsync(Error error, final ApiCallback _callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
204 The Error was added. -
422 The Error was invalid. -
+
+ @@ -273,7 +277,8 @@ private okhttp3.Call addMetricValidateBeforeCall(Metric metric, final ApiCallbac * @param metric Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
204 The metric was added. -
422 The metric was invalid. -
+
+ @@ -290,7 +295,8 @@ public void addMetric(Metric metric) throws ApiException { * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
204 The metric was added. -
422 The metric was invalid. -
+
+ @@ -309,7 +315,8 @@ public ApiResponse addMetricWithHttpInfo(Metric metric) throws ApiExceptio * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
204 The metric was added. -
422 The metric was invalid. -
+
+ @@ -327,7 +334,8 @@ public okhttp3.Call addMetricAsync(Metric metric, final ApiCallback _callb * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
204 The metric was added. -
422 The metric was invalid. -
+
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -388,7 +396,8 @@ private okhttp3.Call getHarLogValidateBeforeCall(final ApiCallback _callback) th * @return Har * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -404,7 +413,8 @@ public Har getHarLog() throws ApiException { * @return ApiResponse<Har> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -422,7 +432,8 @@ public ApiResponse getHarLogWithHttpInfo() throws ApiException { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -440,7 +451,8 @@ public okhttp3.Call getHarLogAsync(final ApiCallback _callback) throws ApiE * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 OK means all is well. -
@@ -499,7 +511,8 @@ private okhttp3.Call healthcheckValidateBeforeCall(final ApiCallback _callback) * Get the healthcheck * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 OK means all is well. -
@@ -514,7 +527,8 @@ public void healthcheck() throws ApiException { * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 OK means all is well. -
@@ -531,7 +545,8 @@ public ApiResponse healthcheckWithHttpInfo() throws ApiException { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 OK means all is well. -
@@ -549,7 +564,8 @@ public okhttp3.Call healthcheckAsync(final ApiCallback _callback) throws A * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -617,7 +633,8 @@ private okhttp3.Call newPageValidateBeforeCall(String title, final ApiCallback _ * @return Har * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -634,7 +651,8 @@ public Har newPage(String title) throws ApiException { * @return ApiResponse<Har> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -653,7 +671,8 @@ public ApiResponse newPageWithHttpInfo(String title) throws ApiException { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -671,7 +690,8 @@ public okhttp3.Call newPageAsync(String title, final ApiCallback _callback) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -732,7 +752,8 @@ private okhttp3.Call resetHarLogValidateBeforeCall(final ApiCallback _callback) * @return Har * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -748,7 +769,8 @@ public Har resetHarLog() throws ApiException { * @return ApiResponse<Har> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -766,7 +788,8 @@ public ApiResponse resetHarLogWithHttpInfo() throws ApiException { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
+
Response Details
Status Code Description Response Headers
200 The current Har file. -
@@ -786,7 +809,8 @@ public okhttp3.Call resetHarLogAsync(final ApiCallback _callback) throws Ap * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+ @@ -862,7 +886,8 @@ private okhttp3.Call verifyNotPresentValidateBeforeCall(String name, MatchCriter * @return VerifyResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic had no matching items -
422 The MatchCriteria are invalid. -
+
+ @@ -881,7 +906,8 @@ public VerifyResult verifyNotPresent(String name, MatchCriteria matchCriteria) t * @return ApiResponse<VerifyResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic had no matching items -
422 The MatchCriteria are invalid. -
+
+ @@ -902,7 +928,8 @@ public ApiResponse verifyNotPresentWithHttpInfo(String name, Match * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic had no matching items -
422 The MatchCriteria are invalid. -
+
+ @@ -923,7 +950,8 @@ public okhttp3.Call verifyNotPresentAsync(String name, MatchCriteria matchCriter * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic had no matching items -
422 The MatchCriteria are invalid. -
+
+ @@ -999,7 +1027,8 @@ private okhttp3.Call verifyPresentValidateBeforeCall(String name, MatchCriteria * @return VerifyResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1018,7 +1047,8 @@ public VerifyResult verifyPresent(String name, MatchCriteria matchCriteria) thro * @return ApiResponse<VerifyResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1039,7 +1069,8 @@ public ApiResponse verifyPresentWithHttpInfo(String name, MatchCri * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1061,7 +1092,8 @@ public okhttp3.Call verifyPresentAsync(String name, MatchCriteria matchCriteria, * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1144,7 +1176,8 @@ private okhttp3.Call verifySLAValidateBeforeCall(Integer time, String name, Matc * @return VerifyResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1164,7 +1197,8 @@ public VerifyResult verifySLA(Integer time, String name, MatchCriteria matchCrit * @return ApiResponse<VerifyResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1186,7 +1220,8 @@ public ApiResponse verifySLAWithHttpInfo(Integer time, String name * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1208,7 +1243,8 @@ public okhttp3.Call verifySLAAsync(Integer time, String name, MatchCriteria matc * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the time criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1291,7 +1327,8 @@ private okhttp3.Call verifySizeValidateBeforeCall(Integer size, String name, Mat * @return VerifyResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the size criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1311,7 +1348,8 @@ public VerifyResult verifySize(Integer size, String name, MatchCriteria matchCri * @return ApiResponse<VerifyResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the size criteria. -
422 The MatchCriteria are invalid. -
+
+ @@ -1333,7 +1371,8 @@ public ApiResponse verifySizeWithHttpInfo(Integer size, String nam * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 The traffic conformed to the size criteria. -
422 The MatchCriteria are invalid. -
+
+ diff --git a/clients/java/src/main/java/com/browserup/proxy_client/AbstractOpenApiSchema.java b/clients/java/src/main/java/com/browserup/proxy_client/AbstractOpenApiSchema.java index 2bf0b9fe25..9c5b8a1cf9 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/AbstractOpenApiSchema.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,14 +17,11 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; - -//import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -46,7 +43,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Action.java b/clients/java/src/main/java/com/browserup/proxy_client/Action.java index f1993b12b8..c838231ff8 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Action.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Action.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,215 +50,199 @@ /** * Action */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Action { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private String id; public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) + @javax.annotation.Nullable private String className; public static final String SERIALIZED_NAME_TAG_NAME = "tagName"; @SerializedName(SERIALIZED_NAME_TAG_NAME) + @javax.annotation.Nullable private String tagName; public static final String SERIALIZED_NAME_XPATH = "xpath"; @SerializedName(SERIALIZED_NAME_XPATH) + @javax.annotation.Nullable private String xpath; public static final String SERIALIZED_NAME_DATA_ATTRIBUTES = "dataAttributes"; @SerializedName(SERIALIZED_NAME_DATA_ATTRIBUTES) + @javax.annotation.Nullable private String dataAttributes; public static final String SERIALIZED_NAME_FORM_NAME = "formName"; @SerializedName(SERIALIZED_NAME_FORM_NAME) + @javax.annotation.Nullable private String formName; public static final String SERIALIZED_NAME_CONTENT = "content"; @SerializedName(SERIALIZED_NAME_CONTENT) + @javax.annotation.Nullable private String content; public Action() { } - public Action name(String name) { - + public Action name(@javax.annotation.Nullable String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nullable String name) { this.name = name; } - public Action id(String id) { - + public Action id(@javax.annotation.Nullable String id) { this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable - public String getId() { return id; } - - public void setId(String id) { + public void setId(@javax.annotation.Nullable String id) { this.id = id; } - public Action className(String className) { - + public Action className(@javax.annotation.Nullable String className) { this.className = className; return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nullable - public String getClassName() { return className; } - - public void setClassName(String className) { + public void setClassName(@javax.annotation.Nullable String className) { this.className = className; } - public Action tagName(String tagName) { - + public Action tagName(@javax.annotation.Nullable String tagName) { this.tagName = tagName; return this; } - /** + /** * Get tagName * @return tagName - **/ + */ @javax.annotation.Nullable - public String getTagName() { return tagName; } - - public void setTagName(String tagName) { + public void setTagName(@javax.annotation.Nullable String tagName) { this.tagName = tagName; } - public Action xpath(String xpath) { - + public Action xpath(@javax.annotation.Nullable String xpath) { this.xpath = xpath; return this; } - /** + /** * Get xpath * @return xpath - **/ + */ @javax.annotation.Nullable - public String getXpath() { return xpath; } - - public void setXpath(String xpath) { + public void setXpath(@javax.annotation.Nullable String xpath) { this.xpath = xpath; } - public Action dataAttributes(String dataAttributes) { - + public Action dataAttributes(@javax.annotation.Nullable String dataAttributes) { this.dataAttributes = dataAttributes; return this; } - /** + /** * Get dataAttributes * @return dataAttributes - **/ + */ @javax.annotation.Nullable - public String getDataAttributes() { return dataAttributes; } - - public void setDataAttributes(String dataAttributes) { + public void setDataAttributes(@javax.annotation.Nullable String dataAttributes) { this.dataAttributes = dataAttributes; } - public Action formName(String formName) { - + public Action formName(@javax.annotation.Nullable String formName) { this.formName = formName; return this; } - /** + /** * Get formName * @return formName - **/ + */ @javax.annotation.Nullable - public String getFormName() { return formName; } - - public void setFormName(String formName) { + public void setFormName(@javax.annotation.Nullable String formName) { this.formName = formName; } - public Action content(String content) { - + public Action content(@javax.annotation.Nullable String content) { this.content = content; return this; } - /** + /** * Get content * @return content - **/ + */ @javax.annotation.Nullable - public String getContent() { return content; } - - public void setContent(String content) { + public void setContent(@javax.annotation.Nullable String content) { this.content = content; } @@ -262,26 +250,12 @@ public void setContent(String content) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Action action = (Action) o; - return Objects.equals(this.name, action.name) && - Objects.equals(this.id, action.id) && - Objects.equals(this.className, action.className) && - Objects.equals(this.tagName, action.tagName) && - Objects.equals(this.xpath, action.xpath) && - Objects.equals(this.dataAttributes, action.dataAttributes) && - Objects.equals(this.formName, action.formName) && - Objects.equals(this.content, action.content); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, id, className, tagName, xpath, dataAttributes, formName, content); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -331,26 +305,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Action - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Action.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Action + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Action.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Action is not found in the empty JSON string", Action.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Action.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Action` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Action` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -397,31 +372,31 @@ public void write(JsonWriter out, Action value) throws IOException { @Override public Action read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Action given an JSON string - * - * @param jsonString JSON string - * @return An instance of Action - * @throws IOException if the JSON string is invalid with respect to Action - */ + /** + * Create an instance of Action given an JSON string + * + * @param jsonString JSON string + * @return An instance of Action + * @throws IOException if the JSON string is invalid with respect to Action + */ public static Action fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Action.class); } - /** - * Convert an instance of Action to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Action to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ApiCallback.java b/clients/java/src/main/java/com/browserup/proxy_client/ApiCallback.java index afec5b44f7..8cb46206b5 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ApiCallback.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ApiCallback.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ApiClient.java b/clients/java/src/main/java/com/browserup/proxy_client/ApiClient.java index c6baa5417f..4c0c8f291d 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ApiClient.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ApiClient.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -47,6 +47,7 @@ import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -474,6 +475,19 @@ public void setAWS4Configuration(String accessKey, String secretKey, String regi throw new RuntimeException("No AWS4 authentication configured!"); } + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + /** * Set the User-Agent header's value (by adding to the default header map). * @@ -729,6 +743,31 @@ public List parameterToPairs(String collectionFormat, String name, Collect return params; } + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** * Formats the specified collection path parameter to a string value. * @@ -1167,21 +1206,20 @@ public Call buildCall(String baseUrl, String path, String method, List que * @throws com.browserup.proxy_client.ApiException If fail to serialize the request body object */ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; String contentType = headerParams.get("Content-Type"); - + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { + } else if ("multipart/form-data".equals(contentTypePure)) { reqBody = buildRequestBodyMultipart(formParams); } else if (body == null) { if ("DELETE".equals(method)) { @@ -1195,10 +1233,12 @@ public Request buildRequest(String baseUrl, String path, String method, List updatedQueryParams = new ArrayList<>(queryParams); + // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - final Request.Builder reqBuilder = new Request.Builder().url(url); + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); processHeaderParams(headerParams, reqBuilder); processCookieParams(cookieParams, reqBuilder); diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ApiException.java b/clients/java/src/main/java/com/browserup/proxy_client/ApiException.java index 80ad8945da..349c367623 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ApiException.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ApiException.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,18 +18,19 @@ import java.util.Map.Entry; import java.util.TreeMap; -import javax.ws.rs.core.GenericType; /** *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - + /** *

Constructor for ApiException.

*/ diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ApiResponse.java b/clients/java/src/main/java/com/browserup/proxy_client/ApiResponse.java index 26f611c348..6422c44991 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ApiResponse.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ApiResponse.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Configuration.java b/clients/java/src/main/java/com/browserup/proxy_client/Configuration.java index b9f3447018..c304297df0 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Configuration.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Configuration.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,9 +13,11 @@ package com.browserup.proxy_client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Configuration { - private static ApiClient defaultApiClient = new ApiClient(); + public static final String VERSION = "1.1.4-SNAPSHOT"; + + private static volatile ApiClient defaultApiClient = new ApiClient(); /** * Get the default API client, which would be used when creating API diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Error.java b/clients/java/src/main/java/com/browserup/proxy_client/Error.java index 8bf045bff7..b1d51927ea 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Error.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Error.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,59 +50,55 @@ /** * Error */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Error { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_DETAILS = "details"; @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nullable private String details; public Error() { } - public Error name(String name) { - + public Error name(@javax.annotation.Nullable String name) { this.name = name; return this; } - /** + /** * Name of the Error to add. Stored in har under _errors * @return name - **/ + */ @javax.annotation.Nullable - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nullable String name) { this.name = name; } - public Error details(String details) { - + public Error details(@javax.annotation.Nullable String details) { this.details = details; return this; } - /** + /** * Short details of the error * @return details - **/ + */ @javax.annotation.Nullable - public String getDetails() { return details; } - - public void setDetails(String details) { + public void setDetails(@javax.annotation.Nullable String details) { this.details = details; } @@ -106,20 +106,12 @@ public void setDetails(String details) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Error error = (Error) o; - return Objects.equals(this.name, error.name) && - Objects.equals(this.details, error.details); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, details); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -157,26 +149,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Error - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Error.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Error is not found in the empty JSON string", Error.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Error.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Error` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Error` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -205,31 +198,31 @@ public void write(JsonWriter out, Error value) throws IOException { @Override public Error read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Error given an JSON string - * - * @param jsonString JSON string - * @return An instance of Error - * @throws IOException if the JSON string is invalid with respect to Error - */ + /** + * Create an instance of Error given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error + * @throws IOException if the JSON string is invalid with respect to Error + */ public static Error fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Error.class); } - /** - * Convert an instance of Error to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Error to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/GzipRequestInterceptor.java b/clients/java/src/main/java/com/browserup/proxy_client/GzipRequestInterceptor.java index 0637d1226e..163d8ac12d 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/GzipRequestInterceptor.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Har.java b/clients/java/src/main/java/com/browserup/proxy_client/Har.java index 570d7508dd..ef5883dbbf 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Har.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Har.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarLog; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -22,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -33,13 +35,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -47,33 +51,31 @@ /** * Har */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Har { public static final String SERIALIZED_NAME_LOG = "log"; @SerializedName(SERIALIZED_NAME_LOG) + @javax.annotation.Nonnull private HarLog log; public Har() { } - public Har log(HarLog log) { - + public Har log(@javax.annotation.Nonnull HarLog log) { this.log = log; return this; } - /** + /** * Get log * @return log - **/ + */ @javax.annotation.Nonnull - public HarLog getLog() { return log; } - - public void setLog(HarLog log) { + public void setLog(@javax.annotation.Nonnull HarLog log) { this.log = log; } @@ -125,20 +127,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Har har = (Har) o; - return Objects.equals(this.log, har.log)&& - Objects.equals(this.additionalProperties, har.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(log, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -176,27 +170,28 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("log"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Har - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Har.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Har + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Har.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Har is not found in the empty JSON string", Har.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Har.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `log` - HarLog.validateJsonObject(jsonObj.getAsJsonObject("log")); + HarLog.validateJsonElement(jsonObj.get("log")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -227,7 +222,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -236,8 +236,9 @@ else if (entry.getValue() instanceof Character) @Override public Har read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance Har instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { @@ -265,22 +266,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Har given an JSON string - * - * @param jsonString JSON string - * @return An instance of Har - * @throws IOException if the JSON string is invalid with respect to Har - */ + /** + * Create an instance of Har given an JSON string + * + * @param jsonString JSON string + * @return An instance of Har + * @throws IOException if the JSON string is invalid with respect to Har + */ public static Har fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Har.class); } - /** - * Convert an instance of Har to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Har to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntry.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntry.java index a18f9ce696..444e569209 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntry.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntry.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarEntryCache; import com.browserup.proxy_client.HarEntryRequest; import com.browserup.proxy_client.HarEntryResponse; @@ -28,6 +29,7 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gson.Gson; @@ -40,13 +42,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -54,234 +58,235 @@ /** * HarEntry */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntry { public static final String SERIALIZED_NAME_PAGEREF = "pageref"; @SerializedName(SERIALIZED_NAME_PAGEREF) + @javax.annotation.Nullable private String pageref; public static final String SERIALIZED_NAME_STARTED_DATE_TIME = "startedDateTime"; @SerializedName(SERIALIZED_NAME_STARTED_DATE_TIME) + @javax.annotation.Nonnull private OffsetDateTime startedDateTime; public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) + @javax.annotation.Nonnull private Long time; public static final String SERIALIZED_NAME_REQUEST = "request"; @SerializedName(SERIALIZED_NAME_REQUEST) + @javax.annotation.Nonnull private HarEntryRequest request; public static final String SERIALIZED_NAME_RESPONSE = "response"; @SerializedName(SERIALIZED_NAME_RESPONSE) + @javax.annotation.Nonnull private HarEntryResponse response; public static final String SERIALIZED_NAME_CACHE = "cache"; @SerializedName(SERIALIZED_NAME_CACHE) + @javax.annotation.Nonnull private HarEntryCache cache; public static final String SERIALIZED_NAME_TIMINGS = "timings"; @SerializedName(SERIALIZED_NAME_TIMINGS) + @javax.annotation.Nonnull private HarEntryTimings timings; public static final String SERIALIZED_NAME_SERVER_I_P_ADDRESS = "serverIPAddress"; @SerializedName(SERIALIZED_NAME_SERVER_I_P_ADDRESS) + @javax.annotation.Nullable private String serverIPAddress; public static final String SERIALIZED_NAME_WEB_SOCKET_MESSAGES = "_webSocketMessages"; @SerializedName(SERIALIZED_NAME_WEB_SOCKET_MESSAGES) + @javax.annotation.Nullable private List webSocketMessages = new ArrayList<>(); + public static final String SERIALIZED_NAME_SPAN_ID = "_span_id"; + @SerializedName(SERIALIZED_NAME_SPAN_ID) + @javax.annotation.Nullable + private String spanId; + + public static final String SERIALIZED_NAME_PARENT_ID = "_parent_id"; + @SerializedName(SERIALIZED_NAME_PARENT_ID) + @javax.annotation.Nullable + private String parentId; + + public static final String SERIALIZED_NAME_TRACE_ID = "_trace_id"; + @SerializedName(SERIALIZED_NAME_TRACE_ID) + @javax.annotation.Nullable + private String traceId; + public static final String SERIALIZED_NAME_CONNECTION = "connection"; @SerializedName(SERIALIZED_NAME_CONNECTION) + @javax.annotation.Nullable private String connection; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntry() { } - public HarEntry pageref(String pageref) { - + public HarEntry pageref(@javax.annotation.Nullable String pageref) { this.pageref = pageref; return this; } - /** + /** * Get pageref * @return pageref - **/ + */ @javax.annotation.Nullable - public String getPageref() { return pageref; } - - public void setPageref(String pageref) { + public void setPageref(@javax.annotation.Nullable String pageref) { this.pageref = pageref; } - public HarEntry startedDateTime(OffsetDateTime startedDateTime) { - + public HarEntry startedDateTime(@javax.annotation.Nonnull OffsetDateTime startedDateTime) { this.startedDateTime = startedDateTime; return this; } - /** + /** * Get startedDateTime * @return startedDateTime - **/ + */ @javax.annotation.Nonnull - public OffsetDateTime getStartedDateTime() { return startedDateTime; } - - public void setStartedDateTime(OffsetDateTime startedDateTime) { + public void setStartedDateTime(@javax.annotation.Nonnull OffsetDateTime startedDateTime) { this.startedDateTime = startedDateTime; } - public HarEntry time(Long time) { - + public HarEntry time(@javax.annotation.Nonnull Long time) { this.time = time; return this; } - /** + /** * Get time * minimum: 0 * @return time - **/ + */ @javax.annotation.Nonnull - public Long getTime() { return time; } - - public void setTime(Long time) { + public void setTime(@javax.annotation.Nonnull Long time) { this.time = time; } - public HarEntry request(HarEntryRequest request) { - + public HarEntry request(@javax.annotation.Nonnull HarEntryRequest request) { this.request = request; return this; } - /** + /** * Get request * @return request - **/ + */ @javax.annotation.Nonnull - public HarEntryRequest getRequest() { return request; } - - public void setRequest(HarEntryRequest request) { + public void setRequest(@javax.annotation.Nonnull HarEntryRequest request) { this.request = request; } - public HarEntry response(HarEntryResponse response) { - + public HarEntry response(@javax.annotation.Nonnull HarEntryResponse response) { this.response = response; return this; } - /** + /** * Get response * @return response - **/ + */ @javax.annotation.Nonnull - public HarEntryResponse getResponse() { return response; } - - public void setResponse(HarEntryResponse response) { + public void setResponse(@javax.annotation.Nonnull HarEntryResponse response) { this.response = response; } - public HarEntry cache(HarEntryCache cache) { - + public HarEntry cache(@javax.annotation.Nonnull HarEntryCache cache) { this.cache = cache; return this; } - /** + /** * Get cache * @return cache - **/ + */ @javax.annotation.Nonnull - public HarEntryCache getCache() { return cache; } - - public void setCache(HarEntryCache cache) { + public void setCache(@javax.annotation.Nonnull HarEntryCache cache) { this.cache = cache; } - public HarEntry timings(HarEntryTimings timings) { - + public HarEntry timings(@javax.annotation.Nonnull HarEntryTimings timings) { this.timings = timings; return this; } - /** + /** * Get timings * @return timings - **/ + */ @javax.annotation.Nonnull - public HarEntryTimings getTimings() { return timings; } - - public void setTimings(HarEntryTimings timings) { + public void setTimings(@javax.annotation.Nonnull HarEntryTimings timings) { this.timings = timings; } - public HarEntry serverIPAddress(String serverIPAddress) { - + public HarEntry serverIPAddress(@javax.annotation.Nullable String serverIPAddress) { this.serverIPAddress = serverIPAddress; return this; } - /** + /** * Get serverIPAddress * @return serverIPAddress - **/ + */ @javax.annotation.Nullable - public String getServerIPAddress() { return serverIPAddress; } - - public void setServerIPAddress(String serverIPAddress) { + public void setServerIPAddress(@javax.annotation.Nullable String serverIPAddress) { this.serverIPAddress = serverIPAddress; } - public HarEntry webSocketMessages(List webSocketMessages) { - + public HarEntry webSocketMessages(@javax.annotation.Nullable List webSocketMessages) { this.webSocketMessages = webSocketMessages; return this; } @@ -294,62 +299,111 @@ public HarEntry addWebSocketMessagesItem(WebSocketMessage webSocketMessagesItem) return this; } - /** + /** * Get webSocketMessages * @return webSocketMessages - **/ + */ @javax.annotation.Nullable - public List getWebSocketMessages() { return webSocketMessages; } - - public void setWebSocketMessages(List webSocketMessages) { + public void setWebSocketMessages(@javax.annotation.Nullable List webSocketMessages) { this.webSocketMessages = webSocketMessages; } - public HarEntry connection(String connection) { - + public HarEntry spanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + return this; + } + + /** + * W3C Trace Context span ID for this entry + * @return spanId + */ + @javax.annotation.Nullable + public String getSpanId() { + return spanId; + } + + public void setSpanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + } + + + public HarEntry parentId(@javax.annotation.Nullable String parentId) { + this.parentId = parentId; + return this; + } + + /** + * W3C Trace Context parent span ID (typically the page span ID) + * @return parentId + */ + @javax.annotation.Nullable + public String getParentId() { + return parentId; + } + + public void setParentId(@javax.annotation.Nullable String parentId) { + this.parentId = parentId; + } + + + public HarEntry traceId(@javax.annotation.Nullable String traceId) { + this.traceId = traceId; + return this; + } + + /** + * W3C Trace Context trace ID for distributed tracing + * @return traceId + */ + @javax.annotation.Nullable + public String getTraceId() { + return traceId; + } + + public void setTraceId(@javax.annotation.Nullable String traceId) { + this.traceId = traceId; + } + + + public HarEntry connection(@javax.annotation.Nullable String connection) { this.connection = connection; return this; } - /** + /** * Get connection * @return connection - **/ + */ @javax.annotation.Nullable - public String getConnection() { return connection; } - - public void setConnection(String connection) { + public void setConnection(@javax.annotation.Nullable String connection) { this.connection = connection; } - public HarEntry comment(String comment) { - + public HarEntry comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -357,29 +411,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntry harEntry = (HarEntry) o; - return Objects.equals(this.pageref, harEntry.pageref) && - Objects.equals(this.startedDateTime, harEntry.startedDateTime) && - Objects.equals(this.time, harEntry.time) && - Objects.equals(this.request, harEntry.request) && - Objects.equals(this.response, harEntry.response) && - Objects.equals(this.cache, harEntry.cache) && - Objects.equals(this.timings, harEntry.timings) && - Objects.equals(this.serverIPAddress, harEntry.serverIPAddress) && - Objects.equals(this.webSocketMessages, harEntry.webSocketMessages) && - Objects.equals(this.connection, harEntry.connection) && - Objects.equals(this.comment, harEntry.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(pageref, startedDateTime, time, request, response, cache, timings, serverIPAddress, webSocketMessages, connection, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -395,6 +432,9 @@ public String toString() { sb.append(" timings: ").append(toIndentedString(timings)).append("\n"); sb.append(" serverIPAddress: ").append(toIndentedString(serverIPAddress)).append("\n"); sb.append(" webSocketMessages: ").append(toIndentedString(webSocketMessages)).append("\n"); + sb.append(" spanId: ").append(toIndentedString(spanId)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" traceId: ").append(toIndentedString(traceId)).append("\n"); sb.append(" connection: ").append(toIndentedString(connection)).append("\n"); sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); sb.append("}"); @@ -428,6 +468,9 @@ private String toIndentedString(Object o) { openapiFields.add("timings"); openapiFields.add("serverIPAddress"); openapiFields.add("_webSocketMessages"); + openapiFields.add("_span_id"); + openapiFields.add("_parent_id"); + openapiFields.add("_trace_id"); openapiFields.add("connection"); openapiFields.add("comment"); @@ -441,40 +484,41 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timings"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntry - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntry is not found in the empty JSON string", HarEntry.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntry.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntry` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntry` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntry.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pageref") != null && !jsonObj.get("pageref").isJsonNull()) && !jsonObj.get("pageref").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `pageref` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pageref").toString())); } // validate the required field `cache` - HarEntryCache.validateJsonObject(jsonObj.getAsJsonObject("cache")); + HarEntryCache.validateJsonElement(jsonObj.get("cache")); // validate the required field `timings` - HarEntryTimings.validateJsonObject(jsonObj.getAsJsonObject("timings")); + HarEntryTimings.validateJsonElement(jsonObj.get("timings")); if ((jsonObj.get("serverIPAddress") != null && !jsonObj.get("serverIPAddress").isJsonNull()) && !jsonObj.get("serverIPAddress").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `serverIPAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIPAddress").toString())); } @@ -488,10 +532,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `_webSocketMessages` (array) for (int i = 0; i < jsonArraywebSocketMessages.size(); i++) { - WebSocketMessage.validateJsonObject(jsonArraywebSocketMessages.get(i).getAsJsonObject()); + WebSocketMessage.validateJsonElement(jsonArraywebSocketMessages.get(i)); }; } } + if ((jsonObj.get("_span_id") != null && !jsonObj.get("_span_id").isJsonNull()) && !jsonObj.get("_span_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_span_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_span_id").toString())); + } + if ((jsonObj.get("_parent_id") != null && !jsonObj.get("_parent_id").isJsonNull()) && !jsonObj.get("_parent_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_parent_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_parent_id").toString())); + } + if ((jsonObj.get("_trace_id") != null && !jsonObj.get("_trace_id").isJsonNull()) && !jsonObj.get("_trace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_trace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_trace_id").toString())); + } if ((jsonObj.get("connection") != null && !jsonObj.get("connection").isJsonNull()) && !jsonObj.get("connection").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `connection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connection").toString())); } @@ -520,31 +573,31 @@ public void write(JsonWriter out, HarEntry value) throws IOException { @Override public HarEntry read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntry given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntry - * @throws IOException if the JSON string is invalid with respect to HarEntry - */ + /** + * Create an instance of HarEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntry + * @throws IOException if the JSON string is invalid with respect to HarEntry + */ public static HarEntry fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntry.class); } - /** - * Convert an instance of HarEntry to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntry to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCache.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCache.java index 6d93843827..e752b7b716 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCache.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCache.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarEntryCacheBeforeRequest; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -22,6 +23,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -33,13 +36,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -47,85 +52,79 @@ /** * HarEntryCache */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryCache { public static final String SERIALIZED_NAME_BEFORE_REQUEST = "beforeRequest"; @SerializedName(SERIALIZED_NAME_BEFORE_REQUEST) + @javax.annotation.Nullable private HarEntryCacheBeforeRequest beforeRequest; public static final String SERIALIZED_NAME_AFTER_REQUEST = "afterRequest"; @SerializedName(SERIALIZED_NAME_AFTER_REQUEST) + @javax.annotation.Nullable private HarEntryCacheBeforeRequest afterRequest; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryCache() { } - public HarEntryCache beforeRequest(HarEntryCacheBeforeRequest beforeRequest) { - + public HarEntryCache beforeRequest(@javax.annotation.Nullable HarEntryCacheBeforeRequest beforeRequest) { this.beforeRequest = beforeRequest; return this; } - /** + /** * Get beforeRequest * @return beforeRequest - **/ + */ @javax.annotation.Nullable - public HarEntryCacheBeforeRequest getBeforeRequest() { return beforeRequest; } - - public void setBeforeRequest(HarEntryCacheBeforeRequest beforeRequest) { + public void setBeforeRequest(@javax.annotation.Nullable HarEntryCacheBeforeRequest beforeRequest) { this.beforeRequest = beforeRequest; } - public HarEntryCache afterRequest(HarEntryCacheBeforeRequest afterRequest) { - + public HarEntryCache afterRequest(@javax.annotation.Nullable HarEntryCacheBeforeRequest afterRequest) { this.afterRequest = afterRequest; return this; } - /** + /** * Get afterRequest * @return afterRequest - **/ + */ @javax.annotation.Nullable - public HarEntryCacheBeforeRequest getAfterRequest() { return afterRequest; } - - public void setAfterRequest(HarEntryCacheBeforeRequest afterRequest) { + public void setAfterRequest(@javax.annotation.Nullable HarEntryCacheBeforeRequest afterRequest) { this.afterRequest = afterRequest; } - public HarEntryCache comment(String comment) { - + public HarEntryCache comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -133,21 +132,23 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryCache harEntryCache = (HarEntryCache) o; - return Objects.equals(this.beforeRequest, harEntryCache.beforeRequest) && - Objects.equals(this.afterRequest, harEntryCache.afterRequest) && - Objects.equals(this.comment, harEntryCache.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(beforeRequest, afterRequest, comment); + return HashCodeBuilder.reflectionHashCode(this); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -187,33 +188,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryCache - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryCache.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryCache + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryCache.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryCache is not found in the empty JSON string", HarEntryCache.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryCache.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryCache` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryCache` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `beforeRequest` if (jsonObj.get("beforeRequest") != null && !jsonObj.get("beforeRequest").isJsonNull()) { - HarEntryCacheBeforeRequest.validateJsonObject(jsonObj.getAsJsonObject("beforeRequest")); + HarEntryCacheBeforeRequest.validateJsonElement(jsonObj.get("beforeRequest")); } // validate the optional field `afterRequest` if (jsonObj.get("afterRequest") != null && !jsonObj.get("afterRequest").isJsonNull()) { - HarEntryCacheBeforeRequest.validateJsonObject(jsonObj.getAsJsonObject("afterRequest")); + HarEntryCacheBeforeRequest.validateJsonElement(jsonObj.get("afterRequest")); } if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); @@ -240,31 +242,31 @@ public void write(JsonWriter out, HarEntryCache value) throws IOException { @Override public HarEntryCache read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryCache given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryCache - * @throws IOException if the JSON string is invalid with respect to HarEntryCache - */ + /** + * Create an instance of HarEntryCache given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryCache + * @throws IOException if the JSON string is invalid with respect to HarEntryCache + */ public static HarEntryCache fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryCache.class); } - /** - * Convert an instance of HarEntryCache to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryCache to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequest.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequest.java index cb94b10d4c..7d40d01222 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequest.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,222 +13,310 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; -import com.browserup.proxy_client.HarEntryCacheBeforeRequestOneOf; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; - -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import com.browserup.proxy_client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HarEntryCacheBeforeRequest extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(HarEntryCacheBeforeRequest.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!HarEntryCacheBeforeRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'HarEntryCacheBeforeRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterHarEntryCacheBeforeRequestOneOf = gson.getDelegateAdapter(this, TypeToken.get(HarEntryCacheBeforeRequestOneOf.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, HarEntryCacheBeforeRequest value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `HarEntryCacheBeforeRequestOneOf` - if (value.getActualInstance() instanceof HarEntryCacheBeforeRequestOneOf) { - JsonObject obj = adapterHarEntryCacheBeforeRequestOneOf.toJsonTree((HarEntryCacheBeforeRequestOneOf)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: HarEntryCacheBeforeRequestOneOf"); - } - - @Override - public HarEntryCacheBeforeRequest read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize HarEntryCacheBeforeRequestOneOf - try { - // validate the JSON object to see if any exception is thrown - HarEntryCacheBeforeRequestOneOf.validateJsonObject(jsonObject); - actualAdapter = adapterHarEntryCacheBeforeRequestOneOf; - match++; - log.log(Level.FINER, "Input data matches schema 'HarEntryCacheBeforeRequestOneOf'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for HarEntryCacheBeforeRequestOneOf failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'HarEntryCacheBeforeRequestOneOf'", e); - } - - if (match == 1) { - HarEntryCacheBeforeRequest ret = new HarEntryCacheBeforeRequest(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); - return ret; - } - - throw new IOException(String.format("Failed deserialization for HarEntryCacheBeforeRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); - } - }.nullSafe(); - } - } +/** + * HarEntryCacheBeforeRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +public class HarEntryCacheBeforeRequest { + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nullable + private String expires; + + public static final String SERIALIZED_NAME_LAST_ACCESS = "lastAccess"; + @SerializedName(SERIALIZED_NAME_LAST_ACCESS) + @javax.annotation.Nonnull + private String lastAccess; + + public static final String SERIALIZED_NAME_E_TAG = "eTag"; + @SerializedName(SERIALIZED_NAME_E_TAG) + @javax.annotation.Nonnull + private String eTag; + + public static final String SERIALIZED_NAME_HIT_COUNT = "hitCount"; + @SerializedName(SERIALIZED_NAME_HIT_COUNT) + @javax.annotation.Nonnull + private Integer hitCount; + + public static final String SERIALIZED_NAME_COMMENT = "comment"; + @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable + private String comment; + + public HarEntryCacheBeforeRequest() { + } - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public HarEntryCacheBeforeRequest expires(@javax.annotation.Nullable String expires) { + this.expires = expires; + return this; + } - public HarEntryCacheBeforeRequest() { - super("oneOf", Boolean.TRUE); - } + /** + * Get expires + * @return expires + */ + @javax.annotation.Nullable + public String getExpires() { + return expires; + } - public HarEntryCacheBeforeRequest(HarEntryCacheBeforeRequestOneOf o) { - super("oneOf", Boolean.TRUE); - setActualInstance(o); - } + public void setExpires(@javax.annotation.Nullable String expires) { + this.expires = expires; + } - static { - schemas.put("HarEntryCacheBeforeRequestOneOf", new GenericType() { - }); - } - @Override - public Map getSchemas() { - return HarEntryCacheBeforeRequest.schemas; - } + public HarEntryCacheBeforeRequest lastAccess(@javax.annotation.Nonnull String lastAccess) { + this.lastAccess = lastAccess; + return this; + } - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * HarEntryCacheBeforeRequestOneOf - * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). - */ - @Override - public void setActualInstance(Object instance) { - if (instance == null) { - super.setActualInstance(instance); - return; - } + /** + * Get lastAccess + * @return lastAccess + */ + @javax.annotation.Nonnull + public String getLastAccess() { + return lastAccess; + } - if (instance instanceof HarEntryCacheBeforeRequestOneOf) { - super.setActualInstance(instance); - return; - } + public void setLastAccess(@javax.annotation.Nonnull String lastAccess) { + this.lastAccess = lastAccess; + } - throw new RuntimeException("Invalid instance type. Must be HarEntryCacheBeforeRequestOneOf"); - } - /** - * Get the actual instance, which can be the following: - * HarEntryCacheBeforeRequestOneOf - * - * @return The actual instance (HarEntryCacheBeforeRequestOneOf) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } + public HarEntryCacheBeforeRequest eTag(@javax.annotation.Nonnull String eTag) { + this.eTag = eTag; + return this; + } - /** - * Get the actual instance of `HarEntryCacheBeforeRequestOneOf`. If the actual instance is not `HarEntryCacheBeforeRequestOneOf`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `HarEntryCacheBeforeRequestOneOf` - * @throws ClassCastException if the instance is not `HarEntryCacheBeforeRequestOneOf` - */ - public HarEntryCacheBeforeRequestOneOf getHarEntryCacheBeforeRequestOneOf() throws ClassCastException { - return (HarEntryCacheBeforeRequestOneOf)super.getActualInstance(); - } + /** + * Get eTag + * @return eTag + */ + @javax.annotation.Nonnull + public String geteTag() { + return eTag; + } + + public void seteTag(@javax.annotation.Nonnull String eTag) { + this.eTag = eTag; + } + + + public HarEntryCacheBeforeRequest hitCount(@javax.annotation.Nonnull Integer hitCount) { + this.hitCount = hitCount; + return this; + } + + /** + * Get hitCount + * @return hitCount + */ + @javax.annotation.Nonnull + public Integer getHitCount() { + return hitCount; + } + + public void setHitCount(@javax.annotation.Nonnull Integer hitCount) { + this.hitCount = hitCount; + } + + + public HarEntryCacheBeforeRequest comment(@javax.annotation.Nullable String comment) { + this.comment = comment; + return this; + } + + /** + * Get comment + * @return comment + */ + @javax.annotation.Nullable + public String getComment() { + return comment; + } + + public void setComment(@javax.annotation.Nullable String comment) { + this.comment = comment; + } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryCacheBeforeRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with HarEntryCacheBeforeRequestOneOf - try { - HarEntryCacheBeforeRequestOneOf.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for HarEntryCacheBeforeRequestOneOf failed with `%s`.", e.getMessage())); - // continue to the next one + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HarEntryCacheBeforeRequest {\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" lastAccess: ").append(toIndentedString(lastAccess)).append("\n"); + sb.append(" eTag: ").append(toIndentedString(eTag)).append("\n"); + sb.append(" hitCount: ").append(toIndentedString(hitCount)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for HarEntryCacheBeforeRequest with oneOf schemas: HarEntryCacheBeforeRequestOneOf. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("expires"); + openapiFields.add("lastAccess"); + openapiFields.add("eTag"); + openapiFields.add("hitCount"); + openapiFields.add("comment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lastAccess"); + openapiRequiredFields.add("eTag"); + openapiRequiredFields.add("hitCount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryCacheBeforeRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryCacheBeforeRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryCacheBeforeRequest is not found in the empty JSON string", HarEntryCacheBeforeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!HarEntryCacheBeforeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryCacheBeforeRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HarEntryCacheBeforeRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("expires") != null && !jsonObj.get("expires").isJsonNull()) && !jsonObj.get("expires").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires").toString())); + } + if (!jsonObj.get("lastAccess").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastAccess` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastAccess").toString())); + } + if (!jsonObj.get("eTag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `eTag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eTag").toString())); + } + if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HarEntryCacheBeforeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HarEntryCacheBeforeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HarEntryCacheBeforeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HarEntryCacheBeforeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HarEntryCacheBeforeRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); } } - /** - * Create an instance of HarEntryCacheBeforeRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryCacheBeforeRequest - * @throws IOException if the JSON string is invalid with respect to HarEntryCacheBeforeRequest - */ + /** + * Create an instance of HarEntryCacheBeforeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryCacheBeforeRequest + * @throws IOException if the JSON string is invalid with respect to HarEntryCacheBeforeRequest + */ public static HarEntryCacheBeforeRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryCacheBeforeRequest.class); } - /** - * Convert an instance of HarEntryCacheBeforeRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryCacheBeforeRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOf.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOf.java deleted file mode 100644 index 9f0d0e4288..0000000000 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOf.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.browserup.proxy_client; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.browserup.proxy_client.JSON; - -/** - * HarEntryCacheBeforeRequestOneOf - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HarEntryCacheBeforeRequestOneOf { - public static final String SERIALIZED_NAME_EXPIRES = "expires"; - @SerializedName(SERIALIZED_NAME_EXPIRES) - private String expires; - - public static final String SERIALIZED_NAME_LAST_ACCESS = "lastAccess"; - @SerializedName(SERIALIZED_NAME_LAST_ACCESS) - private String lastAccess; - - public static final String SERIALIZED_NAME_E_TAG = "eTag"; - @SerializedName(SERIALIZED_NAME_E_TAG) - private String eTag; - - public static final String SERIALIZED_NAME_HIT_COUNT = "hitCount"; - @SerializedName(SERIALIZED_NAME_HIT_COUNT) - private Integer hitCount; - - public static final String SERIALIZED_NAME_COMMENT = "comment"; - @SerializedName(SERIALIZED_NAME_COMMENT) - private String comment; - - public HarEntryCacheBeforeRequestOneOf() { - } - - public HarEntryCacheBeforeRequestOneOf expires(String expires) { - - this.expires = expires; - return this; - } - - /** - * Get expires - * @return expires - **/ - @javax.annotation.Nullable - - public String getExpires() { - return expires; - } - - - public void setExpires(String expires) { - this.expires = expires; - } - - - public HarEntryCacheBeforeRequestOneOf lastAccess(String lastAccess) { - - this.lastAccess = lastAccess; - return this; - } - - /** - * Get lastAccess - * @return lastAccess - **/ - @javax.annotation.Nonnull - - public String getLastAccess() { - return lastAccess; - } - - - public void setLastAccess(String lastAccess) { - this.lastAccess = lastAccess; - } - - - public HarEntryCacheBeforeRequestOneOf eTag(String eTag) { - - this.eTag = eTag; - return this; - } - - /** - * Get eTag - * @return eTag - **/ - @javax.annotation.Nonnull - - public String geteTag() { - return eTag; - } - - - public void seteTag(String eTag) { - this.eTag = eTag; - } - - - public HarEntryCacheBeforeRequestOneOf hitCount(Integer hitCount) { - - this.hitCount = hitCount; - return this; - } - - /** - * Get hitCount - * @return hitCount - **/ - @javax.annotation.Nonnull - - public Integer getHitCount() { - return hitCount; - } - - - public void setHitCount(Integer hitCount) { - this.hitCount = hitCount; - } - - - public HarEntryCacheBeforeRequestOneOf comment(String comment) { - - this.comment = comment; - return this; - } - - /** - * Get comment - * @return comment - **/ - @javax.annotation.Nullable - - public String getComment() { - return comment; - } - - - public void setComment(String comment) { - this.comment = comment; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryCacheBeforeRequestOneOf harEntryCacheBeforeRequestOneOf = (HarEntryCacheBeforeRequestOneOf) o; - return Objects.equals(this.expires, harEntryCacheBeforeRequestOneOf.expires) && - Objects.equals(this.lastAccess, harEntryCacheBeforeRequestOneOf.lastAccess) && - Objects.equals(this.eTag, harEntryCacheBeforeRequestOneOf.eTag) && - Objects.equals(this.hitCount, harEntryCacheBeforeRequestOneOf.hitCount) && - Objects.equals(this.comment, harEntryCacheBeforeRequestOneOf.comment); - } - - @Override - public int hashCode() { - return Objects.hash(expires, lastAccess, eTag, hitCount, comment); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HarEntryCacheBeforeRequestOneOf {\n"); - sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); - sb.append(" lastAccess: ").append(toIndentedString(lastAccess)).append("\n"); - sb.append(" eTag: ").append(toIndentedString(eTag)).append("\n"); - sb.append(" hitCount: ").append(toIndentedString(hitCount)).append("\n"); - sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("expires"); - openapiFields.add("lastAccess"); - openapiFields.add("eTag"); - openapiFields.add("hitCount"); - openapiFields.add("comment"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("lastAccess"); - openapiRequiredFields.add("eTag"); - openapiRequiredFields.add("hitCount"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryCacheBeforeRequestOneOf - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryCacheBeforeRequestOneOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryCacheBeforeRequestOneOf is not found in the empty JSON string", HarEntryCacheBeforeRequestOneOf.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!HarEntryCacheBeforeRequestOneOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryCacheBeforeRequestOneOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : HarEntryCacheBeforeRequestOneOf.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("expires") != null && !jsonObj.get("expires").isJsonNull()) && !jsonObj.get("expires").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expires` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires").toString())); - } - if (!jsonObj.get("lastAccess").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastAccess` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastAccess").toString())); - } - if (!jsonObj.get("eTag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eTag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eTag").toString())); - } - if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!HarEntryCacheBeforeRequestOneOf.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'HarEntryCacheBeforeRequestOneOf' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(HarEntryCacheBeforeRequestOneOf.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, HarEntryCacheBeforeRequestOneOf value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public HarEntryCacheBeforeRequestOneOf read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of HarEntryCacheBeforeRequestOneOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryCacheBeforeRequestOneOf - * @throws IOException if the JSON string is invalid with respect to HarEntryCacheBeforeRequestOneOf - */ - public static HarEntryCacheBeforeRequestOneOf fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, HarEntryCacheBeforeRequestOneOf.class); - } - - /** - * Convert an instance of HarEntryCacheBeforeRequestOneOf to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequest.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequest.java index b76cfa96f0..83b108f3c2 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequest.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarEntryRequestCookiesInner; import com.browserup.proxy_client.HarEntryRequestPostData; import com.browserup.proxy_client.HarEntryRequestQueryStringInner; @@ -26,6 +27,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gson.Gson; @@ -38,13 +40,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -52,282 +56,271 @@ /** * HarEntryRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryRequest { public static final String SERIALIZED_NAME_METHOD = "method"; @SerializedName(SERIALIZED_NAME_METHOD) + @javax.annotation.Nonnull private String method; public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull private String url; public static final String SERIALIZED_NAME_HTTP_VERSION = "httpVersion"; @SerializedName(SERIALIZED_NAME_HTTP_VERSION) + @javax.annotation.Nonnull private String httpVersion; public static final String SERIALIZED_NAME_COOKIES = "cookies"; @SerializedName(SERIALIZED_NAME_COOKIES) + @javax.annotation.Nonnull private List cookies = new ArrayList<>(); public static final String SERIALIZED_NAME_HEADERS = "headers"; @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nonnull private List
headers = new ArrayList<>(); public static final String SERIALIZED_NAME_QUERY_STRING = "queryString"; @SerializedName(SERIALIZED_NAME_QUERY_STRING) + @javax.annotation.Nonnull private List queryString = new ArrayList<>(); public static final String SERIALIZED_NAME_POST_DATA = "postData"; @SerializedName(SERIALIZED_NAME_POST_DATA) + @javax.annotation.Nullable private HarEntryRequestPostData postData; public static final String SERIALIZED_NAME_HEADERS_SIZE = "headersSize"; @SerializedName(SERIALIZED_NAME_HEADERS_SIZE) + @javax.annotation.Nonnull private Integer headersSize; public static final String SERIALIZED_NAME_BODY_SIZE = "bodySize"; @SerializedName(SERIALIZED_NAME_BODY_SIZE) + @javax.annotation.Nonnull private Integer bodySize; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryRequest() { } - public HarEntryRequest method(String method) { - + public HarEntryRequest method(@javax.annotation.Nonnull String method) { this.method = method; return this; } - /** + /** * Get method * @return method - **/ + */ @javax.annotation.Nonnull - public String getMethod() { return method; } - - public void setMethod(String method) { + public void setMethod(@javax.annotation.Nonnull String method) { this.method = method; } - public HarEntryRequest url(String url) { - + public HarEntryRequest url(@javax.annotation.Nonnull String url) { this.url = url; return this; } - /** + /** * Get url * @return url - **/ + */ @javax.annotation.Nonnull - public String getUrl() { return url; } - - public void setUrl(String url) { + public void setUrl(@javax.annotation.Nonnull String url) { this.url = url; } - public HarEntryRequest httpVersion(String httpVersion) { - + public HarEntryRequest httpVersion(@javax.annotation.Nonnull String httpVersion) { this.httpVersion = httpVersion; return this; } - /** + /** * Get httpVersion * @return httpVersion - **/ + */ @javax.annotation.Nonnull - public String getHttpVersion() { return httpVersion; } - - public void setHttpVersion(String httpVersion) { + public void setHttpVersion(@javax.annotation.Nonnull String httpVersion) { this.httpVersion = httpVersion; } - public HarEntryRequest cookies(List cookies) { - + public HarEntryRequest cookies(@javax.annotation.Nonnull List cookies) { this.cookies = cookies; return this; } public HarEntryRequest addCookiesItem(HarEntryRequestCookiesInner cookiesItem) { + if (this.cookies == null) { + this.cookies = new ArrayList<>(); + } this.cookies.add(cookiesItem); return this; } - /** + /** * Get cookies * @return cookies - **/ + */ @javax.annotation.Nonnull - public List getCookies() { return cookies; } - - public void setCookies(List cookies) { + public void setCookies(@javax.annotation.Nonnull List cookies) { this.cookies = cookies; } - public HarEntryRequest headers(List
headers) { - + public HarEntryRequest headers(@javax.annotation.Nonnull List
headers) { this.headers = headers; return this; } public HarEntryRequest addHeadersItem(Header headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } this.headers.add(headersItem); return this; } - /** + /** * Get headers * @return headers - **/ + */ @javax.annotation.Nonnull - public List
getHeaders() { return headers; } - - public void setHeaders(List
headers) { + public void setHeaders(@javax.annotation.Nonnull List
headers) { this.headers = headers; } - public HarEntryRequest queryString(List queryString) { - + public HarEntryRequest queryString(@javax.annotation.Nonnull List queryString) { this.queryString = queryString; return this; } public HarEntryRequest addQueryStringItem(HarEntryRequestQueryStringInner queryStringItem) { + if (this.queryString == null) { + this.queryString = new ArrayList<>(); + } this.queryString.add(queryStringItem); return this; } - /** + /** * Get queryString * @return queryString - **/ + */ @javax.annotation.Nonnull - public List getQueryString() { return queryString; } - - public void setQueryString(List queryString) { + public void setQueryString(@javax.annotation.Nonnull List queryString) { this.queryString = queryString; } - public HarEntryRequest postData(HarEntryRequestPostData postData) { - + public HarEntryRequest postData(@javax.annotation.Nullable HarEntryRequestPostData postData) { this.postData = postData; return this; } - /** + /** * Get postData * @return postData - **/ + */ @javax.annotation.Nullable - public HarEntryRequestPostData getPostData() { return postData; } - - public void setPostData(HarEntryRequestPostData postData) { + public void setPostData(@javax.annotation.Nullable HarEntryRequestPostData postData) { this.postData = postData; } - public HarEntryRequest headersSize(Integer headersSize) { - + public HarEntryRequest headersSize(@javax.annotation.Nonnull Integer headersSize) { this.headersSize = headersSize; return this; } - /** + /** * Get headersSize * @return headersSize - **/ + */ @javax.annotation.Nonnull - public Integer getHeadersSize() { return headersSize; } - - public void setHeadersSize(Integer headersSize) { + public void setHeadersSize(@javax.annotation.Nonnull Integer headersSize) { this.headersSize = headersSize; } - public HarEntryRequest bodySize(Integer bodySize) { - + public HarEntryRequest bodySize(@javax.annotation.Nonnull Integer bodySize) { this.bodySize = bodySize; return this; } - /** + /** * Get bodySize * @return bodySize - **/ + */ @javax.annotation.Nonnull - public Integer getBodySize() { return bodySize; } - - public void setBodySize(Integer bodySize) { + public void setBodySize(@javax.annotation.Nonnull Integer bodySize) { this.bodySize = bodySize; } - public HarEntryRequest comment(String comment) { - + public HarEntryRequest comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -379,29 +372,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryRequest harEntryRequest = (HarEntryRequest) o; - return Objects.equals(this.method, harEntryRequest.method) && - Objects.equals(this.url, harEntryRequest.url) && - Objects.equals(this.httpVersion, harEntryRequest.httpVersion) && - Objects.equals(this.cookies, harEntryRequest.cookies) && - Objects.equals(this.headers, harEntryRequest.headers) && - Objects.equals(this.queryString, harEntryRequest.queryString) && - Objects.equals(this.postData, harEntryRequest.postData) && - Objects.equals(this.headersSize, harEntryRequest.headersSize) && - Objects.equals(this.bodySize, harEntryRequest.bodySize) && - Objects.equals(this.comment, harEntryRequest.comment)&& - Objects.equals(this.additionalProperties, harEntryRequest.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(method, url, httpVersion, cookies, headers, queryString, postData, headersSize, bodySize, comment, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -464,25 +440,26 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bodySize"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryRequest is not found in the empty JSON string", HarEntryRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("method").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); } @@ -500,7 +477,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArraycookies = jsonObj.getAsJsonArray("cookies"); // validate the required field `cookies` (array) for (int i = 0; i < jsonArraycookies.size(); i++) { - HarEntryRequestCookiesInner.validateJsonObject(jsonArraycookies.get(i).getAsJsonObject()); + HarEntryRequestCookiesInner.validateJsonElement(jsonArraycookies.get(i)); }; // ensure the json data is an array if (!jsonObj.get("headers").isJsonArray()) { @@ -510,7 +487,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArrayheaders = jsonObj.getAsJsonArray("headers"); // validate the required field `headers` (array) for (int i = 0; i < jsonArrayheaders.size(); i++) { - Header.validateJsonObject(jsonArrayheaders.get(i).getAsJsonObject()); + Header.validateJsonElement(jsonArrayheaders.get(i)); }; // ensure the json data is an array if (!jsonObj.get("queryString").isJsonArray()) { @@ -520,11 +497,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArrayqueryString = jsonObj.getAsJsonArray("queryString"); // validate the required field `queryString` (array) for (int i = 0; i < jsonArrayqueryString.size(); i++) { - HarEntryRequestQueryStringInner.validateJsonObject(jsonArrayqueryString.get(i).getAsJsonObject()); + HarEntryRequestQueryStringInner.validateJsonElement(jsonArrayqueryString.get(i)); }; // validate the optional field `postData` if (jsonObj.get("postData") != null && !jsonObj.get("postData").isJsonNull()) { - HarEntryRequestPostData.validateJsonObject(jsonObj.getAsJsonObject("postData")); + HarEntryRequestPostData.validateJsonElement(jsonObj.get("postData")); } if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); @@ -559,7 +536,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -568,8 +550,9 @@ else if (entry.getValue() instanceof Character) @Override public HarEntryRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance HarEntryRequest instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { @@ -597,22 +580,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of HarEntryRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryRequest - * @throws IOException if the JSON string is invalid with respect to HarEntryRequest - */ + /** + * Create an instance of HarEntryRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryRequest + * @throws IOException if the JSON string is invalid with respect to HarEntryRequest + */ public static HarEntryRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryRequest.class); } - /** - * Convert an instance of HarEntryRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestCookiesInner.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestCookiesInner.java index be10314337..fa6ef2d049 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestCookiesInner.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestCookiesInner.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,215 +50,199 @@ /** * HarEntryRequestCookiesInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryRequestCookiesInner { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; public static final String SERIALIZED_NAME_PATH = "path"; @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nullable private String path; public static final String SERIALIZED_NAME_DOMAIN = "domain"; @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable private String domain; public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nullable private String expires; public static final String SERIALIZED_NAME_HTTP_ONLY = "httpOnly"; @SerializedName(SERIALIZED_NAME_HTTP_ONLY) + @javax.annotation.Nullable private Boolean httpOnly; public static final String SERIALIZED_NAME_SECURE = "secure"; @SerializedName(SERIALIZED_NAME_SECURE) + @javax.annotation.Nullable private Boolean secure; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryRequestCookiesInner() { } - public HarEntryRequestCookiesInner name(String name) { - + public HarEntryRequestCookiesInner name(@javax.annotation.Nonnull String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public HarEntryRequestCookiesInner value(String value) { - + public HarEntryRequestCookiesInner value(@javax.annotation.Nonnull String value) { this.value = value; return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull - public String getValue() { return value; } - - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } - public HarEntryRequestCookiesInner path(String path) { - + public HarEntryRequestCookiesInner path(@javax.annotation.Nullable String path) { this.path = path; return this; } - /** + /** * Get path * @return path - **/ + */ @javax.annotation.Nullable - public String getPath() { return path; } - - public void setPath(String path) { + public void setPath(@javax.annotation.Nullable String path) { this.path = path; } - public HarEntryRequestCookiesInner domain(String domain) { - + public HarEntryRequestCookiesInner domain(@javax.annotation.Nullable String domain) { this.domain = domain; return this; } - /** + /** * Get domain * @return domain - **/ + */ @javax.annotation.Nullable - public String getDomain() { return domain; } - - public void setDomain(String domain) { + public void setDomain(@javax.annotation.Nullable String domain) { this.domain = domain; } - public HarEntryRequestCookiesInner expires(String expires) { - + public HarEntryRequestCookiesInner expires(@javax.annotation.Nullable String expires) { this.expires = expires; return this; } - /** + /** * Get expires * @return expires - **/ + */ @javax.annotation.Nullable - public String getExpires() { return expires; } - - public void setExpires(String expires) { + public void setExpires(@javax.annotation.Nullable String expires) { this.expires = expires; } - public HarEntryRequestCookiesInner httpOnly(Boolean httpOnly) { - + public HarEntryRequestCookiesInner httpOnly(@javax.annotation.Nullable Boolean httpOnly) { this.httpOnly = httpOnly; return this; } - /** + /** * Get httpOnly * @return httpOnly - **/ + */ @javax.annotation.Nullable - public Boolean getHttpOnly() { return httpOnly; } - - public void setHttpOnly(Boolean httpOnly) { + public void setHttpOnly(@javax.annotation.Nullable Boolean httpOnly) { this.httpOnly = httpOnly; } - public HarEntryRequestCookiesInner secure(Boolean secure) { - + public HarEntryRequestCookiesInner secure(@javax.annotation.Nullable Boolean secure) { this.secure = secure; return this; } - /** + /** * Get secure * @return secure - **/ + */ @javax.annotation.Nullable - public Boolean getSecure() { return secure; } - - public void setSecure(Boolean secure) { + public void setSecure(@javax.annotation.Nullable Boolean secure) { this.secure = secure; } - public HarEntryRequestCookiesInner comment(String comment) { - + public HarEntryRequestCookiesInner comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -262,26 +250,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryRequestCookiesInner harEntryRequestCookiesInner = (HarEntryRequestCookiesInner) o; - return Objects.equals(this.name, harEntryRequestCookiesInner.name) && - Objects.equals(this.value, harEntryRequestCookiesInner.value) && - Objects.equals(this.path, harEntryRequestCookiesInner.path) && - Objects.equals(this.domain, harEntryRequestCookiesInner.domain) && - Objects.equals(this.expires, harEntryRequestCookiesInner.expires) && - Objects.equals(this.httpOnly, harEntryRequestCookiesInner.httpOnly) && - Objects.equals(this.secure, harEntryRequestCookiesInner.secure) && - Objects.equals(this.comment, harEntryRequestCookiesInner.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, value, path, domain, expires, httpOnly, secure, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -333,33 +307,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("value"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryRequestCookiesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryRequestCookiesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryRequestCookiesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryRequestCookiesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryRequestCookiesInner is not found in the empty JSON string", HarEntryRequestCookiesInner.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryRequestCookiesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestCookiesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestCookiesInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryRequestCookiesInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -400,31 +375,31 @@ public void write(JsonWriter out, HarEntryRequestCookiesInner value) throws IOEx @Override public HarEntryRequestCookiesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryRequestCookiesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryRequestCookiesInner - * @throws IOException if the JSON string is invalid with respect to HarEntryRequestCookiesInner - */ + /** + * Create an instance of HarEntryRequestCookiesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryRequestCookiesInner + * @throws IOException if the JSON string is invalid with respect to HarEntryRequestCookiesInner + */ public static HarEntryRequestCookiesInner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryRequestCookiesInner.class); } - /** - * Convert an instance of HarEntryRequestCookiesInner to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryRequestCookiesInner to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostData.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostData.java index c7c79be54a..afacdeddcc 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostData.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostData.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarEntryRequestPostDataParamsInner; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gson.Gson; @@ -35,13 +37,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -49,69 +53,65 @@ /** * Posted data info. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryRequestPostData { public static final String SERIALIZED_NAME_MIME_TYPE = "mimeType"; @SerializedName(SERIALIZED_NAME_MIME_TYPE) + @javax.annotation.Nonnull private String mimeType; public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable private String text; public static final String SERIALIZED_NAME_PARAMS = "params"; @SerializedName(SERIALIZED_NAME_PARAMS) + @javax.annotation.Nullable private List params = new ArrayList<>(); public HarEntryRequestPostData() { } - public HarEntryRequestPostData mimeType(String mimeType) { - + public HarEntryRequestPostData mimeType(@javax.annotation.Nonnull String mimeType) { this.mimeType = mimeType; return this; } - /** + /** * Get mimeType * @return mimeType - **/ + */ @javax.annotation.Nonnull - public String getMimeType() { return mimeType; } - - public void setMimeType(String mimeType) { + public void setMimeType(@javax.annotation.Nonnull String mimeType) { this.mimeType = mimeType; } - public HarEntryRequestPostData text(String text) { - + public HarEntryRequestPostData text(@javax.annotation.Nullable String text) { this.text = text; return this; } - /** + /** * Get text * @return text - **/ + */ @javax.annotation.Nullable - public String getText() { return text; } - - public void setText(String text) { + public void setText(@javax.annotation.Nullable String text) { this.text = text; } - public HarEntryRequestPostData params(List params) { - + public HarEntryRequestPostData params(@javax.annotation.Nullable List params) { this.params = params; return this; } @@ -124,18 +124,16 @@ public HarEntryRequestPostData addParamsItem(HarEntryRequestPostDataParamsInner return this; } - /** + /** * Get params * @return params - **/ + */ @javax.annotation.Nullable - public List getParams() { return params; } - - public void setParams(List params) { + public void setParams(@javax.annotation.Nullable List params) { this.params = params; } @@ -143,21 +141,12 @@ public void setParams(List params) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryRequestPostData harEntryRequestPostData = (HarEntryRequestPostData) o; - return Objects.equals(this.mimeType, harEntryRequestPostData.mimeType) && - Objects.equals(this.text, harEntryRequestPostData.text) && - Objects.equals(this.params, harEntryRequestPostData.params); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mimeType, text, params); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -198,33 +187,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("mimeType"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryRequestPostData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryRequestPostData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryRequestPostData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryRequestPostData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryRequestPostData is not found in the empty JSON string", HarEntryRequestPostData.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryRequestPostData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestPostData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestPostData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryRequestPostData.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("mimeType").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `mimeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mimeType").toString())); } @@ -241,7 +231,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `params` (array) for (int i = 0; i < jsonArrayparams.size(); i++) { - HarEntryRequestPostDataParamsInner.validateJsonObject(jsonArrayparams.get(i).getAsJsonObject()); + HarEntryRequestPostDataParamsInner.validateJsonElement(jsonArrayparams.get(i)); }; } } @@ -267,31 +257,31 @@ public void write(JsonWriter out, HarEntryRequestPostData value) throws IOExcept @Override public HarEntryRequestPostData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryRequestPostData given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryRequestPostData - * @throws IOException if the JSON string is invalid with respect to HarEntryRequestPostData - */ + /** + * Create an instance of HarEntryRequestPostData given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryRequestPostData + * @throws IOException if the JSON string is invalid with respect to HarEntryRequestPostData + */ public static HarEntryRequestPostData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryRequestPostData.class); } - /** - * Convert an instance of HarEntryRequestPostData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryRequestPostData to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInner.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInner.java index 36fe170a24..afd66c45c1 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInner.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInner.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,137 +50,127 @@ /** * HarEntryRequestPostDataParamsInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryRequestPostDataParamsInner { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable private String value; public static final String SERIALIZED_NAME_FILE_NAME = "fileName"; @SerializedName(SERIALIZED_NAME_FILE_NAME) + @javax.annotation.Nullable private String fileName; public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType"; @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) + @javax.annotation.Nullable private String contentType; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryRequestPostDataParamsInner() { } - public HarEntryRequestPostDataParamsInner name(String name) { - + public HarEntryRequestPostDataParamsInner name(@javax.annotation.Nullable String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nullable String name) { this.name = name; } - public HarEntryRequestPostDataParamsInner value(String value) { - + public HarEntryRequestPostDataParamsInner value(@javax.annotation.Nullable String value) { this.value = value; return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nullable - public String getValue() { return value; } - - public void setValue(String value) { + public void setValue(@javax.annotation.Nullable String value) { this.value = value; } - public HarEntryRequestPostDataParamsInner fileName(String fileName) { - + public HarEntryRequestPostDataParamsInner fileName(@javax.annotation.Nullable String fileName) { this.fileName = fileName; return this; } - /** + /** * Get fileName * @return fileName - **/ + */ @javax.annotation.Nullable - public String getFileName() { return fileName; } - - public void setFileName(String fileName) { + public void setFileName(@javax.annotation.Nullable String fileName) { this.fileName = fileName; } - public HarEntryRequestPostDataParamsInner contentType(String contentType) { - + public HarEntryRequestPostDataParamsInner contentType(@javax.annotation.Nullable String contentType) { this.contentType = contentType; return this; } - /** + /** * Get contentType * @return contentType - **/ + */ @javax.annotation.Nullable - public String getContentType() { return contentType; } - - public void setContentType(String contentType) { + public void setContentType(@javax.annotation.Nullable String contentType) { this.contentType = contentType; } - public HarEntryRequestPostDataParamsInner comment(String comment) { - + public HarEntryRequestPostDataParamsInner comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -184,23 +178,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryRequestPostDataParamsInner harEntryRequestPostDataParamsInner = (HarEntryRequestPostDataParamsInner) o; - return Objects.equals(this.name, harEntryRequestPostDataParamsInner.name) && - Objects.equals(this.value, harEntryRequestPostDataParamsInner.value) && - Objects.equals(this.fileName, harEntryRequestPostDataParamsInner.fileName) && - Objects.equals(this.contentType, harEntryRequestPostDataParamsInner.contentType) && - Objects.equals(this.comment, harEntryRequestPostDataParamsInner.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, value, fileName, contentType, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -244,26 +227,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryRequestPostDataParamsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryRequestPostDataParamsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryRequestPostDataParamsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryRequestPostDataParamsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryRequestPostDataParamsInner is not found in the empty JSON string", HarEntryRequestPostDataParamsInner.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryRequestPostDataParamsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestPostDataParamsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestPostDataParamsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -301,31 +285,31 @@ public void write(JsonWriter out, HarEntryRequestPostDataParamsInner value) thro @Override public HarEntryRequestPostDataParamsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryRequestPostDataParamsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryRequestPostDataParamsInner - * @throws IOException if the JSON string is invalid with respect to HarEntryRequestPostDataParamsInner - */ + /** + * Create an instance of HarEntryRequestPostDataParamsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryRequestPostDataParamsInner + * @throws IOException if the JSON string is invalid with respect to HarEntryRequestPostDataParamsInner + */ public static HarEntryRequestPostDataParamsInner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryRequestPostDataParamsInner.class); } - /** - * Convert an instance of HarEntryRequestPostDataParamsInner to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryRequestPostDataParamsInner to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestQueryStringInner.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestQueryStringInner.java index c1acf70286..020f357376 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestQueryStringInner.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryRequestQueryStringInner.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,85 +50,79 @@ /** * HarEntryRequestQueryStringInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryRequestQueryStringInner { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryRequestQueryStringInner() { } - public HarEntryRequestQueryStringInner name(String name) { - + public HarEntryRequestQueryStringInner name(@javax.annotation.Nonnull String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public HarEntryRequestQueryStringInner value(String value) { - + public HarEntryRequestQueryStringInner value(@javax.annotation.Nonnull String value) { this.value = value; return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull - public String getValue() { return value; } - - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } - public HarEntryRequestQueryStringInner comment(String comment) { - + public HarEntryRequestQueryStringInner comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -132,21 +130,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryRequestQueryStringInner harEntryRequestQueryStringInner = (HarEntryRequestQueryStringInner) o; - return Objects.equals(this.name, harEntryRequestQueryStringInner.name) && - Objects.equals(this.value, harEntryRequestQueryStringInner.value) && - Objects.equals(this.comment, harEntryRequestQueryStringInner.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, value, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -188,33 +177,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("value"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryRequestQueryStringInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryRequestQueryStringInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryRequestQueryStringInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryRequestQueryStringInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryRequestQueryStringInner is not found in the empty JSON string", HarEntryRequestQueryStringInner.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryRequestQueryStringInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestQueryStringInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryRequestQueryStringInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryRequestQueryStringInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -246,31 +236,31 @@ public void write(JsonWriter out, HarEntryRequestQueryStringInner value) throws @Override public HarEntryRequestQueryStringInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryRequestQueryStringInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryRequestQueryStringInner - * @throws IOException if the JSON string is invalid with respect to HarEntryRequestQueryStringInner - */ + /** + * Create an instance of HarEntryRequestQueryStringInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryRequestQueryStringInner + * @throws IOException if the JSON string is invalid with respect to HarEntryRequestQueryStringInner + */ public static HarEntryRequestQueryStringInner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryRequestQueryStringInner.class); } - /** - * Convert an instance of HarEntryRequestQueryStringInner to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryRequestQueryStringInner to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponse.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponse.java index 02b0248126..84e6d7f353 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponse.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponse.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarEntryRequestCookiesInner; import com.browserup.proxy_client.HarEntryResponseContent; import com.browserup.proxy_client.Header; @@ -25,6 +26,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gson.Gson; @@ -37,13 +39,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -51,277 +55,263 @@ /** * HarEntryResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private Integer status; public static final String SERIALIZED_NAME_STATUS_TEXT = "statusText"; @SerializedName(SERIALIZED_NAME_STATUS_TEXT) + @javax.annotation.Nonnull private String statusText; public static final String SERIALIZED_NAME_HTTP_VERSION = "httpVersion"; @SerializedName(SERIALIZED_NAME_HTTP_VERSION) + @javax.annotation.Nonnull private String httpVersion; public static final String SERIALIZED_NAME_COOKIES = "cookies"; @SerializedName(SERIALIZED_NAME_COOKIES) + @javax.annotation.Nonnull private List cookies = new ArrayList<>(); public static final String SERIALIZED_NAME_HEADERS = "headers"; @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nonnull private List
headers = new ArrayList<>(); public static final String SERIALIZED_NAME_CONTENT = "content"; @SerializedName(SERIALIZED_NAME_CONTENT) + @javax.annotation.Nonnull private HarEntryResponseContent content; public static final String SERIALIZED_NAME_REDIRECT_U_R_L = "redirectURL"; @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_L) + @javax.annotation.Nonnull private String redirectURL; public static final String SERIALIZED_NAME_HEADERS_SIZE = "headersSize"; @SerializedName(SERIALIZED_NAME_HEADERS_SIZE) + @javax.annotation.Nonnull private Integer headersSize; public static final String SERIALIZED_NAME_BODY_SIZE = "bodySize"; @SerializedName(SERIALIZED_NAME_BODY_SIZE) + @javax.annotation.Nonnull private Integer bodySize; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryResponse() { } - public HarEntryResponse status(Integer status) { - + public HarEntryResponse status(@javax.annotation.Nonnull Integer status) { this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nonnull - public Integer getStatus() { return status; } - - public void setStatus(Integer status) { + public void setStatus(@javax.annotation.Nonnull Integer status) { this.status = status; } - public HarEntryResponse statusText(String statusText) { - + public HarEntryResponse statusText(@javax.annotation.Nonnull String statusText) { this.statusText = statusText; return this; } - /** + /** * Get statusText * @return statusText - **/ + */ @javax.annotation.Nonnull - public String getStatusText() { return statusText; } - - public void setStatusText(String statusText) { + public void setStatusText(@javax.annotation.Nonnull String statusText) { this.statusText = statusText; } - public HarEntryResponse httpVersion(String httpVersion) { - + public HarEntryResponse httpVersion(@javax.annotation.Nonnull String httpVersion) { this.httpVersion = httpVersion; return this; } - /** + /** * Get httpVersion * @return httpVersion - **/ + */ @javax.annotation.Nonnull - public String getHttpVersion() { return httpVersion; } - - public void setHttpVersion(String httpVersion) { + public void setHttpVersion(@javax.annotation.Nonnull String httpVersion) { this.httpVersion = httpVersion; } - public HarEntryResponse cookies(List cookies) { - + public HarEntryResponse cookies(@javax.annotation.Nonnull List cookies) { this.cookies = cookies; return this; } public HarEntryResponse addCookiesItem(HarEntryRequestCookiesInner cookiesItem) { + if (this.cookies == null) { + this.cookies = new ArrayList<>(); + } this.cookies.add(cookiesItem); return this; } - /** + /** * Get cookies * @return cookies - **/ + */ @javax.annotation.Nonnull - public List getCookies() { return cookies; } - - public void setCookies(List cookies) { + public void setCookies(@javax.annotation.Nonnull List cookies) { this.cookies = cookies; } - public HarEntryResponse headers(List
headers) { - + public HarEntryResponse headers(@javax.annotation.Nonnull List
headers) { this.headers = headers; return this; } public HarEntryResponse addHeadersItem(Header headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } this.headers.add(headersItem); return this; } - /** + /** * Get headers * @return headers - **/ + */ @javax.annotation.Nonnull - public List
getHeaders() { return headers; } - - public void setHeaders(List
headers) { + public void setHeaders(@javax.annotation.Nonnull List
headers) { this.headers = headers; } - public HarEntryResponse content(HarEntryResponseContent content) { - + public HarEntryResponse content(@javax.annotation.Nonnull HarEntryResponseContent content) { this.content = content; return this; } - /** + /** * Get content * @return content - **/ + */ @javax.annotation.Nonnull - public HarEntryResponseContent getContent() { return content; } - - public void setContent(HarEntryResponseContent content) { + public void setContent(@javax.annotation.Nonnull HarEntryResponseContent content) { this.content = content; } - public HarEntryResponse redirectURL(String redirectURL) { - + public HarEntryResponse redirectURL(@javax.annotation.Nonnull String redirectURL) { this.redirectURL = redirectURL; return this; } - /** + /** * Get redirectURL * @return redirectURL - **/ + */ @javax.annotation.Nonnull - public String getRedirectURL() { return redirectURL; } - - public void setRedirectURL(String redirectURL) { + public void setRedirectURL(@javax.annotation.Nonnull String redirectURL) { this.redirectURL = redirectURL; } - public HarEntryResponse headersSize(Integer headersSize) { - + public HarEntryResponse headersSize(@javax.annotation.Nonnull Integer headersSize) { this.headersSize = headersSize; return this; } - /** + /** * Get headersSize * @return headersSize - **/ + */ @javax.annotation.Nonnull - public Integer getHeadersSize() { return headersSize; } - - public void setHeadersSize(Integer headersSize) { + public void setHeadersSize(@javax.annotation.Nonnull Integer headersSize) { this.headersSize = headersSize; } - public HarEntryResponse bodySize(Integer bodySize) { - + public HarEntryResponse bodySize(@javax.annotation.Nonnull Integer bodySize) { this.bodySize = bodySize; return this; } - /** + /** * Get bodySize * @return bodySize - **/ + */ @javax.annotation.Nonnull - public Integer getBodySize() { return bodySize; } - - public void setBodySize(Integer bodySize) { + public void setBodySize(@javax.annotation.Nonnull Integer bodySize) { this.bodySize = bodySize; } - public HarEntryResponse comment(String comment) { - + public HarEntryResponse comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -373,29 +363,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryResponse harEntryResponse = (HarEntryResponse) o; - return Objects.equals(this.status, harEntryResponse.status) && - Objects.equals(this.statusText, harEntryResponse.statusText) && - Objects.equals(this.httpVersion, harEntryResponse.httpVersion) && - Objects.equals(this.cookies, harEntryResponse.cookies) && - Objects.equals(this.headers, harEntryResponse.headers) && - Objects.equals(this.content, harEntryResponse.content) && - Objects.equals(this.redirectURL, harEntryResponse.redirectURL) && - Objects.equals(this.headersSize, harEntryResponse.headersSize) && - Objects.equals(this.bodySize, harEntryResponse.bodySize) && - Objects.equals(this.comment, harEntryResponse.comment)&& - Objects.equals(this.additionalProperties, harEntryResponse.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(status, statusText, httpVersion, cookies, headers, content, redirectURL, headersSize, bodySize, comment, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -459,25 +432,26 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bodySize"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryResponse is not found in the empty JSON string", HarEntryResponse.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("statusText").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `statusText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statusText").toString())); } @@ -492,7 +466,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArraycookies = jsonObj.getAsJsonArray("cookies"); // validate the required field `cookies` (array) for (int i = 0; i < jsonArraycookies.size(); i++) { - HarEntryRequestCookiesInner.validateJsonObject(jsonArraycookies.get(i).getAsJsonObject()); + HarEntryRequestCookiesInner.validateJsonElement(jsonArraycookies.get(i)); }; // ensure the json data is an array if (!jsonObj.get("headers").isJsonArray()) { @@ -502,10 +476,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArrayheaders = jsonObj.getAsJsonArray("headers"); // validate the required field `headers` (array) for (int i = 0; i < jsonArrayheaders.size(); i++) { - Header.validateJsonObject(jsonArrayheaders.get(i).getAsJsonObject()); + Header.validateJsonElement(jsonArrayheaders.get(i)); }; // validate the required field `content` - HarEntryResponseContent.validateJsonObject(jsonObj.getAsJsonObject("content")); + HarEntryResponseContent.validateJsonElement(jsonObj.get("content")); if (!jsonObj.get("redirectURL").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `redirectURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectURL").toString())); } @@ -542,7 +516,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -551,8 +530,9 @@ else if (entry.getValue() instanceof Character) @Override public HarEntryResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance HarEntryResponse instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { @@ -580,22 +560,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of HarEntryResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryResponse - * @throws IOException if the JSON string is invalid with respect to HarEntryResponse - */ + /** + * Create an instance of HarEntryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryResponse + * @throws IOException if the JSON string is invalid with respect to HarEntryResponse + */ public static HarEntryResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryResponse.class); } - /** - * Convert an instance of HarEntryResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponseContent.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponseContent.java index c9f02ffe14..a0b1c00d6d 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponseContent.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryResponseContent.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,379 +50,351 @@ /** * HarEntryResponseContent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryResponseContent { public static final String SERIALIZED_NAME_SIZE = "size"; @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull private Integer size; public static final String SERIALIZED_NAME_COMPRESSION = "compression"; @SerializedName(SERIALIZED_NAME_COMPRESSION) + @javax.annotation.Nullable private Integer compression; public static final String SERIALIZED_NAME_MIME_TYPE = "mimeType"; @SerializedName(SERIALIZED_NAME_MIME_TYPE) + @javax.annotation.Nonnull private String mimeType; public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable private String text; public static final String SERIALIZED_NAME_ENCODING = "encoding"; @SerializedName(SERIALIZED_NAME_ENCODING) + @javax.annotation.Nullable private String encoding; public static final String SERIALIZED_NAME_VIDEO_BUFFERED_PERCENT = "_videoBufferedPercent"; @SerializedName(SERIALIZED_NAME_VIDEO_BUFFERED_PERCENT) + @javax.annotation.Nullable private Long videoBufferedPercent = -1l; public static final String SERIALIZED_NAME_VIDEO_STALL_COUNT = "_videoStallCount"; @SerializedName(SERIALIZED_NAME_VIDEO_STALL_COUNT) + @javax.annotation.Nullable private Long videoStallCount = -1l; public static final String SERIALIZED_NAME_VIDEO_DECODED_BYTE_COUNT = "_videoDecodedByteCount"; @SerializedName(SERIALIZED_NAME_VIDEO_DECODED_BYTE_COUNT) + @javax.annotation.Nullable private Long videoDecodedByteCount = -1l; public static final String SERIALIZED_NAME_VIDEO_WAITING_COUNT = "_videoWaitingCount"; @SerializedName(SERIALIZED_NAME_VIDEO_WAITING_COUNT) + @javax.annotation.Nullable private Long videoWaitingCount = -1l; public static final String SERIALIZED_NAME_VIDEO_ERROR_COUNT = "_videoErrorCount"; @SerializedName(SERIALIZED_NAME_VIDEO_ERROR_COUNT) + @javax.annotation.Nullable private Long videoErrorCount = -1l; public static final String SERIALIZED_NAME_VIDEO_DROPPED_FRAMES = "_videoDroppedFrames"; @SerializedName(SERIALIZED_NAME_VIDEO_DROPPED_FRAMES) + @javax.annotation.Nullable private Long videoDroppedFrames = -1l; public static final String SERIALIZED_NAME_VIDEO_TOTAL_FRAMES = "_videoTotalFrames"; @SerializedName(SERIALIZED_NAME_VIDEO_TOTAL_FRAMES) + @javax.annotation.Nullable private Long videoTotalFrames = -1l; public static final String SERIALIZED_NAME_VIDEO_AUDIO_BYTES_DECODED = "_videoAudioBytesDecoded"; @SerializedName(SERIALIZED_NAME_VIDEO_AUDIO_BYTES_DECODED) + @javax.annotation.Nullable private Long videoAudioBytesDecoded = -1l; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryResponseContent() { } - public HarEntryResponseContent size(Integer size) { - + public HarEntryResponseContent size(@javax.annotation.Nonnull Integer size) { this.size = size; return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nonnull - public Integer getSize() { return size; } - - public void setSize(Integer size) { + public void setSize(@javax.annotation.Nonnull Integer size) { this.size = size; } - public HarEntryResponseContent compression(Integer compression) { - + public HarEntryResponseContent compression(@javax.annotation.Nullable Integer compression) { this.compression = compression; return this; } - /** + /** * Get compression * @return compression - **/ + */ @javax.annotation.Nullable - public Integer getCompression() { return compression; } - - public void setCompression(Integer compression) { + public void setCompression(@javax.annotation.Nullable Integer compression) { this.compression = compression; } - public HarEntryResponseContent mimeType(String mimeType) { - + public HarEntryResponseContent mimeType(@javax.annotation.Nonnull String mimeType) { this.mimeType = mimeType; return this; } - /** + /** * Get mimeType * @return mimeType - **/ + */ @javax.annotation.Nonnull - public String getMimeType() { return mimeType; } - - public void setMimeType(String mimeType) { + public void setMimeType(@javax.annotation.Nonnull String mimeType) { this.mimeType = mimeType; } - public HarEntryResponseContent text(String text) { - + public HarEntryResponseContent text(@javax.annotation.Nullable String text) { this.text = text; return this; } - /** + /** * Get text * @return text - **/ + */ @javax.annotation.Nullable - public String getText() { return text; } - - public void setText(String text) { + public void setText(@javax.annotation.Nullable String text) { this.text = text; } - public HarEntryResponseContent encoding(String encoding) { - + public HarEntryResponseContent encoding(@javax.annotation.Nullable String encoding) { this.encoding = encoding; return this; } - /** + /** * Get encoding * @return encoding - **/ + */ @javax.annotation.Nullable - public String getEncoding() { return encoding; } - - public void setEncoding(String encoding) { + public void setEncoding(@javax.annotation.Nullable String encoding) { this.encoding = encoding; } - public HarEntryResponseContent videoBufferedPercent(Long videoBufferedPercent) { - + public HarEntryResponseContent videoBufferedPercent(@javax.annotation.Nullable Long videoBufferedPercent) { this.videoBufferedPercent = videoBufferedPercent; return this; } - /** + /** * Get videoBufferedPercent * minimum: -1 * @return videoBufferedPercent - **/ + */ @javax.annotation.Nullable - public Long getVideoBufferedPercent() { return videoBufferedPercent; } - - public void setVideoBufferedPercent(Long videoBufferedPercent) { + public void setVideoBufferedPercent(@javax.annotation.Nullable Long videoBufferedPercent) { this.videoBufferedPercent = videoBufferedPercent; } - public HarEntryResponseContent videoStallCount(Long videoStallCount) { - + public HarEntryResponseContent videoStallCount(@javax.annotation.Nullable Long videoStallCount) { this.videoStallCount = videoStallCount; return this; } - /** + /** * Get videoStallCount * minimum: -1 * @return videoStallCount - **/ + */ @javax.annotation.Nullable - public Long getVideoStallCount() { return videoStallCount; } - - public void setVideoStallCount(Long videoStallCount) { + public void setVideoStallCount(@javax.annotation.Nullable Long videoStallCount) { this.videoStallCount = videoStallCount; } - public HarEntryResponseContent videoDecodedByteCount(Long videoDecodedByteCount) { - + public HarEntryResponseContent videoDecodedByteCount(@javax.annotation.Nullable Long videoDecodedByteCount) { this.videoDecodedByteCount = videoDecodedByteCount; return this; } - /** + /** * Get videoDecodedByteCount * minimum: -1 * @return videoDecodedByteCount - **/ + */ @javax.annotation.Nullable - public Long getVideoDecodedByteCount() { return videoDecodedByteCount; } - - public void setVideoDecodedByteCount(Long videoDecodedByteCount) { + public void setVideoDecodedByteCount(@javax.annotation.Nullable Long videoDecodedByteCount) { this.videoDecodedByteCount = videoDecodedByteCount; } - public HarEntryResponseContent videoWaitingCount(Long videoWaitingCount) { - + public HarEntryResponseContent videoWaitingCount(@javax.annotation.Nullable Long videoWaitingCount) { this.videoWaitingCount = videoWaitingCount; return this; } - /** + /** * Get videoWaitingCount * minimum: -1 * @return videoWaitingCount - **/ + */ @javax.annotation.Nullable - public Long getVideoWaitingCount() { return videoWaitingCount; } - - public void setVideoWaitingCount(Long videoWaitingCount) { + public void setVideoWaitingCount(@javax.annotation.Nullable Long videoWaitingCount) { this.videoWaitingCount = videoWaitingCount; } - public HarEntryResponseContent videoErrorCount(Long videoErrorCount) { - + public HarEntryResponseContent videoErrorCount(@javax.annotation.Nullable Long videoErrorCount) { this.videoErrorCount = videoErrorCount; return this; } - /** + /** * Get videoErrorCount * minimum: -1 * @return videoErrorCount - **/ + */ @javax.annotation.Nullable - public Long getVideoErrorCount() { return videoErrorCount; } - - public void setVideoErrorCount(Long videoErrorCount) { + public void setVideoErrorCount(@javax.annotation.Nullable Long videoErrorCount) { this.videoErrorCount = videoErrorCount; } - public HarEntryResponseContent videoDroppedFrames(Long videoDroppedFrames) { - + public HarEntryResponseContent videoDroppedFrames(@javax.annotation.Nullable Long videoDroppedFrames) { this.videoDroppedFrames = videoDroppedFrames; return this; } - /** + /** * Get videoDroppedFrames * minimum: -1 * @return videoDroppedFrames - **/ + */ @javax.annotation.Nullable - public Long getVideoDroppedFrames() { return videoDroppedFrames; } - - public void setVideoDroppedFrames(Long videoDroppedFrames) { + public void setVideoDroppedFrames(@javax.annotation.Nullable Long videoDroppedFrames) { this.videoDroppedFrames = videoDroppedFrames; } - public HarEntryResponseContent videoTotalFrames(Long videoTotalFrames) { - + public HarEntryResponseContent videoTotalFrames(@javax.annotation.Nullable Long videoTotalFrames) { this.videoTotalFrames = videoTotalFrames; return this; } - /** + /** * Get videoTotalFrames * minimum: -1 * @return videoTotalFrames - **/ + */ @javax.annotation.Nullable - public Long getVideoTotalFrames() { return videoTotalFrames; } - - public void setVideoTotalFrames(Long videoTotalFrames) { + public void setVideoTotalFrames(@javax.annotation.Nullable Long videoTotalFrames) { this.videoTotalFrames = videoTotalFrames; } - public HarEntryResponseContent videoAudioBytesDecoded(Long videoAudioBytesDecoded) { - + public HarEntryResponseContent videoAudioBytesDecoded(@javax.annotation.Nullable Long videoAudioBytesDecoded) { this.videoAudioBytesDecoded = videoAudioBytesDecoded; return this; } - /** + /** * Get videoAudioBytesDecoded * minimum: -1 * @return videoAudioBytesDecoded - **/ + */ @javax.annotation.Nullable - public Long getVideoAudioBytesDecoded() { return videoAudioBytesDecoded; } - - public void setVideoAudioBytesDecoded(Long videoAudioBytesDecoded) { + public void setVideoAudioBytesDecoded(@javax.annotation.Nullable Long videoAudioBytesDecoded) { this.videoAudioBytesDecoded = videoAudioBytesDecoded; } - public HarEntryResponseContent comment(String comment) { - + public HarEntryResponseContent comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -426,32 +402,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryResponseContent harEntryResponseContent = (HarEntryResponseContent) o; - return Objects.equals(this.size, harEntryResponseContent.size) && - Objects.equals(this.compression, harEntryResponseContent.compression) && - Objects.equals(this.mimeType, harEntryResponseContent.mimeType) && - Objects.equals(this.text, harEntryResponseContent.text) && - Objects.equals(this.encoding, harEntryResponseContent.encoding) && - Objects.equals(this.videoBufferedPercent, harEntryResponseContent.videoBufferedPercent) && - Objects.equals(this.videoStallCount, harEntryResponseContent.videoStallCount) && - Objects.equals(this.videoDecodedByteCount, harEntryResponseContent.videoDecodedByteCount) && - Objects.equals(this.videoWaitingCount, harEntryResponseContent.videoWaitingCount) && - Objects.equals(this.videoErrorCount, harEntryResponseContent.videoErrorCount) && - Objects.equals(this.videoDroppedFrames, harEntryResponseContent.videoDroppedFrames) && - Objects.equals(this.videoTotalFrames, harEntryResponseContent.videoTotalFrames) && - Objects.equals(this.videoAudioBytesDecoded, harEntryResponseContent.videoAudioBytesDecoded) && - Objects.equals(this.comment, harEntryResponseContent.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(size, compression, mimeType, text, encoding, videoBufferedPercent, videoStallCount, videoDecodedByteCount, videoWaitingCount, videoErrorCount, videoDroppedFrames, videoTotalFrames, videoAudioBytesDecoded, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -515,33 +471,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("mimeType"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryResponseContent - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryResponseContent.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryResponseContent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryResponseContent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryResponseContent is not found in the empty JSON string", HarEntryResponseContent.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryResponseContent.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryResponseContent` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryResponseContent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryResponseContent.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("mimeType").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `mimeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mimeType").toString())); } @@ -576,31 +533,31 @@ public void write(JsonWriter out, HarEntryResponseContent value) throws IOExcept @Override public HarEntryResponseContent read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryResponseContent given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryResponseContent - * @throws IOException if the JSON string is invalid with respect to HarEntryResponseContent - */ + /** + * Create an instance of HarEntryResponseContent given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryResponseContent + * @throws IOException if the JSON string is invalid with respect to HarEntryResponseContent + */ public static HarEntryResponseContent fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryResponseContent.class); } - /** - * Convert an instance of HarEntryResponseContent to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryResponseContent to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryTimings.java b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryTimings.java index 9b83be9d9e..fa2a032555 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarEntryTimings.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarEntryTimings.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,222 +50,206 @@ /** * HarEntryTimings */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarEntryTimings { public static final String SERIALIZED_NAME_DNS = "dns"; @SerializedName(SERIALIZED_NAME_DNS) + @javax.annotation.Nonnull private Long dns = -1l; public static final String SERIALIZED_NAME_CONNECT = "connect"; @SerializedName(SERIALIZED_NAME_CONNECT) + @javax.annotation.Nonnull private Long connect = -1l; public static final String SERIALIZED_NAME_BLOCKED = "blocked"; @SerializedName(SERIALIZED_NAME_BLOCKED) + @javax.annotation.Nonnull private Long blocked = -1l; public static final String SERIALIZED_NAME_SEND = "send"; @SerializedName(SERIALIZED_NAME_SEND) + @javax.annotation.Nonnull private Long send = -1l; public static final String SERIALIZED_NAME_WAIT = "wait"; @SerializedName(SERIALIZED_NAME_WAIT) + @javax.annotation.Nonnull private Long wait = -1l; public static final String SERIALIZED_NAME_RECEIVE = "receive"; @SerializedName(SERIALIZED_NAME_RECEIVE) + @javax.annotation.Nonnull private Long receive = -1l; public static final String SERIALIZED_NAME_SSL = "ssl"; @SerializedName(SERIALIZED_NAME_SSL) + @javax.annotation.Nonnull private Long ssl = -1l; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarEntryTimings() { } - public HarEntryTimings dns(Long dns) { - + public HarEntryTimings dns(@javax.annotation.Nonnull Long dns) { this.dns = dns; return this; } - /** + /** * Get dns * minimum: -1 * @return dns - **/ + */ @javax.annotation.Nonnull - public Long getDns() { return dns; } - - public void setDns(Long dns) { + public void setDns(@javax.annotation.Nonnull Long dns) { this.dns = dns; } - public HarEntryTimings connect(Long connect) { - + public HarEntryTimings connect(@javax.annotation.Nonnull Long connect) { this.connect = connect; return this; } - /** + /** * Get connect * minimum: -1 * @return connect - **/ + */ @javax.annotation.Nonnull - public Long getConnect() { return connect; } - - public void setConnect(Long connect) { + public void setConnect(@javax.annotation.Nonnull Long connect) { this.connect = connect; } - public HarEntryTimings blocked(Long blocked) { - + public HarEntryTimings blocked(@javax.annotation.Nonnull Long blocked) { this.blocked = blocked; return this; } - /** + /** * Get blocked * minimum: -1 * @return blocked - **/ + */ @javax.annotation.Nonnull - public Long getBlocked() { return blocked; } - - public void setBlocked(Long blocked) { + public void setBlocked(@javax.annotation.Nonnull Long blocked) { this.blocked = blocked; } - public HarEntryTimings send(Long send) { - + public HarEntryTimings send(@javax.annotation.Nonnull Long send) { this.send = send; return this; } - /** + /** * Get send * minimum: -1 * @return send - **/ + */ @javax.annotation.Nonnull - public Long getSend() { return send; } - - public void setSend(Long send) { + public void setSend(@javax.annotation.Nonnull Long send) { this.send = send; } - public HarEntryTimings wait(Long wait) { - + public HarEntryTimings wait(@javax.annotation.Nonnull Long wait) { this.wait = wait; return this; } - /** + /** * Get wait * minimum: -1 * @return wait - **/ + */ @javax.annotation.Nonnull - public Long getWait() { return wait; } - - public void setWait(Long wait) { + public void setWait(@javax.annotation.Nonnull Long wait) { this.wait = wait; } - public HarEntryTimings receive(Long receive) { - + public HarEntryTimings receive(@javax.annotation.Nonnull Long receive) { this.receive = receive; return this; } - /** + /** * Get receive * minimum: -1 * @return receive - **/ + */ @javax.annotation.Nonnull - public Long getReceive() { return receive; } - - public void setReceive(Long receive) { + public void setReceive(@javax.annotation.Nonnull Long receive) { this.receive = receive; } - public HarEntryTimings ssl(Long ssl) { - + public HarEntryTimings ssl(@javax.annotation.Nonnull Long ssl) { this.ssl = ssl; return this; } - /** + /** * Get ssl * minimum: -1 * @return ssl - **/ + */ @javax.annotation.Nonnull - public Long getSsl() { return ssl; } - - public void setSsl(Long ssl) { + public void setSsl(@javax.annotation.Nonnull Long ssl) { this.ssl = ssl; } - public HarEntryTimings comment(String comment) { - + public HarEntryTimings comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -269,26 +257,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarEntryTimings harEntryTimings = (HarEntryTimings) o; - return Objects.equals(this.dns, harEntryTimings.dns) && - Objects.equals(this.connect, harEntryTimings.connect) && - Objects.equals(this.blocked, harEntryTimings.blocked) && - Objects.equals(this.send, harEntryTimings.send) && - Objects.equals(this.wait, harEntryTimings.wait) && - Objects.equals(this.receive, harEntryTimings.receive) && - Objects.equals(this.ssl, harEntryTimings.ssl) && - Objects.equals(this.comment, harEntryTimings.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(dns, connect, blocked, send, wait, receive, ssl, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -345,33 +319,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ssl"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarEntryTimings - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarEntryTimings.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarEntryTimings + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarEntryTimings.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarEntryTimings is not found in the empty JSON string", HarEntryTimings.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarEntryTimings.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryTimings` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarEntryTimings` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarEntryTimings.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); } @@ -397,31 +372,31 @@ public void write(JsonWriter out, HarEntryTimings value) throws IOException { @Override public HarEntryTimings read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarEntryTimings given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarEntryTimings - * @throws IOException if the JSON string is invalid with respect to HarEntryTimings - */ + /** + * Create an instance of HarEntryTimings given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarEntryTimings + * @throws IOException if the JSON string is invalid with respect to HarEntryTimings + */ public static HarEntryTimings fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarEntryTimings.class); } - /** - * Convert an instance of HarEntryTimings to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarEntryTimings to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarLog.java b/clients/java/src/main/java/com/browserup/proxy_client/HarLog.java index 2208b22ee9..d67a7bb70c 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarLog.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarLog.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.HarEntry; import com.browserup.proxy_client.HarLogCreator; import com.browserup.proxy_client.Page; @@ -25,6 +26,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gson.Gson; @@ -37,13 +39,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -51,173 +55,215 @@ /** * HarLog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarLog { public static final String SERIALIZED_NAME_VERSION = "version"; @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nonnull private String version; public static final String SERIALIZED_NAME_CREATOR = "creator"; @SerializedName(SERIALIZED_NAME_CREATOR) + @javax.annotation.Nonnull private HarLogCreator creator; public static final String SERIALIZED_NAME_BROWSER = "browser"; @SerializedName(SERIALIZED_NAME_BROWSER) + @javax.annotation.Nullable private HarLogCreator browser; public static final String SERIALIZED_NAME_PAGES = "pages"; @SerializedName(SERIALIZED_NAME_PAGES) + @javax.annotation.Nonnull private List pages = new ArrayList<>(); public static final String SERIALIZED_NAME_ENTRIES = "entries"; @SerializedName(SERIALIZED_NAME_ENTRIES) + @javax.annotation.Nonnull private List entries = new ArrayList<>(); + public static final String SERIALIZED_NAME_TRACE_ID = "_trace_id"; + @SerializedName(SERIALIZED_NAME_TRACE_ID) + @javax.annotation.Nullable + private String traceId; + + public static final String SERIALIZED_NAME_SPAN_ID = "_span_id"; + @SerializedName(SERIALIZED_NAME_SPAN_ID) + @javax.annotation.Nullable + private String spanId; + public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarLog() { } - public HarLog version(String version) { - + public HarLog version(@javax.annotation.Nonnull String version) { this.version = version; return this; } - /** + /** * Get version * @return version - **/ + */ @javax.annotation.Nonnull - public String getVersion() { return version; } - - public void setVersion(String version) { + public void setVersion(@javax.annotation.Nonnull String version) { this.version = version; } - public HarLog creator(HarLogCreator creator) { - + public HarLog creator(@javax.annotation.Nonnull HarLogCreator creator) { this.creator = creator; return this; } - /** + /** * Get creator * @return creator - **/ + */ @javax.annotation.Nonnull - public HarLogCreator getCreator() { return creator; } - - public void setCreator(HarLogCreator creator) { + public void setCreator(@javax.annotation.Nonnull HarLogCreator creator) { this.creator = creator; } - public HarLog browser(HarLogCreator browser) { - + public HarLog browser(@javax.annotation.Nullable HarLogCreator browser) { this.browser = browser; return this; } - /** + /** * Get browser * @return browser - **/ + */ @javax.annotation.Nullable - public HarLogCreator getBrowser() { return browser; } - - public void setBrowser(HarLogCreator browser) { + public void setBrowser(@javax.annotation.Nullable HarLogCreator browser) { this.browser = browser; } - public HarLog pages(List pages) { - + public HarLog pages(@javax.annotation.Nonnull List pages) { this.pages = pages; return this; } public HarLog addPagesItem(Page pagesItem) { + if (this.pages == null) { + this.pages = new ArrayList<>(); + } this.pages.add(pagesItem); return this; } - /** + /** * Get pages * @return pages - **/ + */ @javax.annotation.Nonnull - public List getPages() { return pages; } - - public void setPages(List pages) { + public void setPages(@javax.annotation.Nonnull List pages) { this.pages = pages; } - public HarLog entries(List entries) { - + public HarLog entries(@javax.annotation.Nonnull List entries) { this.entries = entries; return this; } public HarLog addEntriesItem(HarEntry entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } this.entries.add(entriesItem); return this; } - /** + /** * Get entries * @return entries - **/ + */ @javax.annotation.Nonnull - public List getEntries() { return entries; } - - public void setEntries(List entries) { + public void setEntries(@javax.annotation.Nonnull List entries) { this.entries = entries; } - public HarLog comment(String comment) { - + public HarLog traceId(@javax.annotation.Nullable String traceId) { + this.traceId = traceId; + return this; + } + + /** + * W3C Trace Context trace ID for distributed tracing + * @return traceId + */ + @javax.annotation.Nullable + public String getTraceId() { + return traceId; + } + + public void setTraceId(@javax.annotation.Nullable String traceId) { + this.traceId = traceId; + } + + + public HarLog spanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + return this; + } + + /** + * W3C Trace Context span ID for this HAR trace root + * @return spanId + */ + @javax.annotation.Nullable + public String getSpanId() { + return spanId; + } + + public void setSpanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + } + + + public HarLog comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -225,24 +271,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarLog harLog = (HarLog) o; - return Objects.equals(this.version, harLog.version) && - Objects.equals(this.creator, harLog.creator) && - Objects.equals(this.browser, harLog.browser) && - Objects.equals(this.pages, harLog.pages) && - Objects.equals(this.entries, harLog.entries) && - Objects.equals(this.comment, harLog.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(version, creator, browser, pages, entries, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -254,6 +288,8 @@ public String toString() { sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); sb.append(" pages: ").append(toIndentedString(pages)).append("\n"); sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" traceId: ").append(toIndentedString(traceId)).append("\n"); + sb.append(" spanId: ").append(toIndentedString(spanId)).append("\n"); sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); sb.append("}"); return sb.toString(); @@ -282,6 +318,8 @@ private String toIndentedString(Object o) { openapiFields.add("browser"); openapiFields.add("pages"); openapiFields.add("entries"); + openapiFields.add("_trace_id"); + openapiFields.add("_span_id"); openapiFields.add("comment"); // a set of required properties/fields (JSON key names) @@ -292,41 +330,42 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("entries"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarLog - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarLog is not found in the empty JSON string", HarLog.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarLog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarLog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarLog.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("version").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } // validate the required field `creator` - HarLogCreator.validateJsonObject(jsonObj.getAsJsonObject("creator")); + HarLogCreator.validateJsonElement(jsonObj.get("creator")); // validate the optional field `browser` if (jsonObj.get("browser") != null && !jsonObj.get("browser").isJsonNull()) { - HarLogCreator.validateJsonObject(jsonObj.getAsJsonObject("browser")); + HarLogCreator.validateJsonElement(jsonObj.get("browser")); } // ensure the required json array is present if (jsonObj.get("pages") == null) { @@ -342,8 +381,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); // validate the required field `entries` (array) for (int i = 0; i < jsonArrayentries.size(); i++) { - HarEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); + HarEntry.validateJsonElement(jsonArrayentries.get(i)); }; + if ((jsonObj.get("_trace_id") != null && !jsonObj.get("_trace_id").isJsonNull()) && !jsonObj.get("_trace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_trace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_trace_id").toString())); + } + if ((jsonObj.get("_span_id") != null && !jsonObj.get("_span_id").isJsonNull()) && !jsonObj.get("_span_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_span_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_span_id").toString())); + } if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); } @@ -369,31 +414,31 @@ public void write(JsonWriter out, HarLog value) throws IOException { @Override public HarLog read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarLog - * @throws IOException if the JSON string is invalid with respect to HarLog - */ + /** + * Create an instance of HarLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarLog + * @throws IOException if the JSON string is invalid with respect to HarLog + */ public static HarLog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarLog.class); } - /** - * Convert an instance of HarLog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarLog to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/HarLogCreator.java b/clients/java/src/main/java/com/browserup/proxy_client/HarLogCreator.java index 478c1075b2..ddc816eb78 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/HarLogCreator.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/HarLogCreator.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,85 +50,79 @@ /** * HarLogCreator */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HarLogCreator { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_VERSION = "version"; @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nonnull private String version; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public HarLogCreator() { } - public HarLogCreator name(String name) { - + public HarLogCreator name(@javax.annotation.Nonnull String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public HarLogCreator version(String version) { - + public HarLogCreator version(@javax.annotation.Nonnull String version) { this.version = version; return this; } - /** + /** * Get version * @return version - **/ + */ @javax.annotation.Nonnull - public String getVersion() { return version; } - - public void setVersion(String version) { + public void setVersion(@javax.annotation.Nonnull String version) { this.version = version; } - public HarLogCreator comment(String comment) { - + public HarLogCreator comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -132,21 +130,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HarLogCreator harLogCreator = (HarLogCreator) o; - return Objects.equals(this.name, harLogCreator.name) && - Objects.equals(this.version, harLogCreator.version) && - Objects.equals(this.comment, harLogCreator.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, version, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -188,33 +177,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("version"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HarLogCreator - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!HarLogCreator.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HarLogCreator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HarLogCreator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in HarLogCreator is not found in the empty JSON string", HarLogCreator.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HarLogCreator.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarLogCreator` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HarLogCreator` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HarLogCreator.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -246,31 +236,31 @@ public void write(JsonWriter out, HarLogCreator value) throws IOException { @Override public HarLogCreator read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of HarLogCreator given an JSON string - * - * @param jsonString JSON string - * @return An instance of HarLogCreator - * @throws IOException if the JSON string is invalid with respect to HarLogCreator - */ + /** + * Create an instance of HarLogCreator given an JSON string + * + * @param jsonString JSON string + * @return An instance of HarLogCreator + * @throws IOException if the JSON string is invalid with respect to HarLogCreator + */ public static HarLogCreator fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HarLogCreator.class); } - /** - * Convert an instance of HarLogCreator to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HarLogCreator to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Header.java b/clients/java/src/main/java/com/browserup/proxy_client/Header.java index b87e63d8af..aeea0e3522 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Header.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Header.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,85 +50,79 @@ /** * Header */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Header { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public Header() { } - public Header name(String name) { - + public Header name(@javax.annotation.Nonnull String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public Header value(String value) { - + public Header value(@javax.annotation.Nonnull String value) { this.value = value; return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull - public String getValue() { return value; } - - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } - public Header comment(String comment) { - + public Header comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -132,21 +130,12 @@ public void setComment(String comment) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Header header = (Header) o; - return Objects.equals(this.name, header.name) && - Objects.equals(this.value, header.value) && - Objects.equals(this.comment, header.comment); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, value, comment); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -188,33 +177,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("value"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Header - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Header.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Header + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Header.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Header is not found in the empty JSON string", Header.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Header.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Header` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Header` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Header.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -246,31 +236,31 @@ public void write(JsonWriter out, Header value) throws IOException { @Override public Header read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Header given an JSON string - * - * @param jsonString JSON string - * @return An instance of Header - * @throws IOException if the JSON string is invalid with respect to Header - */ + /** + * Create an instance of Header given an JSON string + * + * @param jsonString JSON string + * @return An instance of Header + * @throws IOException if the JSON string is invalid with respect to Header + */ public static Header fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Header.class); } - /** - * Convert an instance of Header to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Header to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/JSON.java b/clients/java/src/main/java/com/browserup/proxy_client/JSON.java index 9e49f3ec2f..0049b9320e 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/JSON.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/JSON.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -87,7 +87,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); @@ -100,7 +100,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntryCache.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntryCacheBeforeRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntryCacheBeforeRequestOneOf.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntryRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntryRequestCookiesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.HarEntryRequestPostData.CustomTypeAdapterFactory()); @@ -114,7 +113,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.Header.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.LargestContentfulPaint.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.MatchCriteria.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.MatchCriteriaRequestHeader.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.Metric.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.NameValuePair.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.browserup.proxy_client.Page.CustomTypeAdapterFactory()); diff --git a/clients/java/src/main/java/com/browserup/proxy_client/LargestContentfulPaint.java b/clients/java/src/main/java/com/browserup/proxy_client/LargestContentfulPaint.java index bc9fcfafa5..fe83f65e89 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/LargestContentfulPaint.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/LargestContentfulPaint.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,113 +50,105 @@ /** * LargestContentfulPaint */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class LargestContentfulPaint { public static final String SERIALIZED_NAME_START_TIME = "startTime"; @SerializedName(SERIALIZED_NAME_START_TIME) + @javax.annotation.Nullable private Long startTime = -1l; public static final String SERIALIZED_NAME_SIZE = "size"; @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size = -1l; public static final String SERIALIZED_NAME_DOM_PATH = "domPath"; @SerializedName(SERIALIZED_NAME_DOM_PATH) + @javax.annotation.Nullable private String domPath = ""; public static final String SERIALIZED_NAME_TAG = "tag"; @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable private String tag = ""; public LargestContentfulPaint() { } - public LargestContentfulPaint startTime(Long startTime) { - + public LargestContentfulPaint startTime(@javax.annotation.Nullable Long startTime) { this.startTime = startTime; return this; } - /** + /** * Get startTime * minimum: -1 * @return startTime - **/ + */ @javax.annotation.Nullable - public Long getStartTime() { return startTime; } - - public void setStartTime(Long startTime) { + public void setStartTime(@javax.annotation.Nullable Long startTime) { this.startTime = startTime; } - public LargestContentfulPaint size(Long size) { - + public LargestContentfulPaint size(@javax.annotation.Nullable Long size) { this.size = size; return this; } - /** + /** * Get size * minimum: -1 * @return size - **/ + */ @javax.annotation.Nullable - public Long getSize() { return size; } - - public void setSize(Long size) { + public void setSize(@javax.annotation.Nullable Long size) { this.size = size; } - public LargestContentfulPaint domPath(String domPath) { - + public LargestContentfulPaint domPath(@javax.annotation.Nullable String domPath) { this.domPath = domPath; return this; } - /** + /** * Get domPath * @return domPath - **/ + */ @javax.annotation.Nullable - public String getDomPath() { return domPath; } - - public void setDomPath(String domPath) { + public void setDomPath(@javax.annotation.Nullable String domPath) { this.domPath = domPath; } - public LargestContentfulPaint tag(String tag) { - + public LargestContentfulPaint tag(@javax.annotation.Nullable String tag) { this.tag = tag; return this; } - /** + /** * Get tag * @return tag - **/ + */ @javax.annotation.Nullable - public String getTag() { return tag; } - - public void setTag(String tag) { + public void setTag(@javax.annotation.Nullable String tag) { this.tag = tag; } @@ -204,23 +200,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LargestContentfulPaint largestContentfulPaint = (LargestContentfulPaint) o; - return Objects.equals(this.startTime, largestContentfulPaint.startTime) && - Objects.equals(this.size, largestContentfulPaint.size) && - Objects.equals(this.domPath, largestContentfulPaint.domPath) && - Objects.equals(this.tag, largestContentfulPaint.tag)&& - Objects.equals(this.additionalProperties, largestContentfulPaint.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(startTime, size, domPath, tag, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -263,18 +248,19 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to LargestContentfulPaint - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!LargestContentfulPaint.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LargestContentfulPaint + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LargestContentfulPaint.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in LargestContentfulPaint is not found in the empty JSON string", LargestContentfulPaint.openapiRequiredFields.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("domPath") != null && !jsonObj.get("domPath").isJsonNull()) && !jsonObj.get("domPath").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `domPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domPath").toString())); } @@ -311,7 +297,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,8 +311,9 @@ else if (entry.getValue() instanceof Character) @Override public LargestContentfulPaint read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance LargestContentfulPaint instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { @@ -349,22 +341,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of LargestContentfulPaint given an JSON string - * - * @param jsonString JSON string - * @return An instance of LargestContentfulPaint - * @throws IOException if the JSON string is invalid with respect to LargestContentfulPaint - */ + /** + * Create an instance of LargestContentfulPaint given an JSON string + * + * @param jsonString JSON string + * @return An instance of LargestContentfulPaint + * @throws IOException if the JSON string is invalid with respect to LargestContentfulPaint + */ public static LargestContentfulPaint fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LargestContentfulPaint.class); } - /** - * Convert an instance of LargestContentfulPaint to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LargestContentfulPaint to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteria.java b/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteria.java index 5d4778859a..965bf6125e 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteria.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteria.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,15 +13,17 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; -import com.browserup.proxy_client.MatchCriteriaRequestHeader; +import com.browserup.proxy_client.NameValuePair; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -33,13 +35,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -47,371 +51,343 @@ /** * A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class MatchCriteria { public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable private String url; public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) + @javax.annotation.Nullable private String page; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; public static final String SERIALIZED_NAME_CONTENT = "content"; @SerializedName(SERIALIZED_NAME_CONTENT) + @javax.annotation.Nullable private String content; public static final String SERIALIZED_NAME_CONTENT_TYPE = "content_type"; @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) + @javax.annotation.Nullable private String contentType; public static final String SERIALIZED_NAME_WEBSOCKET_MESSAGE = "websocket_message"; @SerializedName(SERIALIZED_NAME_WEBSOCKET_MESSAGE) + @javax.annotation.Nullable private String websocketMessage; public static final String SERIALIZED_NAME_REQUEST_HEADER = "request_header"; @SerializedName(SERIALIZED_NAME_REQUEST_HEADER) - private MatchCriteriaRequestHeader requestHeader; + @javax.annotation.Nullable + private NameValuePair requestHeader; public static final String SERIALIZED_NAME_REQUEST_COOKIE = "request_cookie"; @SerializedName(SERIALIZED_NAME_REQUEST_COOKIE) - private MatchCriteriaRequestHeader requestCookie; + @javax.annotation.Nullable + private NameValuePair requestCookie; public static final String SERIALIZED_NAME_RESPONSE_HEADER = "response_header"; @SerializedName(SERIALIZED_NAME_RESPONSE_HEADER) - private MatchCriteriaRequestHeader responseHeader; + @javax.annotation.Nullable + private NameValuePair responseHeader; public static final String SERIALIZED_NAME_RESPONSE_COOKIE = "response_cookie"; @SerializedName(SERIALIZED_NAME_RESPONSE_COOKIE) - private MatchCriteriaRequestHeader responseCookie; + @javax.annotation.Nullable + private NameValuePair responseCookie; public static final String SERIALIZED_NAME_JSON_VALID = "json_valid"; @SerializedName(SERIALIZED_NAME_JSON_VALID) + @javax.annotation.Nullable private Boolean jsonValid; public static final String SERIALIZED_NAME_JSON_PATH = "json_path"; @SerializedName(SERIALIZED_NAME_JSON_PATH) + @javax.annotation.Nullable private String jsonPath; public static final String SERIALIZED_NAME_JSON_SCHEMA = "json_schema"; @SerializedName(SERIALIZED_NAME_JSON_SCHEMA) + @javax.annotation.Nullable private String jsonSchema; public static final String SERIALIZED_NAME_ERROR_IF_NO_TRAFFIC = "error_if_no_traffic"; @SerializedName(SERIALIZED_NAME_ERROR_IF_NO_TRAFFIC) + @javax.annotation.Nullable private Boolean errorIfNoTraffic = true; public MatchCriteria() { } - public MatchCriteria url(String url) { - + public MatchCriteria url(@javax.annotation.Nullable String url) { this.url = url; return this; } - /** + /** * Request URL regexp to match * @return url - **/ + */ @javax.annotation.Nullable - public String getUrl() { return url; } - - public void setUrl(String url) { + public void setUrl(@javax.annotation.Nullable String url) { this.url = url; } - public MatchCriteria page(String page) { - + public MatchCriteria page(@javax.annotation.Nullable String page) { this.page = page; return this; } - /** + /** * current|all * @return page - **/ + */ @javax.annotation.Nullable - public String getPage() { return page; } - - public void setPage(String page) { + public void setPage(@javax.annotation.Nullable String page) { this.page = page; } - public MatchCriteria status(String status) { - + public MatchCriteria status(@javax.annotation.Nullable String status) { this.status = status; return this; } - /** + /** * HTTP Status code to match. * @return status - **/ + */ @javax.annotation.Nullable - public String getStatus() { return status; } - - public void setStatus(String status) { + public void setStatus(@javax.annotation.Nullable String status) { this.status = status; } - public MatchCriteria content(String content) { - + public MatchCriteria content(@javax.annotation.Nullable String content) { this.content = content; return this; } - /** + /** * Body content regexp content to match * @return content - **/ + */ @javax.annotation.Nullable - public String getContent() { return content; } - - public void setContent(String content) { + public void setContent(@javax.annotation.Nullable String content) { this.content = content; } - public MatchCriteria contentType(String contentType) { - + public MatchCriteria contentType(@javax.annotation.Nullable String contentType) { this.contentType = contentType; return this; } - /** + /** * Content type * @return contentType - **/ + */ @javax.annotation.Nullable - public String getContentType() { return contentType; } - - public void setContentType(String contentType) { + public void setContentType(@javax.annotation.Nullable String contentType) { this.contentType = contentType; } - public MatchCriteria websocketMessage(String websocketMessage) { - + public MatchCriteria websocketMessage(@javax.annotation.Nullable String websocketMessage) { this.websocketMessage = websocketMessage; return this; } - /** + /** * Websocket message text to match * @return websocketMessage - **/ + */ @javax.annotation.Nullable - public String getWebsocketMessage() { return websocketMessage; } - - public void setWebsocketMessage(String websocketMessage) { + public void setWebsocketMessage(@javax.annotation.Nullable String websocketMessage) { this.websocketMessage = websocketMessage; } - public MatchCriteria requestHeader(MatchCriteriaRequestHeader requestHeader) { - + public MatchCriteria requestHeader(@javax.annotation.Nullable NameValuePair requestHeader) { this.requestHeader = requestHeader; return this; } - /** + /** * Get requestHeader * @return requestHeader - **/ + */ @javax.annotation.Nullable - - public MatchCriteriaRequestHeader getRequestHeader() { + public NameValuePair getRequestHeader() { return requestHeader; } - - public void setRequestHeader(MatchCriteriaRequestHeader requestHeader) { + public void setRequestHeader(@javax.annotation.Nullable NameValuePair requestHeader) { this.requestHeader = requestHeader; } - public MatchCriteria requestCookie(MatchCriteriaRequestHeader requestCookie) { - + public MatchCriteria requestCookie(@javax.annotation.Nullable NameValuePair requestCookie) { this.requestCookie = requestCookie; return this; } - /** + /** * Get requestCookie * @return requestCookie - **/ + */ @javax.annotation.Nullable - - public MatchCriteriaRequestHeader getRequestCookie() { + public NameValuePair getRequestCookie() { return requestCookie; } - - public void setRequestCookie(MatchCriteriaRequestHeader requestCookie) { + public void setRequestCookie(@javax.annotation.Nullable NameValuePair requestCookie) { this.requestCookie = requestCookie; } - public MatchCriteria responseHeader(MatchCriteriaRequestHeader responseHeader) { - + public MatchCriteria responseHeader(@javax.annotation.Nullable NameValuePair responseHeader) { this.responseHeader = responseHeader; return this; } - /** + /** * Get responseHeader * @return responseHeader - **/ + */ @javax.annotation.Nullable - - public MatchCriteriaRequestHeader getResponseHeader() { + public NameValuePair getResponseHeader() { return responseHeader; } - - public void setResponseHeader(MatchCriteriaRequestHeader responseHeader) { + public void setResponseHeader(@javax.annotation.Nullable NameValuePair responseHeader) { this.responseHeader = responseHeader; } - public MatchCriteria responseCookie(MatchCriteriaRequestHeader responseCookie) { - + public MatchCriteria responseCookie(@javax.annotation.Nullable NameValuePair responseCookie) { this.responseCookie = responseCookie; return this; } - /** + /** * Get responseCookie * @return responseCookie - **/ + */ @javax.annotation.Nullable - - public MatchCriteriaRequestHeader getResponseCookie() { + public NameValuePair getResponseCookie() { return responseCookie; } - - public void setResponseCookie(MatchCriteriaRequestHeader responseCookie) { + public void setResponseCookie(@javax.annotation.Nullable NameValuePair responseCookie) { this.responseCookie = responseCookie; } - public MatchCriteria jsonValid(Boolean jsonValid) { - + public MatchCriteria jsonValid(@javax.annotation.Nullable Boolean jsonValid) { this.jsonValid = jsonValid; return this; } - /** + /** * Is valid JSON * @return jsonValid - **/ + */ @javax.annotation.Nullable - public Boolean getJsonValid() { return jsonValid; } - - public void setJsonValid(Boolean jsonValid) { + public void setJsonValid(@javax.annotation.Nullable Boolean jsonValid) { this.jsonValid = jsonValid; } - public MatchCriteria jsonPath(String jsonPath) { - + public MatchCriteria jsonPath(@javax.annotation.Nullable String jsonPath) { this.jsonPath = jsonPath; return this; } - /** + /** * Has JSON path * @return jsonPath - **/ + */ @javax.annotation.Nullable - public String getJsonPath() { return jsonPath; } - - public void setJsonPath(String jsonPath) { + public void setJsonPath(@javax.annotation.Nullable String jsonPath) { this.jsonPath = jsonPath; } - public MatchCriteria jsonSchema(String jsonSchema) { - + public MatchCriteria jsonSchema(@javax.annotation.Nullable String jsonSchema) { this.jsonSchema = jsonSchema; return this; } - /** + /** * Validates against passed JSON schema * @return jsonSchema - **/ + */ @javax.annotation.Nullable - public String getJsonSchema() { return jsonSchema; } - - public void setJsonSchema(String jsonSchema) { + public void setJsonSchema(@javax.annotation.Nullable String jsonSchema) { this.jsonSchema = jsonSchema; } - public MatchCriteria errorIfNoTraffic(Boolean errorIfNoTraffic) { - + public MatchCriteria errorIfNoTraffic(@javax.annotation.Nullable Boolean errorIfNoTraffic) { this.errorIfNoTraffic = errorIfNoTraffic; return this; } - /** + /** * If the proxy has NO traffic at all, return error * @return errorIfNoTraffic - **/ + */ @javax.annotation.Nullable - public Boolean getErrorIfNoTraffic() { return errorIfNoTraffic; } - - public void setErrorIfNoTraffic(Boolean errorIfNoTraffic) { + public void setErrorIfNoTraffic(@javax.annotation.Nullable Boolean errorIfNoTraffic) { this.errorIfNoTraffic = errorIfNoTraffic; } @@ -419,32 +395,12 @@ public void setErrorIfNoTraffic(Boolean errorIfNoTraffic) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MatchCriteria matchCriteria = (MatchCriteria) o; - return Objects.equals(this.url, matchCriteria.url) && - Objects.equals(this.page, matchCriteria.page) && - Objects.equals(this.status, matchCriteria.status) && - Objects.equals(this.content, matchCriteria.content) && - Objects.equals(this.contentType, matchCriteria.contentType) && - Objects.equals(this.websocketMessage, matchCriteria.websocketMessage) && - Objects.equals(this.requestHeader, matchCriteria.requestHeader) && - Objects.equals(this.requestCookie, matchCriteria.requestCookie) && - Objects.equals(this.responseHeader, matchCriteria.responseHeader) && - Objects.equals(this.responseCookie, matchCriteria.responseCookie) && - Objects.equals(this.jsonValid, matchCriteria.jsonValid) && - Objects.equals(this.jsonPath, matchCriteria.jsonPath) && - Objects.equals(this.jsonSchema, matchCriteria.jsonSchema) && - Objects.equals(this.errorIfNoTraffic, matchCriteria.errorIfNoTraffic); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(url, page, status, content, contentType, websocketMessage, requestHeader, requestCookie, responseHeader, responseCookie, jsonValid, jsonPath, jsonSchema, errorIfNoTraffic); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -506,26 +462,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MatchCriteria - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!MatchCriteria.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MatchCriteria + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MatchCriteria.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MatchCriteria is not found in the empty JSON string", MatchCriteria.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!MatchCriteria.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MatchCriteria` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MatchCriteria` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } @@ -546,19 +503,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `request_header` if (jsonObj.get("request_header") != null && !jsonObj.get("request_header").isJsonNull()) { - MatchCriteriaRequestHeader.validateJsonObject(jsonObj.getAsJsonObject("request_header")); + NameValuePair.validateJsonElement(jsonObj.get("request_header")); } // validate the optional field `request_cookie` if (jsonObj.get("request_cookie") != null && !jsonObj.get("request_cookie").isJsonNull()) { - MatchCriteriaRequestHeader.validateJsonObject(jsonObj.getAsJsonObject("request_cookie")); + NameValuePair.validateJsonElement(jsonObj.get("request_cookie")); } // validate the optional field `response_header` if (jsonObj.get("response_header") != null && !jsonObj.get("response_header").isJsonNull()) { - MatchCriteriaRequestHeader.validateJsonObject(jsonObj.getAsJsonObject("response_header")); + NameValuePair.validateJsonElement(jsonObj.get("response_header")); } // validate the optional field `response_cookie` if (jsonObj.get("response_cookie") != null && !jsonObj.get("response_cookie").isJsonNull()) { - MatchCriteriaRequestHeader.validateJsonObject(jsonObj.getAsJsonObject("response_cookie")); + NameValuePair.validateJsonElement(jsonObj.get("response_cookie")); } if ((jsonObj.get("json_path") != null && !jsonObj.get("json_path").isJsonNull()) && !jsonObj.get("json_path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `json_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("json_path").toString())); @@ -588,31 +545,31 @@ public void write(JsonWriter out, MatchCriteria value) throws IOException { @Override public MatchCriteria read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MatchCriteria given an JSON string - * - * @param jsonString JSON string - * @return An instance of MatchCriteria - * @throws IOException if the JSON string is invalid with respect to MatchCriteria - */ + /** + * Create an instance of MatchCriteria given an JSON string + * + * @param jsonString JSON string + * @return An instance of MatchCriteria + * @throws IOException if the JSON string is invalid with respect to MatchCriteria + */ public static MatchCriteria fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MatchCriteria.class); } - /** - * Convert an instance of MatchCriteria to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MatchCriteria to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteriaRequestHeader.java b/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteriaRequestHeader.java deleted file mode 100644 index b94a5ee911..0000000000 --- a/clients/java/src/main/java/com/browserup/proxy_client/MatchCriteriaRequestHeader.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.browserup.proxy_client; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.browserup.proxy_client.JSON; - -/** - * MatchCriteriaRequestHeader - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MatchCriteriaRequestHeader { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public MatchCriteriaRequestHeader() { - } - - public MatchCriteriaRequestHeader name(String name) { - - this.name = name; - return this; - } - - /** - * Name to match - * @return name - **/ - @javax.annotation.Nullable - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public MatchCriteriaRequestHeader value(String value) { - - this.value = value; - return this; - } - - /** - * Value to match - * @return value - **/ - @javax.annotation.Nullable - - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MatchCriteriaRequestHeader matchCriteriaRequestHeader = (MatchCriteriaRequestHeader) o; - return Objects.equals(this.name, matchCriteriaRequestHeader.name) && - Objects.equals(this.value, matchCriteriaRequestHeader.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MatchCriteriaRequestHeader {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MatchCriteriaRequestHeader - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!MatchCriteriaRequestHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in MatchCriteriaRequestHeader is not found in the empty JSON string", MatchCriteriaRequestHeader.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!MatchCriteriaRequestHeader.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MatchCriteriaRequestHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MatchCriteriaRequestHeader.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MatchCriteriaRequestHeader' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MatchCriteriaRequestHeader.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MatchCriteriaRequestHeader value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public MatchCriteriaRequestHeader read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MatchCriteriaRequestHeader given an JSON string - * - * @param jsonString JSON string - * @return An instance of MatchCriteriaRequestHeader - * @throws IOException if the JSON string is invalid with respect to MatchCriteriaRequestHeader - */ - public static MatchCriteriaRequestHeader fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MatchCriteriaRequestHeader.class); - } - - /** - * Convert an instance of MatchCriteriaRequestHeader to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Metric.java b/clients/java/src/main/java/com/browserup/proxy_client/Metric.java index 78fcc61193..9fd8a6d1ea 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Metric.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Metric.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,59 +50,55 @@ /** * Metric */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Metric { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private Double value; + @javax.annotation.Nullable + private Integer value; public Metric() { } - public Metric name(String name) { - + public Metric name(@javax.annotation.Nullable String name) { this.name = name; return this; } - /** + /** * Name of Custom Metric to add to the page under _metrics * @return name - **/ + */ @javax.annotation.Nullable - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nullable String name) { this.name = name; } - public Metric value(Double value) { - + public Metric value(@javax.annotation.Nullable Integer value) { this.value = value; return this; } - /** + /** * Value for the metric * @return value - **/ + */ @javax.annotation.Nullable - - public Double getValue() { + public Integer getValue() { return value; } - - public void setValue(Double value) { + public void setValue(@javax.annotation.Nullable Integer value) { this.value = value; } @@ -106,20 +106,12 @@ public void setValue(Double value) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Metric metric = (Metric) o; - return Objects.equals(this.name, metric.name) && - Objects.equals(this.value, metric.value); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, value); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -157,26 +149,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Metric - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Metric.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Metric + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Metric.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Metric is not found in the empty JSON string", Metric.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Metric.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Metric` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Metric` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -202,31 +195,31 @@ public void write(JsonWriter out, Metric value) throws IOException { @Override public Metric read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Metric given an JSON string - * - * @param jsonString JSON string - * @return An instance of Metric - * @throws IOException if the JSON string is invalid with respect to Metric - */ + /** + * Create an instance of Metric given an JSON string + * + * @param jsonString JSON string + * @return An instance of Metric + * @throws IOException if the JSON string is invalid with respect to Metric + */ public static Metric fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Metric.class); } - /** - * Convert an instance of Metric to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Metric to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/NameValuePair.java b/clients/java/src/main/java/com/browserup/proxy_client/NameValuePair.java index b07f1a295e..c1c929e79e 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/NameValuePair.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/NameValuePair.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,59 +50,55 @@ /** * NameValuePair */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class NameValuePair { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable private String value; public NameValuePair() { } - public NameValuePair name(String name) { - + public NameValuePair name(@javax.annotation.Nullable String name) { this.name = name; return this; } - /** + /** * Name to match * @return name - **/ + */ @javax.annotation.Nullable - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nullable String name) { this.name = name; } - public NameValuePair value(String value) { - + public NameValuePair value(@javax.annotation.Nullable String value) { this.value = value; return this; } - /** + /** * Value to match * @return value - **/ + */ @javax.annotation.Nullable - public String getValue() { return value; } - - public void setValue(String value) { + public void setValue(@javax.annotation.Nullable String value) { this.value = value; } @@ -106,20 +106,12 @@ public void setValue(String value) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NameValuePair nameValuePair = (NameValuePair) o; - return Objects.equals(this.name, nameValuePair.name) && - Objects.equals(this.value, nameValuePair.value); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, value); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -157,26 +149,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NameValuePair - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!NameValuePair.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NameValuePair + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NameValuePair.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NameValuePair is not found in the empty JSON string", NameValuePair.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!NameValuePair.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NameValuePair` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NameValuePair` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -205,31 +198,31 @@ public void write(JsonWriter out, NameValuePair value) throws IOException { @Override public NameValuePair read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NameValuePair given an JSON string - * - * @param jsonString JSON string - * @return An instance of NameValuePair - * @throws IOException if the JSON string is invalid with respect to NameValuePair - */ + /** + * Create an instance of NameValuePair given an JSON string + * + * @param jsonString JSON string + * @return An instance of NameValuePair + * @throws IOException if the JSON string is invalid with respect to NameValuePair + */ public static NameValuePair fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NameValuePair.class); } - /** - * Convert an instance of NameValuePair to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NameValuePair to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Page.java b/clients/java/src/main/java/com/browserup/proxy_client/Page.java index 6661bdbe36..bafdfa433b 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Page.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Page.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.Error; import com.browserup.proxy_client.Metric; import com.browserup.proxy_client.PageTimings; @@ -27,6 +28,7 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gson.Gson; @@ -39,13 +41,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -53,239 +57,271 @@ /** * Page */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Page { public static final String SERIALIZED_NAME_STARTED_DATE_TIME = "startedDateTime"; @SerializedName(SERIALIZED_NAME_STARTED_DATE_TIME) + @javax.annotation.Nonnull private OffsetDateTime startedDateTime; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull private String id; public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nonnull private String title; public static final String SERIALIZED_NAME_VERIFICATIONS = "_verifications"; @SerializedName(SERIALIZED_NAME_VERIFICATIONS) - private List verifications = null; + @javax.annotation.Nullable + private List verifications = new ArrayList<>(); public static final String SERIALIZED_NAME_METRICS = "_metrics"; @SerializedName(SERIALIZED_NAME_METRICS) - private List metrics = null; + @javax.annotation.Nullable + private List metrics = new ArrayList<>(); public static final String SERIALIZED_NAME_ERRORS = "_errors"; @SerializedName(SERIALIZED_NAME_ERRORS) - private List errors = null; + @javax.annotation.Nullable + private List errors = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPAN_ID = "_span_id"; + @SerializedName(SERIALIZED_NAME_SPAN_ID) + @javax.annotation.Nullable + private String spanId; + + public static final String SERIALIZED_NAME_PARENT_ID = "_parent_id"; + @SerializedName(SERIALIZED_NAME_PARENT_ID) + @javax.annotation.Nullable + private String parentId; public static final String SERIALIZED_NAME_PAGE_TIMINGS = "pageTimings"; @SerializedName(SERIALIZED_NAME_PAGE_TIMINGS) + @javax.annotation.Nonnull private PageTimings pageTimings; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public Page() { } - public Page startedDateTime(OffsetDateTime startedDateTime) { - + public Page startedDateTime(@javax.annotation.Nonnull OffsetDateTime startedDateTime) { this.startedDateTime = startedDateTime; return this; } - /** + /** * Get startedDateTime * @return startedDateTime - **/ + */ @javax.annotation.Nonnull - public OffsetDateTime getStartedDateTime() { return startedDateTime; } - - public void setStartedDateTime(OffsetDateTime startedDateTime) { + public void setStartedDateTime(@javax.annotation.Nonnull OffsetDateTime startedDateTime) { this.startedDateTime = startedDateTime; } - public Page id(String id) { - + public Page id(@javax.annotation.Nonnull String id) { this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull - public String getId() { return id; } - - public void setId(String id) { + public void setId(@javax.annotation.Nonnull String id) { this.id = id; } - public Page title(String title) { - + public Page title(@javax.annotation.Nonnull String title) { this.title = title; return this; } - /** + /** * Get title * @return title - **/ + */ @javax.annotation.Nonnull - public String getTitle() { return title; } - - public void setTitle(String title) { + public void setTitle(@javax.annotation.Nonnull String title) { this.title = title; } - public Page verifications(List verifications) { - + public Page verifications(@javax.annotation.Nullable List verifications) { this.verifications = verifications; return this; } public Page addVerificationsItem(VerifyResult verificationsItem) { if (this.verifications == null) { - this.verifications = null; + this.verifications = new ArrayList<>(); } this.verifications.add(verificationsItem); return this; } - /** + /** * Get verifications * @return verifications - **/ + */ @javax.annotation.Nullable - public List getVerifications() { return verifications; } - - public void setVerifications(List verifications) { + public void setVerifications(@javax.annotation.Nullable List verifications) { this.verifications = verifications; } - public Page metrics(List metrics) { - + public Page metrics(@javax.annotation.Nullable List metrics) { this.metrics = metrics; return this; } public Page addMetricsItem(Metric metricsItem) { if (this.metrics == null) { - this.metrics = null; + this.metrics = new ArrayList<>(); } this.metrics.add(metricsItem); return this; } - /** + /** * Get metrics * @return metrics - **/ + */ @javax.annotation.Nullable - public List getMetrics() { return metrics; } - - public void setMetrics(List metrics) { + public void setMetrics(@javax.annotation.Nullable List metrics) { this.metrics = metrics; } - public Page errors(List errors) { - + public Page errors(@javax.annotation.Nullable List errors) { this.errors = errors; return this; } public Page addErrorsItem(Error errorsItem) { if (this.errors == null) { - this.errors = null; + this.errors = new ArrayList<>(); } this.errors.add(errorsItem); return this; } - /** + /** * Get errors * @return errors - **/ + */ @javax.annotation.Nullable - public List getErrors() { return errors; } - - public void setErrors(List errors) { + public void setErrors(@javax.annotation.Nullable List errors) { this.errors = errors; } - public Page pageTimings(PageTimings pageTimings) { - + public Page spanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + return this; + } + + /** + * W3C Trace Context span ID for this page + * @return spanId + */ + @javax.annotation.Nullable + public String getSpanId() { + return spanId; + } + + public void setSpanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + } + + + public Page parentId(@javax.annotation.Nullable String parentId) { + this.parentId = parentId; + return this; + } + + /** + * W3C Trace Context parent span ID (typically the HAR log span ID) + * @return parentId + */ + @javax.annotation.Nullable + public String getParentId() { + return parentId; + } + + public void setParentId(@javax.annotation.Nullable String parentId) { + this.parentId = parentId; + } + + + public Page pageTimings(@javax.annotation.Nonnull PageTimings pageTimings) { this.pageTimings = pageTimings; return this; } - /** + /** * Get pageTimings * @return pageTimings - **/ + */ @javax.annotation.Nonnull - public PageTimings getPageTimings() { return pageTimings; } - - public void setPageTimings(PageTimings pageTimings) { + public void setPageTimings(@javax.annotation.Nonnull PageTimings pageTimings) { this.pageTimings = pageTimings; } - public Page comment(String comment) { - + public Page comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -337,27 +373,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Page page = (Page) o; - return Objects.equals(this.startedDateTime, page.startedDateTime) && - Objects.equals(this.id, page.id) && - Objects.equals(this.title, page.title) && - Objects.equals(this.verifications, page.verifications) && - Objects.equals(this.metrics, page.metrics) && - Objects.equals(this.errors, page.errors) && - Objects.equals(this.pageTimings, page.pageTimings) && - Objects.equals(this.comment, page.comment)&& - Objects.equals(this.additionalProperties, page.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(startedDateTime, id, title, verifications, metrics, errors, pageTimings, comment, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -370,6 +391,8 @@ public String toString() { sb.append(" verifications: ").append(toIndentedString(verifications)).append("\n"); sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" spanId: ").append(toIndentedString(spanId)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); sb.append(" pageTimings: ").append(toIndentedString(pageTimings)).append("\n"); sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -401,6 +424,8 @@ private String toIndentedString(Object o) { openapiFields.add("_verifications"); openapiFields.add("_metrics"); openapiFields.add("_errors"); + openapiFields.add("_span_id"); + openapiFields.add("_parent_id"); openapiFields.add("pageTimings"); openapiFields.add("comment"); @@ -412,25 +437,26 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pageTimings"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Page - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Page.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Page + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Page.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Page is not found in the empty JSON string", Page.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Page.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } @@ -447,7 +473,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `_verifications` (array) for (int i = 0; i < jsonArrayverifications.size(); i++) { - VerifyResult.validateJsonObject(jsonArrayverifications.get(i).getAsJsonObject()); + VerifyResult.validateJsonElement(jsonArrayverifications.get(i)); }; } } @@ -461,7 +487,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `_metrics` (array) for (int i = 0; i < jsonArraymetrics.size(); i++) { - Metric.validateJsonObject(jsonArraymetrics.get(i).getAsJsonObject()); + Metric.validateJsonElement(jsonArraymetrics.get(i)); }; } } @@ -475,10 +501,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `_errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error.validateJsonObject(jsonArrayerrors.get(i).getAsJsonObject()); + Error.validateJsonElement(jsonArrayerrors.get(i)); }; } } + if ((jsonObj.get("_span_id") != null && !jsonObj.get("_span_id").isJsonNull()) && !jsonObj.get("_span_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_span_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_span_id").toString())); + } + if ((jsonObj.get("_parent_id") != null && !jsonObj.get("_parent_id").isJsonNull()) && !jsonObj.get("_parent_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_parent_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_parent_id").toString())); + } if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); } @@ -512,7 +544,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -521,8 +558,9 @@ else if (entry.getValue() instanceof Character) @Override public Page read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance Page instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { @@ -550,22 +588,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Page given an JSON string - * - * @param jsonString JSON string - * @return An instance of Page - * @throws IOException if the JSON string is invalid with respect to Page - */ + /** + * Create an instance of Page given an JSON string + * + * @param jsonString JSON string + * @return An instance of Page + * @throws IOException if the JSON string is invalid with respect to Page + */ public static Page fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Page.class); } - /** - * Convert an instance of Page to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Page to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/PageTiming.java b/clients/java/src/main/java/com/browserup/proxy_client/PageTiming.java index df8ed63173..4baedc33c1 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/PageTiming.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/PageTiming.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,15 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.math.BigDecimal; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -33,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -47,350 +50,356 @@ /** * PageTiming */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class PageTiming { public static final String SERIALIZED_NAME_ON_CONTENT_LOAD = "onContentLoad"; @SerializedName(SERIALIZED_NAME_ON_CONTENT_LOAD) - private BigDecimal onContentLoad; + @javax.annotation.Nullable + private Integer onContentLoad; public static final String SERIALIZED_NAME_ON_LOAD = "onLoad"; @SerializedName(SERIALIZED_NAME_ON_LOAD) - private BigDecimal onLoad; + @javax.annotation.Nullable + private Integer onLoad; public static final String SERIALIZED_NAME_FIRST_INPUT_DELAY = "_firstInputDelay"; @SerializedName(SERIALIZED_NAME_FIRST_INPUT_DELAY) - private BigDecimal firstInputDelay; + @javax.annotation.Nullable + private Integer firstInputDelay; public static final String SERIALIZED_NAME_FIRST_PAINT = "_firstPaint"; @SerializedName(SERIALIZED_NAME_FIRST_PAINT) - private BigDecimal firstPaint; + @javax.annotation.Nullable + private Integer firstPaint; public static final String SERIALIZED_NAME_CUMULATIVE_LAYOUT_SHIFT = "_cumulativeLayoutShift"; @SerializedName(SERIALIZED_NAME_CUMULATIVE_LAYOUT_SHIFT) - private BigDecimal cumulativeLayoutShift; + @javax.annotation.Nullable + private Integer cumulativeLayoutShift; public static final String SERIALIZED_NAME_LARGEST_CONTENTFUL_PAINT = "_largestContentfulPaint"; @SerializedName(SERIALIZED_NAME_LARGEST_CONTENTFUL_PAINT) - private BigDecimal largestContentfulPaint; + @javax.annotation.Nullable + private Integer largestContentfulPaint; public static final String SERIALIZED_NAME_DOM_INTERACTIVE = "_domInteractive"; @SerializedName(SERIALIZED_NAME_DOM_INTERACTIVE) - private BigDecimal domInteractive; + @javax.annotation.Nullable + private Integer domInteractive; public static final String SERIALIZED_NAME_FIRST_CONTENTFUL_PAINT = "_firstContentfulPaint"; @SerializedName(SERIALIZED_NAME_FIRST_CONTENTFUL_PAINT) - private BigDecimal firstContentfulPaint; + @javax.annotation.Nullable + private Integer firstContentfulPaint; public static final String SERIALIZED_NAME_DNS = "_dns"; @SerializedName(SERIALIZED_NAME_DNS) - private BigDecimal dns; + @javax.annotation.Nullable + private Integer dns; public static final String SERIALIZED_NAME_SSL = "_ssl"; @SerializedName(SERIALIZED_NAME_SSL) - private BigDecimal ssl; + @javax.annotation.Nullable + private Integer ssl; public static final String SERIALIZED_NAME_TIME_TO_FIRST_BYTE = "_timeToFirstByte"; @SerializedName(SERIALIZED_NAME_TIME_TO_FIRST_BYTE) - private BigDecimal timeToFirstByte; + @javax.annotation.Nullable + private Integer timeToFirstByte; public static final String SERIALIZED_NAME_HREF = "_href"; @SerializedName(SERIALIZED_NAME_HREF) + @javax.annotation.Nullable private String href; + public static final String SERIALIZED_NAME_SPAN_ID = "_span_id"; + @SerializedName(SERIALIZED_NAME_SPAN_ID) + @javax.annotation.Nullable + private String spanId; + + public static final String SERIALIZED_NAME_PARENT_ID = "_parent_id"; + @SerializedName(SERIALIZED_NAME_PARENT_ID) + @javax.annotation.Nullable + private String parentId; + public PageTiming() { } - public PageTiming onContentLoad(BigDecimal onContentLoad) { - + public PageTiming onContentLoad(@javax.annotation.Nullable Integer onContentLoad) { this.onContentLoad = onContentLoad; return this; } - /** + /** * onContentLoad per the browser * @return onContentLoad - **/ + */ @javax.annotation.Nullable - - public BigDecimal getOnContentLoad() { + public Integer getOnContentLoad() { return onContentLoad; } - - public void setOnContentLoad(BigDecimal onContentLoad) { + public void setOnContentLoad(@javax.annotation.Nullable Integer onContentLoad) { this.onContentLoad = onContentLoad; } - public PageTiming onLoad(BigDecimal onLoad) { - + public PageTiming onLoad(@javax.annotation.Nullable Integer onLoad) { this.onLoad = onLoad; return this; } - /** + /** * onLoad per the browser * @return onLoad - **/ + */ @javax.annotation.Nullable - - public BigDecimal getOnLoad() { + public Integer getOnLoad() { return onLoad; } - - public void setOnLoad(BigDecimal onLoad) { + public void setOnLoad(@javax.annotation.Nullable Integer onLoad) { this.onLoad = onLoad; } - public PageTiming firstInputDelay(BigDecimal firstInputDelay) { - + public PageTiming firstInputDelay(@javax.annotation.Nullable Integer firstInputDelay) { this.firstInputDelay = firstInputDelay; return this; } - /** + /** * firstInputDelay from the browser * @return firstInputDelay - **/ + */ @javax.annotation.Nullable - - public BigDecimal getFirstInputDelay() { + public Integer getFirstInputDelay() { return firstInputDelay; } - - public void setFirstInputDelay(BigDecimal firstInputDelay) { + public void setFirstInputDelay(@javax.annotation.Nullable Integer firstInputDelay) { this.firstInputDelay = firstInputDelay; } - public PageTiming firstPaint(BigDecimal firstPaint) { - + public PageTiming firstPaint(@javax.annotation.Nullable Integer firstPaint) { this.firstPaint = firstPaint; return this; } - /** + /** * firstPaint from the browser * @return firstPaint - **/ + */ @javax.annotation.Nullable - - public BigDecimal getFirstPaint() { + public Integer getFirstPaint() { return firstPaint; } - - public void setFirstPaint(BigDecimal firstPaint) { + public void setFirstPaint(@javax.annotation.Nullable Integer firstPaint) { this.firstPaint = firstPaint; } - public PageTiming cumulativeLayoutShift(BigDecimal cumulativeLayoutShift) { - + public PageTiming cumulativeLayoutShift(@javax.annotation.Nullable Integer cumulativeLayoutShift) { this.cumulativeLayoutShift = cumulativeLayoutShift; return this; } - /** + /** * cumulativeLayoutShift metric from the browser * @return cumulativeLayoutShift - **/ + */ @javax.annotation.Nullable - - public BigDecimal getCumulativeLayoutShift() { + public Integer getCumulativeLayoutShift() { return cumulativeLayoutShift; } - - public void setCumulativeLayoutShift(BigDecimal cumulativeLayoutShift) { + public void setCumulativeLayoutShift(@javax.annotation.Nullable Integer cumulativeLayoutShift) { this.cumulativeLayoutShift = cumulativeLayoutShift; } - public PageTiming largestContentfulPaint(BigDecimal largestContentfulPaint) { - + public PageTiming largestContentfulPaint(@javax.annotation.Nullable Integer largestContentfulPaint) { this.largestContentfulPaint = largestContentfulPaint; return this; } - /** + /** * largestContentfulPaint from the browser * @return largestContentfulPaint - **/ + */ @javax.annotation.Nullable - - public BigDecimal getLargestContentfulPaint() { + public Integer getLargestContentfulPaint() { return largestContentfulPaint; } - - public void setLargestContentfulPaint(BigDecimal largestContentfulPaint) { + public void setLargestContentfulPaint(@javax.annotation.Nullable Integer largestContentfulPaint) { this.largestContentfulPaint = largestContentfulPaint; } - public PageTiming domInteractive(BigDecimal domInteractive) { - + public PageTiming domInteractive(@javax.annotation.Nullable Integer domInteractive) { this.domInteractive = domInteractive; return this; } - /** + /** * domInteractive from the browser * @return domInteractive - **/ + */ @javax.annotation.Nullable - - public BigDecimal getDomInteractive() { + public Integer getDomInteractive() { return domInteractive; } - - public void setDomInteractive(BigDecimal domInteractive) { + public void setDomInteractive(@javax.annotation.Nullable Integer domInteractive) { this.domInteractive = domInteractive; } - public PageTiming firstContentfulPaint(BigDecimal firstContentfulPaint) { - + public PageTiming firstContentfulPaint(@javax.annotation.Nullable Integer firstContentfulPaint) { this.firstContentfulPaint = firstContentfulPaint; return this; } - /** + /** * firstContentfulPaint from the browser * @return firstContentfulPaint - **/ + */ @javax.annotation.Nullable - - public BigDecimal getFirstContentfulPaint() { + public Integer getFirstContentfulPaint() { return firstContentfulPaint; } - - public void setFirstContentfulPaint(BigDecimal firstContentfulPaint) { + public void setFirstContentfulPaint(@javax.annotation.Nullable Integer firstContentfulPaint) { this.firstContentfulPaint = firstContentfulPaint; } - public PageTiming dns(BigDecimal dns) { - + public PageTiming dns(@javax.annotation.Nullable Integer dns) { this.dns = dns; return this; } - /** + /** * dns lookup time from the browser * @return dns - **/ + */ @javax.annotation.Nullable - - public BigDecimal getDns() { + public Integer getDns() { return dns; } - - public void setDns(BigDecimal dns) { + public void setDns(@javax.annotation.Nullable Integer dns) { this.dns = dns; } - public PageTiming ssl(BigDecimal ssl) { - + public PageTiming ssl(@javax.annotation.Nullable Integer ssl) { this.ssl = ssl; return this; } - /** + /** * Ssl connect time from the browser * @return ssl - **/ + */ @javax.annotation.Nullable - - public BigDecimal getSsl() { + public Integer getSsl() { return ssl; } - - public void setSsl(BigDecimal ssl) { + public void setSsl(@javax.annotation.Nullable Integer ssl) { this.ssl = ssl; } - public PageTiming timeToFirstByte(BigDecimal timeToFirstByte) { - + public PageTiming timeToFirstByte(@javax.annotation.Nullable Integer timeToFirstByte) { this.timeToFirstByte = timeToFirstByte; return this; } - /** + /** * Time to first byte of the page's first request per the browser * @return timeToFirstByte - **/ + */ @javax.annotation.Nullable - - public BigDecimal getTimeToFirstByte() { + public Integer getTimeToFirstByte() { return timeToFirstByte; } - - public void setTimeToFirstByte(BigDecimal timeToFirstByte) { + public void setTimeToFirstByte(@javax.annotation.Nullable Integer timeToFirstByte) { this.timeToFirstByte = timeToFirstByte; } - public PageTiming href(String href) { - + public PageTiming href(@javax.annotation.Nullable String href) { this.href = href; return this; } - /** + /** * Top level href, including hashtag, etc per the browser * @return href - **/ + */ @javax.annotation.Nullable - public String getHref() { return href; } - - public void setHref(String href) { + public void setHref(@javax.annotation.Nullable String href) { this.href = href; } + public PageTiming spanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + return this; + } + + /** + * W3C Trace Context span ID for this page + * @return spanId + */ + @javax.annotation.Nullable + public String getSpanId() { + return spanId; + } + + public void setSpanId(@javax.annotation.Nullable String spanId) { + this.spanId = spanId; + } + + + public PageTiming parentId(@javax.annotation.Nullable String parentId) { + this.parentId = parentId; + return this; + } + + /** + * W3C Trace Context parent span ID (typically the HAR log span ID) + * @return parentId + */ + @javax.annotation.Nullable + public String getParentId() { + return parentId; + } + + public void setParentId(@javax.annotation.Nullable String parentId) { + this.parentId = parentId; + } + + @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PageTiming pageTiming = (PageTiming) o; - return Objects.equals(this.onContentLoad, pageTiming.onContentLoad) && - Objects.equals(this.onLoad, pageTiming.onLoad) && - Objects.equals(this.firstInputDelay, pageTiming.firstInputDelay) && - Objects.equals(this.firstPaint, pageTiming.firstPaint) && - Objects.equals(this.cumulativeLayoutShift, pageTiming.cumulativeLayoutShift) && - Objects.equals(this.largestContentfulPaint, pageTiming.largestContentfulPaint) && - Objects.equals(this.domInteractive, pageTiming.domInteractive) && - Objects.equals(this.firstContentfulPaint, pageTiming.firstContentfulPaint) && - Objects.equals(this.dns, pageTiming.dns) && - Objects.equals(this.ssl, pageTiming.ssl) && - Objects.equals(this.timeToFirstByte, pageTiming.timeToFirstByte) && - Objects.equals(this.href, pageTiming.href); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(onContentLoad, onLoad, firstInputDelay, firstPaint, cumulativeLayoutShift, largestContentfulPaint, domInteractive, firstContentfulPaint, dns, ssl, timeToFirstByte, href); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -409,6 +418,8 @@ public String toString() { sb.append(" ssl: ").append(toIndentedString(ssl)).append("\n"); sb.append(" timeToFirstByte: ").append(toIndentedString(timeToFirstByte)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); + sb.append(" spanId: ").append(toIndentedString(spanId)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -443,34 +454,43 @@ private String toIndentedString(Object o) { openapiFields.add("_ssl"); openapiFields.add("_timeToFirstByte"); openapiFields.add("_href"); + openapiFields.add("_span_id"); + openapiFields.add("_parent_id"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PageTiming - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PageTiming.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PageTiming + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PageTiming.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in PageTiming is not found in the empty JSON string", PageTiming.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!PageTiming.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageTiming` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageTiming` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("_href") != null && !jsonObj.get("_href").isJsonNull()) && !jsonObj.get("_href").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `_href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_href").toString())); } + if ((jsonObj.get("_span_id") != null && !jsonObj.get("_span_id").isJsonNull()) && !jsonObj.get("_span_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_span_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_span_id").toString())); + } + if ((jsonObj.get("_parent_id") != null && !jsonObj.get("_parent_id").isJsonNull()) && !jsonObj.get("_parent_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `_parent_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_parent_id").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -493,31 +513,31 @@ public void write(JsonWriter out, PageTiming value) throws IOException { @Override public PageTiming read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of PageTiming given an JSON string - * - * @param jsonString JSON string - * @return An instance of PageTiming - * @throws IOException if the JSON string is invalid with respect to PageTiming - */ + /** + * Create an instance of PageTiming given an JSON string + * + * @param jsonString JSON string + * @return An instance of PageTiming + * @throws IOException if the JSON string is invalid with respect to PageTiming + */ public static PageTiming fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PageTiming.class); } - /** - * Convert an instance of PageTiming to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PageTiming to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/PageTimings.java b/clients/java/src/main/java/com/browserup/proxy_client/PageTimings.java index 5fb5bbdadb..befcde72ad 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/PageTimings.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/PageTimings.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.browserup.proxy_client.LargestContentfulPaint; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -22,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -33,13 +35,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -47,355 +51,329 @@ /** * PageTimings */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class PageTimings { public static final String SERIALIZED_NAME_ON_CONTENT_LOAD = "onContentLoad"; @SerializedName(SERIALIZED_NAME_ON_CONTENT_LOAD) + @javax.annotation.Nonnull private Long onContentLoad = -1l; public static final String SERIALIZED_NAME_ON_LOAD = "onLoad"; @SerializedName(SERIALIZED_NAME_ON_LOAD) + @javax.annotation.Nonnull private Long onLoad = -1l; public static final String SERIALIZED_NAME_HREF = "_href"; @SerializedName(SERIALIZED_NAME_HREF) + @javax.annotation.Nullable private String href = ""; public static final String SERIALIZED_NAME_DNS = "_dns"; @SerializedName(SERIALIZED_NAME_DNS) + @javax.annotation.Nullable private Long dns = -1l; public static final String SERIALIZED_NAME_SSL = "_ssl"; @SerializedName(SERIALIZED_NAME_SSL) + @javax.annotation.Nullable private Long ssl = -1l; public static final String SERIALIZED_NAME_TIME_TO_FIRST_BYTE = "_timeToFirstByte"; @SerializedName(SERIALIZED_NAME_TIME_TO_FIRST_BYTE) + @javax.annotation.Nullable private Long timeToFirstByte = -1l; public static final String SERIALIZED_NAME_CUMULATIVE_LAYOUT_SHIFT = "_cumulativeLayoutShift"; @SerializedName(SERIALIZED_NAME_CUMULATIVE_LAYOUT_SHIFT) + @javax.annotation.Nullable private Float cumulativeLayoutShift = -1f; public static final String SERIALIZED_NAME_LARGEST_CONTENTFUL_PAINT = "_largestContentfulPaint"; @SerializedName(SERIALIZED_NAME_LARGEST_CONTENTFUL_PAINT) + @javax.annotation.Nullable private LargestContentfulPaint largestContentfulPaint; public static final String SERIALIZED_NAME_FIRST_PAINT = "_firstPaint"; @SerializedName(SERIALIZED_NAME_FIRST_PAINT) + @javax.annotation.Nullable private Long firstPaint = -1l; public static final String SERIALIZED_NAME_FIRST_INPUT_DELAY = "_firstInputDelay"; @SerializedName(SERIALIZED_NAME_FIRST_INPUT_DELAY) + @javax.annotation.Nullable private Float firstInputDelay = -1f; public static final String SERIALIZED_NAME_DOM_INTERACTIVE = "_domInteractive"; @SerializedName(SERIALIZED_NAME_DOM_INTERACTIVE) + @javax.annotation.Nullable private Long domInteractive = -1l; public static final String SERIALIZED_NAME_FIRST_CONTENTFUL_PAINT = "_firstContentfulPaint"; @SerializedName(SERIALIZED_NAME_FIRST_CONTENTFUL_PAINT) + @javax.annotation.Nullable private Long firstContentfulPaint = -1l; public static final String SERIALIZED_NAME_COMMENT = "comment"; @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable private String comment; public PageTimings() { } - public PageTimings onContentLoad(Long onContentLoad) { - + public PageTimings onContentLoad(@javax.annotation.Nonnull Long onContentLoad) { this.onContentLoad = onContentLoad; return this; } - /** + /** * Get onContentLoad * minimum: -1 * @return onContentLoad - **/ + */ @javax.annotation.Nonnull - public Long getOnContentLoad() { return onContentLoad; } - - public void setOnContentLoad(Long onContentLoad) { + public void setOnContentLoad(@javax.annotation.Nonnull Long onContentLoad) { this.onContentLoad = onContentLoad; } - public PageTimings onLoad(Long onLoad) { - + public PageTimings onLoad(@javax.annotation.Nonnull Long onLoad) { this.onLoad = onLoad; return this; } - /** + /** * Get onLoad * minimum: -1 * @return onLoad - **/ + */ @javax.annotation.Nonnull - public Long getOnLoad() { return onLoad; } - - public void setOnLoad(Long onLoad) { + public void setOnLoad(@javax.annotation.Nonnull Long onLoad) { this.onLoad = onLoad; } - public PageTimings href(String href) { - + public PageTimings href(@javax.annotation.Nullable String href) { this.href = href; return this; } - /** + /** * Get href * @return href - **/ + */ @javax.annotation.Nullable - public String getHref() { return href; } - - public void setHref(String href) { + public void setHref(@javax.annotation.Nullable String href) { this.href = href; } - public PageTimings dns(Long dns) { - + public PageTimings dns(@javax.annotation.Nullable Long dns) { this.dns = dns; return this; } - /** + /** * Get dns * minimum: -1 * @return dns - **/ + */ @javax.annotation.Nullable - public Long getDns() { return dns; } - - public void setDns(Long dns) { + public void setDns(@javax.annotation.Nullable Long dns) { this.dns = dns; } - public PageTimings ssl(Long ssl) { - + public PageTimings ssl(@javax.annotation.Nullable Long ssl) { this.ssl = ssl; return this; } - /** + /** * Get ssl * minimum: -1 * @return ssl - **/ + */ @javax.annotation.Nullable - public Long getSsl() { return ssl; } - - public void setSsl(Long ssl) { + public void setSsl(@javax.annotation.Nullable Long ssl) { this.ssl = ssl; } - public PageTimings timeToFirstByte(Long timeToFirstByte) { - + public PageTimings timeToFirstByte(@javax.annotation.Nullable Long timeToFirstByte) { this.timeToFirstByte = timeToFirstByte; return this; } - /** + /** * Get timeToFirstByte * minimum: -1 * @return timeToFirstByte - **/ + */ @javax.annotation.Nullable - public Long getTimeToFirstByte() { return timeToFirstByte; } - - public void setTimeToFirstByte(Long timeToFirstByte) { + public void setTimeToFirstByte(@javax.annotation.Nullable Long timeToFirstByte) { this.timeToFirstByte = timeToFirstByte; } - public PageTimings cumulativeLayoutShift(Float cumulativeLayoutShift) { - + public PageTimings cumulativeLayoutShift(@javax.annotation.Nullable Float cumulativeLayoutShift) { this.cumulativeLayoutShift = cumulativeLayoutShift; return this; } - /** + /** * Get cumulativeLayoutShift * minimum: -1 * @return cumulativeLayoutShift - **/ + */ @javax.annotation.Nullable - public Float getCumulativeLayoutShift() { return cumulativeLayoutShift; } - - public void setCumulativeLayoutShift(Float cumulativeLayoutShift) { + public void setCumulativeLayoutShift(@javax.annotation.Nullable Float cumulativeLayoutShift) { this.cumulativeLayoutShift = cumulativeLayoutShift; } - public PageTimings largestContentfulPaint(LargestContentfulPaint largestContentfulPaint) { - + public PageTimings largestContentfulPaint(@javax.annotation.Nullable LargestContentfulPaint largestContentfulPaint) { this.largestContentfulPaint = largestContentfulPaint; return this; } - /** + /** * Get largestContentfulPaint * @return largestContentfulPaint - **/ + */ @javax.annotation.Nullable - public LargestContentfulPaint getLargestContentfulPaint() { return largestContentfulPaint; } - - public void setLargestContentfulPaint(LargestContentfulPaint largestContentfulPaint) { + public void setLargestContentfulPaint(@javax.annotation.Nullable LargestContentfulPaint largestContentfulPaint) { this.largestContentfulPaint = largestContentfulPaint; } - public PageTimings firstPaint(Long firstPaint) { - + public PageTimings firstPaint(@javax.annotation.Nullable Long firstPaint) { this.firstPaint = firstPaint; return this; } - /** + /** * Get firstPaint * minimum: -1 * @return firstPaint - **/ + */ @javax.annotation.Nullable - public Long getFirstPaint() { return firstPaint; } - - public void setFirstPaint(Long firstPaint) { + public void setFirstPaint(@javax.annotation.Nullable Long firstPaint) { this.firstPaint = firstPaint; } - public PageTimings firstInputDelay(Float firstInputDelay) { - + public PageTimings firstInputDelay(@javax.annotation.Nullable Float firstInputDelay) { this.firstInputDelay = firstInputDelay; return this; } - /** + /** * Get firstInputDelay * minimum: -1 * @return firstInputDelay - **/ + */ @javax.annotation.Nullable - public Float getFirstInputDelay() { return firstInputDelay; } - - public void setFirstInputDelay(Float firstInputDelay) { + public void setFirstInputDelay(@javax.annotation.Nullable Float firstInputDelay) { this.firstInputDelay = firstInputDelay; } - public PageTimings domInteractive(Long domInteractive) { - + public PageTimings domInteractive(@javax.annotation.Nullable Long domInteractive) { this.domInteractive = domInteractive; return this; } - /** + /** * Get domInteractive * minimum: -1 * @return domInteractive - **/ + */ @javax.annotation.Nullable - public Long getDomInteractive() { return domInteractive; } - - public void setDomInteractive(Long domInteractive) { + public void setDomInteractive(@javax.annotation.Nullable Long domInteractive) { this.domInteractive = domInteractive; } - public PageTimings firstContentfulPaint(Long firstContentfulPaint) { - + public PageTimings firstContentfulPaint(@javax.annotation.Nullable Long firstContentfulPaint) { this.firstContentfulPaint = firstContentfulPaint; return this; } - /** + /** * Get firstContentfulPaint * minimum: -1 * @return firstContentfulPaint - **/ + */ @javax.annotation.Nullable - public Long getFirstContentfulPaint() { return firstContentfulPaint; } - - public void setFirstContentfulPaint(Long firstContentfulPaint) { + public void setFirstContentfulPaint(@javax.annotation.Nullable Long firstContentfulPaint) { this.firstContentfulPaint = firstContentfulPaint; } - public PageTimings comment(String comment) { - + public PageTimings comment(@javax.annotation.Nullable String comment) { this.comment = comment; return this; } - /** + /** * Get comment * @return comment - **/ + */ @javax.annotation.Nullable - public String getComment() { return comment; } - - public void setComment(String comment) { + public void setComment(@javax.annotation.Nullable String comment) { this.comment = comment; } @@ -447,32 +425,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PageTimings pageTimings = (PageTimings) o; - return Objects.equals(this.onContentLoad, pageTimings.onContentLoad) && - Objects.equals(this.onLoad, pageTimings.onLoad) && - Objects.equals(this.href, pageTimings.href) && - Objects.equals(this.dns, pageTimings.dns) && - Objects.equals(this.ssl, pageTimings.ssl) && - Objects.equals(this.timeToFirstByte, pageTimings.timeToFirstByte) && - Objects.equals(this.cumulativeLayoutShift, pageTimings.cumulativeLayoutShift) && - Objects.equals(this.largestContentfulPaint, pageTimings.largestContentfulPaint) && - Objects.equals(this.firstPaint, pageTimings.firstPaint) && - Objects.equals(this.firstInputDelay, pageTimings.firstInputDelay) && - Objects.equals(this.domInteractive, pageTimings.domInteractive) && - Objects.equals(this.firstContentfulPaint, pageTimings.firstContentfulPaint) && - Objects.equals(this.comment, pageTimings.comment)&& - Objects.equals(this.additionalProperties, pageTimings.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(onContentLoad, onLoad, href, dns, ssl, timeToFirstByte, cumulativeLayoutShift, largestContentfulPaint, firstPaint, firstInputDelay, domInteractive, firstContentfulPaint, comment, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -535,25 +493,26 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("onLoad"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PageTimings - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PageTimings.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PageTimings + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PageTimings.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in PageTimings is not found in the empty JSON string", PageTimings.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PageTimings.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("_href") != null && !jsonObj.get("_href").isJsonNull()) && !jsonObj.get("_href").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `_href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_href").toString())); } @@ -590,7 +549,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -599,8 +563,9 @@ else if (entry.getValue() instanceof Character) @Override public PageTimings read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance PageTimings instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { @@ -628,22 +593,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of PageTimings given an JSON string - * - * @param jsonString JSON string - * @return An instance of PageTimings - * @throws IOException if the JSON string is invalid with respect to PageTimings - */ + /** + * Create an instance of PageTimings given an JSON string + * + * @param jsonString JSON string + * @return An instance of PageTimings + * @throws IOException if the JSON string is invalid with respect to PageTimings + */ public static PageTimings fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PageTimings.class); } - /** - * Convert an instance of PageTimings to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PageTimings to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/Pair.java b/clients/java/src/main/java/com/browserup/proxy_client/Pair.java index 0acae26640..0203b9eaa7 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/Pair.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/Pair.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package com.browserup.proxy_client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Pair { private String name = ""; private String value = ""; diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ProgressRequestBody.java b/clients/java/src/main/java/com/browserup/proxy_client/ProgressRequestBody.java index 418d738f44..b3431621eb 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ProgressRequestBody.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ProgressResponseBody.java b/clients/java/src/main/java/com/browserup/proxy_client/ProgressResponseBody.java index d017f01f6f..ac817201c7 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ProgressResponseBody.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ServerConfiguration.java b/clients/java/src/main/java/com/browserup/proxy_client/ServerConfiguration.java index 0c42dc14bb..c8f579edf8 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ServerConfiguration.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ServerConfiguration.java @@ -1,3 +1,16 @@ +/* + * BrowserUp MitmProxy + * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + * + * The version of the OpenAPI document: 1.25 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.browserup.proxy_client; import java.util.Map; @@ -5,6 +18,7 @@ /** * Representing a Server configuration. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ServerConfiguration { public String URL; public String description; diff --git a/clients/java/src/main/java/com/browserup/proxy_client/ServerVariable.java b/clients/java/src/main/java/com/browserup/proxy_client/ServerVariable.java index 1d9be8047c..56c23dc14a 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/ServerVariable.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/ServerVariable.java @@ -1,3 +1,16 @@ +/* + * BrowserUp MitmProxy + * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + * + * The version of the OpenAPI document: 1.25 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.browserup.proxy_client; import java.util.HashSet; @@ -5,6 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/clients/java/src/main/java/com/browserup/proxy_client/StringUtil.java b/clients/java/src/main/java/com/browserup/proxy_client/StringUtil.java index f9c1f016e5..7e6a254757 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/StringUtil.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/StringUtil.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/VerifyResult.java b/clients/java/src/main/java/com/browserup/proxy_client/VerifyResult.java index 2a887e6956..adf6f62cb1 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/VerifyResult.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/VerifyResult.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,14 +13,16 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -32,13 +34,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -46,85 +50,79 @@ /** * VerifyResult */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class VerifyResult { public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) + @javax.annotation.Nullable private Boolean result; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable private String type; public VerifyResult() { } - public VerifyResult result(Boolean result) { - + public VerifyResult result(@javax.annotation.Nullable Boolean result) { this.result = result; return this; } - /** + /** * Result True / False * @return result - **/ + */ @javax.annotation.Nullable - public Boolean getResult() { return result; } - - public void setResult(Boolean result) { + public void setResult(@javax.annotation.Nullable Boolean result) { this.result = result; } - public VerifyResult name(String name) { - + public VerifyResult name(@javax.annotation.Nullable String name) { this.name = name; return this; } - /** + /** * Name * @return name - **/ + */ @javax.annotation.Nullable - public String getName() { return name; } - - public void setName(String name) { + public void setName(@javax.annotation.Nullable String name) { this.name = name; } - public VerifyResult type(String type) { - + public VerifyResult type(@javax.annotation.Nullable String type) { this.type = type; return this; } - /** + /** * Type * @return type - **/ + */ @javax.annotation.Nullable - public String getType() { return type; } - - public void setType(String type) { + public void setType(@javax.annotation.Nullable String type) { this.type = type; } @@ -132,21 +130,12 @@ public void setType(String type) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VerifyResult verifyResult = (VerifyResult) o; - return Objects.equals(this.result, verifyResult.result) && - Objects.equals(this.name, verifyResult.name) && - Objects.equals(this.type, verifyResult.type); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(result, name, type); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -186,26 +175,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to VerifyResult - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!VerifyResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to VerifyResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VerifyResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyResult is not found in the empty JSON string", VerifyResult.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!VerifyResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerifyResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerifyResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } @@ -234,31 +224,31 @@ public void write(JsonWriter out, VerifyResult value) throws IOException { @Override public VerifyResult read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of VerifyResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of VerifyResult - * @throws IOException if the JSON string is invalid with respect to VerifyResult - */ + /** + * Create an instance of VerifyResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerifyResult + * @throws IOException if the JSON string is invalid with respect to VerifyResult + */ public static VerifyResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, VerifyResult.class); } - /** - * Convert an instance of VerifyResult to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of VerifyResult to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/WebSocketMessage.java b/clients/java/src/main/java/com/browserup/proxy_client/WebSocketMessage.java index 7fac9c7a5e..aa25908f94 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/WebSocketMessage.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/WebSocketMessage.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,8 +13,9 @@ package com.browserup.proxy_client; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -22,6 +23,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; +import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -33,13 +35,15 @@ import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import com.browserup.proxy_client.JSON; @@ -47,111 +51,103 @@ /** * WebSocketMessage */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class WebSocketMessage { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull private String type; public static final String SERIALIZED_NAME_OPCODE = "opcode"; @SerializedName(SERIALIZED_NAME_OPCODE) + @javax.annotation.Nonnull private BigDecimal opcode; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull private String data; public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) + @javax.annotation.Nonnull private BigDecimal time; public WebSocketMessage() { } - public WebSocketMessage type(String type) { - + public WebSocketMessage type(@javax.annotation.Nonnull String type) { this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - public String getType() { return type; } - - public void setType(String type) { + public void setType(@javax.annotation.Nonnull String type) { this.type = type; } - public WebSocketMessage opcode(BigDecimal opcode) { - + public WebSocketMessage opcode(@javax.annotation.Nonnull BigDecimal opcode) { this.opcode = opcode; return this; } - /** + /** * Get opcode * @return opcode - **/ + */ @javax.annotation.Nonnull - public BigDecimal getOpcode() { return opcode; } - - public void setOpcode(BigDecimal opcode) { + public void setOpcode(@javax.annotation.Nonnull BigDecimal opcode) { this.opcode = opcode; } - public WebSocketMessage data(String data) { - + public WebSocketMessage data(@javax.annotation.Nonnull String data) { this.data = data; return this; } - /** + /** * Get data * @return data - **/ + */ @javax.annotation.Nonnull - public String getData() { return data; } - - public void setData(String data) { + public void setData(@javax.annotation.Nonnull String data) { this.data = data; } - public WebSocketMessage time(BigDecimal time) { - + public WebSocketMessage time(@javax.annotation.Nonnull BigDecimal time) { this.time = time; return this; } - /** + /** * Get time * @return time - **/ + */ @javax.annotation.Nonnull - public BigDecimal getTime() { return time; } - - public void setTime(BigDecimal time) { + public void setTime(@javax.annotation.Nonnull BigDecimal time) { this.time = time; } @@ -159,22 +155,12 @@ public void setTime(BigDecimal time) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebSocketMessage webSocketMessage = (WebSocketMessage) o; - return Objects.equals(this.type, webSocketMessage.type) && - Objects.equals(this.opcode, webSocketMessage.opcode) && - Objects.equals(this.data, webSocketMessage.data) && - Objects.equals(this.time, webSocketMessage.time); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(type, opcode, data, time); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -220,33 +206,34 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("time"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to WebSocketMessage - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!WebSocketMessage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebSocketMessage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebSocketMessage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in WebSocketMessage is not found in the empty JSON string", WebSocketMessage.openapiRequiredFields.toString())); } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!WebSocketMessage.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebSocketMessage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebSocketMessage` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : WebSocketMessage.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } @@ -275,31 +262,31 @@ public void write(JsonWriter out, WebSocketMessage value) throws IOException { @Override public WebSocketMessage read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of WebSocketMessage given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebSocketMessage - * @throws IOException if the JSON string is invalid with respect to WebSocketMessage - */ + /** + * Create an instance of WebSocketMessage given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebSocketMessage + * @throws IOException if the JSON string is invalid with respect to WebSocketMessage + */ public static WebSocketMessage fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, WebSocketMessage.class); } - /** - * Convert an instance of WebSocketMessage to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of WebSocketMessage to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/com/browserup/proxy_client/auth/ApiKeyAuth.java b/clients/java/src/main/java/com/browserup/proxy_client/auth/ApiKeyAuth.java index b153f16fd9..17b11735d2 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/auth/ApiKeyAuth.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/clients/java/src/main/java/com/browserup/proxy_client/auth/Authentication.java b/clients/java/src/main/java/com/browserup/proxy_client/auth/Authentication.java index 682e2fe0aa..8785e12953 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/auth/Authentication.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/auth/Authentication.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBasicAuth.java b/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBasicAuth.java index 7560bfa561..f9817511c3 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBasicAuth.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,8 +22,6 @@ import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBearerAuth.java b/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBearerAuth.java index 107da8f407..1cdc23145c 100644 --- a/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBearerAuth.java +++ b/clients/java/src/main/java/com/browserup/proxy_client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,13 +17,15 @@ import com.browserup.proxy_client.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -35,7 +37,7 @@ public HttpBearerAuth(String scheme) { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -44,12 +46,22 @@ public String getBearerToken() { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/clients/java/src/test/java/com/browserup/proxy/api/BrowserUpProxyApiTest.java b/clients/java/src/test/java/com/browserup/proxy/api/BrowserUpProxyApiTest.java index 8b8e6733a2..c2c993e37c 100644 --- a/clients/java/src/test/java/com/browserup/proxy/api/BrowserUpProxyApiTest.java +++ b/clients/java/src/test/java/com/browserup/proxy/api/BrowserUpProxyApiTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/java/src/test/java/com/browserup/proxy_client/ActionTest.java b/clients/java/src/test/java/com/browserup/proxy_client/ActionTest.java index d533000b13..5ac4f33694 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/ActionTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/ActionTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for Action */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/ErrorTest.java b/clients/java/src/test/java/com/browserup/proxy_client/ErrorTest.java index a24cd70460..a62afe9667 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/ErrorTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/ErrorTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for Error */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOfTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOfTest.java deleted file mode 100644 index 308d9e366c..0000000000 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestOneOfTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.browserup.proxy_client; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for HarEntryCacheBeforeRequestOneOf - */ -public class HarEntryCacheBeforeRequestOneOfTest { - private final HarEntryCacheBeforeRequestOneOf model = new HarEntryCacheBeforeRequestOneOf(); - - /** - * Model tests for HarEntryCacheBeforeRequestOneOf - */ - @Test - public void testHarEntryCacheBeforeRequestOneOf() { - // TODO: test HarEntryCacheBeforeRequestOneOf - } - - /** - * Test the property 'expires' - */ - @Test - public void expiresTest() { - // TODO: test expires - } - - /** - * Test the property 'lastAccess' - */ - @Test - public void lastAccessTest() { - // TODO: test lastAccess - } - - /** - * Test the property 'eTag' - */ - @Test - public void eTagTest() { - // TODO: test eTag - } - - /** - * Test the property 'hitCount' - */ - @Test - public void hitCountTest() { - // TODO: test hitCount - } - - /** - * Test the property 'comment' - */ - @Test - public void commentTest() { - // TODO: test comment - } - -} diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestTest.java index b464635d2b..e1bddaf7d7 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheBeforeRequestTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,17 +13,16 @@ package com.browserup.proxy_client; -import com.browserup.proxy_client.HarEntryCacheBeforeRequestOneOf; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryCacheBeforeRequest */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheTest.java index eadf37a0b8..c68a29b06a 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryCacheTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,10 +20,11 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryCache */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestCookiesInnerTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestCookiesInnerTest.java index 659dbb4865..0b36a41e39 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestCookiesInnerTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestCookiesInnerTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryRequestCookiesInner */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInnerTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInnerTest.java index ce2cad94fe..613e2fee30 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInnerTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataParamsInnerTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryRequestPostDataParamsInner */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataTest.java index a0528c46a1..5d834ff495 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestPostDataTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,11 +21,11 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryRequestPostData */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestQueryStringInnerTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestQueryStringInnerTest.java index 60dd104b19..7444b580ef 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestQueryStringInnerTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestQueryStringInnerTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryRequestQueryStringInner */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestTest.java index 52643081c8..ebc1f90920 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryRequestTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryRequest */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseContentTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseContentTest.java index 22b352a0dd..10bac599ae 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseContentTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseContentTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryResponseContent */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseTest.java index 56b0e6955a..9274b4ce99 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryResponseTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,11 +23,11 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryResponse */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTest.java index b737456c01..21d464e2f5 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,11 +26,11 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntry */ @@ -117,6 +117,30 @@ public void webSocketMessagesTest() { // TODO: test webSocketMessages } + /** + * Test the property 'spanId' + */ + @Test + public void spanIdTest() { + // TODO: test spanId + } + + /** + * Test the property 'parentId' + */ + @Test + public void parentIdTest() { + // TODO: test parentId + } + + /** + * Test the property 'traceId' + */ + @Test + public void traceIdTest() { + // TODO: test traceId + } + /** * Test the property 'connection' */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTimingsTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTimingsTest.java index 1d11223531..8c4df5df3f 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTimingsTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarEntryTimingsTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarEntryTimings */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarLogCreatorTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarLogCreatorTest.java index 1d7cc6d664..7baa401c49 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarLogCreatorTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarLogCreatorTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarLogCreator */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarLogTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarLogTest.java index f419c8b085..ca316ea635 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarLogTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarLogTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,11 +23,11 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for HarLog */ @@ -82,6 +82,22 @@ public void entriesTest() { // TODO: test entries } + /** + * Test the property 'traceId' + */ + @Test + public void traceIdTest() { + // TODO: test traceId + } + + /** + * Test the property 'spanId' + */ + @Test + public void spanIdTest() { + // TODO: test spanId + } + /** * Test the property 'comment' */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HarTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HarTest.java index d59fe8fb70..ad1fa64f19 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HarTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HarTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,10 +20,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for Har */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/HeaderTest.java b/clients/java/src/test/java/com/browserup/proxy_client/HeaderTest.java index f088eab39b..24e9adec50 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/HeaderTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/HeaderTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for Header */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/LargestContentfulPaintTest.java b/clients/java/src/test/java/com/browserup/proxy_client/LargestContentfulPaintTest.java index bedfc08f36..c4de7646ea 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/LargestContentfulPaintTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/LargestContentfulPaintTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for LargestContentfulPaint */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaRequestHeaderTest.java b/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaRequestHeaderTest.java deleted file mode 100644 index 7c27143c82..0000000000 --- a/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaRequestHeaderTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.browserup.proxy_client; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for MatchCriteriaRequestHeader - */ -public class MatchCriteriaRequestHeaderTest { - private final MatchCriteriaRequestHeader model = new MatchCriteriaRequestHeader(); - - /** - * Model tests for MatchCriteriaRequestHeader - */ - @Test - public void testMatchCriteriaRequestHeader() { - // TODO: test MatchCriteriaRequestHeader - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaTest.java b/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaTest.java index 44ce24c877..d91b2f84ca 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/MatchCriteriaTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,17 +13,17 @@ package com.browserup.proxy_client; -import com.browserup.proxy_client.MatchCriteriaRequestHeader; +import com.browserup.proxy_client.NameValuePair; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for MatchCriteria */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/MetricTest.java b/clients/java/src/test/java/com/browserup/proxy_client/MetricTest.java index be94891b84..7b96cc28fe 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/MetricTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/MetricTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for Metric */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/NameValuePairTest.java b/clients/java/src/test/java/com/browserup/proxy_client/NameValuePairTest.java index 3655d483ad..65fb95c9c2 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/NameValuePairTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/NameValuePairTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for NameValuePair */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/PageTest.java b/clients/java/src/test/java/com/browserup/proxy_client/PageTest.java index f43b46ecef..cbcdfc6edb 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/PageTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/PageTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,11 +25,11 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for Page */ @@ -92,6 +92,22 @@ public void errorsTest() { // TODO: test errors } + /** + * Test the property 'spanId' + */ + @Test + public void spanIdTest() { + // TODO: test spanId + } + + /** + * Test the property 'parentId' + */ + @Test + public void parentIdTest() { + // TODO: test parentId + } + /** * Test the property 'pageTimings' */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/PageTimingTest.java b/clients/java/src/test/java/com/browserup/proxy_client/PageTimingTest.java index 966c95d460..e4ab4f955c 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/PageTimingTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/PageTimingTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,11 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.math.BigDecimal; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for PageTiming */ @@ -134,4 +133,20 @@ public void hrefTest() { // TODO: test href } + /** + * Test the property 'spanId' + */ + @Test + public void spanIdTest() { + // TODO: test spanId + } + + /** + * Test the property 'parentId' + */ + @Test + public void parentIdTest() { + // TODO: test parentId + } + } diff --git a/clients/java/src/test/java/com/browserup/proxy_client/PageTimingsTest.java b/clients/java/src/test/java/com/browserup/proxy_client/PageTimingsTest.java index 6d233a45a9..35a90ba003 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/PageTimingsTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/PageTimingsTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,10 +20,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for PageTimings */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/VerifyResultTest.java b/clients/java/src/test/java/com/browserup/proxy_client/VerifyResultTest.java index e09356a1ff..4dbdeb0116 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/VerifyResultTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/VerifyResultTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for VerifyResult */ diff --git a/clients/java/src/test/java/com/browserup/proxy_client/WebSocketMessageTest.java b/clients/java/src/test/java/com/browserup/proxy_client/WebSocketMessageTest.java index 380b3e961d..f71975520e 100644 --- a/clients/java/src/test/java/com/browserup/proxy_client/WebSocketMessageTest.java +++ b/clients/java/src/test/java/com/browserup/proxy_client/WebSocketMessageTest.java @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,10 +20,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; +import java.util.Arrays; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - /** * Model tests for WebSocketMessage */ diff --git a/clients/javascript/.openapi-generator/FILES b/clients/javascript/.openapi-generator/FILES index 2ee870c6f8..895120a5dd 100644 --- a/clients/javascript/.openapi-generator/FILES +++ b/clients/javascript/.openapi-generator/FILES @@ -10,7 +10,6 @@ docs/Har.md docs/HarEntry.md docs/HarEntryCache.md docs/HarEntryCacheBeforeRequest.md -docs/HarEntryCacheBeforeRequestOneOf.md docs/HarEntryRequest.md docs/HarEntryRequestCookiesInner.md docs/HarEntryRequestPostData.md @@ -24,7 +23,6 @@ docs/HarLogCreator.md docs/Header.md docs/LargestContentfulPaint.md docs/MatchCriteria.md -docs/MatchCriteriaRequestHeader.md docs/Metric.md docs/NameValuePair.md docs/Page.md @@ -44,7 +42,6 @@ src/BrowserUpMitmProxyClient/model/Har.js src/BrowserUpMitmProxyClient/model/HarEntry.js src/BrowserUpMitmProxyClient/model/HarEntryCache.js src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.js -src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.js src/BrowserUpMitmProxyClient/model/HarEntryRequest.js src/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.js src/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.js @@ -58,7 +55,6 @@ src/BrowserUpMitmProxyClient/model/HarLogCreator.js src/BrowserUpMitmProxyClient/model/Header.js src/BrowserUpMitmProxyClient/model/LargestContentfulPaint.js src/BrowserUpMitmProxyClient/model/MatchCriteria.js -src/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.js src/BrowserUpMitmProxyClient/model/Metric.js src/BrowserUpMitmProxyClient/model/NameValuePair.js src/BrowserUpMitmProxyClient/model/Page.js @@ -73,7 +69,6 @@ test/BrowserUpMitmProxyClient/model/Har.spec.js test/BrowserUpMitmProxyClient/model/HarEntry.spec.js test/BrowserUpMitmProxyClient/model/HarEntryCache.spec.js test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.spec.js -test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.spec.js test/BrowserUpMitmProxyClient/model/HarEntryRequest.spec.js test/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.spec.js test/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.spec.js @@ -87,7 +82,6 @@ test/BrowserUpMitmProxyClient/model/HarLogCreator.spec.js test/BrowserUpMitmProxyClient/model/Header.spec.js test/BrowserUpMitmProxyClient/model/LargestContentfulPaint.spec.js test/BrowserUpMitmProxyClient/model/MatchCriteria.spec.js -test/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.spec.js test/BrowserUpMitmProxyClient/model/Metric.spec.js test/BrowserUpMitmProxyClient/model/NameValuePair.spec.js test/BrowserUpMitmProxyClient/model/Page.spec.js diff --git a/clients/javascript/.openapi-generator/VERSION b/clients/javascript/.openapi-generator/VERSION index c0be8a7992..5f84a81db0 100644 --- a/clients/javascript/.openapi-generator/VERSION +++ b/clients/javascript/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +7.12.0 diff --git a/clients/javascript/README.md b/clients/javascript/README.md index d2aafc2648..1c31dbe1ae 100644 --- a/clients/javascript/README.md +++ b/clients/javascript/README.md @@ -9,8 +9,9 @@ ___ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 1.24 +- API version: 1.25 - Package version: 1.0.0 +- Generator version: 7.12.0 - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen ## Installation @@ -145,7 +146,6 @@ Class | Method | HTTP request | Description - [BrowserUpMitmProxyClient.HarEntry](docs/HarEntry.md) - [BrowserUpMitmProxyClient.HarEntryCache](docs/HarEntryCache.md) - [BrowserUpMitmProxyClient.HarEntryCacheBeforeRequest](docs/HarEntryCacheBeforeRequest.md) - - [BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf](docs/HarEntryCacheBeforeRequestOneOf.md) - [BrowserUpMitmProxyClient.HarEntryRequest](docs/HarEntryRequest.md) - [BrowserUpMitmProxyClient.HarEntryRequestCookiesInner](docs/HarEntryRequestCookiesInner.md) - [BrowserUpMitmProxyClient.HarEntryRequestPostData](docs/HarEntryRequestPostData.md) @@ -159,7 +159,6 @@ Class | Method | HTTP request | Description - [BrowserUpMitmProxyClient.Header](docs/Header.md) - [BrowserUpMitmProxyClient.LargestContentfulPaint](docs/LargestContentfulPaint.md) - [BrowserUpMitmProxyClient.MatchCriteria](docs/MatchCriteria.md) - - [BrowserUpMitmProxyClient.MatchCriteriaRequestHeader](docs/MatchCriteriaRequestHeader.md) - [BrowserUpMitmProxyClient.Metric](docs/Metric.md) - [BrowserUpMitmProxyClient.NameValuePair](docs/NameValuePair.md) - [BrowserUpMitmProxyClient.Page](docs/Page.md) @@ -171,4 +170,5 @@ Class | Method | HTTP request | Description ## Documentation for Authorization -All endpoints do not require authorization. +Endpoints do not require authorization. + diff --git a/clients/javascript/docs/HarEntry.md b/clients/javascript/docs/HarEntry.md index 4ad5dcd2e1..08c3334816 100644 --- a/clients/javascript/docs/HarEntry.md +++ b/clients/javascript/docs/HarEntry.md @@ -13,6 +13,9 @@ Name | Type | Description | Notes **timings** | [**HarEntryTimings**](HarEntryTimings.md) | | **serverIPAddress** | **String** | | [optional] **webSocketMessages** | [**[WebSocketMessage]**](WebSocketMessage.md) | | [optional] +**spanId** | **String** | W3C Trace Context span ID for this entry | [optional] +**parentId** | **String** | W3C Trace Context parent span ID (typically the page span ID) | [optional] +**traceId** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] **connection** | **String** | | [optional] **comment** | **String** | | [optional] diff --git a/clients/javascript/docs/HarEntryCacheBeforeRequestOneOf.md b/clients/javascript/docs/HarEntryCacheBeforeRequestOneOf.md deleted file mode 100644 index 962cd361e0..0000000000 --- a/clients/javascript/docs/HarEntryCacheBeforeRequestOneOf.md +++ /dev/null @@ -1,13 +0,0 @@ -# BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expires** | **String** | | [optional] -**lastAccess** | **String** | | -**eTag** | **String** | | -**hitCount** | **Number** | | -**comment** | **String** | | [optional] - - diff --git a/clients/javascript/docs/HarLog.md b/clients/javascript/docs/HarLog.md index ab33bd28db..92a3774084 100644 --- a/clients/javascript/docs/HarLog.md +++ b/clients/javascript/docs/HarLog.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **browser** | [**HarLogCreator**](HarLogCreator.md) | | [optional] **pages** | [**[Page]**](Page.md) | | **entries** | [**[HarEntry]**](HarEntry.md) | | +**traceId** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] +**spanId** | **String** | W3C Trace Context span ID for this HAR trace root | [optional] **comment** | **String** | | [optional] diff --git a/clients/javascript/docs/MatchCriteria.md b/clients/javascript/docs/MatchCriteria.md index 19181fd056..db27debef8 100644 --- a/clients/javascript/docs/MatchCriteria.md +++ b/clients/javascript/docs/MatchCriteria.md @@ -10,10 +10,10 @@ Name | Type | Description | Notes **content** | **String** | Body content regexp content to match | [optional] **contentType** | **String** | Content type | [optional] **websocketMessage** | **String** | Websocket message text to match | [optional] -**requestHeader** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**requestCookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**responseHeader** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] -**responseCookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] +**requestHeader** | [**NameValuePair**](NameValuePair.md) | | [optional] +**requestCookie** | [**NameValuePair**](NameValuePair.md) | | [optional] +**responseHeader** | [**NameValuePair**](NameValuePair.md) | | [optional] +**responseCookie** | [**NameValuePair**](NameValuePair.md) | | [optional] **jsonValid** | **Boolean** | Is valid JSON | [optional] **jsonPath** | **String** | Has JSON path | [optional] **jsonSchema** | **String** | Validates against passed JSON schema | [optional] diff --git a/clients/javascript/docs/MatchCriteriaRequestHeader.md b/clients/javascript/docs/MatchCriteriaRequestHeader.md deleted file mode 100644 index 159257100b..0000000000 --- a/clients/javascript/docs/MatchCriteriaRequestHeader.md +++ /dev/null @@ -1,10 +0,0 @@ -# BrowserUpMitmProxyClient.MatchCriteriaRequestHeader - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name to match | [optional] -**value** | **String** | Value to match | [optional] - - diff --git a/clients/javascript/docs/Page.md b/clients/javascript/docs/Page.md index 4d29335cb8..ffa2a39f9e 100644 --- a/clients/javascript/docs/Page.md +++ b/clients/javascript/docs/Page.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **verifications** | [**[VerifyResult]**](VerifyResult.md) | | [optional] **metrics** | [**[Metric]**](Metric.md) | | [optional] **errors** | [**[Error]**](Error.md) | | [optional] +**spanId** | **String** | W3C Trace Context span ID for this page | [optional] +**parentId** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] **pageTimings** | [**PageTimings**](PageTimings.md) | | **comment** | **String** | | [optional] diff --git a/clients/javascript/docs/PageTiming.md b/clients/javascript/docs/PageTiming.md index 01e3432e9e..552dc34de4 100644 --- a/clients/javascript/docs/PageTiming.md +++ b/clients/javascript/docs/PageTiming.md @@ -16,5 +16,7 @@ Name | Type | Description | Notes **ssl** | **Number** | Ssl connect time from the browser | [optional] **timeToFirstByte** | **Number** | Time to first byte of the page's first request per the browser | [optional] **href** | **String** | Top level href, including hashtag, etc per the browser | [optional] +**spanId** | **String** | W3C Trace Context span ID for this page | [optional] +**parentId** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/ApiClient.js b/clients/javascript/src/BrowserUpMitmProxyClient/ApiClient.js index 8739fefc31..b7471648ee 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/ApiClient.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/ApiClient.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,6 @@ import superagent from "superagent"; -import querystring from "querystring"; /** * @module BrowserUpMitmProxyClient/ApiClient @@ -48,7 +47,7 @@ class ApiClient { this.authentications = { } - /** + /** * The default HTTP headers to be included for all API calls. * @type {Array.} * @default {} @@ -72,7 +71,7 @@ class ApiClient { */ this.cache = true; - /** + /** * If set to true, the client will save the cookies from each server * response, and return them in the next request. * @default false @@ -154,7 +153,7 @@ class ApiClient { url = apiBasePath + path; } - url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => { + url = url.replace(/\{([\w-\.#]+)\}/g, (fullMatch, key) => { var value; if (pathParams.hasOwnProperty(key)) { value = this.paramToString(pathParams[key]); @@ -438,7 +437,10 @@ class ApiClient { } if (contentType === 'application/x-www-form-urlencoded') { - request.send(querystring.stringify(this.normalizeParams(formParams))); + let normalizedParams = this.normalizeParams(formParams) + let urlSearchParams = new URLSearchParams(normalizedParams); + let queryString = urlSearchParams.toString(); + request.send(queryString); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/browserup-mitmproxy-client/BrowserUpProxyApi.js b/clients/javascript/src/BrowserUpMitmProxyClient/browserup-mitmproxy-client/BrowserUpProxyApi.js index 15bc21775f..9061b0c54b 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/browserup-mitmproxy-client/BrowserUpProxyApi.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/browserup-mitmproxy-client/BrowserUpProxyApi.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/index.js b/clients/javascript/src/BrowserUpMitmProxyClient/index.js index 23c08c1c9d..92a769f437 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/index.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/index.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,7 +19,6 @@ import Har from './model/Har'; import HarEntry from './model/HarEntry'; import HarEntryCache from './model/HarEntryCache'; import HarEntryCacheBeforeRequest from './model/HarEntryCacheBeforeRequest'; -import HarEntryCacheBeforeRequestOneOf from './model/HarEntryCacheBeforeRequestOneOf'; import HarEntryRequest from './model/HarEntryRequest'; import HarEntryRequestCookiesInner from './model/HarEntryRequestCookiesInner'; import HarEntryRequestPostData from './model/HarEntryRequestPostData'; @@ -33,7 +32,6 @@ import HarLogCreator from './model/HarLogCreator'; import Header from './model/Header'; import LargestContentfulPaint from './model/LargestContentfulPaint'; import MatchCriteria from './model/MatchCriteria'; -import MatchCriteriaRequestHeader from './model/MatchCriteriaRequestHeader'; import Metric from './model/Metric'; import NameValuePair from './model/NameValuePair'; import Page from './model/Page'; @@ -118,12 +116,6 @@ export { */ HarEntryCacheBeforeRequest, - /** - * The HarEntryCacheBeforeRequestOneOf model constructor. - * @property {module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf} - */ - HarEntryCacheBeforeRequestOneOf, - /** * The HarEntryRequest model constructor. * @property {module:BrowserUpMitmProxyClient/model/HarEntryRequest} @@ -202,12 +194,6 @@ export { */ MatchCriteria, - /** - * The MatchCriteriaRequestHeader model constructor. - * @property {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} - */ - MatchCriteriaRequestHeader, - /** * The Metric model constructor. * @property {module:BrowserUpMitmProxyClient/model/Metric} diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/Action.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/Action.js index b3735133c4..8e910c196a 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/Action.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/Action.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/Error.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/Error.js index a14efaa12e..10c1e30e76 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/Error.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/Error.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/Har.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/Har.js index b5eef0ceae..1fee8d44cc 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/Har.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/Har.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -69,7 +69,7 @@ class Har { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of Har.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntry.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntry.js index 5338c49877..8336bf88d1 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntry.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntry.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -91,6 +91,15 @@ class HarEntry { if (data.hasOwnProperty('_webSocketMessages')) { obj['_webSocketMessages'] = ApiClient.convertToType(data['_webSocketMessages'], [WebSocketMessage]); } + if (data.hasOwnProperty('_span_id')) { + obj['_span_id'] = ApiClient.convertToType(data['_span_id'], 'String'); + } + if (data.hasOwnProperty('_parent_id')) { + obj['_parent_id'] = ApiClient.convertToType(data['_parent_id'], 'String'); + } + if (data.hasOwnProperty('_trace_id')) { + obj['_trace_id'] = ApiClient.convertToType(data['_trace_id'], 'String'); + } if (data.hasOwnProperty('connection')) { obj['connection'] = ApiClient.convertToType(data['connection'], 'String'); } @@ -109,7 +118,7 @@ class HarEntry { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntry.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } @@ -140,6 +149,18 @@ class HarEntry { }; } // ensure the json data is a string + if (data['_span_id'] && !(typeof data['_span_id'] === 'string' || data['_span_id'] instanceof String)) { + throw new Error("Expected the field `_span_id` to be a primitive type in the JSON string but got " + data['_span_id']); + } + // ensure the json data is a string + if (data['_parent_id'] && !(typeof data['_parent_id'] === 'string' || data['_parent_id'] instanceof String)) { + throw new Error("Expected the field `_parent_id` to be a primitive type in the JSON string but got " + data['_parent_id']); + } + // ensure the json data is a string + if (data['_trace_id'] && !(typeof data['_trace_id'] === 'string' || data['_trace_id'] instanceof String)) { + throw new Error("Expected the field `_trace_id` to be a primitive type in the JSON string but got " + data['_trace_id']); + } + // ensure the json data is a string if (data['connection'] && !(typeof data['connection'] === 'string' || data['connection'] instanceof String)) { throw new Error("Expected the field `connection` to be a primitive type in the JSON string but got " + data['connection']); } @@ -201,6 +222,24 @@ HarEntry.prototype['serverIPAddress'] = undefined; */ HarEntry.prototype['_webSocketMessages'] = undefined; +/** + * W3C Trace Context span ID for this entry + * @member {String} _span_id + */ +HarEntry.prototype['_span_id'] = undefined; + +/** + * W3C Trace Context parent span ID (typically the page span ID) + * @member {String} _parent_id + */ +HarEntry.prototype['_parent_id'] = undefined; + +/** + * W3C Trace Context trace ID for distributed tracing + * @member {String} _trace_id + */ +HarEntry.prototype['_trace_id'] = undefined; + /** * @member {String} connection */ diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCache.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCache.js index b6bb9bad03..8c07ef2061 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCache.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCache.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.js index dceea73a5e..dd2123a5bb 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,7 +12,6 @@ */ import ApiClient from '../ApiClient'; -import HarEntryCacheBeforeRequestOneOf from './HarEntryCacheBeforeRequestOneOf'; /** * The HarEntryCacheBeforeRequest model module. @@ -23,56 +22,24 @@ class HarEntryCacheBeforeRequest { /** * Constructs a new HarEntryCacheBeforeRequest. * @alias module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest - * @param {(module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf|module:BrowserUpMitmProxyClient/model/Null)} instance The actual instance to initialize HarEntryCacheBeforeRequest. + * @param lastAccess {String} + * @param eTag {String} + * @param hitCount {Number} */ - constructor(instance = null) { - if (instance === null) { - this.actualInstance = null; - return; - } - var match = 0; - var errorMessages = []; - try { - if (typeof instance === "Null") { - this.actualInstance = instance; - } else { - // plain JS object - // validate the object - Null.validateJSON(instance); // throw an exception if no match - // create Null from JS object - this.actualInstance = Null.constructFromObject(instance); - } - match++; - } catch(err) { - // json data failed to deserialize into Null - errorMessages.push("Failed to construct Null: " + err) - } - - try { - if (typeof instance === "HarEntryCacheBeforeRequestOneOf") { - this.actualInstance = instance; - } else { - // plain JS object - // validate the object - HarEntryCacheBeforeRequestOneOf.validateJSON(instance); // throw an exception if no match - // create HarEntryCacheBeforeRequestOneOf from JS object - this.actualInstance = HarEntryCacheBeforeRequestOneOf.constructFromObject(instance); - } - match++; - } catch(err) { - // json data failed to deserialize into HarEntryCacheBeforeRequestOneOf - errorMessages.push("Failed to construct HarEntryCacheBeforeRequestOneOf: " + err) - } + constructor(lastAccess, eTag, hitCount) { + + HarEntryCacheBeforeRequest.initialize(this, lastAccess, eTag, hitCount); + } - if (match > 1) { - throw new Error("Multiple matches found constructing `HarEntryCacheBeforeRequest` with oneOf schemas HarEntryCacheBeforeRequestOneOf, Null. Input: " + JSON.stringify(instance)); - } else if (match === 0) { - this.actualInstance = null; // clear the actual instance in case there are multiple matches - throw new Error("No match found constructing `HarEntryCacheBeforeRequest` with oneOf schemas HarEntryCacheBeforeRequestOneOf, Null. Details: " + - errorMessages.join(", ")); - } else { // only 1 match - // the input is valid - } + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, lastAccess, eTag, hitCount) { + obj['lastAccess'] = lastAccess; + obj['eTag'] = eTag; + obj['hitCount'] = hitCount; } /** @@ -83,43 +50,65 @@ class HarEntryCacheBeforeRequest { * @return {module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest} The populated HarEntryCacheBeforeRequest instance. */ static constructFromObject(data, obj) { - return new HarEntryCacheBeforeRequest(data); - } + if (data) { + obj = obj || new HarEntryCacheBeforeRequest(); - /** - * Gets the actual instance, which can be HarEntryCacheBeforeRequestOneOf, Null. - * @return {(module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf|module:BrowserUpMitmProxyClient/model/Null)} The actual instance. - */ - getActualInstance() { - return this.actualInstance; + if (data.hasOwnProperty('expires')) { + obj['expires'] = ApiClient.convertToType(data['expires'], 'String'); + } + if (data.hasOwnProperty('lastAccess')) { + obj['lastAccess'] = ApiClient.convertToType(data['lastAccess'], 'String'); + } + if (data.hasOwnProperty('eTag')) { + obj['eTag'] = ApiClient.convertToType(data['eTag'], 'String'); + } + if (data.hasOwnProperty('hitCount')) { + obj['hitCount'] = ApiClient.convertToType(data['hitCount'], 'Number'); + } + if (data.hasOwnProperty('comment')) { + obj['comment'] = ApiClient.convertToType(data['comment'], 'String'); + } + } + return obj; } /** - * Sets the actual instance, which can be HarEntryCacheBeforeRequestOneOf, Null. - * @param {(module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf|module:BrowserUpMitmProxyClient/model/Null)} obj The actual instance. + * Validates the JSON data with respect to HarEntryCacheBeforeRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to HarEntryCacheBeforeRequest. */ - setActualInstance(obj) { - this.actualInstance = HarEntryCacheBeforeRequest.constructFromObject(obj).getActualInstance(); - } + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of HarEntryCacheBeforeRequest.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['expires'] && !(typeof data['expires'] === 'string' || data['expires'] instanceof String)) { + throw new Error("Expected the field `expires` to be a primitive type in the JSON string but got " + data['expires']); + } + // ensure the json data is a string + if (data['lastAccess'] && !(typeof data['lastAccess'] === 'string' || data['lastAccess'] instanceof String)) { + throw new Error("Expected the field `lastAccess` to be a primitive type in the JSON string but got " + data['lastAccess']); + } + // ensure the json data is a string + if (data['eTag'] && !(typeof data['eTag'] === 'string' || data['eTag'] instanceof String)) { + throw new Error("Expected the field `eTag` to be a primitive type in the JSON string but got " + data['eTag']); + } + // ensure the json data is a string + if (data['comment'] && !(typeof data['comment'] === 'string' || data['comment'] instanceof String)) { + throw new Error("Expected the field `comment` to be a primitive type in the JSON string but got " + data['comment']); + } - /** - * Returns the JSON representation of the actual instance. - * @return {string} - */ - toJSON = function(){ - return this.getActualInstance(); + return true; } - /** - * Create an instance of HarEntryCacheBeforeRequest from a JSON string. - * @param {string} json_string JSON string. - * @return {module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest} An instance of HarEntryCacheBeforeRequest. - */ - static fromJSON = function(json_string){ - return HarEntryCacheBeforeRequest.constructFromObject(JSON.parse(json_string)); - } + } +HarEntryCacheBeforeRequest.RequiredProperties = ["lastAccess", "eTag", "hitCount"]; + /** * @member {String} expires */ @@ -146,7 +135,9 @@ HarEntryCacheBeforeRequest.prototype['hitCount'] = undefined; HarEntryCacheBeforeRequest.prototype['comment'] = undefined; -HarEntryCacheBeforeRequest.OneOf = ["HarEntryCacheBeforeRequestOneOf", "Null"]; + + + export default HarEntryCacheBeforeRequest; diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.js deleted file mode 100644 index cf693e76a7..0000000000 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - * - */ - -import ApiClient from '../ApiClient'; - -/** - * The HarEntryCacheBeforeRequestOneOf model module. - * @module BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf - * @version 1.0.0 - */ -class HarEntryCacheBeforeRequestOneOf { - /** - * Constructs a new HarEntryCacheBeforeRequestOneOf. - * @alias module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf - * @param lastAccess {String} - * @param eTag {String} - * @param hitCount {Number} - */ - constructor(lastAccess, eTag, hitCount) { - - HarEntryCacheBeforeRequestOneOf.initialize(this, lastAccess, eTag, hitCount); - } - - /** - * Initializes the fields of this object. - * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). - * Only for internal use. - */ - static initialize(obj, lastAccess, eTag, hitCount) { - obj['lastAccess'] = lastAccess; - obj['eTag'] = eTag; - obj['hitCount'] = hitCount; - } - - /** - * Constructs a HarEntryCacheBeforeRequestOneOf from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf} obj Optional instance to populate. - * @return {module:BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf} The populated HarEntryCacheBeforeRequestOneOf instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new HarEntryCacheBeforeRequestOneOf(); - - if (data.hasOwnProperty('expires')) { - obj['expires'] = ApiClient.convertToType(data['expires'], 'String'); - } - if (data.hasOwnProperty('lastAccess')) { - obj['lastAccess'] = ApiClient.convertToType(data['lastAccess'], 'String'); - } - if (data.hasOwnProperty('eTag')) { - obj['eTag'] = ApiClient.convertToType(data['eTag'], 'String'); - } - if (data.hasOwnProperty('hitCount')) { - obj['hitCount'] = ApiClient.convertToType(data['hitCount'], 'Number'); - } - if (data.hasOwnProperty('comment')) { - obj['comment'] = ApiClient.convertToType(data['comment'], 'String'); - } - } - return obj; - } - - /** - * Validates the JSON data with respect to HarEntryCacheBeforeRequestOneOf. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @return {boolean} to indicate whether the JSON data is valid with respect to HarEntryCacheBeforeRequestOneOf. - */ - static validateJSON(data) { - // check to make sure all required properties are present in the JSON string - for (const property of HarEntryCacheBeforeRequestOneOf.RequiredProperties) { - if (!data[property]) { - throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); - } - } - // ensure the json data is a string - if (data['expires'] && !(typeof data['expires'] === 'string' || data['expires'] instanceof String)) { - throw new Error("Expected the field `expires` to be a primitive type in the JSON string but got " + data['expires']); - } - // ensure the json data is a string - if (data['lastAccess'] && !(typeof data['lastAccess'] === 'string' || data['lastAccess'] instanceof String)) { - throw new Error("Expected the field `lastAccess` to be a primitive type in the JSON string but got " + data['lastAccess']); - } - // ensure the json data is a string - if (data['eTag'] && !(typeof data['eTag'] === 'string' || data['eTag'] instanceof String)) { - throw new Error("Expected the field `eTag` to be a primitive type in the JSON string but got " + data['eTag']); - } - // ensure the json data is a string - if (data['comment'] && !(typeof data['comment'] === 'string' || data['comment'] instanceof String)) { - throw new Error("Expected the field `comment` to be a primitive type in the JSON string but got " + data['comment']); - } - - return true; - } - - -} - -HarEntryCacheBeforeRequestOneOf.RequiredProperties = ["lastAccess", "eTag", "hitCount"]; - -/** - * @member {String} expires - */ -HarEntryCacheBeforeRequestOneOf.prototype['expires'] = undefined; - -/** - * @member {String} lastAccess - */ -HarEntryCacheBeforeRequestOneOf.prototype['lastAccess'] = undefined; - -/** - * @member {String} eTag - */ -HarEntryCacheBeforeRequestOneOf.prototype['eTag'] = undefined; - -/** - * @member {Number} hitCount - */ -HarEntryCacheBeforeRequestOneOf.prototype['hitCount'] = undefined; - -/** - * @member {String} comment - */ -HarEntryCacheBeforeRequestOneOf.prototype['comment'] = undefined; - - - - - - -export default HarEntryCacheBeforeRequestOneOf; - diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequest.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequest.js index c001ccd520..c97bc004b5 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequest.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequest.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -113,7 +113,7 @@ class HarEntryRequest { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryRequest.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.js index 7e47ad7fe2..291bff5400 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -87,7 +87,7 @@ class HarEntryRequestCookiesInner { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryRequestCookiesInner.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.js index eb233faba8..745e3b7b87 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -72,7 +72,7 @@ class HarEntryRequestPostData { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryRequestPostData.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.js index ab4e39173d..8dd40eaacf 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.js index 80adae3042..07fb47c3b2 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -72,7 +72,7 @@ class HarEntryRequestQueryStringInner { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryRequestQueryStringInner.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponse.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponse.js index 0e8d5f86d9..8bb56fef94 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponse.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponse.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -114,7 +114,7 @@ class HarEntryResponse { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryResponse.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponseContent.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponseContent.js index 5190536140..f32984742f 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponseContent.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryResponseContent.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -38,6 +38,14 @@ class HarEntryResponseContent { static initialize(obj, size, mimeType) { obj['size'] = size; obj['mimeType'] = mimeType; + obj['_videoBufferedPercent'] = -1; + obj['_videoStallCount'] = -1; + obj['_videoDecodedByteCount'] = -1; + obj['_videoWaitingCount'] = -1; + obj['_videoErrorCount'] = -1; + obj['_videoDroppedFrames'] = -1; + obj['_videoTotalFrames'] = -1; + obj['_videoAudioBytesDecoded'] = -1; } /** @@ -105,7 +113,7 @@ class HarEntryResponseContent { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryResponseContent.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryTimings.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryTimings.js index e1fd7b6512..fa70f7e545 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryTimings.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarEntryTimings.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -97,7 +97,7 @@ class HarEntryTimings { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarEntryTimings.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLog.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLog.js index 782c1eb88f..2021b38083 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLog.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLog.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -73,6 +73,12 @@ class HarLog { if (data.hasOwnProperty('entries')) { obj['entries'] = ApiClient.convertToType(data['entries'], [HarEntry]); } + if (data.hasOwnProperty('_trace_id')) { + obj['_trace_id'] = ApiClient.convertToType(data['_trace_id'], 'String'); + } + if (data.hasOwnProperty('_span_id')) { + obj['_span_id'] = ApiClient.convertToType(data['_span_id'], 'String'); + } if (data.hasOwnProperty('comment')) { obj['comment'] = ApiClient.convertToType(data['comment'], 'String'); } @@ -88,7 +94,7 @@ class HarLog { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarLog.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } @@ -119,6 +125,14 @@ class HarLog { }; } // ensure the json data is a string + if (data['_trace_id'] && !(typeof data['_trace_id'] === 'string' || data['_trace_id'] instanceof String)) { + throw new Error("Expected the field `_trace_id` to be a primitive type in the JSON string but got " + data['_trace_id']); + } + // ensure the json data is a string + if (data['_span_id'] && !(typeof data['_span_id'] === 'string' || data['_span_id'] instanceof String)) { + throw new Error("Expected the field `_span_id` to be a primitive type in the JSON string but got " + data['_span_id']); + } + // ensure the json data is a string if (data['comment'] && !(typeof data['comment'] === 'string' || data['comment'] instanceof String)) { throw new Error("Expected the field `comment` to be a primitive type in the JSON string but got " + data['comment']); } @@ -156,6 +170,18 @@ HarLog.prototype['pages'] = undefined; */ HarLog.prototype['entries'] = undefined; +/** + * W3C Trace Context trace ID for distributed tracing + * @member {String} _trace_id + */ +HarLog.prototype['_trace_id'] = undefined; + +/** + * W3C Trace Context span ID for this HAR trace root + * @member {String} _span_id + */ +HarLog.prototype['_span_id'] = undefined; + /** * @member {String} comment */ diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLogCreator.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLogCreator.js index aced457e7e..cea828c62b 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLogCreator.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/HarLogCreator.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -72,7 +72,7 @@ class HarLogCreator { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of HarLogCreator.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/Header.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/Header.js index 4d8c50e3be..7bb0355988 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/Header.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/Header.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -72,7 +72,7 @@ class Header { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of Header.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/LargestContentfulPaint.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/LargestContentfulPaint.js index 40396f5af8..c664e832f8 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/LargestContentfulPaint.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/LargestContentfulPaint.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,6 +35,10 @@ class LargestContentfulPaint { * Only for internal use. */ static initialize(obj) { + obj['startTime'] = -1; + obj['size'] = -1; + obj['domPath'] = ''; + obj['tag'] = ''; } /** diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteria.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteria.js index d7342b7333..6263e8c299 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteria.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteria.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,7 +12,7 @@ */ import ApiClient from '../ApiClient'; -import MatchCriteriaRequestHeader from './MatchCriteriaRequestHeader'; +import NameValuePair from './NameValuePair'; /** * The MatchCriteria model module. @@ -36,6 +36,7 @@ class MatchCriteria { * Only for internal use. */ static initialize(obj) { + obj['error_if_no_traffic'] = true; } /** @@ -68,16 +69,16 @@ class MatchCriteria { obj['websocket_message'] = ApiClient.convertToType(data['websocket_message'], 'String'); } if (data.hasOwnProperty('request_header')) { - obj['request_header'] = MatchCriteriaRequestHeader.constructFromObject(data['request_header']); + obj['request_header'] = ApiClient.convertToType(data['request_header'], NameValuePair); } if (data.hasOwnProperty('request_cookie')) { - obj['request_cookie'] = MatchCriteriaRequestHeader.constructFromObject(data['request_cookie']); + obj['request_cookie'] = ApiClient.convertToType(data['request_cookie'], NameValuePair); } if (data.hasOwnProperty('response_header')) { - obj['response_header'] = MatchCriteriaRequestHeader.constructFromObject(data['response_header']); + obj['response_header'] = ApiClient.convertToType(data['response_header'], NameValuePair); } if (data.hasOwnProperty('response_cookie')) { - obj['response_cookie'] = MatchCriteriaRequestHeader.constructFromObject(data['response_cookie']); + obj['response_cookie'] = ApiClient.convertToType(data['response_cookie'], NameValuePair); } if (data.hasOwnProperty('json_valid')) { obj['json_valid'] = ApiClient.convertToType(data['json_valid'], 'Boolean'); @@ -127,19 +128,19 @@ class MatchCriteria { } // validate the optional field `request_header` if (data['request_header']) { // data not null - MatchCriteriaRequestHeader.validateJSON(data['request_header']); + NameValuePair.validateJSON(data['request_header']); } // validate the optional field `request_cookie` if (data['request_cookie']) { // data not null - MatchCriteriaRequestHeader.validateJSON(data['request_cookie']); + NameValuePair.validateJSON(data['request_cookie']); } // validate the optional field `response_header` if (data['response_header']) { // data not null - MatchCriteriaRequestHeader.validateJSON(data['response_header']); + NameValuePair.validateJSON(data['response_header']); } // validate the optional field `response_cookie` if (data['response_cookie']) { // data not null - MatchCriteriaRequestHeader.validateJSON(data['response_cookie']); + NameValuePair.validateJSON(data['response_cookie']); } // ensure the json data is a string if (data['json_path'] && !(typeof data['json_path'] === 'string' || data['json_path'] instanceof String)) { @@ -195,22 +196,22 @@ MatchCriteria.prototype['content_type'] = undefined; MatchCriteria.prototype['websocket_message'] = undefined; /** - * @member {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} request_header + * @member {module:BrowserUpMitmProxyClient/model/NameValuePair} request_header */ MatchCriteria.prototype['request_header'] = undefined; /** - * @member {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} request_cookie + * @member {module:BrowserUpMitmProxyClient/model/NameValuePair} request_cookie */ MatchCriteria.prototype['request_cookie'] = undefined; /** - * @member {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} response_header + * @member {module:BrowserUpMitmProxyClient/model/NameValuePair} response_header */ MatchCriteria.prototype['response_header'] = undefined; /** - * @member {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} response_cookie + * @member {module:BrowserUpMitmProxyClient/model/NameValuePair} response_cookie */ MatchCriteria.prototype['response_cookie'] = undefined; diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.js deleted file mode 100644 index 5ab43317d6..0000000000 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.js +++ /dev/null @@ -1,115 +0,0 @@ -/** - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - * - */ - -import ApiClient from '../ApiClient'; -import NameValuePair from './NameValuePair'; - -/** - * The MatchCriteriaRequestHeader model module. - * @module BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader - * @version 1.0.0 - */ -class MatchCriteriaRequestHeader { - /** - * Constructs a new MatchCriteriaRequestHeader. - * @alias module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader - * @implements module:BrowserUpMitmProxyClient/model/NameValuePair - */ - constructor() { - NameValuePair.initialize(this); - MatchCriteriaRequestHeader.initialize(this); - } - - /** - * Initializes the fields of this object. - * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). - * Only for internal use. - */ - static initialize(obj) { - } - - /** - * Constructs a MatchCriteriaRequestHeader from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} obj Optional instance to populate. - * @return {module:BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader} The populated MatchCriteriaRequestHeader instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new MatchCriteriaRequestHeader(); - NameValuePair.constructFromObject(data, obj); - - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } - if (data.hasOwnProperty('value')) { - obj['value'] = ApiClient.convertToType(data['value'], 'String'); - } - } - return obj; - } - - /** - * Validates the JSON data with respect to MatchCriteriaRequestHeader. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @return {boolean} to indicate whether the JSON data is valid with respect to MatchCriteriaRequestHeader. - */ - static validateJSON(data) { - // ensure the json data is a string - if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) { - throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']); - } - // ensure the json data is a string - if (data['value'] && !(typeof data['value'] === 'string' || data['value'] instanceof String)) { - throw new Error("Expected the field `value` to be a primitive type in the JSON string but got " + data['value']); - } - - return true; - } - - -} - - - -/** - * Name to match - * @member {String} name - */ -MatchCriteriaRequestHeader.prototype['name'] = undefined; - -/** - * Value to match - * @member {String} value - */ -MatchCriteriaRequestHeader.prototype['value'] = undefined; - - -// Implement NameValuePair interface: -/** - * Name to match - * @member {String} name - */ -NameValuePair.prototype['name'] = undefined; -/** - * Value to match - * @member {String} value - */ -NameValuePair.prototype['value'] = undefined; - - - - -export default MatchCriteriaRequestHeader; - diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/Metric.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/Metric.js index 1a126b03aa..df71b878c6 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/Metric.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/Metric.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/NameValuePair.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/NameValuePair.js index 9662f1a799..e2a3637efe 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/NameValuePair.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/NameValuePair.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/Page.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/Page.js index 54948d4f28..ac2f33d7da 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/Page.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/Page.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -81,6 +81,12 @@ class Page { if (data.hasOwnProperty('_errors')) { obj['_errors'] = ApiClient.convertToType(data['_errors'], [Error]); } + if (data.hasOwnProperty('_span_id')) { + obj['_span_id'] = ApiClient.convertToType(data['_span_id'], 'String'); + } + if (data.hasOwnProperty('_parent_id')) { + obj['_parent_id'] = ApiClient.convertToType(data['_parent_id'], 'String'); + } if (data.hasOwnProperty('pageTimings')) { obj['pageTimings'] = PageTimings.constructFromObject(data['pageTimings']); } @@ -99,7 +105,7 @@ class Page { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of Page.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } @@ -142,6 +148,14 @@ class Page { }; } // ensure the json data is a string + if (data['_span_id'] && !(typeof data['_span_id'] === 'string' || data['_span_id'] instanceof String)) { + throw new Error("Expected the field `_span_id` to be a primitive type in the JSON string but got " + data['_span_id']); + } + // ensure the json data is a string + if (data['_parent_id'] && !(typeof data['_parent_id'] === 'string' || data['_parent_id'] instanceof String)) { + throw new Error("Expected the field `_parent_id` to be a primitive type in the JSON string but got " + data['_parent_id']); + } + // ensure the json data is a string if (data['comment'] && !(typeof data['comment'] === 'string' || data['comment'] instanceof String)) { throw new Error("Expected the field `comment` to be a primitive type in the JSON string but got " + data['comment']); } @@ -184,6 +198,18 @@ Page.prototype['_metrics'] = undefined; */ Page.prototype['_errors'] = undefined; +/** + * W3C Trace Context span ID for this page + * @member {String} _span_id + */ +Page.prototype['_span_id'] = undefined; + +/** + * W3C Trace Context parent span ID (typically the HAR log span ID) + * @member {String} _parent_id + */ +Page.prototype['_parent_id'] = undefined; + /** * @member {module:BrowserUpMitmProxyClient/model/PageTimings} pageTimings */ diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTiming.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTiming.js index f5408f9d63..13dc3a4fb7 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTiming.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTiming.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -83,6 +83,12 @@ class PageTiming { if (data.hasOwnProperty('_href')) { obj['_href'] = ApiClient.convertToType(data['_href'], 'String'); } + if (data.hasOwnProperty('_span_id')) { + obj['_span_id'] = ApiClient.convertToType(data['_span_id'], 'String'); + } + if (data.hasOwnProperty('_parent_id')) { + obj['_parent_id'] = ApiClient.convertToType(data['_parent_id'], 'String'); + } } return obj; } @@ -97,6 +103,14 @@ class PageTiming { if (data['_href'] && !(typeof data['_href'] === 'string' || data['_href'] instanceof String)) { throw new Error("Expected the field `_href` to be a primitive type in the JSON string but got " + data['_href']); } + // ensure the json data is a string + if (data['_span_id'] && !(typeof data['_span_id'] === 'string' || data['_span_id'] instanceof String)) { + throw new Error("Expected the field `_span_id` to be a primitive type in the JSON string but got " + data['_span_id']); + } + // ensure the json data is a string + if (data['_parent_id'] && !(typeof data['_parent_id'] === 'string' || data['_parent_id'] instanceof String)) { + throw new Error("Expected the field `_parent_id` to be a primitive type in the JSON string but got " + data['_parent_id']); + } return true; } @@ -178,6 +192,18 @@ PageTiming.prototype['_timeToFirstByte'] = undefined; */ PageTiming.prototype['_href'] = undefined; +/** + * W3C Trace Context span ID for this page + * @member {String} _span_id + */ +PageTiming.prototype['_span_id'] = undefined; + +/** + * W3C Trace Context parent span ID (typically the HAR log span ID) + * @member {String} _parent_id + */ +PageTiming.prototype['_parent_id'] = undefined; + diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTimings.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTimings.js index 4562accd46..f38c887fe4 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTimings.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/PageTimings.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,6 +40,15 @@ class PageTimings { static initialize(obj, onContentLoad, onLoad) { obj['onContentLoad'] = onContentLoad || -1; obj['onLoad'] = onLoad || -1; + obj['_href'] = ''; + obj['_dns'] = -1; + obj['_ssl'] = -1; + obj['_timeToFirstByte'] = -1; + obj['_cumulativeLayoutShift'] = -1; + obj['_firstPaint'] = -1; + obj['_firstInputDelay'] = -1; + obj['_domInteractive'] = -1; + obj['_firstContentfulPaint'] = -1; } /** @@ -107,7 +116,7 @@ class PageTimings { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of PageTimings.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/VerifyResult.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/VerifyResult.js index 0ee557abba..6cac73a3a1 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/VerifyResult.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/VerifyResult.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/src/BrowserUpMitmProxyClient/model/WebSocketMessage.js b/clients/javascript/src/BrowserUpMitmProxyClient/model/WebSocketMessage.js index 0fc9400b88..e99439383b 100644 --- a/clients/javascript/src/BrowserUpMitmProxyClient/model/WebSocketMessage.js +++ b/clients/javascript/src/BrowserUpMitmProxyClient/model/WebSocketMessage.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -79,7 +79,7 @@ class WebSocketMessage { static validateJSON(data) { // check to make sure all required properties are present in the JSON string for (const property of WebSocketMessage.RequiredProperties) { - if (!data[property]) { + if (!data.hasOwnProperty(property)) { throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); } } diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/api/BrowserUpProxyApi.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/api/BrowserUpProxyApi.spec.js index a7e749aa29..f3fce4f5fc 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/api/BrowserUpProxyApi.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/api/BrowserUpProxyApi.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/Action.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/Action.spec.js index 1f18e7142c..7735737349 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/Action.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/Action.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/Error.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/Error.spec.js index 1a2cca93b4..ae892f24a5 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/Error.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/Error.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/Har.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/Har.spec.js index c31d3a20dc..0898173163 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/Har.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/Har.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntry.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntry.spec.js index 5edba67f1b..60e1a979b1 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntry.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntry.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -108,6 +108,24 @@ //expect(instance).to.be(); }); + it('should have the property spanId (base name: "_span_id")', function() { + // uncomment below and update the code to test the property spanId + //var instance = new BrowserUpMitmProxyClient.HarEntry(); + //expect(instance).to.be(); + }); + + it('should have the property parentId (base name: "_parent_id")', function() { + // uncomment below and update the code to test the property parentId + //var instance = new BrowserUpMitmProxyClient.HarEntry(); + //expect(instance).to.be(); + }); + + it('should have the property traceId (base name: "_trace_id")', function() { + // uncomment below and update the code to test the property traceId + //var instance = new BrowserUpMitmProxyClient.HarEntry(); + //expect(instance).to.be(); + }); + it('should have the property connection (base name: "connection")', function() { // uncomment below and update the code to test the property connection //var instance = new BrowserUpMitmProxyClient.HarEntry(); diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCache.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCache.spec.js index 45ced80c5d..6dff92430d 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCache.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCache.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.spec.js index 5c0a25f507..c6741b9973 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequest.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.spec.js deleted file mode 100644 index 67a01d139f..0000000000 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryCacheBeforeRequestOneOf.spec.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', process.cwd()+'/src/BrowserUpMitmProxyClient/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/BrowserUpMitmProxyClient/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.BrowserUpMitmProxyClient); - } -}(this, function(expect, BrowserUpMitmProxyClient) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('HarEntryCacheBeforeRequestOneOf', function() { - it('should create an instance of HarEntryCacheBeforeRequestOneOf', function() { - // uncomment below and update the code to test HarEntryCacheBeforeRequestOneOf - //var instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - //expect(instance).to.be.a(BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf); - }); - - it('should have the property expires (base name: "expires")', function() { - // uncomment below and update the code to test the property expires - //var instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - //expect(instance).to.be(); - }); - - it('should have the property lastAccess (base name: "lastAccess")', function() { - // uncomment below and update the code to test the property lastAccess - //var instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - //expect(instance).to.be(); - }); - - it('should have the property eTag (base name: "eTag")', function() { - // uncomment below and update the code to test the property eTag - //var instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - //expect(instance).to.be(); - }); - - it('should have the property hitCount (base name: "hitCount")', function() { - // uncomment below and update the code to test the property hitCount - //var instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - //expect(instance).to.be(); - }); - - it('should have the property comment (base name: "comment")', function() { - // uncomment below and update the code to test the property comment - //var instance = new BrowserUpMitmProxyClient.HarEntryCacheBeforeRequestOneOf(); - //expect(instance).to.be(); - }); - - }); - -})); diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequest.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequest.spec.js index 5695e3e6e2..46b7a1593f 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequest.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequest.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.spec.js index cb06c492da..8636ca421c 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestCookiesInner.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.spec.js index ce553c1f1b..bce0b03780 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostData.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.spec.js index 482a05f5b4..fc1c3b1b2f 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestPostDataParamsInner.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.spec.js index 476a7d41b6..7344df0b16 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryRequestQueryStringInner.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponse.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponse.spec.js index 1ff0cc84fb..9967d457e5 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponse.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponse.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponseContent.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponseContent.spec.js index 523a8c4515..fc08f76c3e 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponseContent.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryResponseContent.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryTimings.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryTimings.spec.js index f8078a12a5..c30c3a2988 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryTimings.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarEntryTimings.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLog.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLog.spec.js index 3b2544590e..4ef985906e 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLog.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLog.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -84,6 +84,18 @@ //expect(instance).to.be(); }); + it('should have the property traceId (base name: "_trace_id")', function() { + // uncomment below and update the code to test the property traceId + //var instance = new BrowserUpMitmProxyClient.HarLog(); + //expect(instance).to.be(); + }); + + it('should have the property spanId (base name: "_span_id")', function() { + // uncomment below and update the code to test the property spanId + //var instance = new BrowserUpMitmProxyClient.HarLog(); + //expect(instance).to.be(); + }); + it('should have the property comment (base name: "comment")', function() { // uncomment below and update the code to test the property comment //var instance = new BrowserUpMitmProxyClient.HarLog(); diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLogCreator.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLogCreator.spec.js index 15721c9b90..2bf0328b51 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLogCreator.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/HarLogCreator.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/Header.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/Header.spec.js index d117b201af..a46c3ffc4f 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/Header.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/Header.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/LargestContentfulPaint.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/LargestContentfulPaint.spec.js index 0c5d56741b..4c1e0c40db 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/LargestContentfulPaint.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/LargestContentfulPaint.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteria.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteria.spec.js index c9aa6c4126..10f13209ff 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteria.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteria.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.spec.js deleted file mode 100644 index 018a688d68..0000000000 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/MatchCriteriaRequestHeader.spec.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * BrowserUp MitmProxy - * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - * - * The version of the OpenAPI document: 1.24 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', process.cwd()+'/src/BrowserUpMitmProxyClient/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/BrowserUpMitmProxyClient/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.BrowserUpMitmProxyClient); - } -}(this, function(expect, BrowserUpMitmProxyClient) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new BrowserUpMitmProxyClient.MatchCriteriaRequestHeader(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('MatchCriteriaRequestHeader', function() { - it('should create an instance of MatchCriteriaRequestHeader', function() { - // uncomment below and update the code to test MatchCriteriaRequestHeader - //var instance = new BrowserUpMitmProxyClient.MatchCriteriaRequestHeader(); - //expect(instance).to.be.a(BrowserUpMitmProxyClient.MatchCriteriaRequestHeader); - }); - - it('should have the property name (base name: "name")', function() { - // uncomment below and update the code to test the property name - //var instance = new BrowserUpMitmProxyClient.MatchCriteriaRequestHeader(); - //expect(instance).to.be(); - }); - - it('should have the property value (base name: "value")', function() { - // uncomment below and update the code to test the property value - //var instance = new BrowserUpMitmProxyClient.MatchCriteriaRequestHeader(); - //expect(instance).to.be(); - }); - - }); - -})); diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/Metric.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/Metric.spec.js index 582958fd9b..8d44b600b5 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/Metric.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/Metric.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/NameValuePair.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/NameValuePair.spec.js index 7f59651d65..b509d77be1 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/NameValuePair.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/NameValuePair.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/Page.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/Page.spec.js index 7d8eaa49dd..e9f19c418c 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/Page.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/Page.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -90,6 +90,18 @@ //expect(instance).to.be(); }); + it('should have the property spanId (base name: "_span_id")', function() { + // uncomment below and update the code to test the property spanId + //var instance = new BrowserUpMitmProxyClient.Page(); + //expect(instance).to.be(); + }); + + it('should have the property parentId (base name: "_parent_id")', function() { + // uncomment below and update the code to test the property parentId + //var instance = new BrowserUpMitmProxyClient.Page(); + //expect(instance).to.be(); + }); + it('should have the property pageTimings (base name: "pageTimings")', function() { // uncomment below and update the code to test the property pageTimings //var instance = new BrowserUpMitmProxyClient.Page(); diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTiming.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTiming.spec.js index 02d4610f8c..70433d28da 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTiming.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTiming.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -126,6 +126,18 @@ //expect(instance).to.be(); }); + it('should have the property spanId (base name: "_span_id")', function() { + // uncomment below and update the code to test the property spanId + //var instance = new BrowserUpMitmProxyClient.PageTiming(); + //expect(instance).to.be(); + }); + + it('should have the property parentId (base name: "_parent_id")', function() { + // uncomment below and update the code to test the property parentId + //var instance = new BrowserUpMitmProxyClient.PageTiming(); + //expect(instance).to.be(); + }); + }); })); diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTimings.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTimings.spec.js index 394e2e72a9..656acf1448 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTimings.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/PageTimings.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/VerifyResult.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/VerifyResult.spec.js index 61cdff16cb..174a8d8ba4 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/VerifyResult.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/VerifyResult.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/javascript/test/BrowserUpMitmProxyClient/model/WebSocketMessage.spec.js b/clients/javascript/test/BrowserUpMitmProxyClient/model/WebSocketMessage.spec.js index 59467cc7ac..b0837a83ec 100644 --- a/clients/javascript/test/BrowserUpMitmProxyClient/model/WebSocketMessage.spec.js +++ b/clients/javascript/test/BrowserUpMitmProxyClient/model/WebSocketMessage.spec.js @@ -2,7 +2,7 @@ * BrowserUp MitmProxy * ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ * - * The version of the OpenAPI document: 1.24 + * The version of the OpenAPI document: 1.25 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/clients/markdown/.openapi-generator/FILES b/clients/markdown/.openapi-generator/FILES index e99b00bece..e9c116e172 100644 --- a/clients/markdown/.openapi-generator/FILES +++ b/clients/markdown/.openapi-generator/FILES @@ -6,7 +6,6 @@ Models/Har.md Models/HarEntry.md Models/HarEntry_cache.md Models/HarEntry_cache_beforeRequest.md -Models/HarEntry_cache_beforeRequest_oneOf.md Models/HarEntry_request.md Models/HarEntry_request_cookies_inner.md Models/HarEntry_request_postData.md @@ -20,7 +19,6 @@ Models/Har_log_creator.md Models/Header.md Models/LargestContentfulPaint.md Models/MatchCriteria.md -Models/MatchCriteria_request_header.md Models/Metric.md Models/NameValuePair.md Models/Page.md diff --git a/clients/markdown/.openapi-generator/VERSION b/clients/markdown/.openapi-generator/VERSION index c0be8a7992..5f84a81db0 100644 --- a/clients/markdown/.openapi-generator/VERSION +++ b/clients/markdown/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +7.12.0 diff --git a/clients/markdown/Models/HarEntry.md b/clients/markdown/Models/HarEntry.md index de014016d0..fe0c1ee74c 100644 --- a/clients/markdown/Models/HarEntry.md +++ b/clients/markdown/Models/HarEntry.md @@ -12,6 +12,9 @@ | **timings** | [**HarEntry_timings**](HarEntry_timings.md) | | [default to null] | | **serverIPAddress** | **String** | | [optional] [default to null] | | **\_webSocketMessages** | [**List**](WebSocketMessage.md) | | [optional] [default to null] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this entry | [optional] [default to null] | +| **\_parent\_id** | **String** | W3C Trace Context parent span ID (typically the page span ID) | [optional] [default to null] | +| **\_trace\_id** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] [default to null] | | **connection** | **String** | | [optional] [default to null] | | **comment** | **String** | | [optional] [default to null] | diff --git a/clients/markdown/Models/Har_log.md b/clients/markdown/Models/Har_log.md index 479ef19d39..db8655918b 100644 --- a/clients/markdown/Models/Har_log.md +++ b/clients/markdown/Models/Har_log.md @@ -8,6 +8,8 @@ | **browser** | [**Har_log_creator**](Har_log_creator.md) | | [optional] [default to null] | | **pages** | [**List**](Page.md) | | [default to null] | | **entries** | [**List**](HarEntry.md) | | [default to null] | +| **\_trace\_id** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] [default to null] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this HAR trace root | [optional] [default to null] | | **comment** | **String** | | [optional] [default to null] | [[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/clients/markdown/Models/MatchCriteria.md b/clients/markdown/Models/MatchCriteria.md index ab23a94822..238ecbb697 100644 --- a/clients/markdown/Models/MatchCriteria.md +++ b/clients/markdown/Models/MatchCriteria.md @@ -9,10 +9,10 @@ | **content** | **String** | Body content regexp content to match | [optional] [default to null] | | **content\_type** | **String** | Content type | [optional] [default to null] | | **websocket\_message** | **String** | Websocket message text to match | [optional] [default to null] | -| **request\_header** | [**MatchCriteria_request_header**](MatchCriteria_request_header.md) | | [optional] [default to null] | -| **request\_cookie** | [**MatchCriteria_request_header**](MatchCriteria_request_header.md) | | [optional] [default to null] | -| **response\_header** | [**MatchCriteria_request_header**](MatchCriteria_request_header.md) | | [optional] [default to null] | -| **response\_cookie** | [**MatchCriteria_request_header**](MatchCriteria_request_header.md) | | [optional] [default to null] | +| **request\_header** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **request\_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **response\_header** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **response\_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | | **json\_valid** | **Boolean** | Is valid JSON | [optional] [default to null] | | **json\_path** | **String** | Has JSON path | [optional] [default to null] | | **json\_schema** | **String** | Validates against passed JSON schema | [optional] [default to null] | diff --git a/clients/markdown/Models/Metric.md b/clients/markdown/Models/Metric.md index 4a150c4aff..57777f465a 100644 --- a/clients/markdown/Models/Metric.md +++ b/clients/markdown/Models/Metric.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | **name** | **String** | Name of Custom Metric to add to the page under _metrics | [optional] [default to null] | -| **value** | **Double** | Value for the metric | [optional] [default to null] | +| **value** | **Integer** | Value for the metric | [optional] [default to null] | [[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/clients/markdown/Models/Page.md b/clients/markdown/Models/Page.md index 020a3c5b88..8976754f82 100644 --- a/clients/markdown/Models/Page.md +++ b/clients/markdown/Models/Page.md @@ -9,6 +9,8 @@ | **\_verifications** | [**List**](VerifyResult.md) | | [optional] [default to []] | | **\_metrics** | [**List**](Metric.md) | | [optional] [default to []] | | **\_errors** | [**List**](Error.md) | | [optional] [default to []] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this page | [optional] [default to null] | +| **\_parent\_id** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] [default to null] | | **pageTimings** | [**PageTimings**](PageTimings.md) | | [default to null] | | **comment** | **String** | | [optional] [default to null] | diff --git a/clients/markdown/Models/PageTiming.md b/clients/markdown/Models/PageTiming.md index 91aec45898..cb42bac28c 100644 --- a/clients/markdown/Models/PageTiming.md +++ b/clients/markdown/Models/PageTiming.md @@ -3,18 +3,20 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| **onContentLoad** | **BigDecimal** | onContentLoad per the browser | [optional] [default to null] | -| **onLoad** | **BigDecimal** | onLoad per the browser | [optional] [default to null] | -| **\_firstInputDelay** | **BigDecimal** | firstInputDelay from the browser | [optional] [default to null] | -| **\_firstPaint** | **BigDecimal** | firstPaint from the browser | [optional] [default to null] | -| **\_cumulativeLayoutShift** | **BigDecimal** | cumulativeLayoutShift metric from the browser | [optional] [default to null] | -| **\_largestContentfulPaint** | **BigDecimal** | largestContentfulPaint from the browser | [optional] [default to null] | -| **\_domInteractive** | **BigDecimal** | domInteractive from the browser | [optional] [default to null] | -| **\_firstContentfulPaint** | **BigDecimal** | firstContentfulPaint from the browser | [optional] [default to null] | -| **\_dns** | **BigDecimal** | dns lookup time from the browser | [optional] [default to null] | -| **\_ssl** | **BigDecimal** | Ssl connect time from the browser | [optional] [default to null] | -| **\_timeToFirstByte** | **BigDecimal** | Time to first byte of the page's first request per the browser | [optional] [default to null] | +| **onContentLoad** | **Integer** | onContentLoad per the browser | [optional] [default to null] | +| **onLoad** | **Integer** | onLoad per the browser | [optional] [default to null] | +| **\_firstInputDelay** | **Integer** | firstInputDelay from the browser | [optional] [default to null] | +| **\_firstPaint** | **Integer** | firstPaint from the browser | [optional] [default to null] | +| **\_cumulativeLayoutShift** | **Integer** | cumulativeLayoutShift metric from the browser | [optional] [default to null] | +| **\_largestContentfulPaint** | **Integer** | largestContentfulPaint from the browser | [optional] [default to null] | +| **\_domInteractive** | **Integer** | domInteractive from the browser | [optional] [default to null] | +| **\_firstContentfulPaint** | **Integer** | firstContentfulPaint from the browser | [optional] [default to null] | +| **\_dns** | **Integer** | dns lookup time from the browser | [optional] [default to null] | +| **\_ssl** | **Integer** | Ssl connect time from the browser | [optional] [default to null] | +| **\_timeToFirstByte** | **Integer** | Time to first byte of the page's first request per the browser | [optional] [default to null] | | **\_href** | **String** | Top level href, including hashtag, etc per the browser | [optional] [default to null] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this page | [optional] [default to null] | +| **\_parent\_id** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] [default to null] | [[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/clients/markdown/README.md b/clients/markdown/README.md index 6e801ba11e..05a8c6a41b 100644 --- a/clients/markdown/README.md +++ b/clients/markdown/README.md @@ -28,7 +28,6 @@ All URIs are relative to *http://localhost:48088* - [HarEntry](./Models/HarEntry.md) - [HarEntry_cache](./Models/HarEntry_cache.md) - [HarEntry_cache_beforeRequest](./Models/HarEntry_cache_beforeRequest.md) - - [HarEntry_cache_beforeRequest_oneOf](./Models/HarEntry_cache_beforeRequest_oneOf.md) - [HarEntry_request](./Models/HarEntry_request.md) - [HarEntry_request_cookies_inner](./Models/HarEntry_request_cookies_inner.md) - [HarEntry_request_postData](./Models/HarEntry_request_postData.md) @@ -42,7 +41,6 @@ All URIs are relative to *http://localhost:48088* - [Header](./Models/Header.md) - [LargestContentfulPaint](./Models/LargestContentfulPaint.md) - [MatchCriteria](./Models/MatchCriteria.md) - - [MatchCriteria_request_header](./Models/MatchCriteria_request_header.md) - [Metric](./Models/Metric.md) - [NameValuePair](./Models/NameValuePair.md) - [Page](./Models/Page.md) diff --git a/clients/python/.github/workflows/python.yml b/clients/python/.github/workflows/python.yml new file mode 100644 index 0000000000..40f44bd772 --- /dev/null +++ b/clients/python/.github/workflows/python.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: BrowserUpMitmProxyClient Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov=BrowserUpMitmProxyClient diff --git a/clients/python/.gitignore b/clients/python/.gitignore new file mode 100644 index 0000000000..43995bd42f --- /dev/null +++ b/clients/python/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/clients/python/.gitlab-ci.yml b/clients/python/.gitlab-ci.yml new file mode 100644 index 0000000000..a8b5935f0d --- /dev/null +++ b/clients/python/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=BrowserUpMitmProxyClient + +pytest-3.8: + extends: .pytest + image: python:3.8-alpine +pytest-3.9: + extends: .pytest + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine diff --git a/clients/python/.openapi-generator-ignore b/clients/python/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/clients/python/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# 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 OpenAPI Generator 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 diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES new file mode 100644 index 0000000000..b854ba2d70 --- /dev/null +++ b/clients/python/.openapi-generator/FILES @@ -0,0 +1,106 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +BrowserUpMitmProxyClient/__init__.py +BrowserUpMitmProxyClient/api/__init__.py +BrowserUpMitmProxyClient/api/browser_up_proxy_api.py +BrowserUpMitmProxyClient/api_client.py +BrowserUpMitmProxyClient/api_response.py +BrowserUpMitmProxyClient/configuration.py +BrowserUpMitmProxyClient/exceptions.py +BrowserUpMitmProxyClient/models/__init__.py +BrowserUpMitmProxyClient/models/action.py +BrowserUpMitmProxyClient/models/error.py +BrowserUpMitmProxyClient/models/har.py +BrowserUpMitmProxyClient/models/har_entry.py +BrowserUpMitmProxyClient/models/har_entry_cache.py +BrowserUpMitmProxyClient/models/har_entry_cache_before_request.py +BrowserUpMitmProxyClient/models/har_entry_request.py +BrowserUpMitmProxyClient/models/har_entry_request_cookies_inner.py +BrowserUpMitmProxyClient/models/har_entry_request_post_data.py +BrowserUpMitmProxyClient/models/har_entry_request_post_data_params_inner.py +BrowserUpMitmProxyClient/models/har_entry_request_query_string_inner.py +BrowserUpMitmProxyClient/models/har_entry_response.py +BrowserUpMitmProxyClient/models/har_entry_response_content.py +BrowserUpMitmProxyClient/models/har_entry_timings.py +BrowserUpMitmProxyClient/models/har_log.py +BrowserUpMitmProxyClient/models/har_log_creator.py +BrowserUpMitmProxyClient/models/header.py +BrowserUpMitmProxyClient/models/largest_contentful_paint.py +BrowserUpMitmProxyClient/models/match_criteria.py +BrowserUpMitmProxyClient/models/metric.py +BrowserUpMitmProxyClient/models/name_value_pair.py +BrowserUpMitmProxyClient/models/page.py +BrowserUpMitmProxyClient/models/page_timing.py +BrowserUpMitmProxyClient/models/page_timings.py +BrowserUpMitmProxyClient/models/verify_result.py +BrowserUpMitmProxyClient/models/web_socket_message.py +BrowserUpMitmProxyClient/py.typed +BrowserUpMitmProxyClient/rest.py +LICENSE +README.md +docs/Action.md +docs/BrowserUpProxyApi.md +docs/Error.md +docs/Har.md +docs/HarEntry.md +docs/HarEntryCache.md +docs/HarEntryCacheBeforeRequest.md +docs/HarEntryRequest.md +docs/HarEntryRequestCookiesInner.md +docs/HarEntryRequestPostData.md +docs/HarEntryRequestPostDataParamsInner.md +docs/HarEntryRequestQueryStringInner.md +docs/HarEntryResponse.md +docs/HarEntryResponseContent.md +docs/HarEntryTimings.md +docs/HarLog.md +docs/HarLogCreator.md +docs/Header.md +docs/LargestContentfulPaint.md +docs/MatchCriteria.md +docs/Metric.md +docs/NameValuePair.md +docs/Page.md +docs/PageTiming.md +docs/PageTimings.md +docs/VerifyResult.md +docs/WebSocketMessage.md +git_push.sh +pyproject.toml +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_action.py +test/test_browser_up_proxy_api.py +test/test_error.py +test/test_har.py +test/test_har_entry.py +test/test_har_entry_cache.py +test/test_har_entry_cache_before_request.py +test/test_har_entry_request.py +test/test_har_entry_request_cookies_inner.py +test/test_har_entry_request_post_data.py +test/test_har_entry_request_post_data_params_inner.py +test/test_har_entry_request_query_string_inner.py +test/test_har_entry_response.py +test/test_har_entry_response_content.py +test/test_har_entry_timings.py +test/test_har_log.py +test/test_har_log_creator.py +test/test_header.py +test/test_largest_contentful_paint.py +test/test_match_criteria.py +test/test_metric.py +test/test_name_value_pair.py +test/test_page.py +test/test_page_timing.py +test/test_page_timings.py +test/test_verify_result.py +test/test_web_socket_message.py +tox.ini diff --git a/clients/python/.openapi-generator/VERSION b/clients/python/.openapi-generator/VERSION new file mode 100644 index 0000000000..5f84a81db0 --- /dev/null +++ b/clients/python/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.12.0 diff --git a/clients/python/.travis.yml b/clients/python/.travis.yml new file mode 100644 index 0000000000..018535678b --- /dev/null +++ b/clients/python/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + # uncomment the following if needed + #- "3.12-dev" # 3.12 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=BrowserUpMitmProxyClient diff --git a/clients/python/BrowserUpMitmProxyClient/__init__.py b/clients/python/BrowserUpMitmProxyClient/__init__.py new file mode 100644 index 0000000000..bdc6aed384 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/__init__.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +# flake8: noqa + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.1" + +# import apis into sdk package +from BrowserUpMitmProxyClient.api.browser_up_proxy_api import BrowserUpProxyApi + +# import ApiClient +from BrowserUpMitmProxyClient.api_response import ApiResponse +from BrowserUpMitmProxyClient.api_client import ApiClient +from BrowserUpMitmProxyClient.configuration import Configuration +from BrowserUpMitmProxyClient.exceptions import OpenApiException +from BrowserUpMitmProxyClient.exceptions import ApiTypeError +from BrowserUpMitmProxyClient.exceptions import ApiValueError +from BrowserUpMitmProxyClient.exceptions import ApiKeyError +from BrowserUpMitmProxyClient.exceptions import ApiAttributeError +from BrowserUpMitmProxyClient.exceptions import ApiException + +# import models into sdk package +from BrowserUpMitmProxyClient.models.action import Action +from BrowserUpMitmProxyClient.models.error import Error +from BrowserUpMitmProxyClient.models.har import Har +from BrowserUpMitmProxyClient.models.har_entry import HarEntry +from BrowserUpMitmProxyClient.models.har_entry_cache import HarEntryCache +from BrowserUpMitmProxyClient.models.har_entry_cache_before_request import HarEntryCacheBeforeRequest +from BrowserUpMitmProxyClient.models.har_entry_request import HarEntryRequest +from BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner import HarEntryRequestCookiesInner +from BrowserUpMitmProxyClient.models.har_entry_request_post_data import HarEntryRequestPostData +from BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner import HarEntryRequestPostDataParamsInner +from BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner import HarEntryRequestQueryStringInner +from BrowserUpMitmProxyClient.models.har_entry_response import HarEntryResponse +from BrowserUpMitmProxyClient.models.har_entry_response_content import HarEntryResponseContent +from BrowserUpMitmProxyClient.models.har_entry_timings import HarEntryTimings +from BrowserUpMitmProxyClient.models.har_log import HarLog +from BrowserUpMitmProxyClient.models.har_log_creator import HarLogCreator +from BrowserUpMitmProxyClient.models.header import Header +from BrowserUpMitmProxyClient.models.largest_contentful_paint import LargestContentfulPaint +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.metric import Metric +from BrowserUpMitmProxyClient.models.name_value_pair import NameValuePair +from BrowserUpMitmProxyClient.models.page import Page +from BrowserUpMitmProxyClient.models.page_timing import PageTiming +from BrowserUpMitmProxyClient.models.page_timings import PageTimings +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from BrowserUpMitmProxyClient.models.web_socket_message import WebSocketMessage diff --git a/clients/python/BrowserUpMitmProxyClient/api/__init__.py b/clients/python/BrowserUpMitmProxyClient/api/__init__.py new file mode 100644 index 0000000000..a800597d12 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from BrowserUpMitmProxyClient.api.browser_up_proxy_api import BrowserUpProxyApi + diff --git a/clients/python/BrowserUpMitmProxyClient/api/browser_up_proxy_api.py b/clients/python/BrowserUpMitmProxyClient/api/browser_up_proxy_api.py new file mode 100644 index 0000000000..f14076fdd3 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/api/browser_up_proxy_api.py @@ -0,0 +1,2763 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, field_validator +from typing_extensions import Annotated +from BrowserUpMitmProxyClient.models.error import Error +from BrowserUpMitmProxyClient.models.har import Har +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.metric import Metric +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult + +from BrowserUpMitmProxyClient.api_client import ApiClient, RequestSerialized +from BrowserUpMitmProxyClient.api_response import ApiResponse +from BrowserUpMitmProxyClient.rest import RESTResponseType + + +class BrowserUpProxyApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def add_error( + self, + error: Annotated[Error, Field(description="Receives an error to track. Internally, the error is stored in an array in the har under the _errors key")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """add_error + + Add Custom Error to the captured traffic har + + :param error: Receives an error to track. Internally, the error is stored in an array in the har under the _errors key (required) + :type error: Error + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_error_serialize( + error=error, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_error_with_http_info( + self, + error: Annotated[Error, Field(description="Receives an error to track. Internally, the error is stored in an array in the har under the _errors key")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """add_error + + Add Custom Error to the captured traffic har + + :param error: Receives an error to track. Internally, the error is stored in an array in the har under the _errors key (required) + :type error: Error + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_error_serialize( + error=error, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_error_without_preload_content( + self, + error: Annotated[Error, Field(description="Receives an error to track. Internally, the error is stored in an array in the har under the _errors key")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """add_error + + Add Custom Error to the captured traffic har + + :param error: Receives an error to track. Internally, the error is stored in an array in the har under the _errors key (required) + :type error: Error + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_error_serialize( + error=error, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_error_serialize( + self, + error, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if error is not None: + _body_params = error + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/har/errors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def add_metric( + self, + metric: Annotated[Metric, Field(description="Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """add_metric + + Add Custom Metric to the captured traffic har + + :param metric: Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key (required) + :type metric: Metric + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_metric_serialize( + metric=metric, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_metric_with_http_info( + self, + metric: Annotated[Metric, Field(description="Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """add_metric + + Add Custom Metric to the captured traffic har + + :param metric: Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key (required) + :type metric: Metric + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_metric_serialize( + metric=metric, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_metric_without_preload_content( + self, + metric: Annotated[Metric, Field(description="Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """add_metric + + Add Custom Metric to the captured traffic har + + :param metric: Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key (required) + :type metric: Metric + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_metric_serialize( + metric=metric, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_metric_serialize( + self, + metric, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if metric is not None: + _body_params = metric + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/har/metrics', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_har_log( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Har: + """get_har_log + + Get the current HAR. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_har_log_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_har_log_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Har]: + """get_har_log + + Get the current HAR. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_har_log_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_har_log_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_har_log + + Get the current HAR. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_har_log_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_har_log_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/har', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def healthcheck( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """healthcheck + + Get the healthcheck + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._healthcheck_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def healthcheck_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """healthcheck + + Get the healthcheck + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._healthcheck_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def healthcheck_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """healthcheck + + Get the healthcheck + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._healthcheck_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _healthcheck_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/healthcheck', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def new_page( + self, + title: Annotated[str, Field(strict=True, description="The unique title for this har page/step.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Har: + """new_page + + Starts a fresh HAR Page (Step) in the current active HAR to group requests. + + :param title: The unique title for this har page/step. (required) + :type title: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._new_page_serialize( + title=title, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def new_page_with_http_info( + self, + title: Annotated[str, Field(strict=True, description="The unique title for this har page/step.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Har]: + """new_page + + Starts a fresh HAR Page (Step) in the current active HAR to group requests. + + :param title: The unique title for this har page/step. (required) + :type title: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._new_page_serialize( + title=title, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def new_page_without_preload_content( + self, + title: Annotated[str, Field(strict=True, description="The unique title for this har page/step.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """new_page + + Starts a fresh HAR Page (Step) in the current active HAR to group requests. + + :param title: The unique title for this har page/step. (required) + :type title: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._new_page_serialize( + title=title, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _new_page_serialize( + self, + title, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if title is not None: + _path_params['title'] = title + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/har/page', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def reset_har_log( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Har: + """reset_har_log + + Starts a fresh HAR capture session. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_har_log_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def reset_har_log_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Har]: + """reset_har_log + + Starts a fresh HAR capture session. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_har_log_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def reset_har_log_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """reset_har_log + + Starts a fresh HAR capture session. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_har_log_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Har", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _reset_har_log_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/har', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def verify_not_present( + self, + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VerifyResult: + """verify_not_present + + Verify no matching items are present in the captured traffic + + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_not_present_serialize( + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def verify_not_present_with_http_info( + self, + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VerifyResult]: + """verify_not_present + + Verify no matching items are present in the captured traffic + + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_not_present_serialize( + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def verify_not_present_without_preload_content( + self, + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """verify_not_present + + Verify no matching items are present in the captured traffic + + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_not_present_serialize( + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _verify_not_present_serialize( + self, + name, + match_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if match_criteria is not None: + _body_params = match_criteria + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify/not_present/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def verify_present( + self, + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VerifyResult: + """verify_present + + Verify at least one matching item is present in the captured traffic + + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_present_serialize( + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def verify_present_with_http_info( + self, + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VerifyResult]: + """verify_present + + Verify at least one matching item is present in the captured traffic + + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_present_serialize( + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def verify_present_without_preload_content( + self, + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """verify_present + + Verify at least one matching item is present in the captured traffic + + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_present_serialize( + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _verify_present_serialize( + self, + name, + match_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if match_criteria is not None: + _body_params = match_criteria + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify/present/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def verify_size( + self, + size: Annotated[int, Field(strict=True, ge=0, description="The size used for comparison, in kilobytes")], + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VerifyResult: + """verify_size + + Verify matching items in the captured traffic meet the size criteria + + :param size: The size used for comparison, in kilobytes (required) + :type size: int + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_size_serialize( + size=size, + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def verify_size_with_http_info( + self, + size: Annotated[int, Field(strict=True, ge=0, description="The size used for comparison, in kilobytes")], + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VerifyResult]: + """verify_size + + Verify matching items in the captured traffic meet the size criteria + + :param size: The size used for comparison, in kilobytes (required) + :type size: int + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_size_serialize( + size=size, + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def verify_size_without_preload_content( + self, + size: Annotated[int, Field(strict=True, ge=0, description="The size used for comparison, in kilobytes")], + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """verify_size + + Verify matching items in the captured traffic meet the size criteria + + :param size: The size used for comparison, in kilobytes (required) + :type size: int + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_size_serialize( + size=size, + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _verify_size_serialize( + self, + size, + name, + match_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if size is not None: + _path_params['size'] = size + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if match_criteria is not None: + _body_params = match_criteria + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify/size/{size}/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def verify_sla( + self, + time: Annotated[int, Field(strict=True, ge=0, description="The time used for comparison")], + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VerifyResult: + """verify_sla + + Verify each traffic item matching the criteria meets is below SLA time + + :param time: The time used for comparison (required) + :type time: int + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_sla_serialize( + time=time, + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def verify_sla_with_http_info( + self, + time: Annotated[int, Field(strict=True, ge=0, description="The time used for comparison")], + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VerifyResult]: + """verify_sla + + Verify each traffic item matching the criteria meets is below SLA time + + :param time: The time used for comparison (required) + :type time: int + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_sla_serialize( + time=time, + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def verify_sla_without_preload_content( + self, + time: Annotated[int, Field(strict=True, ge=0, description="The time used for comparison")], + name: Annotated[str, Field(strict=True, description="The unique name for this verification operation")], + match_criteria: Annotated[MatchCriteria, Field(description="Match criteria to select requests - response pairs for size tests")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """verify_sla + + Verify each traffic item matching the criteria meets is below SLA time + + :param time: The time used for comparison (required) + :type time: int + :param name: The unique name for this verification operation (required) + :type name: str + :param match_criteria: Match criteria to select requests - response pairs for size tests (required) + :type match_criteria: MatchCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_sla_serialize( + time=time, + name=name, + match_criteria=match_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VerifyResult", + '422': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _verify_sla_serialize( + self, + time, + name, + match_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if time is not None: + _path_params['time'] = time + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if match_criteria is not None: + _body_params = match_criteria + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify/sla/{time}/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/BrowserUpMitmProxyClient/api_client.py b/clients/python/BrowserUpMitmProxyClient/api_client.py new file mode 100644 index 0000000000..44ba9211aa --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/api_client.py @@ -0,0 +1,798 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from BrowserUpMitmProxyClient.configuration import Configuration +from BrowserUpMitmProxyClient.api_response import ApiResponse, T as ApiResponseT +import BrowserUpMitmProxyClient.models +from BrowserUpMitmProxyClient import rest +from BrowserUpMitmProxyClient.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.1/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(BrowserUpMitmProxyClient.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/clients/python/BrowserUpMitmProxyClient/api_response.py b/clients/python/BrowserUpMitmProxyClient/api_response.py new file mode 100644 index 0000000000..9bc7c11f6b --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/clients/python/BrowserUpMitmProxyClient/configuration.py b/clients/python/BrowserUpMitmProxyClient/configuration.py new file mode 100644 index 0000000000..99ab2e2be7 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/configuration.py @@ -0,0 +1,582 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import http.client as httplib +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + +import urllib3 + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "http://localhost:48088" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("BrowserUpMitmProxyClient") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.25\n"\ + "SDK Package Version: 1.0.1".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://localhost:{port}", + 'description': "The development API server", + 'variables': { + 'port': { + 'description': "No description provided", + 'default_value': "48088", + 'enum_values': [ + "48088" + ] + } + } + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/clients/python/BrowserUpMitmProxyClient/exceptions.py b/clients/python/BrowserUpMitmProxyClient/exceptions.py new file mode 100644 index 0000000000..089bbfca31 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/exceptions.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/clients/python/BrowserUpMitmProxyClient/models/__init__.py b/clients/python/BrowserUpMitmProxyClient/models/__init__.py new file mode 100644 index 0000000000..0764afb5e9 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/__init__.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +# flake8: noqa +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from BrowserUpMitmProxyClient.models.action import Action +from BrowserUpMitmProxyClient.models.error import Error +from BrowserUpMitmProxyClient.models.har import Har +from BrowserUpMitmProxyClient.models.har_entry import HarEntry +from BrowserUpMitmProxyClient.models.har_entry_cache import HarEntryCache +from BrowserUpMitmProxyClient.models.har_entry_cache_before_request import HarEntryCacheBeforeRequest +from BrowserUpMitmProxyClient.models.har_entry_request import HarEntryRequest +from BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner import HarEntryRequestCookiesInner +from BrowserUpMitmProxyClient.models.har_entry_request_post_data import HarEntryRequestPostData +from BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner import HarEntryRequestPostDataParamsInner +from BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner import HarEntryRequestQueryStringInner +from BrowserUpMitmProxyClient.models.har_entry_response import HarEntryResponse +from BrowserUpMitmProxyClient.models.har_entry_response_content import HarEntryResponseContent +from BrowserUpMitmProxyClient.models.har_entry_timings import HarEntryTimings +from BrowserUpMitmProxyClient.models.har_log import HarLog +from BrowserUpMitmProxyClient.models.har_log_creator import HarLogCreator +from BrowserUpMitmProxyClient.models.header import Header +from BrowserUpMitmProxyClient.models.largest_contentful_paint import LargestContentfulPaint +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.metric import Metric +from BrowserUpMitmProxyClient.models.name_value_pair import NameValuePair +from BrowserUpMitmProxyClient.models.page import Page +from BrowserUpMitmProxyClient.models.page_timing import PageTiming +from BrowserUpMitmProxyClient.models.page_timings import PageTimings +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from BrowserUpMitmProxyClient.models.web_socket_message import WebSocketMessage diff --git a/clients/python/BrowserUpMitmProxyClient/models/action.py b/clients/python/BrowserUpMitmProxyClient/models/action.py new file mode 100644 index 0000000000..d6f6c0065e --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/action.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Action(BaseModel): + """ + Action + """ # noqa: E501 + name: Optional[StrictStr] = None + id: Optional[StrictStr] = None + class_name: Optional[StrictStr] = Field(default=None, alias="className") + tag_name: Optional[StrictStr] = Field(default=None, alias="tagName") + xpath: Optional[StrictStr] = None + data_attributes: Optional[StrictStr] = Field(default=None, alias="dataAttributes") + form_name: Optional[StrictStr] = Field(default=None, alias="formName") + content: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "id", "className", "tagName", "xpath", "dataAttributes", "formName", "content"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Action from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Action from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "id": obj.get("id"), + "className": obj.get("className"), + "tagName": obj.get("tagName"), + "xpath": obj.get("xpath"), + "dataAttributes": obj.get("dataAttributes"), + "formName": obj.get("formName"), + "content": obj.get("content") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/error.py b/clients/python/BrowserUpMitmProxyClient/models/error.py new file mode 100644 index 0000000000..be1048d0c4 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/error.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Error(BaseModel): + """ + Error + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the Error to add. Stored in har under _errors") + details: Optional[StrictStr] = Field(default=None, description="Short details of the error") + __properties: ClassVar[List[str]] = ["name", "details"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "details": obj.get("details") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har.py b/clients/python/BrowserUpMitmProxyClient/models/har.py new file mode 100644 index 0000000000..e4d190c767 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from BrowserUpMitmProxyClient.models.har_log import HarLog +from typing import Optional, Set +from typing_extensions import Self + +class Har(BaseModel): + """ + Har + """ # noqa: E501 + log: HarLog + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["log"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Har from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of log + if self.log: + _dict['log'] = self.log.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Har from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "log": HarLog.from_dict(obj["log"]) if obj.get("log") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry.py new file mode 100644 index 0000000000..68e1fb5b6e --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from BrowserUpMitmProxyClient.models.har_entry_cache import HarEntryCache +from BrowserUpMitmProxyClient.models.har_entry_request import HarEntryRequest +from BrowserUpMitmProxyClient.models.har_entry_response import HarEntryResponse +from BrowserUpMitmProxyClient.models.har_entry_timings import HarEntryTimings +from BrowserUpMitmProxyClient.models.web_socket_message import WebSocketMessage +from typing import Optional, Set +from typing_extensions import Self + +class HarEntry(BaseModel): + """ + HarEntry + """ # noqa: E501 + pageref: Optional[StrictStr] = None + started_date_time: datetime = Field(alias="startedDateTime") + time: Annotated[int, Field(strict=True, ge=0)] + request: HarEntryRequest + response: HarEntryResponse + cache: HarEntryCache + timings: HarEntryTimings + server_ip_address: Optional[StrictStr] = Field(default=None, alias="serverIPAddress") + web_socket_messages: Optional[List[WebSocketMessage]] = Field(default=None, alias="_webSocketMessages") + span_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context span ID for this entry", alias="_span_id") + parent_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context parent span ID (typically the page span ID)", alias="_parent_id") + trace_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context trace ID for distributed tracing", alias="_trace_id") + connection: Optional[StrictStr] = None + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["pageref", "startedDateTime", "time", "request", "response", "cache", "timings", "serverIPAddress", "_webSocketMessages", "_span_id", "_parent_id", "_trace_id", "connection", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of request + if self.request: + _dict['request'] = self.request.to_dict() + # override the default output from pydantic by calling `to_dict()` of response + if self.response: + _dict['response'] = self.response.to_dict() + # override the default output from pydantic by calling `to_dict()` of cache + if self.cache: + _dict['cache'] = self.cache.to_dict() + # override the default output from pydantic by calling `to_dict()` of timings + if self.timings: + _dict['timings'] = self.timings.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in web_socket_messages (list) + _items = [] + if self.web_socket_messages: + for _item_web_socket_messages in self.web_socket_messages: + if _item_web_socket_messages: + _items.append(_item_web_socket_messages.to_dict()) + _dict['_webSocketMessages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageref": obj.get("pageref"), + "startedDateTime": obj.get("startedDateTime"), + "time": obj.get("time"), + "request": HarEntryRequest.from_dict(obj["request"]) if obj.get("request") is not None else None, + "response": HarEntryResponse.from_dict(obj["response"]) if obj.get("response") is not None else None, + "cache": HarEntryCache.from_dict(obj["cache"]) if obj.get("cache") is not None else None, + "timings": HarEntryTimings.from_dict(obj["timings"]) if obj.get("timings") is not None else None, + "serverIPAddress": obj.get("serverIPAddress"), + "_webSocketMessages": [WebSocketMessage.from_dict(_item) for _item in obj["_webSocketMessages"]] if obj.get("_webSocketMessages") is not None else None, + "_span_id": obj.get("_span_id"), + "_parent_id": obj.get("_parent_id"), + "_trace_id": obj.get("_trace_id"), + "connection": obj.get("connection"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_cache.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_cache.py new file mode 100644 index 0000000000..c5234fa744 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_cache.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.har_entry_cache_before_request import HarEntryCacheBeforeRequest +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryCache(BaseModel): + """ + HarEntryCache + """ # noqa: E501 + before_request: Optional[HarEntryCacheBeforeRequest] = Field(default=None, alias="beforeRequest") + after_request: Optional[HarEntryCacheBeforeRequest] = Field(default=None, alias="afterRequest") + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["beforeRequest", "afterRequest", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryCache from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of before_request + if self.before_request: + _dict['beforeRequest'] = self.before_request.to_dict() + # override the default output from pydantic by calling `to_dict()` of after_request + if self.after_request: + _dict['afterRequest'] = self.after_request.to_dict() + # set to None if before_request (nullable) is None + # and model_fields_set contains the field + if self.before_request is None and "before_request" in self.model_fields_set: + _dict['beforeRequest'] = None + + # set to None if after_request (nullable) is None + # and model_fields_set contains the field + if self.after_request is None and "after_request" in self.model_fields_set: + _dict['afterRequest'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryCache from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "beforeRequest": HarEntryCacheBeforeRequest.from_dict(obj["beforeRequest"]) if obj.get("beforeRequest") is not None else None, + "afterRequest": HarEntryCacheBeforeRequest.from_dict(obj["afterRequest"]) if obj.get("afterRequest") is not None else None, + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_cache_before_request.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_cache_before_request.py new file mode 100644 index 0000000000..02008ce8ed --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_cache_before_request.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryCacheBeforeRequest(BaseModel): + """ + HarEntryCacheBeforeRequest + """ # noqa: E501 + expires: Optional[StrictStr] = None + last_access: StrictStr = Field(alias="lastAccess") + e_tag: StrictStr = Field(alias="eTag") + hit_count: StrictInt = Field(alias="hitCount") + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["expires", "lastAccess", "eTag", "hitCount", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryCacheBeforeRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryCacheBeforeRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expires": obj.get("expires"), + "lastAccess": obj.get("lastAccess"), + "eTag": obj.get("eTag"), + "hitCount": obj.get("hitCount"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_request.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request.py new file mode 100644 index 0000000000..80754e9447 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner import HarEntryRequestCookiesInner +from BrowserUpMitmProxyClient.models.har_entry_request_post_data import HarEntryRequestPostData +from BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner import HarEntryRequestQueryStringInner +from BrowserUpMitmProxyClient.models.header import Header +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryRequest(BaseModel): + """ + HarEntryRequest + """ # noqa: E501 + method: StrictStr + url: StrictStr + http_version: StrictStr = Field(alias="httpVersion") + cookies: List[HarEntryRequestCookiesInner] + headers: List[Header] + query_string: List[HarEntryRequestQueryStringInner] = Field(alias="queryString") + post_data: Optional[HarEntryRequestPostData] = Field(default=None, alias="postData") + headers_size: StrictInt = Field(alias="headersSize") + body_size: StrictInt = Field(alias="bodySize") + comment: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["method", "url", "httpVersion", "cookies", "headers", "queryString", "postData", "headersSize", "bodySize", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in cookies (list) + _items = [] + if self.cookies: + for _item_cookies in self.cookies: + if _item_cookies: + _items.append(_item_cookies.to_dict()) + _dict['cookies'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in headers (list) + _items = [] + if self.headers: + for _item_headers in self.headers: + if _item_headers: + _items.append(_item_headers.to_dict()) + _dict['headers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in query_string (list) + _items = [] + if self.query_string: + for _item_query_string in self.query_string: + if _item_query_string: + _items.append(_item_query_string.to_dict()) + _dict['queryString'] = _items + # override the default output from pydantic by calling `to_dict()` of post_data + if self.post_data: + _dict['postData'] = self.post_data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "method": obj.get("method"), + "url": obj.get("url"), + "httpVersion": obj.get("httpVersion"), + "cookies": [HarEntryRequestCookiesInner.from_dict(_item) for _item in obj["cookies"]] if obj.get("cookies") is not None else None, + "headers": [Header.from_dict(_item) for _item in obj["headers"]] if obj.get("headers") is not None else None, + "queryString": [HarEntryRequestQueryStringInner.from_dict(_item) for _item in obj["queryString"]] if obj.get("queryString") is not None else None, + "postData": HarEntryRequestPostData.from_dict(obj["postData"]) if obj.get("postData") is not None else None, + "headersSize": obj.get("headersSize"), + "bodySize": obj.get("bodySize"), + "comment": obj.get("comment") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_cookies_inner.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_cookies_inner.py new file mode 100644 index 0000000000..9bd3d232c1 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_cookies_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryRequestCookiesInner(BaseModel): + """ + HarEntryRequestCookiesInner + """ # noqa: E501 + name: StrictStr + value: StrictStr + path: Optional[StrictStr] = None + domain: Optional[StrictStr] = None + expires: Optional[StrictStr] = None + http_only: Optional[StrictBool] = Field(default=None, alias="httpOnly") + secure: Optional[StrictBool] = None + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "value", "path", "domain", "expires", "httpOnly", "secure", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryRequestCookiesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryRequestCookiesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "path": obj.get("path"), + "domain": obj.get("domain"), + "expires": obj.get("expires"), + "httpOnly": obj.get("httpOnly"), + "secure": obj.get("secure"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_post_data.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_post_data.py new file mode 100644 index 0000000000..6b857b8393 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_post_data.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner import HarEntryRequestPostDataParamsInner +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryRequestPostData(BaseModel): + """ + Posted data info. + """ # noqa: E501 + mime_type: StrictStr = Field(alias="mimeType") + text: Optional[StrictStr] = None + params: Optional[List[HarEntryRequestPostDataParamsInner]] = None + __properties: ClassVar[List[str]] = ["mimeType", "text", "params"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryRequestPostData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in params (list) + _items = [] + if self.params: + for _item_params in self.params: + if _item_params: + _items.append(_item_params.to_dict()) + _dict['params'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryRequestPostData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mimeType": obj.get("mimeType"), + "text": obj.get("text"), + "params": [HarEntryRequestPostDataParamsInner.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_post_data_params_inner.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_post_data_params_inner.py new file mode 100644 index 0000000000..7a71162483 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_post_data_params_inner.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryRequestPostDataParamsInner(BaseModel): + """ + HarEntryRequestPostDataParamsInner + """ # noqa: E501 + name: Optional[StrictStr] = None + value: Optional[StrictStr] = None + file_name: Optional[StrictStr] = Field(default=None, alias="fileName") + content_type: Optional[StrictStr] = Field(default=None, alias="contentType") + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "value", "fileName", "contentType", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryRequestPostDataParamsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryRequestPostDataParamsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "fileName": obj.get("fileName"), + "contentType": obj.get("contentType"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_query_string_inner.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_query_string_inner.py new file mode 100644 index 0000000000..1057f3a69a --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_request_query_string_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryRequestQueryStringInner(BaseModel): + """ + HarEntryRequestQueryStringInner + """ # noqa: E501 + name: StrictStr + value: StrictStr + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "value", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryRequestQueryStringInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryRequestQueryStringInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_response.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_response.py new file mode 100644 index 0000000000..44c2f2b22a --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_response.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner import HarEntryRequestCookiesInner +from BrowserUpMitmProxyClient.models.har_entry_response_content import HarEntryResponseContent +from BrowserUpMitmProxyClient.models.header import Header +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryResponse(BaseModel): + """ + HarEntryResponse + """ # noqa: E501 + status: StrictInt + status_text: StrictStr = Field(alias="statusText") + http_version: StrictStr = Field(alias="httpVersion") + cookies: List[HarEntryRequestCookiesInner] + headers: List[Header] + content: HarEntryResponseContent + redirect_url: StrictStr = Field(alias="redirectURL") + headers_size: StrictInt = Field(alias="headersSize") + body_size: StrictInt = Field(alias="bodySize") + comment: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status", "statusText", "httpVersion", "cookies", "headers", "content", "redirectURL", "headersSize", "bodySize", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in cookies (list) + _items = [] + if self.cookies: + for _item_cookies in self.cookies: + if _item_cookies: + _items.append(_item_cookies.to_dict()) + _dict['cookies'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in headers (list) + _items = [] + if self.headers: + for _item_headers in self.headers: + if _item_headers: + _items.append(_item_headers.to_dict()) + _dict['headers'] = _items + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "statusText": obj.get("statusText"), + "httpVersion": obj.get("httpVersion"), + "cookies": [HarEntryRequestCookiesInner.from_dict(_item) for _item in obj["cookies"]] if obj.get("cookies") is not None else None, + "headers": [Header.from_dict(_item) for _item in obj["headers"]] if obj.get("headers") is not None else None, + "content": HarEntryResponseContent.from_dict(obj["content"]) if obj.get("content") is not None else None, + "redirectURL": obj.get("redirectURL"), + "headersSize": obj.get("headersSize"), + "bodySize": obj.get("bodySize"), + "comment": obj.get("comment") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_response_content.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_response_content.py new file mode 100644 index 0000000000..8fc4cfc1cd --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_response_content.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryResponseContent(BaseModel): + """ + HarEntryResponseContent + """ # noqa: E501 + size: StrictInt + compression: Optional[StrictInt] = None + mime_type: StrictStr = Field(alias="mimeType") + text: Optional[StrictStr] = None + encoding: Optional[StrictStr] = None + video_buffered_percent: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoBufferedPercent") + video_stall_count: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoStallCount") + video_decoded_byte_count: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoDecodedByteCount") + video_waiting_count: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoWaitingCount") + video_error_count: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoErrorCount") + video_dropped_frames: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoDroppedFrames") + video_total_frames: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoTotalFrames") + video_audio_bytes_decoded: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_videoAudioBytesDecoded") + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["size", "compression", "mimeType", "text", "encoding", "_videoBufferedPercent", "_videoStallCount", "_videoDecodedByteCount", "_videoWaitingCount", "_videoErrorCount", "_videoDroppedFrames", "_videoTotalFrames", "_videoAudioBytesDecoded", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryResponseContent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryResponseContent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "size": obj.get("size"), + "compression": obj.get("compression"), + "mimeType": obj.get("mimeType"), + "text": obj.get("text"), + "encoding": obj.get("encoding"), + "_videoBufferedPercent": obj.get("_videoBufferedPercent") if obj.get("_videoBufferedPercent") is not None else -1, + "_videoStallCount": obj.get("_videoStallCount") if obj.get("_videoStallCount") is not None else -1, + "_videoDecodedByteCount": obj.get("_videoDecodedByteCount") if obj.get("_videoDecodedByteCount") is not None else -1, + "_videoWaitingCount": obj.get("_videoWaitingCount") if obj.get("_videoWaitingCount") is not None else -1, + "_videoErrorCount": obj.get("_videoErrorCount") if obj.get("_videoErrorCount") is not None else -1, + "_videoDroppedFrames": obj.get("_videoDroppedFrames") if obj.get("_videoDroppedFrames") is not None else -1, + "_videoTotalFrames": obj.get("_videoTotalFrames") if obj.get("_videoTotalFrames") is not None else -1, + "_videoAudioBytesDecoded": obj.get("_videoAudioBytesDecoded") if obj.get("_videoAudioBytesDecoded") is not None else -1, + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_entry_timings.py b/clients/python/BrowserUpMitmProxyClient/models/har_entry_timings.py new file mode 100644 index 0000000000..b56b5e41ef --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_entry_timings.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class HarEntryTimings(BaseModel): + """ + HarEntryTimings + """ # noqa: E501 + dns: Annotated[int, Field(strict=True, ge=-1)] + connect: Annotated[int, Field(strict=True, ge=-1)] + blocked: Annotated[int, Field(strict=True, ge=-1)] + send: Annotated[int, Field(strict=True, ge=-1)] + wait: Annotated[int, Field(strict=True, ge=-1)] + receive: Annotated[int, Field(strict=True, ge=-1)] + ssl: Annotated[int, Field(strict=True, ge=-1)] + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["dns", "connect", "blocked", "send", "wait", "receive", "ssl", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarEntryTimings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarEntryTimings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dns": obj.get("dns") if obj.get("dns") is not None else -1, + "connect": obj.get("connect") if obj.get("connect") is not None else -1, + "blocked": obj.get("blocked") if obj.get("blocked") is not None else -1, + "send": obj.get("send") if obj.get("send") is not None else -1, + "wait": obj.get("wait") if obj.get("wait") is not None else -1, + "receive": obj.get("receive") if obj.get("receive") is not None else -1, + "ssl": obj.get("ssl") if obj.get("ssl") is not None else -1, + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_log.py b/clients/python/BrowserUpMitmProxyClient/models/har_log.py new file mode 100644 index 0000000000..cc574f6afe --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_log.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.har_entry import HarEntry +from BrowserUpMitmProxyClient.models.har_log_creator import HarLogCreator +from BrowserUpMitmProxyClient.models.page import Page +from typing import Optional, Set +from typing_extensions import Self + +class HarLog(BaseModel): + """ + HarLog + """ # noqa: E501 + version: StrictStr + creator: HarLogCreator + browser: Optional[HarLogCreator] = None + pages: List[Page] + entries: List[HarEntry] + trace_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context trace ID for distributed tracing", alias="_trace_id") + span_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context span ID for this HAR trace root", alias="_span_id") + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["version", "creator", "browser", "pages", "entries", "_trace_id", "_span_id", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarLog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of creator + if self.creator: + _dict['creator'] = self.creator.to_dict() + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in pages (list) + _items = [] + if self.pages: + for _item_pages in self.pages: + if _item_pages: + _items.append(_item_pages.to_dict()) + _dict['pages'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in entries (list) + _items = [] + if self.entries: + for _item_entries in self.entries: + if _item_entries: + _items.append(_item_entries.to_dict()) + _dict['entries'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarLog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "version": obj.get("version"), + "creator": HarLogCreator.from_dict(obj["creator"]) if obj.get("creator") is not None else None, + "browser": HarLogCreator.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "pages": [Page.from_dict(_item) for _item in obj["pages"]] if obj.get("pages") is not None else None, + "entries": [HarEntry.from_dict(_item) for _item in obj["entries"]] if obj.get("entries") is not None else None, + "_trace_id": obj.get("_trace_id"), + "_span_id": obj.get("_span_id"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/har_log_creator.py b/clients/python/BrowserUpMitmProxyClient/models/har_log_creator.py new file mode 100644 index 0000000000..dfaabddbbd --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/har_log_creator.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HarLogCreator(BaseModel): + """ + HarLogCreator + """ # noqa: E501 + name: StrictStr + version: StrictStr + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "version", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HarLogCreator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HarLogCreator from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "version": obj.get("version"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/header.py b/clients/python/BrowserUpMitmProxyClient/models/header.py new file mode 100644 index 0000000000..82f12131ca --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/header.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Header(BaseModel): + """ + Header + """ # noqa: E501 + name: StrictStr + value: StrictStr + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "value", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Header from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Header from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "comment": obj.get("comment") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/largest_contentful_paint.py b/clients/python/BrowserUpMitmProxyClient/models/largest_contentful_paint.py new file mode 100644 index 0000000000..6ff812127f --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/largest_contentful_paint.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class LargestContentfulPaint(BaseModel): + """ + LargestContentfulPaint + """ # noqa: E501 + start_time: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="startTime") + size: Optional[Annotated[int, Field(strict=True, ge=-1)]] = -1 + dom_path: Optional[StrictStr] = Field(default='', alias="domPath") + tag: Optional[StrictStr] = '' + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["startTime", "size", "domPath", "tag"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LargestContentfulPaint from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LargestContentfulPaint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startTime": obj.get("startTime") if obj.get("startTime") is not None else -1, + "size": obj.get("size") if obj.get("size") is not None else -1, + "domPath": obj.get("domPath") if obj.get("domPath") is not None else '', + "tag": obj.get("tag") if obj.get("tag") is not None else '' + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/match_criteria.py b/clients/python/BrowserUpMitmProxyClient/models/match_criteria.py new file mode 100644 index 0000000000..c57f82e3d7 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/match_criteria.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.name_value_pair import NameValuePair +from typing import Optional, Set +from typing_extensions import Self + +class MatchCriteria(BaseModel): + """ + A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison + """ # noqa: E501 + url: Optional[StrictStr] = Field(default=None, description="Request URL regexp to match") + page: Optional[StrictStr] = Field(default=None, description="current|all") + status: Optional[StrictStr] = Field(default=None, description="HTTP Status code to match.") + content: Optional[StrictStr] = Field(default=None, description="Body content regexp content to match") + content_type: Optional[StrictStr] = Field(default=None, description="Content type") + websocket_message: Optional[StrictStr] = Field(default=None, description="Websocket message text to match") + request_header: Optional[NameValuePair] = None + request_cookie: Optional[NameValuePair] = None + response_header: Optional[NameValuePair] = None + response_cookie: Optional[NameValuePair] = None + json_valid: Optional[StrictBool] = Field(default=None, description="Is valid JSON") + json_path: Optional[StrictStr] = Field(default=None, description="Has JSON path") + json_schema: Optional[StrictStr] = Field(default=None, description="Validates against passed JSON schema") + error_if_no_traffic: Optional[StrictBool] = Field(default=True, description="If the proxy has NO traffic at all, return error") + __properties: ClassVar[List[str]] = ["url", "page", "status", "content", "content_type", "websocket_message", "request_header", "request_cookie", "response_header", "response_cookie", "json_valid", "json_path", "json_schema", "error_if_no_traffic"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchCriteria from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of request_header + if self.request_header: + _dict['request_header'] = self.request_header.to_dict() + # override the default output from pydantic by calling `to_dict()` of request_cookie + if self.request_cookie: + _dict['request_cookie'] = self.request_cookie.to_dict() + # override the default output from pydantic by calling `to_dict()` of response_header + if self.response_header: + _dict['response_header'] = self.response_header.to_dict() + # override the default output from pydantic by calling `to_dict()` of response_cookie + if self.response_cookie: + _dict['response_cookie'] = self.response_cookie.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchCriteria from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url"), + "page": obj.get("page"), + "status": obj.get("status"), + "content": obj.get("content"), + "content_type": obj.get("content_type"), + "websocket_message": obj.get("websocket_message"), + "request_header": NameValuePair.from_dict(obj["request_header"]) if obj.get("request_header") is not None else None, + "request_cookie": NameValuePair.from_dict(obj["request_cookie"]) if obj.get("request_cookie") is not None else None, + "response_header": NameValuePair.from_dict(obj["response_header"]) if obj.get("response_header") is not None else None, + "response_cookie": NameValuePair.from_dict(obj["response_cookie"]) if obj.get("response_cookie") is not None else None, + "json_valid": obj.get("json_valid"), + "json_path": obj.get("json_path"), + "json_schema": obj.get("json_schema"), + "error_if_no_traffic": obj.get("error_if_no_traffic") if obj.get("error_if_no_traffic") is not None else True + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/metric.py b/clients/python/BrowserUpMitmProxyClient/models/metric.py new file mode 100644 index 0000000000..2f49a2a189 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/metric.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Metric(BaseModel): + """ + Metric + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of Custom Metric to add to the page under _metrics") + value: Optional[StrictInt] = Field(default=None, description="Value for the metric") + __properties: ClassVar[List[str]] = ["name", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Metric from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Metric from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/name_value_pair.py b/clients/python/BrowserUpMitmProxyClient/models/name_value_pair.py new file mode 100644 index 0000000000..0c15a21879 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/name_value_pair.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NameValuePair(BaseModel): + """ + NameValuePair + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name to match") + value: Optional[StrictStr] = Field(default=None, description="Value to match") + __properties: ClassVar[List[str]] = ["name", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NameValuePair from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NameValuePair from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/page.py b/clients/python/BrowserUpMitmProxyClient/models/page.py new file mode 100644 index 0000000000..a0d2102816 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/page.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from BrowserUpMitmProxyClient.models.error import Error +from BrowserUpMitmProxyClient.models.metric import Metric +from BrowserUpMitmProxyClient.models.page_timings import PageTimings +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from typing import Optional, Set +from typing_extensions import Self + +class Page(BaseModel): + """ + Page + """ # noqa: E501 + started_date_time: datetime = Field(alias="startedDateTime") + id: StrictStr + title: StrictStr + verifications: Optional[List[VerifyResult]] = Field(default=None, alias="_verifications") + metrics: Optional[List[Metric]] = Field(default=None, alias="_metrics") + errors: Optional[List[Error]] = Field(default=None, alias="_errors") + span_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context span ID for this page", alias="_span_id") + parent_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context parent span ID (typically the HAR log span ID)", alias="_parent_id") + page_timings: PageTimings = Field(alias="pageTimings") + comment: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["startedDateTime", "id", "title", "_verifications", "_metrics", "_errors", "_span_id", "_parent_id", "pageTimings", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Page from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in verifications (list) + _items = [] + if self.verifications: + for _item_verifications in self.verifications: + if _item_verifications: + _items.append(_item_verifications.to_dict()) + _dict['_verifications'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in metrics (list) + _items = [] + if self.metrics: + for _item_metrics in self.metrics: + if _item_metrics: + _items.append(_item_metrics.to_dict()) + _dict['_metrics'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['_errors'] = _items + # override the default output from pydantic by calling `to_dict()` of page_timings + if self.page_timings: + _dict['pageTimings'] = self.page_timings.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Page from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startedDateTime": obj.get("startedDateTime"), + "id": obj.get("id"), + "title": obj.get("title"), + "_verifications": [VerifyResult.from_dict(_item) for _item in obj["_verifications"]] if obj.get("_verifications") is not None else None, + "_metrics": [Metric.from_dict(_item) for _item in obj["_metrics"]] if obj.get("_metrics") is not None else None, + "_errors": [Error.from_dict(_item) for _item in obj["_errors"]] if obj.get("_errors") is not None else None, + "_span_id": obj.get("_span_id"), + "_parent_id": obj.get("_parent_id"), + "pageTimings": PageTimings.from_dict(obj["pageTimings"]) if obj.get("pageTimings") is not None else None, + "comment": obj.get("comment") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/page_timing.py b/clients/python/BrowserUpMitmProxyClient/models/page_timing.py new file mode 100644 index 0000000000..eada665919 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/page_timing.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PageTiming(BaseModel): + """ + PageTiming + """ # noqa: E501 + on_content_load: Optional[StrictInt] = Field(default=None, description="onContentLoad per the browser", alias="onContentLoad") + on_load: Optional[StrictInt] = Field(default=None, description="onLoad per the browser", alias="onLoad") + first_input_delay: Optional[StrictInt] = Field(default=None, description="firstInputDelay from the browser", alias="_firstInputDelay") + first_paint: Optional[StrictInt] = Field(default=None, description="firstPaint from the browser", alias="_firstPaint") + cumulative_layout_shift: Optional[StrictInt] = Field(default=None, description="cumulativeLayoutShift metric from the browser", alias="_cumulativeLayoutShift") + largest_contentful_paint: Optional[StrictInt] = Field(default=None, description="largestContentfulPaint from the browser", alias="_largestContentfulPaint") + dom_interactive: Optional[StrictInt] = Field(default=None, description="domInteractive from the browser", alias="_domInteractive") + first_contentful_paint: Optional[StrictInt] = Field(default=None, description="firstContentfulPaint from the browser", alias="_firstContentfulPaint") + dns: Optional[StrictInt] = Field(default=None, description="dns lookup time from the browser", alias="_dns") + ssl: Optional[StrictInt] = Field(default=None, description="Ssl connect time from the browser", alias="_ssl") + time_to_first_byte: Optional[StrictInt] = Field(default=None, description="Time to first byte of the page's first request per the browser", alias="_timeToFirstByte") + href: Optional[StrictStr] = Field(default=None, description="Top level href, including hashtag, etc per the browser", alias="_href") + span_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context span ID for this page", alias="_span_id") + parent_id: Optional[StrictStr] = Field(default=None, description="W3C Trace Context parent span ID (typically the HAR log span ID)", alias="_parent_id") + __properties: ClassVar[List[str]] = ["onContentLoad", "onLoad", "_firstInputDelay", "_firstPaint", "_cumulativeLayoutShift", "_largestContentfulPaint", "_domInteractive", "_firstContentfulPaint", "_dns", "_ssl", "_timeToFirstByte", "_href", "_span_id", "_parent_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PageTiming from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PageTiming from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "onContentLoad": obj.get("onContentLoad"), + "onLoad": obj.get("onLoad"), + "_firstInputDelay": obj.get("_firstInputDelay"), + "_firstPaint": obj.get("_firstPaint"), + "_cumulativeLayoutShift": obj.get("_cumulativeLayoutShift"), + "_largestContentfulPaint": obj.get("_largestContentfulPaint"), + "_domInteractive": obj.get("_domInteractive"), + "_firstContentfulPaint": obj.get("_firstContentfulPaint"), + "_dns": obj.get("_dns"), + "_ssl": obj.get("_ssl"), + "_timeToFirstByte": obj.get("_timeToFirstByte"), + "_href": obj.get("_href"), + "_span_id": obj.get("_span_id"), + "_parent_id": obj.get("_parent_id") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/page_timings.py b/clients/python/BrowserUpMitmProxyClient/models/page_timings.py new file mode 100644 index 0000000000..b90486cc14 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/page_timings.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from BrowserUpMitmProxyClient.models.largest_contentful_paint import LargestContentfulPaint +from typing import Optional, Set +from typing_extensions import Self + +class PageTimings(BaseModel): + """ + PageTimings + """ # noqa: E501 + on_content_load: Annotated[int, Field(strict=True, ge=-1)] = Field(alias="onContentLoad") + on_load: Annotated[int, Field(strict=True, ge=-1)] = Field(alias="onLoad") + href: Optional[StrictStr] = Field(default='', alias="_href") + dns: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_dns") + ssl: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_ssl") + time_to_first_byte: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_timeToFirstByte") + cumulative_layout_shift: Optional[Union[Annotated[float, Field(strict=True, ge=-1)], Annotated[int, Field(strict=True, ge=-1)]]] = Field(default=-1, alias="_cumulativeLayoutShift") + largest_contentful_paint: Optional[LargestContentfulPaint] = Field(default=None, alias="_largestContentfulPaint") + first_paint: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_firstPaint") + first_input_delay: Optional[Union[Annotated[float, Field(strict=True, ge=-1)], Annotated[int, Field(strict=True, ge=-1)]]] = Field(default=-1, alias="_firstInputDelay") + dom_interactive: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_domInteractive") + first_contentful_paint: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, alias="_firstContentfulPaint") + comment: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["onContentLoad", "onLoad", "_href", "_dns", "_ssl", "_timeToFirstByte", "_cumulativeLayoutShift", "_largestContentfulPaint", "_firstPaint", "_firstInputDelay", "_domInteractive", "_firstContentfulPaint", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PageTimings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of largest_contentful_paint + if self.largest_contentful_paint: + _dict['_largestContentfulPaint'] = self.largest_contentful_paint.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PageTimings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "onContentLoad": obj.get("onContentLoad") if obj.get("onContentLoad") is not None else -1, + "onLoad": obj.get("onLoad") if obj.get("onLoad") is not None else -1, + "_href": obj.get("_href") if obj.get("_href") is not None else '', + "_dns": obj.get("_dns") if obj.get("_dns") is not None else -1, + "_ssl": obj.get("_ssl") if obj.get("_ssl") is not None else -1, + "_timeToFirstByte": obj.get("_timeToFirstByte") if obj.get("_timeToFirstByte") is not None else -1, + "_cumulativeLayoutShift": obj.get("_cumulativeLayoutShift") if obj.get("_cumulativeLayoutShift") is not None else -1, + "_largestContentfulPaint": LargestContentfulPaint.from_dict(obj["_largestContentfulPaint"]) if obj.get("_largestContentfulPaint") is not None else None, + "_firstPaint": obj.get("_firstPaint") if obj.get("_firstPaint") is not None else -1, + "_firstInputDelay": obj.get("_firstInputDelay") if obj.get("_firstInputDelay") is not None else -1, + "_domInteractive": obj.get("_domInteractive") if obj.get("_domInteractive") is not None else -1, + "_firstContentfulPaint": obj.get("_firstContentfulPaint") if obj.get("_firstContentfulPaint") is not None else -1, + "comment": obj.get("comment") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/verify_result.py b/clients/python/BrowserUpMitmProxyClient/models/verify_result.py new file mode 100644 index 0000000000..b08c91c14c --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/verify_result.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class VerifyResult(BaseModel): + """ + VerifyResult + """ # noqa: E501 + result: Optional[StrictBool] = Field(default=None, description="Result True / False") + name: Optional[StrictStr] = Field(default=None, description="Name") + type: Optional[StrictStr] = Field(default=None, description="Type") + __properties: ClassVar[List[str]] = ["result", "name", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VerifyResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VerifyResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "result": obj.get("result"), + "name": obj.get("name"), + "type": obj.get("type") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/models/web_socket_message.py b/clients/python/BrowserUpMitmProxyClient/models/web_socket_message.py new file mode 100644 index 0000000000..a1689cb09f --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/models/web_socket_message.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class WebSocketMessage(BaseModel): + """ + WebSocketMessage + """ # noqa: E501 + type: StrictStr + opcode: Union[StrictFloat, StrictInt] + data: StrictStr + time: Union[StrictFloat, StrictInt] + __properties: ClassVar[List[str]] = ["type", "opcode", "data", "time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSocketMessage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSocketMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "opcode": obj.get("opcode"), + "data": obj.get("data"), + "time": obj.get("time") + }) + return _obj + + diff --git a/clients/python/BrowserUpMitmProxyClient/py.typed b/clients/python/BrowserUpMitmProxyClient/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/clients/python/BrowserUpMitmProxyClient/rest.py b/clients/python/BrowserUpMitmProxyClient/rest.py new file mode 100644 index 0000000000..39cd482745 --- /dev/null +++ b/clients/python/BrowserUpMitmProxyClient/rest.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from BrowserUpMitmProxyClient.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/clients/python/LICENSE b/clients/python/LICENSE new file mode 100644 index 0000000000..00b2401109 --- /dev/null +++ b/clients/python/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 The Kubernetes Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/python/README.md b/clients/python/README.md new file mode 100644 index 0000000000..72c6c0b327 --- /dev/null +++ b/clients/python/README.md @@ -0,0 +1,142 @@ +# BrowserUpMitmProxyClient +___ +This is the REST API for controlling the BrowserUp MitmProxy. +The BrowserUp MitmProxy is a swiss army knife for automated testing that +captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. +___ + + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.25 +- Package version: 1.0.1 +- Generator version: 7.12.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.8+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import BrowserUpMitmProxyClient +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import BrowserUpMitmProxyClient +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + error = BrowserUpMitmProxyClient.Error() # Error | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key + + try: + api_instance.add_error(error) + except ApiException as e: + print("Exception when calling BrowserUpProxyApi->add_error: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:48088* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BrowserUpProxyApi* | [**add_error**](docs/BrowserUpProxyApi.md#add_error) | **POST** /har/errors | +*BrowserUpProxyApi* | [**add_metric**](docs/BrowserUpProxyApi.md#add_metric) | **POST** /har/metrics | +*BrowserUpProxyApi* | [**get_har_log**](docs/BrowserUpProxyApi.md#get_har_log) | **GET** /har | +*BrowserUpProxyApi* | [**healthcheck**](docs/BrowserUpProxyApi.md#healthcheck) | **GET** /healthcheck | +*BrowserUpProxyApi* | [**new_page**](docs/BrowserUpProxyApi.md#new_page) | **POST** /har/page | +*BrowserUpProxyApi* | [**reset_har_log**](docs/BrowserUpProxyApi.md#reset_har_log) | **PUT** /har | +*BrowserUpProxyApi* | [**verify_not_present**](docs/BrowserUpProxyApi.md#verify_not_present) | **POST** /verify/not_present/{name} | +*BrowserUpProxyApi* | [**verify_present**](docs/BrowserUpProxyApi.md#verify_present) | **POST** /verify/present/{name} | +*BrowserUpProxyApi* | [**verify_size**](docs/BrowserUpProxyApi.md#verify_size) | **POST** /verify/size/{size}/{name} | +*BrowserUpProxyApi* | [**verify_sla**](docs/BrowserUpProxyApi.md#verify_sla) | **POST** /verify/sla/{time}/{name} | + + +## Documentation For Models + + - [Action](docs/Action.md) + - [Error](docs/Error.md) + - [Har](docs/Har.md) + - [HarEntry](docs/HarEntry.md) + - [HarEntryCache](docs/HarEntryCache.md) + - [HarEntryCacheBeforeRequest](docs/HarEntryCacheBeforeRequest.md) + - [HarEntryRequest](docs/HarEntryRequest.md) + - [HarEntryRequestCookiesInner](docs/HarEntryRequestCookiesInner.md) + - [HarEntryRequestPostData](docs/HarEntryRequestPostData.md) + - [HarEntryRequestPostDataParamsInner](docs/HarEntryRequestPostDataParamsInner.md) + - [HarEntryRequestQueryStringInner](docs/HarEntryRequestQueryStringInner.md) + - [HarEntryResponse](docs/HarEntryResponse.md) + - [HarEntryResponseContent](docs/HarEntryResponseContent.md) + - [HarEntryTimings](docs/HarEntryTimings.md) + - [HarLog](docs/HarLog.md) + - [HarLogCreator](docs/HarLogCreator.md) + - [Header](docs/Header.md) + - [LargestContentfulPaint](docs/LargestContentfulPaint.md) + - [MatchCriteria](docs/MatchCriteria.md) + - [Metric](docs/Metric.md) + - [NameValuePair](docs/NameValuePair.md) + - [Page](docs/Page.md) + - [PageTiming](docs/PageTiming.md) + - [PageTimings](docs/PageTimings.md) + - [VerifyResult](docs/VerifyResult.md) + - [WebSocketMessage](docs/WebSocketMessage.md) + + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + +developers@browserup.com + + diff --git a/clients/python/docs/Action.md b/clients/python/docs/Action.md new file mode 100644 index 0000000000..a0105a31a7 --- /dev/null +++ b/clients/python/docs/Action.md @@ -0,0 +1,36 @@ +# Action + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**id** | **str** | | [optional] +**class_name** | **str** | | [optional] +**tag_name** | **str** | | [optional] +**xpath** | **str** | | [optional] +**data_attributes** | **str** | | [optional] +**form_name** | **str** | | [optional] +**content** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.action import Action + +# TODO update the JSON string below +json = "{}" +# create an instance of Action from a JSON string +action_instance = Action.from_json(json) +# print the JSON string representation of the object +print(Action.to_json()) + +# convert the object into a dict +action_dict = action_instance.to_dict() +# create an instance of Action from a dict +action_from_dict = Action.from_dict(action_dict) +``` +[[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/clients/python/docs/BrowserUpProxyApi.md b/clients/python/docs/BrowserUpProxyApi.md new file mode 100644 index 0000000000..b09b18296a --- /dev/null +++ b/clients/python/docs/BrowserUpProxyApi.md @@ -0,0 +1,671 @@ +# BrowserUpMitmProxyClient.BrowserUpProxyApi + +All URIs are relative to *http://localhost:48088* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_error**](BrowserUpProxyApi.md#add_error) | **POST** /har/errors | +[**add_metric**](BrowserUpProxyApi.md#add_metric) | **POST** /har/metrics | +[**get_har_log**](BrowserUpProxyApi.md#get_har_log) | **GET** /har | +[**healthcheck**](BrowserUpProxyApi.md#healthcheck) | **GET** /healthcheck | +[**new_page**](BrowserUpProxyApi.md#new_page) | **POST** /har/page | +[**reset_har_log**](BrowserUpProxyApi.md#reset_har_log) | **PUT** /har | +[**verify_not_present**](BrowserUpProxyApi.md#verify_not_present) | **POST** /verify/not_present/{name} | +[**verify_present**](BrowserUpProxyApi.md#verify_present) | **POST** /verify/present/{name} | +[**verify_size**](BrowserUpProxyApi.md#verify_size) | **POST** /verify/size/{size}/{name} | +[**verify_sla**](BrowserUpProxyApi.md#verify_sla) | **POST** /verify/sla/{time}/{name} | + + +# **add_error** +> add_error(error) + +Add Custom Error to the captured traffic har + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.error import Error +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + error = BrowserUpMitmProxyClient.Error() # Error | Receives an error to track. Internally, the error is stored in an array in the har under the _errors key + + try: + api_instance.add_error(error) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->add_error: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **error** | [**Error**](Error.md)| Receives an error to track. Internally, the error is stored in an array in the har under the _errors key | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | The Error was added. | - | +**422** | The Error was invalid. | - | + +[[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) + +# **add_metric** +> add_metric(metric) + +Add Custom Metric to the captured traffic har + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.metric import Metric +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + metric = BrowserUpMitmProxyClient.Metric() # Metric | Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key + + try: + api_instance.add_metric(metric) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->add_metric: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **metric** | [**Metric**](Metric.md)| Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | The metric was added. | - | +**422** | The metric was invalid. | - | + +[[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) + +# **get_har_log** +> Har get_har_log() + +Get the current HAR. + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.har import Har +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + + try: + api_response = api_instance.get_har_log() + print("The response of BrowserUpProxyApi->get_har_log:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->get_har_log: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Har**](Har.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The current Har file. | - | + +[[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) + +# **healthcheck** +> healthcheck() + +Get the healthcheck + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + + try: + api_instance.healthcheck() + except Exception as e: + print("Exception when calling BrowserUpProxyApi->healthcheck: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK means all is well. | - | + +[[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) + +# **new_page** +> Har new_page(title) + +Starts a fresh HAR Page (Step) in the current active HAR to group requests. + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.har import Har +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + title = 'title_example' # str | The unique title for this har page/step. + + try: + api_response = api_instance.new_page(title) + print("The response of BrowserUpProxyApi->new_page:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->new_page: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **title** | **str**| The unique title for this har page/step. | + +### Return type + +[**Har**](Har.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The current Har file. | - | + +[[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) + +# **reset_har_log** +> Har reset_har_log() + +Starts a fresh HAR capture session. + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.har import Har +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + + try: + api_response = api_instance.reset_har_log() + print("The response of BrowserUpProxyApi->reset_har_log:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->reset_har_log: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Har**](Har.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The current Har file. | - | + +[[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) + +# **verify_not_present** +> VerifyResult verify_not_present(name, match_criteria) + +Verify no matching items are present in the captured traffic + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + name = 'name_example' # str | The unique name for this verification operation + match_criteria = BrowserUpMitmProxyClient.MatchCriteria() # MatchCriteria | Match criteria to select requests - response pairs for size tests + + try: + api_response = api_instance.verify_not_present(name, match_criteria) + print("The response of BrowserUpProxyApi->verify_not_present:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->verify_not_present: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The unique name for this verification operation | + **match_criteria** | [**MatchCriteria**](MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The traffic had no matching items | - | +**422** | The MatchCriteria are invalid. | - | + +[[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) + +# **verify_present** +> VerifyResult verify_present(name, match_criteria) + +Verify at least one matching item is present in the captured traffic + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + name = 'name_example' # str | The unique name for this verification operation + match_criteria = BrowserUpMitmProxyClient.MatchCriteria() # MatchCriteria | Match criteria to select requests - response pairs for size tests + + try: + api_response = api_instance.verify_present(name, match_criteria) + print("The response of BrowserUpProxyApi->verify_present:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->verify_present: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The unique name for this verification operation | + **match_criteria** | [**MatchCriteria**](MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The traffic conformed to the time criteria. | - | +**422** | The MatchCriteria are invalid. | - | + +[[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) + +# **verify_size** +> VerifyResult verify_size(size, name, match_criteria) + +Verify matching items in the captured traffic meet the size criteria + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + size = 56 # int | The size used for comparison, in kilobytes + name = 'name_example' # str | The unique name for this verification operation + match_criteria = BrowserUpMitmProxyClient.MatchCriteria() # MatchCriteria | Match criteria to select requests - response pairs for size tests + + try: + api_response = api_instance.verify_size(size, name, match_criteria) + print("The response of BrowserUpProxyApi->verify_size:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->verify_size: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **size** | **int**| The size used for comparison, in kilobytes | + **name** | **str**| The unique name for this verification operation | + **match_criteria** | [**MatchCriteria**](MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The traffic conformed to the size criteria. | - | +**422** | The MatchCriteria are invalid. | - | + +[[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) + +# **verify_sla** +> VerifyResult verify_sla(time, name, match_criteria) + +Verify each traffic item matching the criteria meets is below SLA time + +### Example + + +```python +import BrowserUpMitmProxyClient +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult +from BrowserUpMitmProxyClient.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:48088 +# See configuration.py for a list of all supported configuration parameters. +configuration = BrowserUpMitmProxyClient.Configuration( + host = "http://localhost:48088" +) + + +# Enter a context with an instance of the API client +with BrowserUpMitmProxyClient.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = BrowserUpMitmProxyClient.BrowserUpProxyApi(api_client) + time = 56 # int | The time used for comparison + name = 'name_example' # str | The unique name for this verification operation + match_criteria = BrowserUpMitmProxyClient.MatchCriteria() # MatchCriteria | Match criteria to select requests - response pairs for size tests + + try: + api_response = api_instance.verify_sla(time, name, match_criteria) + print("The response of BrowserUpProxyApi->verify_sla:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BrowserUpProxyApi->verify_sla: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **time** | **int**| The time used for comparison | + **name** | **str**| The unique name for this verification operation | + **match_criteria** | [**MatchCriteria**](MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | + +### Return type + +[**VerifyResult**](VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The traffic conformed to the time criteria. | - | +**422** | The MatchCriteria are invalid. | - | + +[[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/clients/python/docs/Error.md b/clients/python/docs/Error.md new file mode 100644 index 0000000000..be0edef16a --- /dev/null +++ b/clients/python/docs/Error.md @@ -0,0 +1,30 @@ +# Error + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the Error to add. Stored in har under _errors | [optional] +**details** | **str** | Short details of the error | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print(Error.to_json()) + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_from_dict = Error.from_dict(error_dict) +``` +[[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/clients/python/docs/Har.md b/clients/python/docs/Har.md new file mode 100644 index 0000000000..0121a11e92 --- /dev/null +++ b/clients/python/docs/Har.md @@ -0,0 +1,29 @@ +# Har + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**log** | [**HarLog**](HarLog.md) | | + +## Example + +```python +from BrowserUpMitmProxyClient.models.har import Har + +# TODO update the JSON string below +json = "{}" +# create an instance of Har from a JSON string +har_instance = Har.from_json(json) +# print the JSON string representation of the object +print(Har.to_json()) + +# convert the object into a dict +har_dict = har_instance.to_dict() +# create an instance of Har from a dict +har_from_dict = Har.from_dict(har_dict) +``` +[[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/clients/python/docs/HarEntry.md b/clients/python/docs/HarEntry.md new file mode 100644 index 0000000000..0d9cd27c75 --- /dev/null +++ b/clients/python/docs/HarEntry.md @@ -0,0 +1,42 @@ +# HarEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pageref** | **str** | | [optional] +**started_date_time** | **datetime** | | +**time** | **int** | | +**request** | [**HarEntryRequest**](HarEntryRequest.md) | | +**response** | [**HarEntryResponse**](HarEntryResponse.md) | | +**cache** | [**HarEntryCache**](HarEntryCache.md) | | +**timings** | [**HarEntryTimings**](HarEntryTimings.md) | | +**server_ip_address** | **str** | | [optional] +**web_socket_messages** | [**List[WebSocketMessage]**](WebSocketMessage.md) | | [optional] +**span_id** | **str** | W3C Trace Context span ID for this entry | [optional] +**parent_id** | **str** | W3C Trace Context parent span ID (typically the page span ID) | [optional] +**trace_id** | **str** | W3C Trace Context trace ID for distributed tracing | [optional] +**connection** | **str** | | [optional] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry import HarEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntry from a JSON string +har_entry_instance = HarEntry.from_json(json) +# print the JSON string representation of the object +print(HarEntry.to_json()) + +# convert the object into a dict +har_entry_dict = har_entry_instance.to_dict() +# create an instance of HarEntry from a dict +har_entry_from_dict = HarEntry.from_dict(har_entry_dict) +``` +[[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/clients/python/docs/HarEntryCache.md b/clients/python/docs/HarEntryCache.md new file mode 100644 index 0000000000..4694dfb5ae --- /dev/null +++ b/clients/python/docs/HarEntryCache.md @@ -0,0 +1,31 @@ +# HarEntryCache + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**before_request** | [**HarEntryCacheBeforeRequest**](HarEntryCacheBeforeRequest.md) | | [optional] +**after_request** | [**HarEntryCacheBeforeRequest**](HarEntryCacheBeforeRequest.md) | | [optional] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_cache import HarEntryCache + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryCache from a JSON string +har_entry_cache_instance = HarEntryCache.from_json(json) +# print the JSON string representation of the object +print(HarEntryCache.to_json()) + +# convert the object into a dict +har_entry_cache_dict = har_entry_cache_instance.to_dict() +# create an instance of HarEntryCache from a dict +har_entry_cache_from_dict = HarEntryCache.from_dict(har_entry_cache_dict) +``` +[[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/clients/python/docs/HarEntryCacheBeforeRequest.md b/clients/python/docs/HarEntryCacheBeforeRequest.md new file mode 100644 index 0000000000..0b32f30ffd --- /dev/null +++ b/clients/python/docs/HarEntryCacheBeforeRequest.md @@ -0,0 +1,33 @@ +# HarEntryCacheBeforeRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expires** | **str** | | [optional] +**last_access** | **str** | | +**e_tag** | **str** | | +**hit_count** | **int** | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_cache_before_request import HarEntryCacheBeforeRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryCacheBeforeRequest from a JSON string +har_entry_cache_before_request_instance = HarEntryCacheBeforeRequest.from_json(json) +# print the JSON string representation of the object +print(HarEntryCacheBeforeRequest.to_json()) + +# convert the object into a dict +har_entry_cache_before_request_dict = har_entry_cache_before_request_instance.to_dict() +# create an instance of HarEntryCacheBeforeRequest from a dict +har_entry_cache_before_request_from_dict = HarEntryCacheBeforeRequest.from_dict(har_entry_cache_before_request_dict) +``` +[[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/clients/python/docs/HarEntryRequest.md b/clients/python/docs/HarEntryRequest.md new file mode 100644 index 0000000000..fd14a5075d --- /dev/null +++ b/clients/python/docs/HarEntryRequest.md @@ -0,0 +1,38 @@ +# HarEntryRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**method** | **str** | | +**url** | **str** | | +**http_version** | **str** | | +**cookies** | [**List[HarEntryRequestCookiesInner]**](HarEntryRequestCookiesInner.md) | | +**headers** | [**List[Header]**](Header.md) | | +**query_string** | [**List[HarEntryRequestQueryStringInner]**](HarEntryRequestQueryStringInner.md) | | +**post_data** | [**HarEntryRequestPostData**](HarEntryRequestPostData.md) | | [optional] +**headers_size** | **int** | | +**body_size** | **int** | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_request import HarEntryRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryRequest from a JSON string +har_entry_request_instance = HarEntryRequest.from_json(json) +# print the JSON string representation of the object +print(HarEntryRequest.to_json()) + +# convert the object into a dict +har_entry_request_dict = har_entry_request_instance.to_dict() +# create an instance of HarEntryRequest from a dict +har_entry_request_from_dict = HarEntryRequest.from_dict(har_entry_request_dict) +``` +[[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/clients/python/docs/HarEntryRequestCookiesInner.md b/clients/python/docs/HarEntryRequestCookiesInner.md new file mode 100644 index 0000000000..80f8740c5b --- /dev/null +++ b/clients/python/docs/HarEntryRequestCookiesInner.md @@ -0,0 +1,36 @@ +# HarEntryRequestCookiesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**value** | **str** | | +**path** | **str** | | [optional] +**domain** | **str** | | [optional] +**expires** | **str** | | [optional] +**http_only** | **bool** | | [optional] +**secure** | **bool** | | [optional] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner import HarEntryRequestCookiesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryRequestCookiesInner from a JSON string +har_entry_request_cookies_inner_instance = HarEntryRequestCookiesInner.from_json(json) +# print the JSON string representation of the object +print(HarEntryRequestCookiesInner.to_json()) + +# convert the object into a dict +har_entry_request_cookies_inner_dict = har_entry_request_cookies_inner_instance.to_dict() +# create an instance of HarEntryRequestCookiesInner from a dict +har_entry_request_cookies_inner_from_dict = HarEntryRequestCookiesInner.from_dict(har_entry_request_cookies_inner_dict) +``` +[[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/clients/python/docs/HarEntryRequestPostData.md b/clients/python/docs/HarEntryRequestPostData.md new file mode 100644 index 0000000000..d2a0624e83 --- /dev/null +++ b/clients/python/docs/HarEntryRequestPostData.md @@ -0,0 +1,32 @@ +# HarEntryRequestPostData + +Posted data info. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mime_type** | **str** | | +**text** | **str** | | [optional] +**params** | [**List[HarEntryRequestPostDataParamsInner]**](HarEntryRequestPostDataParamsInner.md) | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_request_post_data import HarEntryRequestPostData + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryRequestPostData from a JSON string +har_entry_request_post_data_instance = HarEntryRequestPostData.from_json(json) +# print the JSON string representation of the object +print(HarEntryRequestPostData.to_json()) + +# convert the object into a dict +har_entry_request_post_data_dict = har_entry_request_post_data_instance.to_dict() +# create an instance of HarEntryRequestPostData from a dict +har_entry_request_post_data_from_dict = HarEntryRequestPostData.from_dict(har_entry_request_post_data_dict) +``` +[[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/clients/python/docs/HarEntryRequestPostDataParamsInner.md b/clients/python/docs/HarEntryRequestPostDataParamsInner.md new file mode 100644 index 0000000000..b2f72880bc --- /dev/null +++ b/clients/python/docs/HarEntryRequestPostDataParamsInner.md @@ -0,0 +1,33 @@ +# HarEntryRequestPostDataParamsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**value** | **str** | | [optional] +**file_name** | **str** | | [optional] +**content_type** | **str** | | [optional] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner import HarEntryRequestPostDataParamsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryRequestPostDataParamsInner from a JSON string +har_entry_request_post_data_params_inner_instance = HarEntryRequestPostDataParamsInner.from_json(json) +# print the JSON string representation of the object +print(HarEntryRequestPostDataParamsInner.to_json()) + +# convert the object into a dict +har_entry_request_post_data_params_inner_dict = har_entry_request_post_data_params_inner_instance.to_dict() +# create an instance of HarEntryRequestPostDataParamsInner from a dict +har_entry_request_post_data_params_inner_from_dict = HarEntryRequestPostDataParamsInner.from_dict(har_entry_request_post_data_params_inner_dict) +``` +[[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/clients/python/docs/HarEntryRequestQueryStringInner.md b/clients/python/docs/HarEntryRequestQueryStringInner.md new file mode 100644 index 0000000000..6cffb93b5e --- /dev/null +++ b/clients/python/docs/HarEntryRequestQueryStringInner.md @@ -0,0 +1,31 @@ +# HarEntryRequestQueryStringInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**value** | **str** | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner import HarEntryRequestQueryStringInner + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryRequestQueryStringInner from a JSON string +har_entry_request_query_string_inner_instance = HarEntryRequestQueryStringInner.from_json(json) +# print the JSON string representation of the object +print(HarEntryRequestQueryStringInner.to_json()) + +# convert the object into a dict +har_entry_request_query_string_inner_dict = har_entry_request_query_string_inner_instance.to_dict() +# create an instance of HarEntryRequestQueryStringInner from a dict +har_entry_request_query_string_inner_from_dict = HarEntryRequestQueryStringInner.from_dict(har_entry_request_query_string_inner_dict) +``` +[[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/clients/python/docs/HarEntryResponse.md b/clients/python/docs/HarEntryResponse.md new file mode 100644 index 0000000000..e3f4f27d8f --- /dev/null +++ b/clients/python/docs/HarEntryResponse.md @@ -0,0 +1,38 @@ +# HarEntryResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **int** | | +**status_text** | **str** | | +**http_version** | **str** | | +**cookies** | [**List[HarEntryRequestCookiesInner]**](HarEntryRequestCookiesInner.md) | | +**headers** | [**List[Header]**](Header.md) | | +**content** | [**HarEntryResponseContent**](HarEntryResponseContent.md) | | +**redirect_url** | **str** | | +**headers_size** | **int** | | +**body_size** | **int** | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_response import HarEntryResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryResponse from a JSON string +har_entry_response_instance = HarEntryResponse.from_json(json) +# print the JSON string representation of the object +print(HarEntryResponse.to_json()) + +# convert the object into a dict +har_entry_response_dict = har_entry_response_instance.to_dict() +# create an instance of HarEntryResponse from a dict +har_entry_response_from_dict = HarEntryResponse.from_dict(har_entry_response_dict) +``` +[[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/clients/python/docs/HarEntryResponseContent.md b/clients/python/docs/HarEntryResponseContent.md new file mode 100644 index 0000000000..0262809dd4 --- /dev/null +++ b/clients/python/docs/HarEntryResponseContent.md @@ -0,0 +1,42 @@ +# HarEntryResponseContent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | +**compression** | **int** | | [optional] +**mime_type** | **str** | | +**text** | **str** | | [optional] +**encoding** | **str** | | [optional] +**video_buffered_percent** | **int** | | [optional] [default to -1] +**video_stall_count** | **int** | | [optional] [default to -1] +**video_decoded_byte_count** | **int** | | [optional] [default to -1] +**video_waiting_count** | **int** | | [optional] [default to -1] +**video_error_count** | **int** | | [optional] [default to -1] +**video_dropped_frames** | **int** | | [optional] [default to -1] +**video_total_frames** | **int** | | [optional] [default to -1] +**video_audio_bytes_decoded** | **int** | | [optional] [default to -1] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_response_content import HarEntryResponseContent + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryResponseContent from a JSON string +har_entry_response_content_instance = HarEntryResponseContent.from_json(json) +# print the JSON string representation of the object +print(HarEntryResponseContent.to_json()) + +# convert the object into a dict +har_entry_response_content_dict = har_entry_response_content_instance.to_dict() +# create an instance of HarEntryResponseContent from a dict +har_entry_response_content_from_dict = HarEntryResponseContent.from_dict(har_entry_response_content_dict) +``` +[[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/clients/python/docs/HarEntryTimings.md b/clients/python/docs/HarEntryTimings.md new file mode 100644 index 0000000000..391abcd4b1 --- /dev/null +++ b/clients/python/docs/HarEntryTimings.md @@ -0,0 +1,36 @@ +# HarEntryTimings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dns** | **int** | | [default to -1] +**connect** | **int** | | [default to -1] +**blocked** | **int** | | [default to -1] +**send** | **int** | | [default to -1] +**wait** | **int** | | [default to -1] +**receive** | **int** | | [default to -1] +**ssl** | **int** | | [default to -1] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_entry_timings import HarEntryTimings + +# TODO update the JSON string below +json = "{}" +# create an instance of HarEntryTimings from a JSON string +har_entry_timings_instance = HarEntryTimings.from_json(json) +# print the JSON string representation of the object +print(HarEntryTimings.to_json()) + +# convert the object into a dict +har_entry_timings_dict = har_entry_timings_instance.to_dict() +# create an instance of HarEntryTimings from a dict +har_entry_timings_from_dict = HarEntryTimings.from_dict(har_entry_timings_dict) +``` +[[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/clients/python/docs/HarLog.md b/clients/python/docs/HarLog.md new file mode 100644 index 0000000000..966ac29ac3 --- /dev/null +++ b/clients/python/docs/HarLog.md @@ -0,0 +1,36 @@ +# HarLog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **str** | | +**creator** | [**HarLogCreator**](HarLogCreator.md) | | +**browser** | [**HarLogCreator**](HarLogCreator.md) | | [optional] +**pages** | [**List[Page]**](Page.md) | | +**entries** | [**List[HarEntry]**](HarEntry.md) | | +**trace_id** | **str** | W3C Trace Context trace ID for distributed tracing | [optional] +**span_id** | **str** | W3C Trace Context span ID for this HAR trace root | [optional] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_log import HarLog + +# TODO update the JSON string below +json = "{}" +# create an instance of HarLog from a JSON string +har_log_instance = HarLog.from_json(json) +# print the JSON string representation of the object +print(HarLog.to_json()) + +# convert the object into a dict +har_log_dict = har_log_instance.to_dict() +# create an instance of HarLog from a dict +har_log_from_dict = HarLog.from_dict(har_log_dict) +``` +[[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/clients/python/docs/HarLogCreator.md b/clients/python/docs/HarLogCreator.md new file mode 100644 index 0000000000..7aa21d4837 --- /dev/null +++ b/clients/python/docs/HarLogCreator.md @@ -0,0 +1,31 @@ +# HarLogCreator + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**version** | **str** | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.har_log_creator import HarLogCreator + +# TODO update the JSON string below +json = "{}" +# create an instance of HarLogCreator from a JSON string +har_log_creator_instance = HarLogCreator.from_json(json) +# print the JSON string representation of the object +print(HarLogCreator.to_json()) + +# convert the object into a dict +har_log_creator_dict = har_log_creator_instance.to_dict() +# create an instance of HarLogCreator from a dict +har_log_creator_from_dict = HarLogCreator.from_dict(har_log_creator_dict) +``` +[[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/clients/python/docs/Header.md b/clients/python/docs/Header.md new file mode 100644 index 0000000000..f2ec0b75da --- /dev/null +++ b/clients/python/docs/Header.md @@ -0,0 +1,31 @@ +# Header + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**value** | **str** | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.header import Header + +# TODO update the JSON string below +json = "{}" +# create an instance of Header from a JSON string +header_instance = Header.from_json(json) +# print the JSON string representation of the object +print(Header.to_json()) + +# convert the object into a dict +header_dict = header_instance.to_dict() +# create an instance of Header from a dict +header_from_dict = Header.from_dict(header_dict) +``` +[[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/clients/python/docs/LargestContentfulPaint.md b/clients/python/docs/LargestContentfulPaint.md new file mode 100644 index 0000000000..b538a3849e --- /dev/null +++ b/clients/python/docs/LargestContentfulPaint.md @@ -0,0 +1,32 @@ +# LargestContentfulPaint + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_time** | **int** | | [optional] [default to -1] +**size** | **int** | | [optional] [default to -1] +**dom_path** | **str** | | [optional] [default to ''] +**tag** | **str** | | [optional] [default to ''] + +## Example + +```python +from BrowserUpMitmProxyClient.models.largest_contentful_paint import LargestContentfulPaint + +# TODO update the JSON string below +json = "{}" +# create an instance of LargestContentfulPaint from a JSON string +largest_contentful_paint_instance = LargestContentfulPaint.from_json(json) +# print the JSON string representation of the object +print(LargestContentfulPaint.to_json()) + +# convert the object into a dict +largest_contentful_paint_dict = largest_contentful_paint_instance.to_dict() +# create an instance of LargestContentfulPaint from a dict +largest_contentful_paint_from_dict = LargestContentfulPaint.from_dict(largest_contentful_paint_dict) +``` +[[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/clients/python/docs/MatchCriteria.md b/clients/python/docs/MatchCriteria.md new file mode 100644 index 0000000000..36415081a7 --- /dev/null +++ b/clients/python/docs/MatchCriteria.md @@ -0,0 +1,43 @@ +# MatchCriteria + +A set of criteria for filtering HTTP Requests and Responses. Criteria are AND based, and use python regular expressions for string comparison + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Request URL regexp to match | [optional] +**page** | **str** | current|all | [optional] +**status** | **str** | HTTP Status code to match. | [optional] +**content** | **str** | Body content regexp content to match | [optional] +**content_type** | **str** | Content type | [optional] +**websocket_message** | **str** | Websocket message text to match | [optional] +**request_header** | [**NameValuePair**](NameValuePair.md) | | [optional] +**request_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] +**response_header** | [**NameValuePair**](NameValuePair.md) | | [optional] +**response_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] +**json_valid** | **bool** | Is valid JSON | [optional] +**json_path** | **str** | Has JSON path | [optional] +**json_schema** | **str** | Validates against passed JSON schema | [optional] +**error_if_no_traffic** | **bool** | If the proxy has NO traffic at all, return error | [optional] [default to True] + +## Example + +```python +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria + +# TODO update the JSON string below +json = "{}" +# create an instance of MatchCriteria from a JSON string +match_criteria_instance = MatchCriteria.from_json(json) +# print the JSON string representation of the object +print(MatchCriteria.to_json()) + +# convert the object into a dict +match_criteria_dict = match_criteria_instance.to_dict() +# create an instance of MatchCriteria from a dict +match_criteria_from_dict = MatchCriteria.from_dict(match_criteria_dict) +``` +[[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/clients/python/docs/Metric.md b/clients/python/docs/Metric.md new file mode 100644 index 0000000000..330153849a --- /dev/null +++ b/clients/python/docs/Metric.md @@ -0,0 +1,30 @@ +# Metric + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of Custom Metric to add to the page under _metrics | [optional] +**value** | **int** | Value for the metric | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.metric import Metric + +# TODO update the JSON string below +json = "{}" +# create an instance of Metric from a JSON string +metric_instance = Metric.from_json(json) +# print the JSON string representation of the object +print(Metric.to_json()) + +# convert the object into a dict +metric_dict = metric_instance.to_dict() +# create an instance of Metric from a dict +metric_from_dict = Metric.from_dict(metric_dict) +``` +[[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/clients/python/docs/NameValuePair.md b/clients/python/docs/NameValuePair.md new file mode 100644 index 0000000000..4320c98d3f --- /dev/null +++ b/clients/python/docs/NameValuePair.md @@ -0,0 +1,30 @@ +# NameValuePair + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name to match | [optional] +**value** | **str** | Value to match | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.name_value_pair import NameValuePair + +# TODO update the JSON string below +json = "{}" +# create an instance of NameValuePair from a JSON string +name_value_pair_instance = NameValuePair.from_json(json) +# print the JSON string representation of the object +print(NameValuePair.to_json()) + +# convert the object into a dict +name_value_pair_dict = name_value_pair_instance.to_dict() +# create an instance of NameValuePair from a dict +name_value_pair_from_dict = NameValuePair.from_dict(name_value_pair_dict) +``` +[[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/clients/python/docs/Page.md b/clients/python/docs/Page.md new file mode 100644 index 0000000000..7345653922 --- /dev/null +++ b/clients/python/docs/Page.md @@ -0,0 +1,38 @@ +# Page + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**started_date_time** | **datetime** | | +**id** | **str** | | +**title** | **str** | | +**verifications** | [**List[VerifyResult]**](VerifyResult.md) | | [optional] [default to []] +**metrics** | [**List[Metric]**](Metric.md) | | [optional] [default to []] +**errors** | [**List[Error]**](Error.md) | | [optional] [default to []] +**span_id** | **str** | W3C Trace Context span ID for this page | [optional] +**parent_id** | **str** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] +**page_timings** | [**PageTimings**](PageTimings.md) | | +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.page import Page + +# TODO update the JSON string below +json = "{}" +# create an instance of Page from a JSON string +page_instance = Page.from_json(json) +# print the JSON string representation of the object +print(Page.to_json()) + +# convert the object into a dict +page_dict = page_instance.to_dict() +# create an instance of Page from a dict +page_from_dict = Page.from_dict(page_dict) +``` +[[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/clients/python/docs/PageTiming.md b/clients/python/docs/PageTiming.md new file mode 100644 index 0000000000..fcb1997ec0 --- /dev/null +++ b/clients/python/docs/PageTiming.md @@ -0,0 +1,42 @@ +# PageTiming + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**on_content_load** | **int** | onContentLoad per the browser | [optional] +**on_load** | **int** | onLoad per the browser | [optional] +**first_input_delay** | **int** | firstInputDelay from the browser | [optional] +**first_paint** | **int** | firstPaint from the browser | [optional] +**cumulative_layout_shift** | **int** | cumulativeLayoutShift metric from the browser | [optional] +**largest_contentful_paint** | **int** | largestContentfulPaint from the browser | [optional] +**dom_interactive** | **int** | domInteractive from the browser | [optional] +**first_contentful_paint** | **int** | firstContentfulPaint from the browser | [optional] +**dns** | **int** | dns lookup time from the browser | [optional] +**ssl** | **int** | Ssl connect time from the browser | [optional] +**time_to_first_byte** | **int** | Time to first byte of the page's first request per the browser | [optional] +**href** | **str** | Top level href, including hashtag, etc per the browser | [optional] +**span_id** | **str** | W3C Trace Context span ID for this page | [optional] +**parent_id** | **str** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.page_timing import PageTiming + +# TODO update the JSON string below +json = "{}" +# create an instance of PageTiming from a JSON string +page_timing_instance = PageTiming.from_json(json) +# print the JSON string representation of the object +print(PageTiming.to_json()) + +# convert the object into a dict +page_timing_dict = page_timing_instance.to_dict() +# create an instance of PageTiming from a dict +page_timing_from_dict = PageTiming.from_dict(page_timing_dict) +``` +[[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/clients/python/docs/PageTimings.md b/clients/python/docs/PageTimings.md new file mode 100644 index 0000000000..ddb163017b --- /dev/null +++ b/clients/python/docs/PageTimings.md @@ -0,0 +1,41 @@ +# PageTimings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**on_content_load** | **int** | | [default to -1] +**on_load** | **int** | | [default to -1] +**href** | **str** | | [optional] [default to ''] +**dns** | **int** | | [optional] [default to -1] +**ssl** | **int** | | [optional] [default to -1] +**time_to_first_byte** | **int** | | [optional] [default to -1] +**cumulative_layout_shift** | **float** | | [optional] [default to -1] +**largest_contentful_paint** | [**LargestContentfulPaint**](LargestContentfulPaint.md) | | [optional] +**first_paint** | **int** | | [optional] [default to -1] +**first_input_delay** | **float** | | [optional] [default to -1] +**dom_interactive** | **int** | | [optional] [default to -1] +**first_contentful_paint** | **int** | | [optional] [default to -1] +**comment** | **str** | | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.page_timings import PageTimings + +# TODO update the JSON string below +json = "{}" +# create an instance of PageTimings from a JSON string +page_timings_instance = PageTimings.from_json(json) +# print the JSON string representation of the object +print(PageTimings.to_json()) + +# convert the object into a dict +page_timings_dict = page_timings_instance.to_dict() +# create an instance of PageTimings from a dict +page_timings_from_dict = PageTimings.from_dict(page_timings_dict) +``` +[[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/clients/python/docs/VerifyResult.md b/clients/python/docs/VerifyResult.md new file mode 100644 index 0000000000..fbba4bb96f --- /dev/null +++ b/clients/python/docs/VerifyResult.md @@ -0,0 +1,31 @@ +# VerifyResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | Result True / False | [optional] +**name** | **str** | Name | [optional] +**type** | **str** | Type | [optional] + +## Example + +```python +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult + +# TODO update the JSON string below +json = "{}" +# create an instance of VerifyResult from a JSON string +verify_result_instance = VerifyResult.from_json(json) +# print the JSON string representation of the object +print(VerifyResult.to_json()) + +# convert the object into a dict +verify_result_dict = verify_result_instance.to_dict() +# create an instance of VerifyResult from a dict +verify_result_from_dict = VerifyResult.from_dict(verify_result_dict) +``` +[[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/clients/python/docs/WebSocketMessage.md b/clients/python/docs/WebSocketMessage.md new file mode 100644 index 0000000000..a2d3acb52b --- /dev/null +++ b/clients/python/docs/WebSocketMessage.md @@ -0,0 +1,32 @@ +# WebSocketMessage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**opcode** | **float** | | +**data** | **str** | | +**time** | **float** | | + +## Example + +```python +from BrowserUpMitmProxyClient.models.web_socket_message import WebSocketMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of WebSocketMessage from a JSON string +web_socket_message_instance = WebSocketMessage.from_json(json) +# print the JSON string representation of the object +print(WebSocketMessage.to_json()) + +# convert the object into a dict +web_socket_message_dict = web_socket_message_instance.to_dict() +# create an instance of WebSocketMessage from a dict +web_socket_message_from_dict = WebSocketMessage.from_dict(web_socket_message_dict) +``` +[[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/clients/python/git_push.sh b/clients/python/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/clients/python/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml new file mode 100644 index 0000000000..749df0c2c7 --- /dev/null +++ b/clients/python/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = [ + "setuptools>=42" +] +build-backend = "setuptools.build_meta" diff --git a/clients/python/requirements.txt b/clients/python/requirements.txt new file mode 100644 index 0000000000..67f7f68dfe --- /dev/null +++ b/clients/python/requirements.txt @@ -0,0 +1,4 @@ +urllib3 >= 1.25.3, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/clients/python/setup.cfg b/clients/python/setup.cfg new file mode 100644 index 0000000000..11433ee875 --- /dev/null +++ b/clients/python/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/clients/python/setup.py b/clients/python/setup.py new file mode 100644 index 0000000000..e8498ada7a --- /dev/null +++ b/clients/python/setup.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "BrowserUpMitmProxyClient" +VERSION = "1.0.1" +PYTHON_REQUIRES = ">= 3.8" +REQUIRES = [ + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="BrowserUp MitmProxy", + author="BrowserUp, Inc.", + author_email="developers@browserup.com", + url="https://github.com/browserup/mitmproxy", + keywords=["OpenAPI", "OpenAPI-Generator", "BrowserUp MitmProxy"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + """, # noqa: E501 + package_data={"BrowserUpMitmProxyClient": ["py.typed"]}, +) \ No newline at end of file diff --git a/clients/python/test-requirements.txt b/clients/python/test-requirements.txt new file mode 100644 index 0000000000..e98555c11c --- /dev/null +++ b/clients/python/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/clients/python/test/__init__.py b/clients/python/test/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/clients/python/test/test_action.py b/clients/python/test/test_action.py new file mode 100644 index 0000000000..5ac634012e --- /dev/null +++ b/clients/python/test/test_action.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.action import Action + +class TestAction(unittest.TestCase): + """Action unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Action: + """Test Action + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Action` + """ + model = Action() + if include_optional: + return Action( + name = '', + id = '', + class_name = '', + tag_name = '', + xpath = '', + data_attributes = '', + form_name = '', + content = '' + ) + else: + return Action( + ) + """ + + def testAction(self): + """Test Action""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_browser_up_proxy_api.py b/clients/python/test/test_browser_up_proxy_api.py new file mode 100644 index 0000000000..184ca66856 --- /dev/null +++ b/clients/python/test/test_browser_up_proxy_api.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.api.browser_up_proxy_api import BrowserUpProxyApi + + +class TestBrowserUpProxyApi(unittest.TestCase): + """BrowserUpProxyApi unit test stubs""" + + def setUp(self) -> None: + self.api = BrowserUpProxyApi() + + def tearDown(self) -> None: + pass + + def test_add_error(self) -> None: + """Test case for add_error + + """ + pass + + def test_add_metric(self) -> None: + """Test case for add_metric + + """ + pass + + def test_get_har_log(self) -> None: + """Test case for get_har_log + + """ + pass + + def test_healthcheck(self) -> None: + """Test case for healthcheck + + """ + pass + + def test_new_page(self) -> None: + """Test case for new_page + + """ + pass + + def test_reset_har_log(self) -> None: + """Test case for reset_har_log + + """ + pass + + def test_verify_not_present(self) -> None: + """Test case for verify_not_present + + """ + pass + + def test_verify_present(self) -> None: + """Test case for verify_present + + """ + pass + + def test_verify_size(self) -> None: + """Test case for verify_size + + """ + pass + + def test_verify_sla(self) -> None: + """Test case for verify_sla + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_error.py b/clients/python/test/test_error.py new file mode 100644 index 0000000000..63c1b08bae --- /dev/null +++ b/clients/python/test/test_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + name = '', + details = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har.py b/clients/python/test/test_har.py new file mode 100644 index 0000000000..8e07c5dc04 --- /dev/null +++ b/clients/python/test/test_har.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har import Har + +class TestHar(unittest.TestCase): + """Har unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Har: + """Test Har + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Har` + """ + model = Har() + if include_optional: + return Har( + log = BrowserUpMitmProxyClient.models.har_log.Har_log( + version = '', + creator = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + browser = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + pages = [ + { } + ], + entries = [ + BrowserUpMitmProxyClient.models.har_entry.HarEntry( + pageref = '', + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + time = 0, + request = { }, + response = { }, + cache = BrowserUpMitmProxyClient.models.har_entry_cache.HarEntry_cache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '', ), + timings = BrowserUpMitmProxyClient.models.har_entry_timings.HarEntry_timings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '', ), + server_ip_address = '', + _web_socket_messages = [ + BrowserUpMitmProxyClient.models.web_socket_message.WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337, ) + ], + _span_id = '', + _parent_id = '', + _trace_id = '', + connection = '', + comment = '', ) + ], + _trace_id = '', + _span_id = '', + comment = '', ) + ) + else: + return Har( + log = BrowserUpMitmProxyClient.models.har_log.Har_log( + version = '', + creator = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + browser = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + pages = [ + { } + ], + entries = [ + BrowserUpMitmProxyClient.models.har_entry.HarEntry( + pageref = '', + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + time = 0, + request = { }, + response = { }, + cache = BrowserUpMitmProxyClient.models.har_entry_cache.HarEntry_cache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '', ), + timings = BrowserUpMitmProxyClient.models.har_entry_timings.HarEntry_timings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '', ), + server_ip_address = '', + _web_socket_messages = [ + BrowserUpMitmProxyClient.models.web_socket_message.WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337, ) + ], + _span_id = '', + _parent_id = '', + _trace_id = '', + connection = '', + comment = '', ) + ], + _trace_id = '', + _span_id = '', + comment = '', ), + ) + """ + + def testHar(self): + """Test Har""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry.py b/clients/python/test/test_har_entry.py new file mode 100644 index 0000000000..fab907b563 --- /dev/null +++ b/clients/python/test/test_har_entry.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry import HarEntry + +class TestHarEntry(unittest.TestCase): + """HarEntry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntry: + """Test HarEntry + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntry` + """ + model = HarEntry() + if include_optional: + return HarEntry( + pageref = '', + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + time = 0, + request = { }, + response = { }, + cache = BrowserUpMitmProxyClient.models.har_entry_cache.HarEntry_cache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '', ), + timings = BrowserUpMitmProxyClient.models.har_entry_timings.HarEntry_timings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '', ), + server_ip_address = '', + web_socket_messages = [ + BrowserUpMitmProxyClient.models.web_socket_message.WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337, ) + ], + span_id = '', + parent_id = '', + trace_id = '', + connection = '', + comment = '' + ) + else: + return HarEntry( + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + time = 0, + request = { }, + response = { }, + cache = BrowserUpMitmProxyClient.models.har_entry_cache.HarEntry_cache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '', ), + timings = BrowserUpMitmProxyClient.models.har_entry_timings.HarEntry_timings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '', ), + ) + """ + + def testHarEntry(self): + """Test HarEntry""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_cache.py b/clients/python/test/test_har_entry_cache.py new file mode 100644 index 0000000000..428f6baa9d --- /dev/null +++ b/clients/python/test/test_har_entry_cache.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_cache import HarEntryCache + +class TestHarEntryCache(unittest.TestCase): + """HarEntryCache unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryCache: + """Test HarEntryCache + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryCache` + """ + model = HarEntryCache() + if include_optional: + return HarEntryCache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '' + ) + else: + return HarEntryCache( + ) + """ + + def testHarEntryCache(self): + """Test HarEntryCache""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_cache_before_request.py b/clients/python/test/test_har_entry_cache_before_request.py new file mode 100644 index 0000000000..7a5fb8f5f8 --- /dev/null +++ b/clients/python/test/test_har_entry_cache_before_request.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_cache_before_request import HarEntryCacheBeforeRequest + +class TestHarEntryCacheBeforeRequest(unittest.TestCase): + """HarEntryCacheBeforeRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryCacheBeforeRequest: + """Test HarEntryCacheBeforeRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryCacheBeforeRequest` + """ + model = HarEntryCacheBeforeRequest() + if include_optional: + return HarEntryCacheBeforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '' + ) + else: + return HarEntryCacheBeforeRequest( + last_access = '', + e_tag = '', + hit_count = 56, + ) + """ + + def testHarEntryCacheBeforeRequest(self): + """Test HarEntryCacheBeforeRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_request.py b/clients/python/test/test_har_entry_request.py new file mode 100644 index 0000000000..d64f67f3e3 --- /dev/null +++ b/clients/python/test/test_har_entry_request.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_request import HarEntryRequest + +class TestHarEntryRequest(unittest.TestCase): + """HarEntryRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryRequest: + """Test HarEntryRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryRequest` + """ + model = HarEntryRequest() + if include_optional: + return HarEntryRequest( + method = '', + url = '', + http_version = '', + cookies = [ + BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner.HarEntry_request_cookies_inner( + name = '', + value = '', + path = '', + domain = '', + expires = '', + http_only = True, + secure = True, + comment = '', ) + ], + headers = [ + BrowserUpMitmProxyClient.models.header.Header( + name = '', + value = '', + comment = '', ) + ], + query_string = [ + BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner.HarEntry_request_queryString_inner( + name = '', + value = '', + comment = '', ) + ], + post_data = BrowserUpMitmProxyClient.models.har_entry_request_post_data.HarEntry_request_postData( + mime_type = '', + text = '', + params = [ + BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner.HarEntry_request_postData_params_inner( + name = '', + value = '', + file_name = '', + content_type = '', + comment = '', ) + ], ), + headers_size = 56, + body_size = 56, + comment = '' + ) + else: + return HarEntryRequest( + method = '', + url = '', + http_version = '', + cookies = [ + BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner.HarEntry_request_cookies_inner( + name = '', + value = '', + path = '', + domain = '', + expires = '', + http_only = True, + secure = True, + comment = '', ) + ], + headers = [ + BrowserUpMitmProxyClient.models.header.Header( + name = '', + value = '', + comment = '', ) + ], + query_string = [ + BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner.HarEntry_request_queryString_inner( + name = '', + value = '', + comment = '', ) + ], + headers_size = 56, + body_size = 56, + ) + """ + + def testHarEntryRequest(self): + """Test HarEntryRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_request_cookies_inner.py b/clients/python/test/test_har_entry_request_cookies_inner.py new file mode 100644 index 0000000000..b5247e936e --- /dev/null +++ b/clients/python/test/test_har_entry_request_cookies_inner.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner import HarEntryRequestCookiesInner + +class TestHarEntryRequestCookiesInner(unittest.TestCase): + """HarEntryRequestCookiesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryRequestCookiesInner: + """Test HarEntryRequestCookiesInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryRequestCookiesInner` + """ + model = HarEntryRequestCookiesInner() + if include_optional: + return HarEntryRequestCookiesInner( + name = '', + value = '', + path = '', + domain = '', + expires = '', + http_only = True, + secure = True, + comment = '' + ) + else: + return HarEntryRequestCookiesInner( + name = '', + value = '', + ) + """ + + def testHarEntryRequestCookiesInner(self): + """Test HarEntryRequestCookiesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_request_post_data.py b/clients/python/test/test_har_entry_request_post_data.py new file mode 100644 index 0000000000..9e12acb67d --- /dev/null +++ b/clients/python/test/test_har_entry_request_post_data.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_request_post_data import HarEntryRequestPostData + +class TestHarEntryRequestPostData(unittest.TestCase): + """HarEntryRequestPostData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryRequestPostData: + """Test HarEntryRequestPostData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryRequestPostData` + """ + model = HarEntryRequestPostData() + if include_optional: + return HarEntryRequestPostData( + mime_type = '', + text = '', + params = [ + BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner.HarEntry_request_postData_params_inner( + name = '', + value = '', + file_name = '', + content_type = '', + comment = '', ) + ] + ) + else: + return HarEntryRequestPostData( + mime_type = '', + ) + """ + + def testHarEntryRequestPostData(self): + """Test HarEntryRequestPostData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_request_post_data_params_inner.py b/clients/python/test/test_har_entry_request_post_data_params_inner.py new file mode 100644 index 0000000000..613981b9f6 --- /dev/null +++ b/clients/python/test/test_har_entry_request_post_data_params_inner.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_request_post_data_params_inner import HarEntryRequestPostDataParamsInner + +class TestHarEntryRequestPostDataParamsInner(unittest.TestCase): + """HarEntryRequestPostDataParamsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryRequestPostDataParamsInner: + """Test HarEntryRequestPostDataParamsInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryRequestPostDataParamsInner` + """ + model = HarEntryRequestPostDataParamsInner() + if include_optional: + return HarEntryRequestPostDataParamsInner( + name = '', + value = '', + file_name = '', + content_type = '', + comment = '' + ) + else: + return HarEntryRequestPostDataParamsInner( + ) + """ + + def testHarEntryRequestPostDataParamsInner(self): + """Test HarEntryRequestPostDataParamsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_request_query_string_inner.py b/clients/python/test/test_har_entry_request_query_string_inner.py new file mode 100644 index 0000000000..1c7ffc6994 --- /dev/null +++ b/clients/python/test/test_har_entry_request_query_string_inner.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_request_query_string_inner import HarEntryRequestQueryStringInner + +class TestHarEntryRequestQueryStringInner(unittest.TestCase): + """HarEntryRequestQueryStringInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryRequestQueryStringInner: + """Test HarEntryRequestQueryStringInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryRequestQueryStringInner` + """ + model = HarEntryRequestQueryStringInner() + if include_optional: + return HarEntryRequestQueryStringInner( + name = '', + value = '', + comment = '' + ) + else: + return HarEntryRequestQueryStringInner( + name = '', + value = '', + ) + """ + + def testHarEntryRequestQueryStringInner(self): + """Test HarEntryRequestQueryStringInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_response.py b/clients/python/test/test_har_entry_response.py new file mode 100644 index 0000000000..97ce875d27 --- /dev/null +++ b/clients/python/test/test_har_entry_response.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_response import HarEntryResponse + +class TestHarEntryResponse(unittest.TestCase): + """HarEntryResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryResponse: + """Test HarEntryResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryResponse` + """ + model = HarEntryResponse() + if include_optional: + return HarEntryResponse( + status = 56, + status_text = '', + http_version = '', + cookies = [ + BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner.HarEntry_request_cookies_inner( + name = '', + value = '', + path = '', + domain = '', + expires = '', + http_only = True, + secure = True, + comment = '', ) + ], + headers = [ + BrowserUpMitmProxyClient.models.header.Header( + name = '', + value = '', + comment = '', ) + ], + content = BrowserUpMitmProxyClient.models.har_entry_response_content.HarEntry_response_content( + size = 56, + compression = 56, + mime_type = '', + text = '', + encoding = '', + _video_buffered_percent = -1, + _video_stall_count = -1, + _video_decoded_byte_count = -1, + _video_waiting_count = -1, + _video_error_count = -1, + _video_dropped_frames = -1, + _video_total_frames = -1, + _video_audio_bytes_decoded = -1, + comment = '', ), + redirect_url = '', + headers_size = 56, + body_size = 56, + comment = '' + ) + else: + return HarEntryResponse( + status = 56, + status_text = '', + http_version = '', + cookies = [ + BrowserUpMitmProxyClient.models.har_entry_request_cookies_inner.HarEntry_request_cookies_inner( + name = '', + value = '', + path = '', + domain = '', + expires = '', + http_only = True, + secure = True, + comment = '', ) + ], + headers = [ + BrowserUpMitmProxyClient.models.header.Header( + name = '', + value = '', + comment = '', ) + ], + content = BrowserUpMitmProxyClient.models.har_entry_response_content.HarEntry_response_content( + size = 56, + compression = 56, + mime_type = '', + text = '', + encoding = '', + _video_buffered_percent = -1, + _video_stall_count = -1, + _video_decoded_byte_count = -1, + _video_waiting_count = -1, + _video_error_count = -1, + _video_dropped_frames = -1, + _video_total_frames = -1, + _video_audio_bytes_decoded = -1, + comment = '', ), + redirect_url = '', + headers_size = 56, + body_size = 56, + ) + """ + + def testHarEntryResponse(self): + """Test HarEntryResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_response_content.py b/clients/python/test/test_har_entry_response_content.py new file mode 100644 index 0000000000..7856f349ee --- /dev/null +++ b/clients/python/test/test_har_entry_response_content.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_response_content import HarEntryResponseContent + +class TestHarEntryResponseContent(unittest.TestCase): + """HarEntryResponseContent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryResponseContent: + """Test HarEntryResponseContent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryResponseContent` + """ + model = HarEntryResponseContent() + if include_optional: + return HarEntryResponseContent( + size = 56, + compression = 56, + mime_type = '', + text = '', + encoding = '', + video_buffered_percent = -1, + video_stall_count = -1, + video_decoded_byte_count = -1, + video_waiting_count = -1, + video_error_count = -1, + video_dropped_frames = -1, + video_total_frames = -1, + video_audio_bytes_decoded = -1, + comment = '' + ) + else: + return HarEntryResponseContent( + size = 56, + mime_type = '', + ) + """ + + def testHarEntryResponseContent(self): + """Test HarEntryResponseContent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_entry_timings.py b/clients/python/test/test_har_entry_timings.py new file mode 100644 index 0000000000..dc4b929354 --- /dev/null +++ b/clients/python/test/test_har_entry_timings.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_entry_timings import HarEntryTimings + +class TestHarEntryTimings(unittest.TestCase): + """HarEntryTimings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarEntryTimings: + """Test HarEntryTimings + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarEntryTimings` + """ + model = HarEntryTimings() + if include_optional: + return HarEntryTimings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '' + ) + else: + return HarEntryTimings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + ) + """ + + def testHarEntryTimings(self): + """Test HarEntryTimings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_log.py b/clients/python/test/test_har_log.py new file mode 100644 index 0000000000..1c2949d0f1 --- /dev/null +++ b/clients/python/test/test_har_log.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_log import HarLog + +class TestHarLog(unittest.TestCase): + """HarLog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarLog: + """Test HarLog + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarLog` + """ + model = HarLog() + if include_optional: + return HarLog( + version = '', + creator = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + browser = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + pages = [ + { } + ], + entries = [ + BrowserUpMitmProxyClient.models.har_entry.HarEntry( + pageref = '', + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + time = 0, + request = { }, + response = { }, + cache = BrowserUpMitmProxyClient.models.har_entry_cache.HarEntry_cache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '', ), + timings = BrowserUpMitmProxyClient.models.har_entry_timings.HarEntry_timings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '', ), + server_ip_address = '', + _web_socket_messages = [ + BrowserUpMitmProxyClient.models.web_socket_message.WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337, ) + ], + _span_id = '', + _parent_id = '', + _trace_id = '', + connection = '', + comment = '', ) + ], + trace_id = '', + span_id = '', + comment = '' + ) + else: + return HarLog( + version = '', + creator = BrowserUpMitmProxyClient.models.har_log_creator.Har_log_creator( + name = '', + version = '', + comment = '', ), + pages = [ + { } + ], + entries = [ + BrowserUpMitmProxyClient.models.har_entry.HarEntry( + pageref = '', + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + time = 0, + request = { }, + response = { }, + cache = BrowserUpMitmProxyClient.models.har_entry_cache.HarEntry_cache( + before_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + after_request = BrowserUpMitmProxyClient.models.har_entry_cache_before_request.HarEntry_cache_beforeRequest( + expires = '', + last_access = '', + e_tag = '', + hit_count = 56, + comment = '', ), + comment = '', ), + timings = BrowserUpMitmProxyClient.models.har_entry_timings.HarEntry_timings( + dns = -1, + connect = -1, + blocked = -1, + send = -1, + wait = -1, + receive = -1, + ssl = -1, + comment = '', ), + server_ip_address = '', + _web_socket_messages = [ + BrowserUpMitmProxyClient.models.web_socket_message.WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337, ) + ], + _span_id = '', + _parent_id = '', + _trace_id = '', + connection = '', + comment = '', ) + ], + ) + """ + + def testHarLog(self): + """Test HarLog""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_har_log_creator.py b/clients/python/test/test_har_log_creator.py new file mode 100644 index 0000000000..9820ceaf35 --- /dev/null +++ b/clients/python/test/test_har_log_creator.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.har_log_creator import HarLogCreator + +class TestHarLogCreator(unittest.TestCase): + """HarLogCreator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HarLogCreator: + """Test HarLogCreator + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HarLogCreator` + """ + model = HarLogCreator() + if include_optional: + return HarLogCreator( + name = '', + version = '', + comment = '' + ) + else: + return HarLogCreator( + name = '', + version = '', + ) + """ + + def testHarLogCreator(self): + """Test HarLogCreator""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_header.py b/clients/python/test/test_header.py new file mode 100644 index 0000000000..25084dc7e0 --- /dev/null +++ b/clients/python/test/test_header.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.header import Header + +class TestHeader(unittest.TestCase): + """Header unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Header: + """Test Header + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Header` + """ + model = Header() + if include_optional: + return Header( + name = '', + value = '', + comment = '' + ) + else: + return Header( + name = '', + value = '', + ) + """ + + def testHeader(self): + """Test Header""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_largest_contentful_paint.py b/clients/python/test/test_largest_contentful_paint.py new file mode 100644 index 0000000000..ee2a1f71bf --- /dev/null +++ b/clients/python/test/test_largest_contentful_paint.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.largest_contentful_paint import LargestContentfulPaint + +class TestLargestContentfulPaint(unittest.TestCase): + """LargestContentfulPaint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LargestContentfulPaint: + """Test LargestContentfulPaint + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LargestContentfulPaint` + """ + model = LargestContentfulPaint() + if include_optional: + return LargestContentfulPaint( + start_time = -1, + size = -1, + dom_path = '', + tag = '' + ) + else: + return LargestContentfulPaint( + ) + """ + + def testLargestContentfulPaint(self): + """Test LargestContentfulPaint""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_match_criteria.py b/clients/python/test/test_match_criteria.py new file mode 100644 index 0000000000..c460f2150c --- /dev/null +++ b/clients/python/test/test_match_criteria.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.match_criteria import MatchCriteria + +class TestMatchCriteria(unittest.TestCase): + """MatchCriteria unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MatchCriteria: + """Test MatchCriteria + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MatchCriteria` + """ + model = MatchCriteria() + if include_optional: + return MatchCriteria( + url = '', + page = '', + status = '', + content = '', + content_type = '', + websocket_message = '', + request_header = BrowserUpMitmProxyClient.models.name_value_pair.NameValuePair( + name = '', + value = '', ), + request_cookie = BrowserUpMitmProxyClient.models.name_value_pair.NameValuePair( + name = '', + value = '', ), + response_header = BrowserUpMitmProxyClient.models.name_value_pair.NameValuePair( + name = '', + value = '', ), + response_cookie = BrowserUpMitmProxyClient.models.name_value_pair.NameValuePair( + name = '', + value = '', ), + json_valid = True, + json_path = '', + json_schema = '', + error_if_no_traffic = True + ) + else: + return MatchCriteria( + ) + """ + + def testMatchCriteria(self): + """Test MatchCriteria""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_metric.py b/clients/python/test/test_metric.py new file mode 100644 index 0000000000..5aac2f8cf0 --- /dev/null +++ b/clients/python/test/test_metric.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.metric import Metric + +class TestMetric(unittest.TestCase): + """Metric unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Metric: + """Test Metric + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Metric` + """ + model = Metric() + if include_optional: + return Metric( + name = '', + value = 56 + ) + else: + return Metric( + ) + """ + + def testMetric(self): + """Test Metric""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_name_value_pair.py b/clients/python/test/test_name_value_pair.py new file mode 100644 index 0000000000..2a932feb9d --- /dev/null +++ b/clients/python/test/test_name_value_pair.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.name_value_pair import NameValuePair + +class TestNameValuePair(unittest.TestCase): + """NameValuePair unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NameValuePair: + """Test NameValuePair + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NameValuePair` + """ + model = NameValuePair() + if include_optional: + return NameValuePair( + name = '', + value = '' + ) + else: + return NameValuePair( + ) + """ + + def testNameValuePair(self): + """Test NameValuePair""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_page.py b/clients/python/test/test_page.py new file mode 100644 index 0000000000..b572d8aa6b --- /dev/null +++ b/clients/python/test/test_page.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.page import Page + +class TestPage(unittest.TestCase): + """Page unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Page: + """Test Page + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Page` + """ + model = Page() + if include_optional: + return Page( + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = '', + title = '', + verifications = [ + BrowserUpMitmProxyClient.models.verify_result.VerifyResult( + result = True, + name = '', + type = '', ) + ], + metrics = [ + BrowserUpMitmProxyClient.models.metric.Metric( + name = '', + value = 56, ) + ], + errors = [ + BrowserUpMitmProxyClient.models.error.Error( + name = '', + details = '', ) + ], + span_id = '', + parent_id = '', + page_timings = { }, + comment = '' + ) + else: + return Page( + started_date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = '', + title = '', + page_timings = { }, + ) + """ + + def testPage(self): + """Test Page""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_page_timing.py b/clients/python/test/test_page_timing.py new file mode 100644 index 0000000000..f3bf8e0cb4 --- /dev/null +++ b/clients/python/test/test_page_timing.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.page_timing import PageTiming + +class TestPageTiming(unittest.TestCase): + """PageTiming unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageTiming: + """Test PageTiming + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageTiming` + """ + model = PageTiming() + if include_optional: + return PageTiming( + on_content_load = 56, + on_load = 56, + first_input_delay = 56, + first_paint = 56, + cumulative_layout_shift = 56, + largest_contentful_paint = 56, + dom_interactive = 56, + first_contentful_paint = 56, + dns = 56, + ssl = 56, + time_to_first_byte = 56, + href = '', + span_id = '', + parent_id = '' + ) + else: + return PageTiming( + ) + """ + + def testPageTiming(self): + """Test PageTiming""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_page_timings.py b/clients/python/test/test_page_timings.py new file mode 100644 index 0000000000..002cb67a97 --- /dev/null +++ b/clients/python/test/test_page_timings.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.page_timings import PageTimings + +class TestPageTimings(unittest.TestCase): + """PageTimings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageTimings: + """Test PageTimings + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageTimings` + """ + model = PageTimings() + if include_optional: + return PageTimings( + on_content_load = -1, + on_load = -1, + href = '', + dns = -1, + ssl = -1, + time_to_first_byte = -1, + cumulative_layout_shift = -1, + largest_contentful_paint = { }, + first_paint = -1, + first_input_delay = -1, + dom_interactive = -1, + first_contentful_paint = -1, + comment = '' + ) + else: + return PageTimings( + on_content_load = -1, + on_load = -1, + ) + """ + + def testPageTimings(self): + """Test PageTimings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_verify_result.py b/clients/python/test/test_verify_result.py new file mode 100644 index 0000000000..dfc726a6d0 --- /dev/null +++ b/clients/python/test/test_verify_result.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.verify_result import VerifyResult + +class TestVerifyResult(unittest.TestCase): + """VerifyResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VerifyResult: + """Test VerifyResult + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VerifyResult` + """ + model = VerifyResult() + if include_optional: + return VerifyResult( + result = True, + name = '', + type = '' + ) + else: + return VerifyResult( + ) + """ + + def testVerifyResult(self): + """Test VerifyResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_web_socket_message.py b/clients/python/test/test_web_socket_message.py new file mode 100644 index 0000000000..c2b855b205 --- /dev/null +++ b/clients/python/test/test_web_socket_message.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + BrowserUp MitmProxy + + ___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ + + The version of the OpenAPI document: 1.25 + Contact: developers@browserup.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from BrowserUpMitmProxyClient.models.web_socket_message import WebSocketMessage + +class TestWebSocketMessage(unittest.TestCase): + """WebSocketMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebSocketMessage: + """Test WebSocketMessage + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebSocketMessage` + """ + model = WebSocketMessage() + if include_optional: + return WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337 + ) + else: + return WebSocketMessage( + type = '', + opcode = 1.337, + data = '', + time = 1.337, + ) + """ + + def testWebSocketMessage(self): + """Test WebSocketMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/tox.ini b/clients/python/tox.ini new file mode 100644 index 0000000000..034038e1e9 --- /dev/null +++ b/clients/python/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=BrowserUpMitmProxyClient diff --git a/clients/ruby/.openapi-generator/FILES b/clients/ruby/.openapi-generator/FILES index ca405d0af6..bb81f77957 100644 --- a/clients/ruby/.openapi-generator/FILES +++ b/clients/ruby/.openapi-generator/FILES @@ -15,7 +15,6 @@ docs/Har.md docs/HarEntry.md docs/HarEntryCache.md docs/HarEntryCacheBeforeRequest.md -docs/HarEntryCacheBeforeRequestOneOf.md docs/HarEntryRequest.md docs/HarEntryRequestCookiesInner.md docs/HarEntryRequestPostData.md @@ -29,7 +28,6 @@ docs/HarLogCreator.md docs/Header.md docs/LargestContentfulPaint.md docs/MatchCriteria.md -docs/MatchCriteriaRequestHeader.md docs/Metric.md docs/NameValuePair.md docs/Page.md @@ -49,7 +47,6 @@ lib/browserup_mitmproxy_client/models/har.rb lib/browserup_mitmproxy_client/models/har_entry.rb lib/browserup_mitmproxy_client/models/har_entry_cache.rb lib/browserup_mitmproxy_client/models/har_entry_cache_before_request.rb -lib/browserup_mitmproxy_client/models/har_entry_cache_before_request_one_of.rb lib/browserup_mitmproxy_client/models/har_entry_request.rb lib/browserup_mitmproxy_client/models/har_entry_request_cookies_inner.rb lib/browserup_mitmproxy_client/models/har_entry_request_post_data.rb @@ -63,7 +60,6 @@ lib/browserup_mitmproxy_client/models/har_log_creator.rb lib/browserup_mitmproxy_client/models/header.rb lib/browserup_mitmproxy_client/models/largest_contentful_paint.rb lib/browserup_mitmproxy_client/models/match_criteria.rb -lib/browserup_mitmproxy_client/models/match_criteria_request_header.rb lib/browserup_mitmproxy_client/models/metric.rb lib/browserup_mitmproxy_client/models/name_value_pair.rb lib/browserup_mitmproxy_client/models/page.rb @@ -73,11 +69,8 @@ lib/browserup_mitmproxy_client/models/verify_result.rb lib/browserup_mitmproxy_client/models/web_socket_message.rb lib/browserup_mitmproxy_client/version.rb spec/api/browser_up_proxy_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb spec/models/action_spec.rb spec/models/error_spec.rb -spec/models/har_entry_cache_before_request_one_of_spec.rb spec/models/har_entry_cache_before_request_spec.rb spec/models/har_entry_cache_spec.rb spec/models/har_entry_request_cookies_inner_spec.rb @@ -94,7 +87,6 @@ spec/models/har_log_spec.rb spec/models/har_spec.rb spec/models/header_spec.rb spec/models/largest_contentful_paint_spec.rb -spec/models/match_criteria_request_header_spec.rb spec/models/match_criteria_spec.rb spec/models/metric_spec.rb spec/models/name_value_pair_spec.rb diff --git a/clients/ruby/.openapi-generator/VERSION b/clients/ruby/.openapi-generator/VERSION index c0be8a7992..5f84a81db0 100644 --- a/clients/ruby/.openapi-generator/VERSION +++ b/clients/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +7.12.0 diff --git a/clients/ruby/README.md b/clients/ruby/README.md index 2f88a5317b..3744ad01cd 100644 --- a/clients/ruby/README.md +++ b/clients/ruby/README.md @@ -11,8 +11,9 @@ ___ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 1.24 +- API version: 1.25 - Package version: 1.1 +- Generator version: 7.12.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen ## Installation @@ -98,7 +99,6 @@ Class | Method | HTTP request | Description - [BrowserupMitmProxy::HarEntry](docs/HarEntry.md) - [BrowserupMitmProxy::HarEntryCache](docs/HarEntryCache.md) - [BrowserupMitmProxy::HarEntryCacheBeforeRequest](docs/HarEntryCacheBeforeRequest.md) - - [BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf](docs/HarEntryCacheBeforeRequestOneOf.md) - [BrowserupMitmProxy::HarEntryRequest](docs/HarEntryRequest.md) - [BrowserupMitmProxy::HarEntryRequestCookiesInner](docs/HarEntryRequestCookiesInner.md) - [BrowserupMitmProxy::HarEntryRequestPostData](docs/HarEntryRequestPostData.md) @@ -112,7 +112,6 @@ Class | Method | HTTP request | Description - [BrowserupMitmProxy::Header](docs/Header.md) - [BrowserupMitmProxy::LargestContentfulPaint](docs/LargestContentfulPaint.md) - [BrowserupMitmProxy::MatchCriteria](docs/MatchCriteria.md) - - [BrowserupMitmProxy::MatchCriteriaRequestHeader](docs/MatchCriteriaRequestHeader.md) - [BrowserupMitmProxy::Metric](docs/Metric.md) - [BrowserupMitmProxy::NameValuePair](docs/NameValuePair.md) - [BrowserupMitmProxy::Page](docs/Page.md) @@ -124,5 +123,5 @@ Class | Method | HTTP request | Description ## Documentation for Authorization - All endpoints do not require authorization. +Endpoints do not require authorization. diff --git a/clients/ruby/browserup_mitmproxy_client.gemspec b/clients/ruby/browserup_mitmproxy_client.gemspec index d15369ed93..0bb32fa11a 100644 --- a/clients/ruby/browserup_mitmproxy_client.gemspec +++ b/clients/ruby/browserup_mitmproxy_client.gemspec @@ -5,10 +5,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -26,6 +26,7 @@ Gem::Specification.new do |s| s.description = "A REST client for the browserup-mitmproxy" s.license = "Unlicense" s.required_ruby_version = ">= 2.3" + s.metadata = {} s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' diff --git a/clients/ruby/docs/HarEntry.md b/clients/ruby/docs/HarEntry.md index cdbc6c27bf..cd91f2b371 100644 --- a/clients/ruby/docs/HarEntry.md +++ b/clients/ruby/docs/HarEntry.md @@ -13,6 +13,9 @@ | **timings** | [**HarEntryTimings**](HarEntryTimings.md) | | | | **server_ip_address** | **String** | | [optional] | | **_web_socket_messages** | [**Array<WebSocketMessage>**](WebSocketMessage.md) | | [optional] | +| **_span_id** | **String** | W3C Trace Context span ID for this entry | [optional] | +| **_parent_id** | **String** | W3C Trace Context parent span ID (typically the page span ID) | [optional] | +| **_trace_id** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] | | **connection** | **String** | | [optional] | | **comment** | **String** | | [optional] | @@ -31,6 +34,9 @@ instance = BrowserupMitmProxy::HarEntry.new( timings: null, server_ip_address: null, _web_socket_messages: null, + _span_id: null, + _parent_id: null, + _trace_id: null, connection: null, comment: null ) diff --git a/clients/ruby/docs/HarEntryCacheBeforeRequest.md b/clients/ruby/docs/HarEntryCacheBeforeRequest.md index 552bf16b2b..2905acab05 100644 --- a/clients/ruby/docs/HarEntryCacheBeforeRequest.md +++ b/clients/ruby/docs/HarEntryCacheBeforeRequest.md @@ -1,49 +1,26 @@ # BrowserupMitmProxy::HarEntryCacheBeforeRequest -## Class instance methods +## Properties -### `openapi_one_of` +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **expires** | **String** | | [optional] | +| **last_access** | **String** | | | +| **e_tag** | **String** | | | +| **hit_count** | **Integer** | | | +| **comment** | **String** | | [optional] | -Returns the list of classes defined in oneOf. - -#### Example - -```ruby -require 'browserup_mitmproxy_client' - -BrowserupMitmProxy::HarEntryCacheBeforeRequest.openapi_one_of -# => -# [ -# :'HarEntryCacheBeforeRequestOneOf', -# :'Null' -# ] -``` - -### build - -Find the appropriate object from the `openapi_one_of` list and casts the data into it. - -#### Example +## Example ```ruby require 'browserup_mitmproxy_client' -BrowserupMitmProxy::HarEntryCacheBeforeRequest.build(data) -# => # - -BrowserupMitmProxy::HarEntryCacheBeforeRequest.build(data_that_doesnt_match) -# => nil +instance = BrowserupMitmProxy::HarEntryCacheBeforeRequest.new( + expires: null, + last_access: null, + e_tag: null, + hit_count: null, + comment: null +) ``` -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| **data** | **Mixed** | data to be matched against the list of oneOf items | - -#### Return type - -- `HarEntryCacheBeforeRequestOneOf` -- `Null` -- `nil` (if no type matches) - diff --git a/clients/ruby/docs/HarEntryCacheBeforeRequestOneOf.md b/clients/ruby/docs/HarEntryCacheBeforeRequestOneOf.md deleted file mode 100644 index 2c806aa47a..0000000000 --- a/clients/ruby/docs/HarEntryCacheBeforeRequestOneOf.md +++ /dev/null @@ -1,26 +0,0 @@ -# BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **expires** | **String** | | [optional] | -| **last_access** | **String** | | | -| **e_tag** | **String** | | | -| **hit_count** | **Integer** | | | -| **comment** | **String** | | [optional] | - -## Example - -```ruby -require 'browserup_mitmproxy_client' - -instance = BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf.new( - expires: null, - last_access: null, - e_tag: null, - hit_count: null, - comment: null -) -``` - diff --git a/clients/ruby/docs/HarLog.md b/clients/ruby/docs/HarLog.md index 04277ffaab..26f92baec8 100644 --- a/clients/ruby/docs/HarLog.md +++ b/clients/ruby/docs/HarLog.md @@ -9,6 +9,8 @@ | **browser** | [**HarLogCreator**](HarLogCreator.md) | | [optional] | | **pages** | [**Array<Page>**](Page.md) | | | | **entries** | [**Array<HarEntry>**](HarEntry.md) | | | +| **_trace_id** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] | +| **_span_id** | **String** | W3C Trace Context span ID for this HAR trace root | [optional] | | **comment** | **String** | | [optional] | ## Example @@ -22,6 +24,8 @@ instance = BrowserupMitmProxy::HarLog.new( browser: null, pages: null, entries: null, + _trace_id: null, + _span_id: null, comment: null ) ``` diff --git a/clients/ruby/docs/MatchCriteria.md b/clients/ruby/docs/MatchCriteria.md index 30a11bfaa2..893bbba52b 100644 --- a/clients/ruby/docs/MatchCriteria.md +++ b/clients/ruby/docs/MatchCriteria.md @@ -10,10 +10,10 @@ | **content** | **String** | Body content regexp content to match | [optional] | | **content_type** | **String** | Content type | [optional] | | **websocket_message** | **String** | Websocket message text to match | [optional] | -| **request_header** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | -| **request_cookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | -| **response_header** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | -| **response_cookie** | [**MatchCriteriaRequestHeader**](MatchCriteriaRequestHeader.md) | | [optional] | +| **request_header** | [**NameValuePair**](NameValuePair.md) | | [optional] | +| **request_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] | +| **response_header** | [**NameValuePair**](NameValuePair.md) | | [optional] | +| **response_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] | | **json_valid** | **Boolean** | Is valid JSON | [optional] | | **json_path** | **String** | Has JSON path | [optional] | | **json_schema** | **String** | Validates against passed JSON schema | [optional] | diff --git a/clients/ruby/docs/MatchCriteriaRequestHeader.md b/clients/ruby/docs/MatchCriteriaRequestHeader.md deleted file mode 100644 index 5243f7a780..0000000000 --- a/clients/ruby/docs/MatchCriteriaRequestHeader.md +++ /dev/null @@ -1,20 +0,0 @@ -# BrowserupMitmProxy::MatchCriteriaRequestHeader - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **name** | **String** | Name to match | [optional] | -| **value** | **String** | Value to match | [optional] | - -## Example - -```ruby -require 'browserup_mitmproxy_client' - -instance = BrowserupMitmProxy::MatchCriteriaRequestHeader.new( - name: null, - value: null -) -``` - diff --git a/clients/ruby/docs/Metric.md b/clients/ruby/docs/Metric.md index 76faa6cafb..a1806f9e31 100644 --- a/clients/ruby/docs/Metric.md +++ b/clients/ruby/docs/Metric.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **name** | **String** | Name of Custom Metric to add to the page under _metrics | [optional] | -| **value** | **Float** | Value for the metric | [optional] | +| **value** | **Integer** | Value for the metric | [optional] | ## Example diff --git a/clients/ruby/docs/Page.md b/clients/ruby/docs/Page.md index dde67413f0..ea11f3b7e6 100644 --- a/clients/ruby/docs/Page.md +++ b/clients/ruby/docs/Page.md @@ -10,6 +10,8 @@ | **_verifications** | [**Array<VerifyResult>**](VerifyResult.md) | | [optional] | | **_metrics** | [**Array<Metric>**](Metric.md) | | [optional] | | **_errors** | [**Array<Error>**](Error.md) | | [optional] | +| **_span_id** | **String** | W3C Trace Context span ID for this page | [optional] | +| **_parent_id** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] | | **page_timings** | [**PageTimings**](PageTimings.md) | | | | **comment** | **String** | | [optional] | @@ -25,6 +27,8 @@ instance = BrowserupMitmProxy::Page.new( _verifications: null, _metrics: null, _errors: null, + _span_id: null, + _parent_id: null, page_timings: null, comment: null ) diff --git a/clients/ruby/docs/PageTiming.md b/clients/ruby/docs/PageTiming.md index 7350cd990c..881d48b11b 100644 --- a/clients/ruby/docs/PageTiming.md +++ b/clients/ruby/docs/PageTiming.md @@ -4,18 +4,20 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **on_content_load** | **Float** | onContentLoad per the browser | [optional] | -| **on_load** | **Float** | onLoad per the browser | [optional] | -| **_first_input_delay** | **Float** | firstInputDelay from the browser | [optional] | -| **_first_paint** | **Float** | firstPaint from the browser | [optional] | -| **_cumulative_layout_shift** | **Float** | cumulativeLayoutShift metric from the browser | [optional] | -| **_largest_contentful_paint** | **Float** | largestContentfulPaint from the browser | [optional] | -| **_dom_interactive** | **Float** | domInteractive from the browser | [optional] | -| **_first_contentful_paint** | **Float** | firstContentfulPaint from the browser | [optional] | -| **_dns** | **Float** | dns lookup time from the browser | [optional] | -| **_ssl** | **Float** | Ssl connect time from the browser | [optional] | -| **_time_to_first_byte** | **Float** | Time to first byte of the page's first request per the browser | [optional] | +| **on_content_load** | **Integer** | onContentLoad per the browser | [optional] | +| **on_load** | **Integer** | onLoad per the browser | [optional] | +| **_first_input_delay** | **Integer** | firstInputDelay from the browser | [optional] | +| **_first_paint** | **Integer** | firstPaint from the browser | [optional] | +| **_cumulative_layout_shift** | **Integer** | cumulativeLayoutShift metric from the browser | [optional] | +| **_largest_contentful_paint** | **Integer** | largestContentfulPaint from the browser | [optional] | +| **_dom_interactive** | **Integer** | domInteractive from the browser | [optional] | +| **_first_contentful_paint** | **Integer** | firstContentfulPaint from the browser | [optional] | +| **_dns** | **Integer** | dns lookup time from the browser | [optional] | +| **_ssl** | **Integer** | Ssl connect time from the browser | [optional] | +| **_time_to_first_byte** | **Integer** | Time to first byte of the page's first request per the browser | [optional] | | **_href** | **String** | Top level href, including hashtag, etc per the browser | [optional] | +| **_span_id** | **String** | W3C Trace Context span ID for this page | [optional] | +| **_parent_id** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] | ## Example @@ -34,7 +36,9 @@ instance = BrowserupMitmProxy::PageTiming.new( _dns: null, _ssl: null, _time_to_first_byte: null, - _href: null + _href: null, + _span_id: null, + _parent_id: null ) ``` diff --git a/clients/ruby/lib/browserup_mitmproxy_client.rb b/clients/ruby/lib/browserup_mitmproxy_client.rb index ea5fcdd2a4..90d13c32b7 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -23,7 +23,6 @@ require 'browserup_mitmproxy_client/models/har_entry' require 'browserup_mitmproxy_client/models/har_entry_cache' require 'browserup_mitmproxy_client/models/har_entry_cache_before_request' -require 'browserup_mitmproxy_client/models/har_entry_cache_before_request_one_of' require 'browserup_mitmproxy_client/models/har_entry_request' require 'browserup_mitmproxy_client/models/har_entry_request_cookies_inner' require 'browserup_mitmproxy_client/models/har_entry_request_post_data' @@ -37,7 +36,6 @@ require 'browserup_mitmproxy_client/models/header' require 'browserup_mitmproxy_client/models/largest_contentful_paint' require 'browserup_mitmproxy_client/models/match_criteria' -require 'browserup_mitmproxy_client/models/match_criteria_request_header' require 'browserup_mitmproxy_client/models/metric' require 'browserup_mitmproxy_client/models/name_value_pair' require 'browserup_mitmproxy_client/models/page' diff --git a/clients/ruby/lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb b/clients/ruby/lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb index fb71831afc..0c556f038d 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -171,7 +171,7 @@ def get_har_log_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -290,7 +290,7 @@ def new_page_with_http_info(title, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -345,7 +345,7 @@ def reset_har_log_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -417,7 +417,7 @@ def verify_not_present_with_http_info(name, match_criteria, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -494,7 +494,7 @@ def verify_present_with_http_info(name, match_criteria, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -581,7 +581,7 @@ def verify_size_with_http_info(size, name, match_criteria, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -668,7 +668,7 @@ def verify_sla_with_http_info(time, name, match_criteria, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/clients/ruby/lib/browserup_mitmproxy_client/api_client.rb b/clients/ruby/lib/browserup_mitmproxy_client/api_client.rb index ed5ff48e91..79c39d20e2 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/api_client.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/api_client.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -17,6 +17,7 @@ require 'time' require 'typhoeus' + module BrowserupMitmProxy class ApiClient # The Configuration object holding settings to be used in the API client. @@ -45,9 +46,11 @@ def self.default # Call an API with given options. # # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. + # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers. def call_api(http_method, path, opts = {}) request = build_request(http_method, path, opts) + tempfile = nil + (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File' response = request.run if @config.debugging @@ -69,7 +72,9 @@ def call_api(http_method, path, opts = {}) end end - if opts[:return_type] + if opts[:return_type] == 'File' + data = tempfile + elsif opts[:return_type] data = deserialize(response, opts[:return_type]) else data = nil @@ -124,9 +129,7 @@ def build_request(http_method, path, opts = {}) end end - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request + Typhoeus::Request.new(url, req_opts) end # Builds the HTTP request body @@ -164,6 +167,8 @@ def build_request_body(header_params, form_params, body) # process can use. # # @see Configuration#temp_folder_path + # + # @return [Tempfile] the tempfile generated def download_file(request) tempfile = nil encoding = nil @@ -178,20 +183,21 @@ def download_file(request) prefix = prefix + '-' unless prefix.end_with?('-') encoding = response.body.encoding tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile end request.on_body do |chunk| chunk.force_encoding(encoding) tempfile.write(chunk) end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" + request.on_complete do + if !tempfile + fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") end + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + yield tempfile if block_given? end end @@ -204,7 +210,7 @@ def download_file(request) # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -213,15 +219,10 @@ def json_mime?(mime) # @param [String] return_type some examples: "User", "Array", "Hash" def deserialize(response, return_type) body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - return nil if body.nil? || body.empty? # return response body directly for String return type - return body if return_type == 'String' + return body.to_s if return_type == 'String' # ensuring a default content type content_type = response.headers['Content-Type'] || 'application/json' @@ -288,7 +289,7 @@ def convert_to_type(data, return_type) # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/clients/ruby/lib/browserup_mitmproxy_client/api_error.rb b/clients/ruby/lib/browserup_mitmproxy_client/api_error.rb index 551c986ed0..0f8b28edd2 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/api_error.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/api_error.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/configuration.rb b/clients/ruby/lib/browserup_mitmproxy_client/configuration.rb index a0ea1ec42c..9a28ec7517 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/configuration.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/configuration.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -67,6 +67,11 @@ class Configuration # @return [Proc] attr_accessor :access_token_getter + # Set this to return data as binary instead of downloading a temp file. When enabled (set to true) + # HTTP responses with return type `File` will be returned as a stream of binary data. + # Default to false. + attr_accessor :return_binary_data + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response # details will be logged with `logger.debug` (see the `logger` attribute). # Default to false. @@ -74,6 +79,14 @@ class Configuration # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -147,7 +160,7 @@ def initialize @scheme = 'http' @host = 'localhost:48088' @base_path = '' - @server_index = 0 + @server_index = nil @server_operation_index = {} @server_variables = {} @server_operation_variables = {} @@ -161,6 +174,7 @@ def initialize @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -195,10 +209,13 @@ def base_path=(base_path) # Returns base URL for specified operation based on server settings def base_url(operation = nil) - index = server_operation_index.fetch(operation, server_index) - return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil - - server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers + if operation_server_settings.key?(operation) then + index = server_operation_index.fetch(operation, server_index) + server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + else + server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil) + end end # Gets API key (with prefix if set). @@ -215,8 +232,8 @@ def api_key_with_prefix(param_name, param_alias = nil) # Gets access_token using access_token_getter or uses the static access_token def access_token_with_refresh - return access_token if access_token_getter.nil? - access_token_getter.call + return access_token if access_token_getter.nil? + access_token_getter.call end # Gets Basic Auth token string @@ -262,8 +279,8 @@ def server_url(index, variables = {}, servers = nil) servers = server_settings if servers == nil # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + if (index.nil? || index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}" end server = servers[index] @@ -288,5 +305,6 @@ def server_url(index, variables = {}, servers = nil) url end + end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/action.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/action.rb index 79eecb8a44..848d885752 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/action.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/action.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -45,9 +45,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -78,9 +83,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Action`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Action`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -121,6 +127,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -128,6 +135,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -162,37 +170,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -227,7 +228,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/error.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/error.rb index 5156802c3c..c0cf3b4391 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/error.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/error.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -29,9 +29,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -56,9 +61,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -75,6 +81,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +89,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +118,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -175,7 +176,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har.rb index 0d1ab7e1c0..9b15283b7a 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -24,9 +24,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -50,21 +55,25 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Har`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Har`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'log') self.log = attributes[:'log'] + else + self.log = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @log.nil? invalid_properties.push('invalid value for "log", log cannot be nil.') @@ -76,10 +85,21 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @log.nil? true end + # Custom attribute writer method with validation + # @param [Object] log Value to be assigned + def log=(log) + if log.nil? + fail ArgumentError, 'log cannot be nil' + end + + @log = log + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -104,37 +124,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -169,7 +182,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry.rb index 0cc572a205..d8c2246591 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -33,6 +33,15 @@ class HarEntry attr_accessor :_web_socket_messages + # W3C Trace Context span ID for this entry + attr_accessor :_span_id + + # W3C Trace Context parent span ID (typically the page span ID) + attr_accessor :_parent_id + + # W3C Trace Context trace ID for distributed tracing + attr_accessor :_trace_id + attr_accessor :connection attr_accessor :comment @@ -49,14 +58,22 @@ def self.attribute_map :'timings' => :'timings', :'server_ip_address' => :'serverIPAddress', :'_web_socket_messages' => :'_webSocketMessages', + :'_span_id' => :'_span_id', + :'_parent_id' => :'_parent_id', + :'_trace_id' => :'_trace_id', :'connection' => :'connection', :'comment' => :'comment' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -71,6 +88,9 @@ def self.openapi_types :'timings' => :'HarEntryTimings', :'server_ip_address' => :'String', :'_web_socket_messages' => :'Array', + :'_span_id' => :'String', + :'_parent_id' => :'String', + :'_trace_id' => :'String', :'connection' => :'String', :'comment' => :'String' } @@ -90,9 +110,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -103,26 +124,38 @@ def initialize(attributes = {}) if attributes.key?(:'started_date_time') self.started_date_time = attributes[:'started_date_time'] + else + self.started_date_time = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'request') self.request = attributes[:'request'] + else + self.request = nil end if attributes.key?(:'response') self.response = attributes[:'response'] + else + self.response = nil end if attributes.key?(:'cache') self.cache = attributes[:'cache'] + else + self.cache = nil end if attributes.key?(:'timings') self.timings = attributes[:'timings'] + else + self.timings = nil end if attributes.key?(:'server_ip_address') @@ -135,6 +168,18 @@ def initialize(attributes = {}) end end + if attributes.key?(:'_span_id') + self._span_id = attributes[:'_span_id'] + end + + if attributes.key?(:'_parent_id') + self._parent_id = attributes[:'_parent_id'] + end + + if attributes.key?(:'_trace_id') + self._trace_id = attributes[:'_trace_id'] + end + if attributes.key?(:'connection') self.connection = attributes[:'connection'] end @@ -147,6 +192,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @started_date_time.nil? invalid_properties.push('invalid value for "started_date_time", started_date_time cannot be nil.') @@ -182,6 +228,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @started_date_time.nil? return false if @time.nil? return false if @time < 0 @@ -192,6 +239,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] started_date_time Value to be assigned + def started_date_time=(started_date_time) + if started_date_time.nil? + fail ArgumentError, 'started_date_time cannot be nil' + end + + @started_date_time = started_date_time + end + # Custom attribute writer method with validation # @param [Object] time Value to be assigned def time=(time) @@ -206,6 +263,46 @@ def time=(time) @time = time end + # Custom attribute writer method with validation + # @param [Object] request Value to be assigned + def request=(request) + if request.nil? + fail ArgumentError, 'request cannot be nil' + end + + @request = request + end + + # Custom attribute writer method with validation + # @param [Object] response Value to be assigned + def response=(response) + if response.nil? + fail ArgumentError, 'response cannot be nil' + end + + @response = response + end + + # Custom attribute writer method with validation + # @param [Object] cache Value to be assigned + def cache=(cache) + if cache.nil? + fail ArgumentError, 'cache cannot be nil' + end + + @cache = cache + end + + # Custom attribute writer method with validation + # @param [Object] timings Value to be assigned + def timings=(timings) + if timings.nil? + fail ArgumentError, 'timings cannot be nil' + end + + @timings = timings + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -220,6 +317,9 @@ def ==(o) timings == o.timings && server_ip_address == o.server_ip_address && _web_socket_messages == o._web_socket_messages && + _span_id == o._span_id && + _parent_id == o._parent_id && + _trace_id == o._trace_id && connection == o.connection && comment == o.comment end @@ -233,44 +333,37 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pageref, started_date_time, time, request, response, cache, timings, server_ip_address, _web_socket_messages, connection, comment].hash + [pageref, started_date_time, time, request, response, cache, timings, server_ip_address, _web_socket_messages, _span_id, _parent_id, _trace_id, connection, comment].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -305,7 +398,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache.rb index 2f67f133b1..19de7bc727 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -47,6 +52,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'before_request', + :'after_request', ]) end @@ -58,9 +65,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryCache`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryCache`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -81,6 +89,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -88,6 +97,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -117,37 +127,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -182,7 +185,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request.rb index 4eca1c6156..4e770d12d1 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -14,92 +14,294 @@ require 'time' module BrowserupMitmProxy - module HarEntryCacheBeforeRequest - class << self - # List of class defined in oneOf (OpenAPI v3) - def openapi_one_of - [ - :'HarEntryCacheBeforeRequestOneOf', - :'Null' - ] - end - - # Builds the object - # @param [Mixed] Data to be matched against the list of oneOf items - # @return [Object] Returns the model or the data itself - def build(data) - # Go through the list of oneOf items and attempt to identify the appropriate one. - # Note: - # - We do not attempt to check whether exactly one item matches. - # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) - # due to the way the deserialization is made in the base_object template (it just casts without verifying). - # - TODO: scalar values are de facto behaving as if they were nullable. - # - TODO: logging when debugging is set. - openapi_one_of.each do |klass| - begin - next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - return typed_data if typed_data - rescue # rescue all errors so we keep iterating even if the current item lookup raises - end + class HarEntryCacheBeforeRequest + attr_accessor :expires + + attr_accessor :last_access + + attr_accessor :e_tag + + attr_accessor :hit_count + + attr_accessor :comment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'expires' => :'expires', + :'last_access' => :'lastAccess', + :'e_tag' => :'eTag', + :'hit_count' => :'hitCount', + :'comment' => :'comment' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'expires' => :'String', + :'last_access' => :'String', + :'e_tag' => :'String', + :'hit_count' => :'Integer', + :'comment' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `BrowserupMitmProxy::HarEntryCacheBeforeRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryCacheBeforeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end + h[k.to_sym] = v + } - openapi_one_of.include?(:AnyType) ? data : nil - end - - private - - SchemaMismatchError = Class.new(StandardError) - - # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. - def find_and_cast_into_type(klass, data) - return if data.nil? - - case klass.to_s - when 'Boolean' - return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) - when 'Float' - return data if data.instance_of?(Float) - when 'Integer' - return data if data.instance_of?(Integer) - when 'Time' - return Time.parse(data) - when 'Date' - return Date.parse(data) - when 'String' - return data if data.instance_of?(String) - when 'Object' # "type: object" - return data if data.instance_of?(Hash) - when /\AArray<(?.+)>\z/ # "type: array" - if data.instance_of?(Array) - sub_type = Regexp.last_match[:sub_type] - return data.map { |item| find_and_cast_into_type(sub_type, item) } - end - when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" - if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } - sub_type = Regexp.last_match[:sub_type] - return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + if attributes.key?(:'expires') + self.expires = attributes[:'expires'] + end + + if attributes.key?(:'last_access') + self.last_access = attributes[:'last_access'] + else + self.last_access = nil + end + + if attributes.key?(:'e_tag') + self.e_tag = attributes[:'e_tag'] + else + self.e_tag = nil + end + + if attributes.key?(:'hit_count') + self.hit_count = attributes[:'hit_count'] + else + self.hit_count = nil + end + + if attributes.key?(:'comment') + self.comment = attributes[:'comment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @last_access.nil? + invalid_properties.push('invalid value for "last_access", last_access cannot be nil.') + end + + if @e_tag.nil? + invalid_properties.push('invalid value for "e_tag", e_tag cannot be nil.') + end + + if @hit_count.nil? + invalid_properties.push('invalid value for "hit_count", hit_count cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @last_access.nil? + return false if @e_tag.nil? + return false if @hit_count.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] last_access Value to be assigned + def last_access=(last_access) + if last_access.nil? + fail ArgumentError, 'last_access cannot be nil' + end + + @last_access = last_access + end + + # Custom attribute writer method with validation + # @param [Object] e_tag Value to be assigned + def e_tag=(e_tag) + if e_tag.nil? + fail ArgumentError, 'e_tag cannot be nil' + end + + @e_tag = e_tag + end + + # Custom attribute writer method with validation + # @param [Object] hit_count Value to be assigned + def hit_count=(hit_count) + if hit_count.nil? + fail ArgumentError, 'hit_count cannot be nil' + end + + @hit_count = hit_count + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expires == o.expires && + last_access == o.last_access && + e_tag == o.e_tag && + hit_count == o.hit_count && + comment == o.comment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [expires, last_access, e_tag, hit_count, comment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - else # model - const = BrowserupMitmProxy.const_get(klass) - if const - if const.respond_to?(:openapi_one_of) # nested oneOf model - model = const.build(data) - return model if model - else - # raise if data contains keys that are not known to the model - raise unless (data.keys - const.acceptable_attributes).empty? - model = const.build_from_hash(data) - return model if model && model.valid? - end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end + else # model + # models (e.g. Pet) or oneOf + klass = BrowserupMitmProxy.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end - raise # if no match by now, raise - rescue - raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) end + hash end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request_one_of.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request_one_of.rb deleted file mode 100644 index 78d61bdd3e..0000000000 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_cache_before_request_one_of.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#BrowserUp MitmProxy - -#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - -The version of the OpenAPI document: 1.24 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end - -require 'date' -require 'time' - -module BrowserupMitmProxy - class HarEntryCacheBeforeRequestOneOf - attr_accessor :expires - - attr_accessor :last_access - - attr_accessor :e_tag - - attr_accessor :hit_count - - attr_accessor :comment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expires' => :'expires', - :'last_access' => :'lastAccess', - :'e_tag' => :'eTag', - :'hit_count' => :'hitCount', - :'comment' => :'comment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'expires' => :'String', - :'last_access' => :'String', - :'e_tag' => :'String', - :'hit_count' => :'Integer', - :'comment' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expires') - self.expires = attributes[:'expires'] - end - - if attributes.key?(:'last_access') - self.last_access = attributes[:'last_access'] - end - - if attributes.key?(:'e_tag') - self.e_tag = attributes[:'e_tag'] - end - - if attributes.key?(:'hit_count') - self.hit_count = attributes[:'hit_count'] - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @last_access.nil? - invalid_properties.push('invalid value for "last_access", last_access cannot be nil.') - end - - if @e_tag.nil? - invalid_properties.push('invalid value for "e_tag", e_tag cannot be nil.') - end - - if @hit_count.nil? - invalid_properties.push('invalid value for "hit_count", hit_count cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @last_access.nil? - return false if @e_tag.nil? - return false if @hit_count.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expires == o.expires && - last_access == o.last_access && - e_tag == o.e_tag && - hit_count == o.hit_count && - comment == o.comment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expires, last_access, e_tag, hit_count, comment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request.rb index 08dc7ddf9c..0c43cf5d02 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -51,9 +51,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -86,41 +91,54 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'method') self.method = attributes[:'method'] + else + self.method = nil end if attributes.key?(:'url') self.url = attributes[:'url'] + else + self.url = nil end if attributes.key?(:'http_version') self.http_version = attributes[:'http_version'] + else + self.http_version = nil end if attributes.key?(:'cookies') if (value = attributes[:'cookies']).is_a?(Array) self.cookies = value end + else + self.cookies = nil end if attributes.key?(:'headers') if (value = attributes[:'headers']).is_a?(Array) self.headers = value end + else + self.headers = nil end if attributes.key?(:'query_string') if (value = attributes[:'query_string']).is_a?(Array) self.query_string = value end + else + self.query_string = nil end if attributes.key?(:'post_data') @@ -129,10 +147,14 @@ def initialize(attributes = {}) if attributes.key?(:'headers_size') self.headers_size = attributes[:'headers_size'] + else + self.headers_size = nil end if attributes.key?(:'body_size') self.body_size = attributes[:'body_size'] + else + self.body_size = nil end if attributes.key?(:'comment') @@ -143,6 +165,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @method.nil? invalid_properties.push('invalid value for "method", method cannot be nil.') @@ -182,6 +205,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @method.nil? return false if @url.nil? return false if @http_version.nil? @@ -193,6 +217,86 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] method Value to be assigned + def method=(method) + if method.nil? + fail ArgumentError, 'method cannot be nil' + end + + @method = method + end + + # Custom attribute writer method with validation + # @param [Object] url Value to be assigned + def url=(url) + if url.nil? + fail ArgumentError, 'url cannot be nil' + end + + @url = url + end + + # Custom attribute writer method with validation + # @param [Object] http_version Value to be assigned + def http_version=(http_version) + if http_version.nil? + fail ArgumentError, 'http_version cannot be nil' + end + + @http_version = http_version + end + + # Custom attribute writer method with validation + # @param [Object] cookies Value to be assigned + def cookies=(cookies) + if cookies.nil? + fail ArgumentError, 'cookies cannot be nil' + end + + @cookies = cookies + end + + # Custom attribute writer method with validation + # @param [Object] headers Value to be assigned + def headers=(headers) + if headers.nil? + fail ArgumentError, 'headers cannot be nil' + end + + @headers = headers + end + + # Custom attribute writer method with validation + # @param [Object] query_string Value to be assigned + def query_string=(query_string) + if query_string.nil? + fail ArgumentError, 'query_string cannot be nil' + end + + @query_string = query_string + end + + # Custom attribute writer method with validation + # @param [Object] headers_size Value to be assigned + def headers_size=(headers_size) + if headers_size.nil? + fail ArgumentError, 'headers_size cannot be nil' + end + + @headers_size = headers_size + end + + # Custom attribute writer method with validation + # @param [Object] body_size Value to be assigned + def body_size=(body_size) + if body_size.nil? + fail ArgumentError, 'body_size cannot be nil' + end + + @body_size = body_size + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -226,37 +330,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -291,7 +388,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_cookies_inner.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_cookies_inner.rb index 1e7977917f..e371c12ffa 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_cookies_inner.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_cookies_inner.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -45,9 +45,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -78,19 +83,24 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestCookiesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestCookiesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'value') self.value = attributes[:'value'] + else + self.value = nil end if attributes.key?(:'path') @@ -121,6 +131,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') @@ -136,11 +147,32 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @value.nil? true end + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] value Value to be assigned + def value=(value) + if value.nil? + fail ArgumentError, 'value cannot be nil' + end + + @value = value + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -172,37 +204,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -237,7 +262,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data.rb index 8019a5dccc..4b0d4b20e1 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -31,9 +31,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -59,15 +64,18 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestPostData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestPostData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'mime_type') self.mime_type = attributes[:'mime_type'] + else + self.mime_type = nil end if attributes.key?(:'text') @@ -84,6 +92,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @mime_type.nil? invalid_properties.push('invalid value for "mime_type", mime_type cannot be nil.') @@ -95,10 +104,21 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @mime_type.nil? true end + # Custom attribute writer method with validation + # @param [Object] mime_type Value to be assigned + def mime_type=(mime_type) + if mime_type.nil? + fail ArgumentError, 'mime_type cannot be nil' + end + + @mime_type = mime_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -125,37 +145,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -190,7 +203,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data_params_inner.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data_params_inner.rb index 09bfe53abc..fabde113b3 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data_params_inner.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_post_data_params_inner.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -36,9 +36,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -66,9 +71,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestPostDataParamsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestPostDataParamsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -97,6 +103,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -104,6 +111,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -135,37 +143,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -200,7 +201,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_query_string_inner.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_query_string_inner.rb index 39053c2a76..4faad3d439 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_query_string_inner.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_request_query_string_inner.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -58,19 +63,24 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestQueryStringInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryRequestQueryStringInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'value') self.value = attributes[:'value'] + else + self.value = nil end if attributes.key?(:'comment') @@ -81,6 +91,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') @@ -96,11 +107,32 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @value.nil? true end + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] value Value to be assigned + def value=(value) + if value.nil? + fail ArgumentError, 'value cannot be nil' + end + + @value = value + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -127,37 +159,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -192,7 +217,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response.rb index 5e98298e9d..bdf596fec0 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -51,9 +51,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -86,51 +91,70 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'status') self.status = attributes[:'status'] + else + self.status = nil end if attributes.key?(:'status_text') self.status_text = attributes[:'status_text'] + else + self.status_text = nil end if attributes.key?(:'http_version') self.http_version = attributes[:'http_version'] + else + self.http_version = nil end if attributes.key?(:'cookies') if (value = attributes[:'cookies']).is_a?(Array) self.cookies = value end + else + self.cookies = nil end if attributes.key?(:'headers') if (value = attributes[:'headers']).is_a?(Array) self.headers = value end + else + self.headers = nil end if attributes.key?(:'content') self.content = attributes[:'content'] + else + self.content = nil end if attributes.key?(:'redirect_url') self.redirect_url = attributes[:'redirect_url'] + else + self.redirect_url = nil end if attributes.key?(:'headers_size') self.headers_size = attributes[:'headers_size'] + else + self.headers_size = nil end if attributes.key?(:'body_size') self.body_size = attributes[:'body_size'] + else + self.body_size = nil end if attributes.key?(:'comment') @@ -141,6 +165,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') @@ -184,6 +209,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @status.nil? return false if @status_text.nil? return false if @http_version.nil? @@ -196,6 +222,96 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] status_text Value to be assigned + def status_text=(status_text) + if status_text.nil? + fail ArgumentError, 'status_text cannot be nil' + end + + @status_text = status_text + end + + # Custom attribute writer method with validation + # @param [Object] http_version Value to be assigned + def http_version=(http_version) + if http_version.nil? + fail ArgumentError, 'http_version cannot be nil' + end + + @http_version = http_version + end + + # Custom attribute writer method with validation + # @param [Object] cookies Value to be assigned + def cookies=(cookies) + if cookies.nil? + fail ArgumentError, 'cookies cannot be nil' + end + + @cookies = cookies + end + + # Custom attribute writer method with validation + # @param [Object] headers Value to be assigned + def headers=(headers) + if headers.nil? + fail ArgumentError, 'headers cannot be nil' + end + + @headers = headers + end + + # Custom attribute writer method with validation + # @param [Object] content Value to be assigned + def content=(content) + if content.nil? + fail ArgumentError, 'content cannot be nil' + end + + @content = content + end + + # Custom attribute writer method with validation + # @param [Object] redirect_url Value to be assigned + def redirect_url=(redirect_url) + if redirect_url.nil? + fail ArgumentError, 'redirect_url cannot be nil' + end + + @redirect_url = redirect_url + end + + # Custom attribute writer method with validation + # @param [Object] headers_size Value to be assigned + def headers_size=(headers_size) + if headers_size.nil? + fail ArgumentError, 'headers_size cannot be nil' + end + + @headers_size = headers_size + end + + # Custom attribute writer method with validation + # @param [Object] body_size Value to be assigned + def body_size=(body_size) + if body_size.nil? + fail ArgumentError, 'body_size cannot be nil' + end + + @body_size = body_size + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -229,37 +345,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -294,7 +403,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response_content.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response_content.rb index 0e3aa6b04c..7feb8ea0d4 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response_content.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_response_content.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -63,9 +63,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -102,15 +107,18 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryResponseContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryResponseContent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'size') self.size = attributes[:'size'] + else + self.size = nil end if attributes.key?(:'compression') @@ -119,6 +127,8 @@ def initialize(attributes = {}) if attributes.key?(:'mime_type') self.mime_type = attributes[:'mime_type'] + else + self.mime_type = nil end if attributes.key?(:'text') @@ -185,6 +195,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @size.nil? invalid_properties.push('invalid value for "size", size cannot be nil.') @@ -232,6 +243,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @size.nil? return false if @mime_type.nil? return false if !@_video_buffered_percent.nil? && @_video_buffered_percent < -1 @@ -245,10 +257,34 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] size Value to be assigned + def size=(size) + if size.nil? + fail ArgumentError, 'size cannot be nil' + end + + @size = size + end + + # Custom attribute writer method with validation + # @param [Object] mime_type Value to be assigned + def mime_type=(mime_type) + if mime_type.nil? + fail ArgumentError, 'mime_type cannot be nil' + end + + @mime_type = mime_type + end + # Custom attribute writer method with validation # @param [Object] _video_buffered_percent Value to be assigned def _video_buffered_percent=(_video_buffered_percent) - if !_video_buffered_percent.nil? && _video_buffered_percent < -1 + if _video_buffered_percent.nil? + fail ArgumentError, '_video_buffered_percent cannot be nil' + end + + if _video_buffered_percent < -1 fail ArgumentError, 'invalid value for "_video_buffered_percent", must be greater than or equal to -1.' end @@ -258,7 +294,11 @@ def _video_buffered_percent=(_video_buffered_percent) # Custom attribute writer method with validation # @param [Object] _video_stall_count Value to be assigned def _video_stall_count=(_video_stall_count) - if !_video_stall_count.nil? && _video_stall_count < -1 + if _video_stall_count.nil? + fail ArgumentError, '_video_stall_count cannot be nil' + end + + if _video_stall_count < -1 fail ArgumentError, 'invalid value for "_video_stall_count", must be greater than or equal to -1.' end @@ -268,7 +308,11 @@ def _video_stall_count=(_video_stall_count) # Custom attribute writer method with validation # @param [Object] _video_decoded_byte_count Value to be assigned def _video_decoded_byte_count=(_video_decoded_byte_count) - if !_video_decoded_byte_count.nil? && _video_decoded_byte_count < -1 + if _video_decoded_byte_count.nil? + fail ArgumentError, '_video_decoded_byte_count cannot be nil' + end + + if _video_decoded_byte_count < -1 fail ArgumentError, 'invalid value for "_video_decoded_byte_count", must be greater than or equal to -1.' end @@ -278,7 +322,11 @@ def _video_decoded_byte_count=(_video_decoded_byte_count) # Custom attribute writer method with validation # @param [Object] _video_waiting_count Value to be assigned def _video_waiting_count=(_video_waiting_count) - if !_video_waiting_count.nil? && _video_waiting_count < -1 + if _video_waiting_count.nil? + fail ArgumentError, '_video_waiting_count cannot be nil' + end + + if _video_waiting_count < -1 fail ArgumentError, 'invalid value for "_video_waiting_count", must be greater than or equal to -1.' end @@ -288,7 +336,11 @@ def _video_waiting_count=(_video_waiting_count) # Custom attribute writer method with validation # @param [Object] _video_error_count Value to be assigned def _video_error_count=(_video_error_count) - if !_video_error_count.nil? && _video_error_count < -1 + if _video_error_count.nil? + fail ArgumentError, '_video_error_count cannot be nil' + end + + if _video_error_count < -1 fail ArgumentError, 'invalid value for "_video_error_count", must be greater than or equal to -1.' end @@ -298,7 +350,11 @@ def _video_error_count=(_video_error_count) # Custom attribute writer method with validation # @param [Object] _video_dropped_frames Value to be assigned def _video_dropped_frames=(_video_dropped_frames) - if !_video_dropped_frames.nil? && _video_dropped_frames < -1 + if _video_dropped_frames.nil? + fail ArgumentError, '_video_dropped_frames cannot be nil' + end + + if _video_dropped_frames < -1 fail ArgumentError, 'invalid value for "_video_dropped_frames", must be greater than or equal to -1.' end @@ -308,7 +364,11 @@ def _video_dropped_frames=(_video_dropped_frames) # Custom attribute writer method with validation # @param [Object] _video_total_frames Value to be assigned def _video_total_frames=(_video_total_frames) - if !_video_total_frames.nil? && _video_total_frames < -1 + if _video_total_frames.nil? + fail ArgumentError, '_video_total_frames cannot be nil' + end + + if _video_total_frames < -1 fail ArgumentError, 'invalid value for "_video_total_frames", must be greater than or equal to -1.' end @@ -318,7 +378,11 @@ def _video_total_frames=(_video_total_frames) # Custom attribute writer method with validation # @param [Object] _video_audio_bytes_decoded Value to be assigned def _video_audio_bytes_decoded=(_video_audio_bytes_decoded) - if !_video_audio_bytes_decoded.nil? && _video_audio_bytes_decoded < -1 + if _video_audio_bytes_decoded.nil? + fail ArgumentError, '_video_audio_bytes_decoded cannot be nil' + end + + if _video_audio_bytes_decoded < -1 fail ArgumentError, 'invalid value for "_video_audio_bytes_decoded", must be greater than or equal to -1.' end @@ -362,37 +426,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -427,7 +484,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_timings.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_timings.rb index 7a891c5db5..8eaa39485a 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_timings.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_entry_timings.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -45,9 +45,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -78,9 +83,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryTimings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarEntryTimings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -135,6 +141,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @dns.nil? invalid_properties.push('invalid value for "dns", dns cannot be nil.') @@ -198,6 +205,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @dns.nil? return false if @dns < -1 return false if @connect.nil? @@ -344,37 +352,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -409,7 +410,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_log.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_log.rb index 292dbeab65..1ab9869299 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_log.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_log.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -25,6 +25,12 @@ class HarLog attr_accessor :entries + # W3C Trace Context trace ID for distributed tracing + attr_accessor :_trace_id + + # W3C Trace Context span ID for this HAR trace root + attr_accessor :_span_id + attr_accessor :comment # Attribute mapping from ruby-style variable name to JSON key. @@ -35,13 +41,20 @@ def self.attribute_map :'browser' => :'browser', :'pages' => :'pages', :'entries' => :'entries', + :'_trace_id' => :'_trace_id', + :'_span_id' => :'_span_id', :'comment' => :'comment' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,6 +65,8 @@ def self.openapi_types :'browser' => :'HarLogCreator', :'pages' => :'Array', :'entries' => :'Array', + :'_trace_id' => :'String', + :'_span_id' => :'String', :'comment' => :'String' } end @@ -70,19 +85,24 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarLog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarLog`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'version') self.version = attributes[:'version'] + else + self.version = nil end if attributes.key?(:'creator') self.creator = attributes[:'creator'] + else + self.creator = nil end if attributes.key?(:'browser') @@ -93,12 +113,24 @@ def initialize(attributes = {}) if (value = attributes[:'pages']).is_a?(Array) self.pages = value end + else + self.pages = nil end if attributes.key?(:'entries') if (value = attributes[:'entries']).is_a?(Array) self.entries = value end + else + self.entries = nil + end + + if attributes.key?(:'_trace_id') + self._trace_id = attributes[:'_trace_id'] + end + + if attributes.key?(:'_span_id') + self._span_id = attributes[:'_span_id'] end if attributes.key?(:'comment') @@ -109,6 +141,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @version.nil? invalid_properties.push('invalid value for "version", version cannot be nil.') @@ -132,6 +165,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @version.nil? return false if @creator.nil? return false if @pages.nil? @@ -139,6 +173,46 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] version Value to be assigned + def version=(version) + if version.nil? + fail ArgumentError, 'version cannot be nil' + end + + @version = version + end + + # Custom attribute writer method with validation + # @param [Object] creator Value to be assigned + def creator=(creator) + if creator.nil? + fail ArgumentError, 'creator cannot be nil' + end + + @creator = creator + end + + # Custom attribute writer method with validation + # @param [Object] pages Value to be assigned + def pages=(pages) + if pages.nil? + fail ArgumentError, 'pages cannot be nil' + end + + @pages = pages + end + + # Custom attribute writer method with validation + # @param [Object] entries Value to be assigned + def entries=(entries) + if entries.nil? + fail ArgumentError, 'entries cannot be nil' + end + + @entries = entries + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -149,6 +223,8 @@ def ==(o) browser == o.browser && pages == o.pages && entries == o.entries && + _trace_id == o._trace_id && + _span_id == o._span_id && comment == o.comment end @@ -161,44 +237,37 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [version, creator, browser, pages, entries, comment].hash + [version, creator, browser, pages, entries, _trace_id, _span_id, comment].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -233,7 +302,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/har_log_creator.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/har_log_creator.rb index 90bd5dd8a2..74304d18f0 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/har_log_creator.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/har_log_creator.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -58,19 +63,24 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarLogCreator`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::HarLogCreator`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'version') self.version = attributes[:'version'] + else + self.version = nil end if attributes.key?(:'comment') @@ -81,6 +91,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') @@ -96,11 +107,32 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @version.nil? true end + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] version Value to be assigned + def version=(version) + if version.nil? + fail ArgumentError, 'version cannot be nil' + end + + @version = version + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -127,37 +159,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -192,7 +217,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/header.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/header.rb index d2d315c9fd..0ee4adb398 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/header.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/header.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -58,19 +63,24 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Header`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Header`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'value') self.value = attributes[:'value'] + else + self.value = nil end if attributes.key?(:'comment') @@ -81,6 +91,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') @@ -96,11 +107,32 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @value.nil? true end + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] value Value to be assigned + def value=(value) + if value.nil? + fail ArgumentError, 'value cannot be nil' + end + + @value = value + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -127,37 +159,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -192,7 +217,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/largest_contentful_paint.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/largest_contentful_paint.rb index 57d3ab6f14..7de2519f4b 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/largest_contentful_paint.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/largest_contentful_paint.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -33,9 +33,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -62,9 +67,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::LargestContentfulPaint`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::LargestContentfulPaint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -97,6 +103,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@start_time.nil? && @start_time < -1 invalid_properties.push('invalid value for "start_time", must be greater than or equal to -1.') @@ -112,6 +119,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@start_time.nil? && @start_time < -1 return false if !@size.nil? && @size < -1 true @@ -120,7 +128,11 @@ def valid? # Custom attribute writer method with validation # @param [Object] start_time Value to be assigned def start_time=(start_time) - if !start_time.nil? && start_time < -1 + if start_time.nil? + fail ArgumentError, 'start_time cannot be nil' + end + + if start_time < -1 fail ArgumentError, 'invalid value for "start_time", must be greater than or equal to -1.' end @@ -130,7 +142,11 @@ def start_time=(start_time) # Custom attribute writer method with validation # @param [Object] size Value to be assigned def size=(size) - if !size.nil? && size < -1 + if size.nil? + fail ArgumentError, 'size cannot be nil' + end + + if size < -1 fail ArgumentError, 'invalid value for "size", must be greater than or equal to -1.' end @@ -164,37 +180,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -229,7 +238,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria.rb index 37bafa2f1e..600666a1b9 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -74,9 +74,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -88,10 +93,10 @@ def self.openapi_types :'content' => :'String', :'content_type' => :'String', :'websocket_message' => :'String', - :'request_header' => :'MatchCriteriaRequestHeader', - :'request_cookie' => :'MatchCriteriaRequestHeader', - :'response_header' => :'MatchCriteriaRequestHeader', - :'response_cookie' => :'MatchCriteriaRequestHeader', + :'request_header' => :'NameValuePair', + :'request_cookie' => :'NameValuePair', + :'response_header' => :'NameValuePair', + :'response_cookie' => :'NameValuePair', :'json_valid' => :'Boolean', :'json_path' => :'String', :'json_schema' => :'String', @@ -113,9 +118,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::MatchCriteria`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::MatchCriteria`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -182,6 +188,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -189,6 +196,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -229,37 +237,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -294,7 +295,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria_request_header.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria_request_header.rb deleted file mode 100644 index 7c0ebf8efe..0000000000 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/match_criteria_request_header.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#BrowserUp MitmProxy - -#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - -The version of the OpenAPI document: 1.24 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end - -require 'date' -require 'time' - -module BrowserupMitmProxy - class MatchCriteriaRequestHeader - # Name to match - attr_accessor :name - - # Value to match - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'NameValuePair' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `BrowserupMitmProxy::MatchCriteriaRequestHeader` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::MatchCriteriaRequestHeader`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/metric.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/metric.rb index 3c610ab66c..55b165de71 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/metric.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/metric.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -29,16 +29,21 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { :'name' => :'String', - :'value' => :'Float' + :'value' => :'Integer' } end @@ -56,9 +61,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Metric`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Metric`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -75,6 +81,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +89,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +118,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -175,7 +176,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/name_value_pair.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/name_value_pair.rb index e53d3aadd8..429344baf0 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/name_value_pair.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/name_value_pair.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -29,9 +29,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -56,9 +61,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::NameValuePair`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::NameValuePair`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -75,6 +81,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +89,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +118,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -175,7 +176,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/page.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/page.rb index 1ed7e7894f..9824da8c87 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/page.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/page.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -27,6 +27,12 @@ class Page attr_accessor :_errors + # W3C Trace Context span ID for this page + attr_accessor :_span_id + + # W3C Trace Context parent span ID (typically the HAR log span ID) + attr_accessor :_parent_id + attr_accessor :page_timings attr_accessor :comment @@ -40,14 +46,21 @@ def self.attribute_map :'_verifications' => :'_verifications', :'_metrics' => :'_metrics', :'_errors' => :'_errors', + :'_span_id' => :'_span_id', + :'_parent_id' => :'_parent_id', :'page_timings' => :'pageTimings', :'comment' => :'comment' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -59,6 +72,8 @@ def self.openapi_types :'_verifications' => :'Array', :'_metrics' => :'Array', :'_errors' => :'Array', + :'_span_id' => :'String', + :'_parent_id' => :'String', :'page_timings' => :'PageTimings', :'comment' => :'String' } @@ -78,23 +93,30 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Page`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::Page`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'started_date_time') self.started_date_time = attributes[:'started_date_time'] + else + self.started_date_time = nil end if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'title') self.title = attributes[:'title'] + else + self.title = nil end if attributes.key?(:'_verifications') @@ -115,8 +137,18 @@ def initialize(attributes = {}) end end + if attributes.key?(:'_span_id') + self._span_id = attributes[:'_span_id'] + end + + if attributes.key?(:'_parent_id') + self._parent_id = attributes[:'_parent_id'] + end + if attributes.key?(:'page_timings') self.page_timings = attributes[:'page_timings'] + else + self.page_timings = nil end if attributes.key?(:'comment') @@ -127,6 +159,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @started_date_time.nil? invalid_properties.push('invalid value for "started_date_time", started_date_time cannot be nil.') @@ -150,6 +183,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @started_date_time.nil? return false if @id.nil? return false if @title.nil? @@ -157,6 +191,46 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] started_date_time Value to be assigned + def started_date_time=(started_date_time) + if started_date_time.nil? + fail ArgumentError, 'started_date_time cannot be nil' + end + + @started_date_time = started_date_time + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] page_timings Value to be assigned + def page_timings=(page_timings) + if page_timings.nil? + fail ArgumentError, 'page_timings cannot be nil' + end + + @page_timings = page_timings + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -168,6 +242,8 @@ def ==(o) _verifications == o._verifications && _metrics == o._metrics && _errors == o._errors && + _span_id == o._span_id && + _parent_id == o._parent_id && page_timings == o.page_timings && comment == o.comment end @@ -181,44 +257,37 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [started_date_time, id, title, _verifications, _metrics, _errors, page_timings, comment].hash + [started_date_time, id, title, _verifications, _metrics, _errors, _span_id, _parent_id, page_timings, comment].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -253,7 +322,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/page_timing.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/page_timing.rb index d09250333c..3db4c36775 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/page_timing.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/page_timing.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -51,6 +51,12 @@ class PageTiming # Top level href, including hashtag, etc per the browser attr_accessor :_href + # W3C Trace Context span ID for this page + attr_accessor :_span_id + + # W3C Trace Context parent span ID (typically the HAR log span ID) + attr_accessor :_parent_id + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -65,30 +71,39 @@ def self.attribute_map :'_dns' => :'_dns', :'_ssl' => :'_ssl', :'_time_to_first_byte' => :'_timeToFirstByte', - :'_href' => :'_href' + :'_href' => :'_href', + :'_span_id' => :'_span_id', + :'_parent_id' => :'_parent_id' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { - :'on_content_load' => :'Float', - :'on_load' => :'Float', - :'_first_input_delay' => :'Float', - :'_first_paint' => :'Float', - :'_cumulative_layout_shift' => :'Float', - :'_largest_contentful_paint' => :'Float', - :'_dom_interactive' => :'Float', - :'_first_contentful_paint' => :'Float', - :'_dns' => :'Float', - :'_ssl' => :'Float', - :'_time_to_first_byte' => :'Float', - :'_href' => :'String' + :'on_content_load' => :'Integer', + :'on_load' => :'Integer', + :'_first_input_delay' => :'Integer', + :'_first_paint' => :'Integer', + :'_cumulative_layout_shift' => :'Integer', + :'_largest_contentful_paint' => :'Integer', + :'_dom_interactive' => :'Integer', + :'_first_contentful_paint' => :'Integer', + :'_dns' => :'Integer', + :'_ssl' => :'Integer', + :'_time_to_first_byte' => :'Integer', + :'_href' => :'String', + :'_span_id' => :'String', + :'_parent_id' => :'String' } end @@ -106,9 +121,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::PageTiming`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::PageTiming`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -160,11 +176,20 @@ def initialize(attributes = {}) if attributes.key?(:'_href') self._href = attributes[:'_href'] end + + if attributes.key?(:'_span_id') + self._span_id = attributes[:'_span_id'] + end + + if attributes.key?(:'_parent_id') + self._parent_id = attributes[:'_parent_id'] + end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -172,6 +197,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -191,7 +217,9 @@ def ==(o) _dns == o._dns && _ssl == o._ssl && _time_to_first_byte == o._time_to_first_byte && - _href == o._href + _href == o._href && + _span_id == o._span_id && + _parent_id == o._parent_id end # @see the `==` method @@ -203,44 +231,37 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [on_content_load, on_load, _first_input_delay, _first_paint, _cumulative_layout_shift, _largest_contentful_paint, _dom_interactive, _first_contentful_paint, _dns, _ssl, _time_to_first_byte, _href].hash + [on_content_load, on_load, _first_input_delay, _first_paint, _cumulative_layout_shift, _largest_contentful_paint, _dom_interactive, _first_contentful_paint, _dns, _ssl, _time_to_first_byte, _href, _span_id, _parent_id].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -275,7 +296,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/page_timings.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/page_timings.rb index 3b9fd11344..e322f32d97 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/page_timings.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/page_timings.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -60,9 +60,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -98,9 +103,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::PageTimings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::PageTimings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -183,6 +189,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @on_content_load.nil? invalid_properties.push('invalid value for "on_content_load", on_content_load cannot be nil.') @@ -238,6 +245,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @on_content_load.nil? return false if @on_content_load < -1 return false if @on_load.nil? @@ -284,7 +292,11 @@ def on_load=(on_load) # Custom attribute writer method with validation # @param [Object] _dns Value to be assigned def _dns=(_dns) - if !_dns.nil? && _dns < -1 + if _dns.nil? + fail ArgumentError, '_dns cannot be nil' + end + + if _dns < -1 fail ArgumentError, 'invalid value for "_dns", must be greater than or equal to -1.' end @@ -294,7 +306,11 @@ def _dns=(_dns) # Custom attribute writer method with validation # @param [Object] _ssl Value to be assigned def _ssl=(_ssl) - if !_ssl.nil? && _ssl < -1 + if _ssl.nil? + fail ArgumentError, '_ssl cannot be nil' + end + + if _ssl < -1 fail ArgumentError, 'invalid value for "_ssl", must be greater than or equal to -1.' end @@ -304,7 +320,11 @@ def _ssl=(_ssl) # Custom attribute writer method with validation # @param [Object] _time_to_first_byte Value to be assigned def _time_to_first_byte=(_time_to_first_byte) - if !_time_to_first_byte.nil? && _time_to_first_byte < -1 + if _time_to_first_byte.nil? + fail ArgumentError, '_time_to_first_byte cannot be nil' + end + + if _time_to_first_byte < -1 fail ArgumentError, 'invalid value for "_time_to_first_byte", must be greater than or equal to -1.' end @@ -314,7 +334,11 @@ def _time_to_first_byte=(_time_to_first_byte) # Custom attribute writer method with validation # @param [Object] _cumulative_layout_shift Value to be assigned def _cumulative_layout_shift=(_cumulative_layout_shift) - if !_cumulative_layout_shift.nil? && _cumulative_layout_shift < -1 + if _cumulative_layout_shift.nil? + fail ArgumentError, '_cumulative_layout_shift cannot be nil' + end + + if _cumulative_layout_shift < -1 fail ArgumentError, 'invalid value for "_cumulative_layout_shift", must be greater than or equal to -1.' end @@ -324,7 +348,11 @@ def _cumulative_layout_shift=(_cumulative_layout_shift) # Custom attribute writer method with validation # @param [Object] _first_paint Value to be assigned def _first_paint=(_first_paint) - if !_first_paint.nil? && _first_paint < -1 + if _first_paint.nil? + fail ArgumentError, '_first_paint cannot be nil' + end + + if _first_paint < -1 fail ArgumentError, 'invalid value for "_first_paint", must be greater than or equal to -1.' end @@ -334,7 +362,11 @@ def _first_paint=(_first_paint) # Custom attribute writer method with validation # @param [Object] _first_input_delay Value to be assigned def _first_input_delay=(_first_input_delay) - if !_first_input_delay.nil? && _first_input_delay < -1 + if _first_input_delay.nil? + fail ArgumentError, '_first_input_delay cannot be nil' + end + + if _first_input_delay < -1 fail ArgumentError, 'invalid value for "_first_input_delay", must be greater than or equal to -1.' end @@ -344,7 +376,11 @@ def _first_input_delay=(_first_input_delay) # Custom attribute writer method with validation # @param [Object] _dom_interactive Value to be assigned def _dom_interactive=(_dom_interactive) - if !_dom_interactive.nil? && _dom_interactive < -1 + if _dom_interactive.nil? + fail ArgumentError, '_dom_interactive cannot be nil' + end + + if _dom_interactive < -1 fail ArgumentError, 'invalid value for "_dom_interactive", must be greater than or equal to -1.' end @@ -354,7 +390,11 @@ def _dom_interactive=(_dom_interactive) # Custom attribute writer method with validation # @param [Object] _first_contentful_paint Value to be assigned def _first_contentful_paint=(_first_contentful_paint) - if !_first_contentful_paint.nil? && _first_contentful_paint < -1 + if _first_contentful_paint.nil? + fail ArgumentError, '_first_contentful_paint cannot be nil' + end + + if _first_contentful_paint < -1 fail ArgumentError, 'invalid value for "_first_contentful_paint", must be greater than or equal to -1.' end @@ -397,37 +437,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -462,7 +495,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/verify_result.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/verify_result.rb index 22e77993dc..c93704ee90 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/verify_result.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/verify_result.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -33,9 +33,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -61,9 +66,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::VerifyResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::VerifyResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -84,6 +90,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -91,6 +98,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -120,37 +128,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -185,7 +186,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/models/web_socket_message.rb b/clients/ruby/lib/browserup_mitmproxy_client/models/web_socket_message.rb index b2e21de939..93f2daba83 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/models/web_socket_message.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/models/web_socket_message.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -33,9 +33,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -62,33 +67,43 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::WebSocketMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::WebSocketMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'opcode') self.opcode = attributes[:'opcode'] + else + self.opcode = nil end if attributes.key?(:'data') self.data = attributes[:'data'] + else + self.data = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') @@ -112,6 +127,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @type.nil? return false if @opcode.nil? return false if @data.nil? @@ -119,6 +135,46 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] opcode Value to be assigned + def opcode=(opcode) + if opcode.nil? + fail ArgumentError, 'opcode cannot be nil' + end + + @opcode = opcode + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + + # Custom attribute writer method with validation + # @param [Object] time Value to be assigned + def time=(time) + if time.nil? + fail ArgumentError, 'time cannot be nil' + end + + @time = time + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -146,37 +202,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) @@ -211,7 +260,7 @@ def _deserialize(type, value) else # model # models (e.g. Pet) or oneOf klass = BrowserupMitmProxy.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end diff --git a/clients/ruby/lib/browserup_mitmproxy_client/version.rb b/clients/ruby/lib/browserup_mitmproxy_client/version.rb index dc281b1984..58f87938cf 100644 --- a/clients/ruby/lib/browserup_mitmproxy_client/version.rb +++ b/clients/ruby/lib/browserup_mitmproxy_client/version.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end diff --git a/clients/ruby/spec/api/browser_up_proxy_api_spec.rb b/clients/ruby/spec/api/browser_up_proxy_api_spec.rb index 95ef44eaf7..97437e4fee 100644 --- a/clients/ruby/spec/api/browser_up_proxy_api_spec.rb +++ b/clients/ruby/spec/api/browser_up_proxy_api_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -39,7 +39,7 @@ # @return [nil] describe 'add_error test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -50,7 +50,7 @@ # @return [nil] describe 'add_metric test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -60,7 +60,7 @@ # @return [Har] describe 'get_har_log test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -70,7 +70,7 @@ # @return [nil] describe 'healthcheck test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -81,7 +81,7 @@ # @return [Har] describe 'new_page test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -91,7 +91,7 @@ # @return [Har] describe 'reset_har_log test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -103,7 +103,7 @@ # @return [VerifyResult] describe 'verify_not_present test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -115,7 +115,7 @@ # @return [VerifyResult] describe 'verify_present test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -128,7 +128,7 @@ # @return [VerifyResult] describe 'verify_size test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -141,7 +141,7 @@ # @return [VerifyResult] describe 'verify_sla test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/api_client_spec.rb b/clients/ruby/spec/api_client_spec.rb deleted file mode 100644 index 3c45eb33a6..0000000000 --- a/clients/ruby/spec/api_client_spec.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#BrowserUp MitmProxy - -#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - -The version of the OpenAPI document: 1.24 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end - -require 'spec_helper' - -describe BrowserupMitmProxy::ApiClient do - context 'initialization' do - context 'URL stuff' do - context 'host' do - it 'removes http from host' do - BrowserupMitmProxy.configure { |c| c.host = 'http://example.com' } - expect(BrowserupMitmProxy::Configuration.default.host).to eq('example.com') - end - - it 'removes https from host' do - BrowserupMitmProxy.configure { |c| c.host = 'https://wookiee.com' } - expect(BrowserupMitmProxy::ApiClient.default.config.host).to eq('wookiee.com') - end - - it 'removes trailing path from host' do - BrowserupMitmProxy.configure { |c| c.host = 'hobo.com/v4' } - expect(BrowserupMitmProxy::Configuration.default.host).to eq('hobo.com') - end - end - - context 'base_path' do - it "prepends a slash to base_path" do - BrowserupMitmProxy.configure { |c| c.base_path = 'v4/dog' } - expect(BrowserupMitmProxy::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - BrowserupMitmProxy.configure { |c| c.base_path = '/v4/dog' } - expect(BrowserupMitmProxy::Configuration.default.base_path).to eq('/v4/dog') - end - - it "ends up as a blank string if nil" do - BrowserupMitmProxy.configure { |c| c.base_path = nil } - expect(BrowserupMitmProxy::Configuration.default.base_path).to eq('') - end - end - end - end - - describe 'params_encoding in #build_request' do - let(:config) { BrowserupMitmProxy::Configuration.new } - let(:api_client) { BrowserupMitmProxy::ApiClient.new(config) } - - it 'defaults to nil' do - expect(BrowserupMitmProxy::Configuration.default.params_encoding).to eq(nil) - expect(config.params_encoding).to eq(nil) - - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(nil) - end - - it 'can be customized' do - config.params_encoding = :multi - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(:multi) - end - end - - describe 'timeout in #build_request' do - let(:config) { BrowserupMitmProxy::Configuration.new } - let(:api_client) { BrowserupMitmProxy::ApiClient.new(config) } - - it 'defaults to 0' do - expect(BrowserupMitmProxy::Configuration.default.timeout).to eq(0) - expect(config.timeout).to eq(0) - - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(0) - end - - it 'can be customized' do - config.timeout = 100 - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(100) - end - end - - - - describe '#deserialize' do - it "handles Array" do - api_client = BrowserupMitmProxy::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') - expect(data).to be_instance_of(Array) - expect(data).to eq([12, 34]) - end - - it 'handles Array>' do - api_client = BrowserupMitmProxy::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') - expect(data).to be_instance_of(Array) - expect(data).to eq([[12, 34], [56]]) - end - - it 'handles Hash' do - api_client = BrowserupMitmProxy::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') - expect(data).to be_instance_of(Hash) - expect(data).to eq(:message => 'Hello') - end - end - - describe "#object_to_hash" do - it 'ignores nils and includes empty arrays' do - # uncomment below to test object_to_hash for model - # api_client = BrowserupMitmProxy::ApiClient.new - # _model = BrowserupMitmProxy::ModelName.new - # update the model attribute below - # _model.id = 1 - # update the expected value (hash) below - # expected = {id: 1, name: '', tags: []} - # expect(api_client.object_to_hash(_model)).to eq(expected) - end - end - - describe '#build_collection_param' do - let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { BrowserupMitmProxy::ApiClient.new } - - it 'works for csv' do - expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') - end - - it 'works for ssv' do - expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') - end - - it 'works for tsv' do - expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") - end - - it 'works for pipes' do - expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') - end - - it 'works for multi' do - expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) - end - - it 'fails for invalid collection format' do - expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') - end - end - - describe '#json_mime?' do - let(:api_client) { BrowserupMitmProxy::ApiClient.new } - - it 'works' do - expect(api_client.json_mime?(nil)).to eq false - expect(api_client.json_mime?('')).to eq false - - expect(api_client.json_mime?('application/json')).to eq true - expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true - expect(api_client.json_mime?('APPLICATION/JSON')).to eq true - - expect(api_client.json_mime?('application/xml')).to eq false - expect(api_client.json_mime?('text/plain')).to eq false - expect(api_client.json_mime?('application/jsonp')).to eq false - end - end - - describe '#select_header_accept' do - let(:api_client) { BrowserupMitmProxy::ApiClient.new } - - it 'works' do - expect(api_client.select_header_accept(nil)).to be_nil - expect(api_client.select_header_accept([])).to be_nil - - expect(api_client.select_header_accept(['application/json'])).to eq('application/json') - expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - - expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') - end - end - - describe '#select_header_content_type' do - let(:api_client) { BrowserupMitmProxy::ApiClient.new } - - it 'works' do - expect(api_client.select_header_content_type(nil)).to be_nil - expect(api_client.select_header_content_type([])).to be_nil - - expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') - expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') - end - end - - describe '#sanitize_filename' do - let(:api_client) { BrowserupMitmProxy::ApiClient.new } - - it 'works' do - expect(api_client.sanitize_filename('sun')).to eq('sun') - expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') - end - end -end diff --git a/clients/ruby/spec/configuration_spec.rb b/clients/ruby/spec/configuration_spec.rb deleted file mode 100644 index 3218884c95..0000000000 --- a/clients/ruby/spec/configuration_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#BrowserUp MitmProxy - -#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - -The version of the OpenAPI document: 1.24 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end - -require 'spec_helper' - -describe BrowserupMitmProxy::Configuration do - let(:config) { BrowserupMitmProxy::Configuration.default } - - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("http://localhost:48088") - # BrowserupMitmProxy.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end - end - - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - # expect(config.base_url).to eq("http://localhost:48088") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("http://localhost:48088") - end - end - end -end diff --git a/clients/ruby/spec/models/action_spec.rb b/clients/ruby/spec/models/action_spec.rb index bb0c991a49..6c4cec3b18 100644 --- a/clients/ruby/spec/models/action_spec.rb +++ b/clients/ruby/spec/models/action_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,54 +22,56 @@ describe 'test an instance of Action' do it 'should create an instance of Action' do - expect(instance).to be_instance_of(BrowserupMitmProxy::Action) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::Action) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "class_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "xpath"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "data_attributes"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "form_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "content"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/error_spec.rb b/clients/ruby/spec/models/error_spec.rb index a8174759ad..9a38a034e4 100644 --- a/clients/ruby/spec/models/error_spec.rb +++ b/clients/ruby/spec/models/error_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,18 +22,20 @@ describe 'test an instance of Error' do it 'should create an instance of Error' do - expect(instance).to be_instance_of(BrowserupMitmProxy::Error) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::Error) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "details"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_cache_before_request_one_of_spec.rb b/clients/ruby/spec/models/har_entry_cache_before_request_one_of_spec.rb deleted file mode 100644 index 2209e0a453..0000000000 --- a/clients/ruby/spec/models/har_entry_cache_before_request_one_of_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#BrowserUp MitmProxy - -#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - -The version of the OpenAPI document: 1.24 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf do - let(:instance) { BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf.new } - - describe 'test an instance of HarEntryCacheBeforeRequestOneOf' do - it 'should create an instance of HarEntryCacheBeforeRequestOneOf' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryCacheBeforeRequestOneOf) - end - end - describe 'test attribute "expires"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "last_access"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "e_tag"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "hit_count"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/clients/ruby/spec/models/har_entry_cache_before_request_spec.rb b/clients/ruby/spec/models/har_entry_cache_before_request_spec.rb index 6975a2a134..d519c03e6d 100644 --- a/clients/ruby/spec/models/har_entry_cache_before_request_spec.rb +++ b/clients/ruby/spec/models/har_entry_cache_before_request_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -18,14 +18,43 @@ # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe BrowserupMitmProxy::HarEntryCacheBeforeRequest do - describe '.openapi_one_of' do - it 'lists the items referenced in the oneOf array' do - expect(described_class.openapi_one_of).to_not be_empty + let(:instance) { BrowserupMitmProxy::HarEntryCacheBeforeRequest.new } + + describe 'test an instance of HarEntryCacheBeforeRequest' do + it 'should create an instance of HarEntryCacheBeforeRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryCacheBeforeRequest) + end + end + + describe 'test attribute "expires"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_access"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end - describe '.build' do - it 'returns the correct model' do + describe 'test attribute "e_tag"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end + + describe 'test attribute "hit_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "comment"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + end diff --git a/clients/ruby/spec/models/har_entry_cache_spec.rb b/clients/ruby/spec/models/har_entry_cache_spec.rb index f98e304ea4..0563bb9c49 100644 --- a/clients/ruby/spec/models/har_entry_cache_spec.rb +++ b/clients/ruby/spec/models/har_entry_cache_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,24 +22,26 @@ describe 'test an instance of HarEntryCache' do it 'should create an instance of HarEntryCache' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryCache) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryCache) end end + describe 'test attribute "before_request"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "after_request"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_request_cookies_inner_spec.rb b/clients/ruby/spec/models/har_entry_request_cookies_inner_spec.rb index a95bcfa59e..6d12a3a680 100644 --- a/clients/ruby/spec/models/har_entry_request_cookies_inner_spec.rb +++ b/clients/ruby/spec/models/har_entry_request_cookies_inner_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,54 +22,56 @@ describe 'test an instance of HarEntryRequestCookiesInner' do it 'should create an instance of HarEntryRequestCookiesInner' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestCookiesInner) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestCookiesInner) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "path"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "domain"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "expires"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "http_only"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "secure"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_request_post_data_params_inner_spec.rb b/clients/ruby/spec/models/har_entry_request_post_data_params_inner_spec.rb index 39a28317ce..83ba81787d 100644 --- a/clients/ruby/spec/models/har_entry_request_post_data_params_inner_spec.rb +++ b/clients/ruby/spec/models/har_entry_request_post_data_params_inner_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,36 +22,38 @@ describe 'test an instance of HarEntryRequestPostDataParamsInner' do it 'should create an instance of HarEntryRequestPostDataParamsInner' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestPostDataParamsInner) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestPostDataParamsInner) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "content_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_request_post_data_spec.rb b/clients/ruby/spec/models/har_entry_request_post_data_spec.rb index c46c5de1b3..d8ecb97ec5 100644 --- a/clients/ruby/spec/models/har_entry_request_post_data_spec.rb +++ b/clients/ruby/spec/models/har_entry_request_post_data_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,24 +22,26 @@ describe 'test an instance of HarEntryRequestPostData' do it 'should create an instance of HarEntryRequestPostData' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestPostData) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestPostData) end end + describe 'test attribute "mime_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "params"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_request_query_string_inner_spec.rb b/clients/ruby/spec/models/har_entry_request_query_string_inner_spec.rb index 7be7893792..e662083118 100644 --- a/clients/ruby/spec/models/har_entry_request_query_string_inner_spec.rb +++ b/clients/ruby/spec/models/har_entry_request_query_string_inner_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,24 +22,26 @@ describe 'test an instance of HarEntryRequestQueryStringInner' do it 'should create an instance of HarEntryRequestQueryStringInner' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestQueryStringInner) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequestQueryStringInner) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_request_spec.rb b/clients/ruby/spec/models/har_entry_request_spec.rb index 0e5bd62edf..2ae08111a1 100644 --- a/clients/ruby/spec/models/har_entry_request_spec.rb +++ b/clients/ruby/spec/models/har_entry_request_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,66 +22,68 @@ describe 'test an instance of HarEntryRequest' do it 'should create an instance of HarEntryRequest' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequest) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryRequest) end end + describe 'test attribute "method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "http_version"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cookies"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "headers"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "query_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "post_data"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "headers_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "body_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_response_content_spec.rb b/clients/ruby/spec/models/har_entry_response_content_spec.rb index ea1375ace8..b0afb7581b 100644 --- a/clients/ruby/spec/models/har_entry_response_content_spec.rb +++ b/clients/ruby/spec/models/har_entry_response_content_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,90 +22,92 @@ describe 'test an instance of HarEntryResponseContent' do it 'should create an instance of HarEntryResponseContent' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryResponseContent) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryResponseContent) end end + describe 'test attribute "size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "compression"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "mime_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "encoding"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_buffered_percent"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_stall_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_decoded_byte_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_waiting_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_error_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_dropped_frames"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_total_frames"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_video_audio_bytes_decoded"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_response_spec.rb b/clients/ruby/spec/models/har_entry_response_spec.rb index a14538a50f..3c57c172e0 100644 --- a/clients/ruby/spec/models/har_entry_response_spec.rb +++ b/clients/ruby/spec/models/har_entry_response_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,66 +22,68 @@ describe 'test an instance of HarEntryResponse' do it 'should create an instance of HarEntryResponse' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryResponse) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryResponse) end end + describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status_text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "http_version"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cookies"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "headers"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "content"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "headers_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "body_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_spec.rb b/clients/ruby/spec/models/har_entry_spec.rb index 112f913f66..ba59f2b914 100644 --- a/clients/ruby/spec/models/har_entry_spec.rb +++ b/clients/ruby/spec/models/har_entry_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,72 +22,92 @@ describe 'test an instance of HarEntry' do it 'should create an instance of HarEntry' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntry) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntry) end end + describe 'test attribute "pageref"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "started_date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "request"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "response"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cache"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "timings"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "server_ip_address"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_web_socket_messages"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_span_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_parent_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_trace_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "connection"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_entry_timings_spec.rb b/clients/ruby/spec/models/har_entry_timings_spec.rb index cc34e847bd..49a323f604 100644 --- a/clients/ruby/spec/models/har_entry_timings_spec.rb +++ b/clients/ruby/spec/models/har_entry_timings_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,54 +22,56 @@ describe 'test an instance of HarEntryTimings' do it 'should create an instance of HarEntryTimings' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryTimings) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarEntryTimings) end end + describe 'test attribute "dns"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "connect"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "blocked"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_send"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "wait"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "receive"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "ssl"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_log_creator_spec.rb b/clients/ruby/spec/models/har_log_creator_spec.rb index 4ec9015ff6..98b1cb739d 100644 --- a/clients/ruby/spec/models/har_log_creator_spec.rb +++ b/clients/ruby/spec/models/har_log_creator_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,24 +22,26 @@ describe 'test an instance of HarLogCreator' do it 'should create an instance of HarLogCreator' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarLogCreator) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarLogCreator) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "version"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_log_spec.rb b/clients/ruby/spec/models/har_log_spec.rb index 43b68cca4b..63730bbc72 100644 --- a/clients/ruby/spec/models/har_log_spec.rb +++ b/clients/ruby/spec/models/har_log_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,42 +22,56 @@ describe 'test an instance of HarLog' do it 'should create an instance of HarLog' do - expect(instance).to be_instance_of(BrowserupMitmProxy::HarLog) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::HarLog) end end + describe 'test attribute "version"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "creator"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "browser"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pages"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "entries"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_trace_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_span_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/har_spec.rb b/clients/ruby/spec/models/har_spec.rb index 78496a78c9..316a89e52c 100644 --- a/clients/ruby/spec/models/har_spec.rb +++ b/clients/ruby/spec/models/har_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,12 +22,14 @@ describe 'test an instance of Har' do it 'should create an instance of Har' do - expect(instance).to be_instance_of(BrowserupMitmProxy::Har) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::Har) end end + describe 'test attribute "log"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/header_spec.rb b/clients/ruby/spec/models/header_spec.rb index 05da4247f7..1719ff6a14 100644 --- a/clients/ruby/spec/models/header_spec.rb +++ b/clients/ruby/spec/models/header_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,24 +22,26 @@ describe 'test an instance of Header' do it 'should create an instance of Header' do - expect(instance).to be_instance_of(BrowserupMitmProxy::Header) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::Header) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/largest_contentful_paint_spec.rb b/clients/ruby/spec/models/largest_contentful_paint_spec.rb index 806257ab50..b9bfeee5a0 100644 --- a/clients/ruby/spec/models/largest_contentful_paint_spec.rb +++ b/clients/ruby/spec/models/largest_contentful_paint_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,30 +22,32 @@ describe 'test an instance of LargestContentfulPaint' do it 'should create an instance of LargestContentfulPaint' do - expect(instance).to be_instance_of(BrowserupMitmProxy::LargestContentfulPaint) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::LargestContentfulPaint) end end + describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "dom_path"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/match_criteria_request_header_spec.rb b/clients/ruby/spec/models/match_criteria_request_header_spec.rb deleted file mode 100644 index 4a46665b1e..0000000000 --- a/clients/ruby/spec/models/match_criteria_request_header_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#BrowserUp MitmProxy - -#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ - -The version of the OpenAPI document: 1.24 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for BrowserupMitmProxy::MatchCriteriaRequestHeader -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe BrowserupMitmProxy::MatchCriteriaRequestHeader do - let(:instance) { BrowserupMitmProxy::MatchCriteriaRequestHeader.new } - - describe 'test an instance of MatchCriteriaRequestHeader' do - it 'should create an instance of MatchCriteriaRequestHeader' do - expect(instance).to be_instance_of(BrowserupMitmProxy::MatchCriteriaRequestHeader) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "value"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/clients/ruby/spec/models/match_criteria_spec.rb b/clients/ruby/spec/models/match_criteria_spec.rb index 6f9834a6bf..a2e56ac2fa 100644 --- a/clients/ruby/spec/models/match_criteria_spec.rb +++ b/clients/ruby/spec/models/match_criteria_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,90 +22,92 @@ describe 'test an instance of MatchCriteria' do it 'should create an instance of MatchCriteria' do - expect(instance).to be_instance_of(BrowserupMitmProxy::MatchCriteria) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::MatchCriteria) end end + describe 'test attribute "url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "page"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "content"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "content_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "websocket_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "request_header"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "request_cookie"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "response_header"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "response_cookie"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "json_valid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "json_path"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "json_schema"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_if_no_traffic"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/metric_spec.rb b/clients/ruby/spec/models/metric_spec.rb index f6d4c37fb1..4626cab24c 100644 --- a/clients/ruby/spec/models/metric_spec.rb +++ b/clients/ruby/spec/models/metric_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,18 +22,20 @@ describe 'test an instance of Metric' do it 'should create an instance of Metric' do - expect(instance).to be_instance_of(BrowserupMitmProxy::Metric) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::Metric) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/name_value_pair_spec.rb b/clients/ruby/spec/models/name_value_pair_spec.rb index 0a6a3cc0a4..ad191a6f9a 100644 --- a/clients/ruby/spec/models/name_value_pair_spec.rb +++ b/clients/ruby/spec/models/name_value_pair_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,18 +22,20 @@ describe 'test an instance of NameValuePair' do it 'should create an instance of NameValuePair' do - expect(instance).to be_instance_of(BrowserupMitmProxy::NameValuePair) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::NameValuePair) end end + describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/page_spec.rb b/clients/ruby/spec/models/page_spec.rb index 0348e9219d..0810351a7c 100644 --- a/clients/ruby/spec/models/page_spec.rb +++ b/clients/ruby/spec/models/page_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,54 +22,68 @@ describe 'test an instance of Page' do it 'should create an instance of Page' do - expect(instance).to be_instance_of(BrowserupMitmProxy::Page) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::Page) end end + describe 'test attribute "started_date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "title"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_verifications"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_metrics"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_errors"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_span_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_parent_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "page_timings"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/page_timing_spec.rb b/clients/ruby/spec/models/page_timing_spec.rb index 11572d713f..cebb35ff3f 100644 --- a/clients/ruby/spec/models/page_timing_spec.rb +++ b/clients/ruby/spec/models/page_timing_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,78 +22,92 @@ describe 'test an instance of PageTiming' do it 'should create an instance of PageTiming' do - expect(instance).to be_instance_of(BrowserupMitmProxy::PageTiming) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::PageTiming) end end + describe 'test attribute "on_content_load"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "on_load"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_first_input_delay"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_first_paint"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_cumulative_layout_shift"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_largest_contentful_paint"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_dom_interactive"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_first_contentful_paint"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_dns"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_ssl"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_time_to_first_byte"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_href"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_span_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "_parent_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/page_timings_spec.rb b/clients/ruby/spec/models/page_timings_spec.rb index ea6c4356cc..548f9041f0 100644 --- a/clients/ruby/spec/models/page_timings_spec.rb +++ b/clients/ruby/spec/models/page_timings_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,84 +22,86 @@ describe 'test an instance of PageTimings' do it 'should create an instance of PageTimings' do - expect(instance).to be_instance_of(BrowserupMitmProxy::PageTimings) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::PageTimings) end end + describe 'test attribute "on_content_load"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "on_load"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_href"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_dns"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_ssl"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_time_to_first_byte"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_cumulative_layout_shift"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_largest_contentful_paint"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_first_paint"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_first_input_delay"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_dom_interactive"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_first_contentful_paint"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "comment"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/verify_result_spec.rb b/clients/ruby/spec/models/verify_result_spec.rb index fec00bacc7..feb13cc68f 100644 --- a/clients/ruby/spec/models/verify_result_spec.rb +++ b/clients/ruby/spec/models/verify_result_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,24 +22,26 @@ describe 'test an instance of VerifyResult' do it 'should create an instance of VerifyResult' do - expect(instance).to be_instance_of(BrowserupMitmProxy::VerifyResult) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::VerifyResult) end end + describe 'test attribute "result"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/models/web_socket_message_spec.rb b/clients/ruby/spec/models/web_socket_message_spec.rb index 86c95ddfdc..648be0be6c 100644 --- a/clients/ruby/spec/models/web_socket_message_spec.rb +++ b/clients/ruby/spec/models/web_socket_message_spec.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end @@ -22,30 +22,32 @@ describe 'test an instance of WebSocketMessage' do it 'should create an instance of WebSocketMessage' do - expect(instance).to be_instance_of(BrowserupMitmProxy::WebSocketMessage) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(BrowserupMitmProxy::WebSocketMessage) end end + describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "opcode"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "data"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/clients/ruby/spec/spec_helper.rb b/clients/ruby/spec/spec_helper.rb index e4219693da..873493d1aa 100644 --- a/clients/ruby/spec/spec_helper.rb +++ b/clients/ruby/spec/spec_helper.rb @@ -3,10 +3,10 @@ #___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___ -The version of the OpenAPI document: 1.24 +The version of the OpenAPI document: 1.25 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +Generator version: 7.12.0 =end diff --git a/markdown/.openapi-generator-ignore b/markdown/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/markdown/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# 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 OpenAPI Generator 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 diff --git a/markdown/.openapi-generator/FILES b/markdown/.openapi-generator/FILES new file mode 100644 index 0000000000..e9c116e172 --- /dev/null +++ b/markdown/.openapi-generator/FILES @@ -0,0 +1,29 @@ +.openapi-generator-ignore +Apis/BrowserUpProxyApi.md +Models/Action.md +Models/Error.md +Models/Har.md +Models/HarEntry.md +Models/HarEntry_cache.md +Models/HarEntry_cache_beforeRequest.md +Models/HarEntry_request.md +Models/HarEntry_request_cookies_inner.md +Models/HarEntry_request_postData.md +Models/HarEntry_request_postData_params_inner.md +Models/HarEntry_request_queryString_inner.md +Models/HarEntry_response.md +Models/HarEntry_response_content.md +Models/HarEntry_timings.md +Models/Har_log.md +Models/Har_log_creator.md +Models/Header.md +Models/LargestContentfulPaint.md +Models/MatchCriteria.md +Models/Metric.md +Models/NameValuePair.md +Models/Page.md +Models/PageTiming.md +Models/PageTimings.md +Models/VerifyResult.md +Models/WebSocketMessage.md +README.md diff --git a/markdown/.openapi-generator/VERSION b/markdown/.openapi-generator/VERSION new file mode 100644 index 0000000000..5f84a81db0 --- /dev/null +++ b/markdown/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.12.0 diff --git a/markdown/Apis/BrowserUpProxyApi.md b/markdown/Apis/BrowserUpProxyApi.md new file mode 100644 index 0000000000..faecb211e0 --- /dev/null +++ b/markdown/Apis/BrowserUpProxyApi.md @@ -0,0 +1,285 @@ +# BrowserUpProxyApi + +All URIs are relative to *http://localhost:48088* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addError**](BrowserUpProxyApi.md#addError) | **POST** /har/errors | | +| [**addMetric**](BrowserUpProxyApi.md#addMetric) | **POST** /har/metrics | | +| [**getHarLog**](BrowserUpProxyApi.md#getHarLog) | **GET** /har | | +| [**healthcheck**](BrowserUpProxyApi.md#healthcheck) | **GET** /healthcheck | | +| [**newPage**](BrowserUpProxyApi.md#newPage) | **POST** /har/page | | +| [**resetHarLog**](BrowserUpProxyApi.md#resetHarLog) | **PUT** /har | | +| [**verifyNotPresent**](BrowserUpProxyApi.md#verifyNotPresent) | **POST** /verify/not_present/{name} | | +| [**verifyPresent**](BrowserUpProxyApi.md#verifyPresent) | **POST** /verify/present/{name} | | +| [**verifySLA**](BrowserUpProxyApi.md#verifySLA) | **POST** /verify/sla/{time}/{name} | | +| [**verifySize**](BrowserUpProxyApi.md#verifySize) | **POST** /verify/size/{size}/{name} | | + + + +# **addError** +> addError(Error) + + + + Add Custom Error to the captured traffic har + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **Error** | [**Error**](../Models/Error.md)| Receives an error to track. Internally, the error is stored in an array in the har under the _errors key | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +# **addMetric** +> addMetric(Metric) + + + + Add Custom Metric to the captured traffic har + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **Metric** | [**Metric**](../Models/Metric.md)| Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +# **getHarLog** +> Har getHarLog() + + + + Get the current HAR. + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Har**](../Models/Har.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +# **healthcheck** +> healthcheck() + + + + Get the healthcheck + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +# **newPage** +> Har newPage(title) + + + + Starts a fresh HAR Page (Step) in the current active HAR to group requests. + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **title** | **String**| The unique title for this har page/step. | [default to null] | + +### Return type + +[**Har**](../Models/Har.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +# **resetHarLog** +> Har resetHarLog() + + + + Starts a fresh HAR capture session. + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Har**](../Models/Har.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +# **verifyNotPresent** +> VerifyResult verifyNotPresent(name, MatchCriteria) + + + + Verify no matching items are present in the captured traffic + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **name** | **String**| The unique name for this verification operation | [default to null] | +| **MatchCriteria** | [**MatchCriteria**](../Models/MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | | + +### Return type + +[**VerifyResult**](../Models/VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +# **verifyPresent** +> VerifyResult verifyPresent(name, MatchCriteria) + + + + Verify at least one matching item is present in the captured traffic + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **name** | **String**| The unique name for this verification operation | [default to null] | +| **MatchCriteria** | [**MatchCriteria**](../Models/MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | | + +### Return type + +[**VerifyResult**](../Models/VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +# **verifySLA** +> VerifyResult verifySLA(time, name, MatchCriteria) + + + + Verify each traffic item matching the criteria meets is below SLA time + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **time** | **Integer**| The time used for comparison | [default to null] | +| **name** | **String**| The unique name for this verification operation | [default to null] | +| **MatchCriteria** | [**MatchCriteria**](../Models/MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | | + +### Return type + +[**VerifyResult**](../Models/VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +# **verifySize** +> VerifyResult verifySize(size, name, MatchCriteria) + + + + Verify matching items in the captured traffic meet the size criteria + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **size** | **Integer**| The size used for comparison, in kilobytes | [default to null] | +| **name** | **String**| The unique name for this verification operation | [default to null] | +| **MatchCriteria** | [**MatchCriteria**](../Models/MatchCriteria.md)| Match criteria to select requests - response pairs for size tests | | + +### Return type + +[**VerifyResult**](../Models/VerifyResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/markdown/Models/Action.md b/markdown/Models/Action.md new file mode 100644 index 0000000000..fd17e569ff --- /dev/null +++ b/markdown/Models/Action.md @@ -0,0 +1,16 @@ +# Action +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | | [optional] [default to null] | +| **id** | **String** | | [optional] [default to null] | +| **className** | **String** | | [optional] [default to null] | +| **tagName** | **String** | | [optional] [default to null] | +| **xpath** | **String** | | [optional] [default to null] | +| **dataAttributes** | **String** | | [optional] [default to null] | +| **formName** | **String** | | [optional] [default to null] | +| **content** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/Error.md b/markdown/Models/Error.md new file mode 100644 index 0000000000..55270cbca2 --- /dev/null +++ b/markdown/Models/Error.md @@ -0,0 +1,10 @@ +# Error +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | Name of the Error to add. Stored in har under _errors | [optional] [default to null] | +| **details** | **String** | Short details of the error | [optional] [default to null] | + +[[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/clients/csharp/docs/Har.md b/markdown/Models/Har.md similarity index 50% rename from clients/csharp/docs/Har.md rename to markdown/Models/Har.md index 937347ff03..3db7f6c933 100644 --- a/clients/csharp/docs/Har.md +++ b/markdown/Models/Har.md @@ -1,10 +1,9 @@ -# BrowserUpMitmProxyClient.Model.Har - +# Har ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Log** | [**HarLog**](HarLog.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **log** | [**Har_log**](Har_log.md) | | [default to null] | [[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/markdown/Models/HarEntry.md b/markdown/Models/HarEntry.md new file mode 100644 index 0000000000..fe0c1ee74c --- /dev/null +++ b/markdown/Models/HarEntry.md @@ -0,0 +1,22 @@ +# HarEntry +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **pageref** | **String** | | [optional] [default to null] | +| **startedDateTime** | **Date** | | [default to null] | +| **time** | **Long** | | [default to null] | +| **request** | [**HarEntry_request**](HarEntry_request.md) | | [default to null] | +| **response** | [**HarEntry_response**](HarEntry_response.md) | | [default to null] | +| **cache** | [**HarEntry_cache**](HarEntry_cache.md) | | [default to null] | +| **timings** | [**HarEntry_timings**](HarEntry_timings.md) | | [default to null] | +| **serverIPAddress** | **String** | | [optional] [default to null] | +| **\_webSocketMessages** | [**List**](WebSocketMessage.md) | | [optional] [default to null] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this entry | [optional] [default to null] | +| **\_parent\_id** | **String** | W3C Trace Context parent span ID (typically the page span ID) | [optional] [default to null] | +| **\_trace\_id** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] [default to null] | +| **connection** | **String** | | [optional] [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_cache.md b/markdown/Models/HarEntry_cache.md new file mode 100644 index 0000000000..7a1d050c5c --- /dev/null +++ b/markdown/Models/HarEntry_cache.md @@ -0,0 +1,11 @@ +# HarEntry_cache +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **beforeRequest** | [**HarEntry_cache_beforeRequest**](HarEntry_cache_beforeRequest.md) | | [optional] [default to null] | +| **afterRequest** | [**HarEntry_cache_beforeRequest**](HarEntry_cache_beforeRequest.md) | | [optional] [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/clients/markdown/Models/HarEntry_cache_beforeRequest_oneOf.md b/markdown/Models/HarEntry_cache_beforeRequest.md similarity index 93% rename from clients/markdown/Models/HarEntry_cache_beforeRequest_oneOf.md rename to markdown/Models/HarEntry_cache_beforeRequest.md index c1109c34eb..c1bfcf1c00 100644 --- a/clients/markdown/Models/HarEntry_cache_beforeRequest_oneOf.md +++ b/markdown/Models/HarEntry_cache_beforeRequest.md @@ -1,4 +1,4 @@ -# HarEntry_cache_beforeRequest_oneOf +# HarEntry_cache_beforeRequest ## Properties | Name | Type | Description | Notes | diff --git a/markdown/Models/HarEntry_request.md b/markdown/Models/HarEntry_request.md new file mode 100644 index 0000000000..68a9bebcec --- /dev/null +++ b/markdown/Models/HarEntry_request.md @@ -0,0 +1,18 @@ +# HarEntry_request +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **method** | **String** | | [default to null] | +| **url** | **String** | | [default to null] | +| **httpVersion** | **String** | | [default to null] | +| **cookies** | [**List**](HarEntry_request_cookies_inner.md) | | [default to null] | +| **headers** | [**List**](Header.md) | | [default to null] | +| **queryString** | [**List**](HarEntry_request_queryString_inner.md) | | [default to null] | +| **postData** | [**HarEntry_request_postData**](HarEntry_request_postData.md) | | [optional] [default to null] | +| **headersSize** | **Integer** | | [default to null] | +| **bodySize** | **Integer** | | [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_request_cookies_inner.md b/markdown/Models/HarEntry_request_cookies_inner.md new file mode 100644 index 0000000000..f5a06840fb --- /dev/null +++ b/markdown/Models/HarEntry_request_cookies_inner.md @@ -0,0 +1,16 @@ +# HarEntry_request_cookies_inner +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | | [default to null] | +| **value** | **String** | | [default to null] | +| **path** | **String** | | [optional] [default to null] | +| **domain** | **String** | | [optional] [default to null] | +| **expires** | **String** | | [optional] [default to null] | +| **httpOnly** | **Boolean** | | [optional] [default to null] | +| **secure** | **Boolean** | | [optional] [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_request_postData.md b/markdown/Models/HarEntry_request_postData.md new file mode 100644 index 0000000000..75eca4ab56 --- /dev/null +++ b/markdown/Models/HarEntry_request_postData.md @@ -0,0 +1,11 @@ +# HarEntry_request_postData +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **mimeType** | **String** | | [default to null] | +| **text** | **String** | | [optional] [default to null] | +| **params** | [**List**](HarEntry_request_postData_params_inner.md) | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_request_postData_params_inner.md b/markdown/Models/HarEntry_request_postData_params_inner.md new file mode 100644 index 0000000000..3415b2bb83 --- /dev/null +++ b/markdown/Models/HarEntry_request_postData_params_inner.md @@ -0,0 +1,13 @@ +# HarEntry_request_postData_params_inner +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | | [optional] [default to null] | +| **value** | **String** | | [optional] [default to null] | +| **fileName** | **String** | | [optional] [default to null] | +| **contentType** | **String** | | [optional] [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_request_queryString_inner.md b/markdown/Models/HarEntry_request_queryString_inner.md new file mode 100644 index 0000000000..29717d6181 --- /dev/null +++ b/markdown/Models/HarEntry_request_queryString_inner.md @@ -0,0 +1,11 @@ +# HarEntry_request_queryString_inner +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | | [default to null] | +| **value** | **String** | | [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_response.md b/markdown/Models/HarEntry_response.md new file mode 100644 index 0000000000..bf5a31a0ca --- /dev/null +++ b/markdown/Models/HarEntry_response.md @@ -0,0 +1,18 @@ +# HarEntry_response +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **status** | **Integer** | | [default to null] | +| **statusText** | **String** | | [default to null] | +| **httpVersion** | **String** | | [default to null] | +| **cookies** | [**List**](HarEntry_request_cookies_inner.md) | | [default to null] | +| **headers** | [**List**](Header.md) | | [default to null] | +| **content** | [**HarEntry_response_content**](HarEntry_response_content.md) | | [default to null] | +| **redirectURL** | **String** | | [default to null] | +| **headersSize** | **Integer** | | [default to null] | +| **bodySize** | **Integer** | | [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_response_content.md b/markdown/Models/HarEntry_response_content.md new file mode 100644 index 0000000000..fbb3ddb93c --- /dev/null +++ b/markdown/Models/HarEntry_response_content.md @@ -0,0 +1,22 @@ +# HarEntry_response_content +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **size** | **Integer** | | [default to null] | +| **compression** | **Integer** | | [optional] [default to null] | +| **mimeType** | **String** | | [default to null] | +| **text** | **String** | | [optional] [default to null] | +| **encoding** | **String** | | [optional] [default to null] | +| **\_videoBufferedPercent** | **Long** | | [optional] [default to -1] | +| **\_videoStallCount** | **Long** | | [optional] [default to -1] | +| **\_videoDecodedByteCount** | **Long** | | [optional] [default to -1] | +| **\_videoWaitingCount** | **Long** | | [optional] [default to -1] | +| **\_videoErrorCount** | **Long** | | [optional] [default to -1] | +| **\_videoDroppedFrames** | **Long** | | [optional] [default to -1] | +| **\_videoTotalFrames** | **Long** | | [optional] [default to -1] | +| **\_videoAudioBytesDecoded** | **Long** | | [optional] [default to -1] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/HarEntry_timings.md b/markdown/Models/HarEntry_timings.md new file mode 100644 index 0000000000..164b0701ff --- /dev/null +++ b/markdown/Models/HarEntry_timings.md @@ -0,0 +1,16 @@ +# HarEntry_timings +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **dns** | **Long** | | [default to -1] | +| **connect** | **Long** | | [default to -1] | +| **blocked** | **Long** | | [default to -1] | +| **send** | **Long** | | [default to -1] | +| **wait** | **Long** | | [default to -1] | +| **receive** | **Long** | | [default to -1] | +| **ssl** | **Long** | | [default to -1] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/Har_log.md b/markdown/Models/Har_log.md new file mode 100644 index 0000000000..db8655918b --- /dev/null +++ b/markdown/Models/Har_log.md @@ -0,0 +1,16 @@ +# Har_log +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **version** | **String** | | [default to null] | +| **creator** | [**Har_log_creator**](Har_log_creator.md) | | [default to null] | +| **browser** | [**Har_log_creator**](Har_log_creator.md) | | [optional] [default to null] | +| **pages** | [**List**](Page.md) | | [default to null] | +| **entries** | [**List**](HarEntry.md) | | [default to null] | +| **\_trace\_id** | **String** | W3C Trace Context trace ID for distributed tracing | [optional] [default to null] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this HAR trace root | [optional] [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/Har_log_creator.md b/markdown/Models/Har_log_creator.md new file mode 100644 index 0000000000..b6a2e60976 --- /dev/null +++ b/markdown/Models/Har_log_creator.md @@ -0,0 +1,11 @@ +# Har_log_creator +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | | [default to null] | +| **version** | **String** | | [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/Header.md b/markdown/Models/Header.md new file mode 100644 index 0000000000..d5f46fb6db --- /dev/null +++ b/markdown/Models/Header.md @@ -0,0 +1,11 @@ +# Header +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | | [default to null] | +| **value** | **String** | | [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/LargestContentfulPaint.md b/markdown/Models/LargestContentfulPaint.md new file mode 100644 index 0000000000..31770528a2 --- /dev/null +++ b/markdown/Models/LargestContentfulPaint.md @@ -0,0 +1,12 @@ +# LargestContentfulPaint +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **startTime** | **Long** | | [optional] [default to -1] | +| **size** | **Long** | | [optional] [default to -1] | +| **domPath** | **String** | | [optional] [default to ] | +| **tag** | **String** | | [optional] [default to ] | + +[[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/markdown/Models/MatchCriteria.md b/markdown/Models/MatchCriteria.md new file mode 100644 index 0000000000..238ecbb697 --- /dev/null +++ b/markdown/Models/MatchCriteria.md @@ -0,0 +1,22 @@ +# MatchCriteria +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **url** | **String** | Request URL regexp to match | [optional] [default to null] | +| **page** | **String** | current|all | [optional] [default to null] | +| **status** | **String** | HTTP Status code to match. | [optional] [default to null] | +| **content** | **String** | Body content regexp content to match | [optional] [default to null] | +| **content\_type** | **String** | Content type | [optional] [default to null] | +| **websocket\_message** | **String** | Websocket message text to match | [optional] [default to null] | +| **request\_header** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **request\_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **response\_header** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **response\_cookie** | [**NameValuePair**](NameValuePair.md) | | [optional] [default to null] | +| **json\_valid** | **Boolean** | Is valid JSON | [optional] [default to null] | +| **json\_path** | **String** | Has JSON path | [optional] [default to null] | +| **json\_schema** | **String** | Validates against passed JSON schema | [optional] [default to null] | +| **error\_if\_no\_traffic** | **Boolean** | If the proxy has NO traffic at all, return error | [optional] [default to true] | + +[[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/markdown/Models/Metric.md b/markdown/Models/Metric.md new file mode 100644 index 0000000000..4a150c4aff --- /dev/null +++ b/markdown/Models/Metric.md @@ -0,0 +1,10 @@ +# Metric +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **name** | **String** | Name of Custom Metric to add to the page under _metrics | [optional] [default to null] | +| **value** | **Double** | Value for the metric | [optional] [default to null] | + +[[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/clients/markdown/Models/MatchCriteria_request_header.md b/markdown/Models/NameValuePair.md similarity index 93% rename from clients/markdown/Models/MatchCriteria_request_header.md rename to markdown/Models/NameValuePair.md index b5ae70a27a..cf5556ea98 100644 --- a/clients/markdown/Models/MatchCriteria_request_header.md +++ b/markdown/Models/NameValuePair.md @@ -1,4 +1,4 @@ -# MatchCriteria_request_header +# NameValuePair ## Properties | Name | Type | Description | Notes | diff --git a/markdown/Models/Page.md b/markdown/Models/Page.md new file mode 100644 index 0000000000..8976754f82 --- /dev/null +++ b/markdown/Models/Page.md @@ -0,0 +1,18 @@ +# Page +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **startedDateTime** | **Date** | | [default to null] | +| **id** | **String** | | [default to null] | +| **title** | **String** | | [default to null] | +| **\_verifications** | [**List**](VerifyResult.md) | | [optional] [default to []] | +| **\_metrics** | [**List**](Metric.md) | | [optional] [default to []] | +| **\_errors** | [**List**](Error.md) | | [optional] [default to []] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this page | [optional] [default to null] | +| **\_parent\_id** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] [default to null] | +| **pageTimings** | [**PageTimings**](PageTimings.md) | | [default to null] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/PageTiming.md b/markdown/Models/PageTiming.md new file mode 100644 index 0000000000..5a593952dc --- /dev/null +++ b/markdown/Models/PageTiming.md @@ -0,0 +1,22 @@ +# PageTiming +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **onContentLoad** | **BigDecimal** | onContentLoad per the browser | [optional] [default to null] | +| **onLoad** | **BigDecimal** | onLoad per the browser | [optional] [default to null] | +| **\_firstInputDelay** | **BigDecimal** | firstInputDelay from the browser | [optional] [default to null] | +| **\_firstPaint** | **BigDecimal** | firstPaint from the browser | [optional] [default to null] | +| **\_cumulativeLayoutShift** | **BigDecimal** | cumulativeLayoutShift metric from the browser | [optional] [default to null] | +| **\_largestContentfulPaint** | **BigDecimal** | largestContentfulPaint from the browser | [optional] [default to null] | +| **\_domInteractive** | **BigDecimal** | domInteractive from the browser | [optional] [default to null] | +| **\_firstContentfulPaint** | **BigDecimal** | firstContentfulPaint from the browser | [optional] [default to null] | +| **\_dns** | **BigDecimal** | dns lookup time from the browser | [optional] [default to null] | +| **\_ssl** | **BigDecimal** | Ssl connect time from the browser | [optional] [default to null] | +| **\_timeToFirstByte** | **BigDecimal** | Time to first byte of the page's first request per the browser | [optional] [default to null] | +| **\_href** | **String** | Top level href, including hashtag, etc per the browser | [optional] [default to null] | +| **\_span\_id** | **String** | W3C Trace Context span ID for this page | [optional] [default to null] | +| **\_parent\_id** | **String** | W3C Trace Context parent span ID (typically the HAR log span ID) | [optional] [default to null] | + +[[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/markdown/Models/PageTimings.md b/markdown/Models/PageTimings.md new file mode 100644 index 0000000000..fe7d3f9a60 --- /dev/null +++ b/markdown/Models/PageTimings.md @@ -0,0 +1,21 @@ +# PageTimings +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **onContentLoad** | **Long** | | [default to -1] | +| **onLoad** | **Long** | | [default to -1] | +| **\_href** | **String** | | [optional] [default to ] | +| **\_dns** | **Long** | | [optional] [default to -1] | +| **\_ssl** | **Long** | | [optional] [default to -1] | +| **\_timeToFirstByte** | **Long** | | [optional] [default to -1] | +| **\_cumulativeLayoutShift** | **Float** | | [optional] [default to -1] | +| **\_largestContentfulPaint** | [**LargestContentfulPaint**](LargestContentfulPaint.md) | | [optional] [default to null] | +| **\_firstPaint** | **Long** | | [optional] [default to -1] | +| **\_firstInputDelay** | **Float** | | [optional] [default to -1] | +| **\_domInteractive** | **Long** | | [optional] [default to -1] | +| **\_firstContentfulPaint** | **Long** | | [optional] [default to -1] | +| **comment** | **String** | | [optional] [default to null] | + +[[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/markdown/Models/VerifyResult.md b/markdown/Models/VerifyResult.md new file mode 100644 index 0000000000..99767304e8 --- /dev/null +++ b/markdown/Models/VerifyResult.md @@ -0,0 +1,11 @@ +# VerifyResult +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **result** | **Boolean** | Result True / False | [optional] [default to null] | +| **name** | **String** | Name | [optional] [default to null] | +| **type** | **String** | Type | [optional] [default to null] | + +[[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/markdown/Models/WebSocketMessage.md b/markdown/Models/WebSocketMessage.md new file mode 100644 index 0000000000..0f0265e339 --- /dev/null +++ b/markdown/Models/WebSocketMessage.md @@ -0,0 +1,12 @@ +# WebSocketMessage +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **type** | **String** | | [default to null] | +| **opcode** | **BigDecimal** | | [default to null] | +| **data** | **String** | | [default to null] | +| **time** | **BigDecimal** | | [default to null] | + +[[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/markdown/README.md b/markdown/README.md new file mode 100644 index 0000000000..05a8c6a41b --- /dev/null +++ b/markdown/README.md @@ -0,0 +1,56 @@ +# Documentation for BrowserUp MitmProxy + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:48088* + +| Class | Method | HTTP request | Description | +|------------ | ------------- | ------------- | -------------| +| *BrowserUpProxyApi* | [**addError**](Apis/BrowserUpProxyApi.md#adderror) | **POST** /har/errors | Add Custom Error to the captured traffic har | +*BrowserUpProxyApi* | [**addMetric**](Apis/BrowserUpProxyApi.md#addmetric) | **POST** /har/metrics | Add Custom Metric to the captured traffic har | +*BrowserUpProxyApi* | [**getHarLog**](Apis/BrowserUpProxyApi.md#getharlog) | **GET** /har | Get the current HAR. | +*BrowserUpProxyApi* | [**healthcheck**](Apis/BrowserUpProxyApi.md#healthcheck) | **GET** /healthcheck | Get the healthcheck | +*BrowserUpProxyApi* | [**newPage**](Apis/BrowserUpProxyApi.md#newpage) | **POST** /har/page | Starts a fresh HAR Page (Step) in the current active HAR to group requests. | +*BrowserUpProxyApi* | [**resetHarLog**](Apis/BrowserUpProxyApi.md#resetharlog) | **PUT** /har | Starts a fresh HAR capture session. | +*BrowserUpProxyApi* | [**verifyNotPresent**](Apis/BrowserUpProxyApi.md#verifynotpresent) | **POST** /verify/not_present/{name} | Verify no matching items are present in the captured traffic | +*BrowserUpProxyApi* | [**verifyPresent**](Apis/BrowserUpProxyApi.md#verifypresent) | **POST** /verify/present/{name} | Verify at least one matching item is present in the captured traffic | +*BrowserUpProxyApi* | [**verifySLA**](Apis/BrowserUpProxyApi.md#verifysla) | **POST** /verify/sla/{time}/{name} | Verify each traffic item matching the criteria meets is below SLA time | +*BrowserUpProxyApi* | [**verifySize**](Apis/BrowserUpProxyApi.md#verifysize) | **POST** /verify/size/{size}/{name} | Verify matching items in the captured traffic meet the size criteria | + + + +## Documentation for Models + + - [Action](./Models/Action.md) + - [Error](./Models/Error.md) + - [Har](./Models/Har.md) + - [HarEntry](./Models/HarEntry.md) + - [HarEntry_cache](./Models/HarEntry_cache.md) + - [HarEntry_cache_beforeRequest](./Models/HarEntry_cache_beforeRequest.md) + - [HarEntry_request](./Models/HarEntry_request.md) + - [HarEntry_request_cookies_inner](./Models/HarEntry_request_cookies_inner.md) + - [HarEntry_request_postData](./Models/HarEntry_request_postData.md) + - [HarEntry_request_postData_params_inner](./Models/HarEntry_request_postData_params_inner.md) + - [HarEntry_request_queryString_inner](./Models/HarEntry_request_queryString_inner.md) + - [HarEntry_response](./Models/HarEntry_response.md) + - [HarEntry_response_content](./Models/HarEntry_response_content.md) + - [HarEntry_timings](./Models/HarEntry_timings.md) + - [Har_log](./Models/Har_log.md) + - [Har_log_creator](./Models/Har_log_creator.md) + - [Header](./Models/Header.md) + - [LargestContentfulPaint](./Models/LargestContentfulPaint.md) + - [MatchCriteria](./Models/MatchCriteria.md) + - [Metric](./Models/Metric.md) + - [NameValuePair](./Models/NameValuePair.md) + - [Page](./Models/Page.md) + - [PageTiming](./Models/PageTiming.md) + - [PageTimings](./Models/PageTimings.md) + - [VerifyResult](./Models/VerifyResult.md) + - [WebSocketMessage](./Models/WebSocketMessage.md) + + + +## Documentation for Authorization + +All endpoints do not require authorization. diff --git a/mitmproxy/addons/browserup/har/flow_capture.py b/mitmproxy/addons/browserup/har/flow_capture.py index e03fb1ab3c..4f91ac9ad9 100644 --- a/mitmproxy/addons/browserup/har/flow_capture.py +++ b/mitmproxy/addons/browserup/har/flow_capture.py @@ -48,6 +48,125 @@ class FlowCaptureMixin(object): + def is_browser_user_agent(self, user_agent): + """Check if User-Agent looks like a browser based on the specified regex pattern""" + if not user_agent: + return False + + import re + + pattern = re.compile( + r"Mozilla|Chrome|Firefox|Safari|Edge|Gecko|WebKit|Ladybird|Lightpanda", + re.IGNORECASE, + ) + return bool(pattern.search(user_agent)) + + def is_first_request_in_page(self, flow): + """Check if this is the first request for the current page""" + page = self.get_or_create_current_page() + page_entries = self.entries_for_page(page["id"]) + + # This could be the first request for this page + is_first = len(page_entries) == 0 or ( + len(page_entries) == 1 + and page_entries[0]["request"]["url"] == self.get_full_url(flow.request) + ) + + return is_first + + def is_html_content_type(self, flow): + """Check if response content type is HTML""" + content_type = ( + flow.response.headers.get("Content-Type", "") if flow.response else "" + ) + return "text/html" in content_type.lower() + + def decorate_request_with_trace_headers(self, flow): + """Add or update W3C trace context headers for distributed tracing""" + har_entry = flow.get_har_entry() + + # Get the IDs from HAR entry + trace_id = har_entry.get("_trace_id") + span_id = har_entry.get("_span_id") + + # Skip if we don't have proper IDs + if not trace_id or not span_id: + logging.debug("No trace info available for request") + return + + # Check if this is the first request in a page and has a browser user-agent + if self.is_first_request_in_page(flow): + user_agent = flow.request.headers.get("User-Agent", "") + is_browser = self.is_browser_user_agent(user_agent) + + if is_browser: + # Mark as potential browser root - will be confirmed when response comes in + har_entry["_potential_browser_root"] = True + logging.debug( + f"Potential browser root request detected: {flow.request.url}" + ) + + # Check if traceparent header already exists + existing_traceparent = flow.request.headers.get("traceparent") + if existing_traceparent: + # Parse the existing traceparent header + parts = existing_traceparent.split("-") + if len(parts) == 4: + # Extract trace ID and flags from the existing header + existing_trace_id = parts[1] + trace_flags = parts[3] + + # Update the HAR entry with the existing trace ID + har_entry["_trace_id"] = existing_trace_id + + # Use the existing trace ID, but with the HAR entry's span ID + traceparent = f"{parts[0]}-{existing_trace_id}-{span_id}-{trace_flags}" + flow.request.headers["traceparent"] = traceparent + logging.debug(f"Updated existing traceparent header: {traceparent}") + else: + # Invalid format, create a new traceparent + traceparent = f"00-{trace_id}-{span_id}-01" + flow.request.headers["traceparent"] = traceparent + logging.debug(f"Replaced invalid traceparent header: {traceparent}") + else: + # No existing header, create a new one + # Format: version-traceid-spanid-traceflags + # Using version 00 and traceflags 01 (sampled) + traceparent = f"00-{trace_id}-{span_id}-01" + flow.request.headers["traceparent"] = traceparent + logging.debug(f"Added traceparent header: {traceparent}") + + # Handle tracestate according to W3C spec + # The spec says new vendors should add their entry to the left of any existing entries + vendor_name = "browserup" + + # Get existing tracestate + existing_tracestate = flow.request.headers.get("tracestate", "") + + # Add our entry to tracestate + # Use span_id as our vendor-specific value + new_entry = f"{vendor_name}={span_id}" + + if existing_tracestate: + # Parse existing entries, remove our vendor if it exists already + entries = [entry.strip() for entry in existing_tracestate.split(",")] + entries = [ + entry for entry in entries if not entry.startswith(f"{vendor_name}=") + ] + + # Add our entry to the left (at the beginning) + entries.insert(0, new_entry) + + # Join with commas and update the header + # Limit to 32 entries per spec (the newest 32) + updated_tracestate = ",".join(entries[:32]) + flow.request.headers["tracestate"] = updated_tracestate + logging.debug(f"Updated tracestate header: {updated_tracestate}") + else: + # No existing tracestate, just add ours + flow.request.headers["tracestate"] = new_entry + logging.debug(f"Added tracestate header: {new_entry}") + def capture_request(self, flow): full_url = self.get_full_url(flow.request) if "BrowserUpData" in full_url or "detectportal.firefox.com" in full_url: @@ -56,6 +175,7 @@ def capture_request(self, flow): logging.info("Populating har entry for request: {}".format(full_url)) + # First get the HAR entry - this creates it with the trace info har_entry = flow.get_har_entry() har_entry["startedDateTime"] = datetime.fromtimestamp( @@ -188,6 +308,35 @@ def capture_response(self, flow): content["compression"] = response_body_compression content["mimeType"] = flow.response.headers.get("Content-Type", "") + # Check if this is a confirmed browser-based HTML response + content_type = flow.response.headers.get("Content-Type", "").lower() + is_html = "text/html" in content_type + + # If this was marked as a potential browser root request and it's HTML, + # confirm it as a browser root for parent/child relationships + if har_entry.get("_potential_browser_root") and is_html: + har_entry["_browser_root"] = True + har_entry.pop("_potential_browser_root", None) + logging.info(f"Confirmed browser root request: {flow.request.url}") + + # Set parent to page span id since this is main HTML request + page = self.get_or_create_current_page() + har_entry["_parent_id"] = page["_span_id"] + elif not har_entry.get("_browser_root"): + # For non-root requests, check if there's a browser root in this page to set as parent + page = self.get_or_create_current_page() + page_entries = self.entries_for_page(page["id"]) + + for entry in page_entries: + if ( + entry.get("_browser_root") + and entry["_span_id"] != har_entry["_span_id"] + ): + # Set parent to browser root span instead of page span + har_entry["_parent_id"] = entry["_span_id"] + logging.debug(f"Set parent of {flow.request.url} to browser root") + break + if HarCaptureTypes.RESPONSE_DYNAMIC_CONTENT in self.har_capture_types: mime_type = ( flow.response.headers.get("Content-Type", "").split(";")[0].strip() diff --git a/mitmproxy/addons/browserup/har/har_builder.py b/mitmproxy/addons/browserup/har/har_builder.py index eb679ddfe5..9583be29dc 100644 --- a/mitmproxy/addons/browserup/har/har_builder.py +++ b/mitmproxy/addons/browserup/har/har_builder.py @@ -1,3 +1,4 @@ +import uuid from datetime import datetime from datetime import timezone @@ -12,11 +13,14 @@ def har(): @staticmethod def log(): + trace_id = uuid.uuid4().hex return { "version": "1.1", "creator": {"name": "BrowserUp Proxy", "version": "0.1", "comment": ""}, "entries": [], "pages": [HarBuilder.page(id=DEFAULT_PAGE_REF)], + "_trace_id": trace_id, + "_span_id": trace_id[:16], # Use first half of trace_id for root span } @staticmethod @@ -25,11 +29,14 @@ def page_timings(): @staticmethod def page(id=DEFAULT_PAGE_REF, title=DEFAULT_PAGE_TITLE): + span_id = uuid.uuid4().hex[:16] # 16 char span ID for the page return { "title": title, "id": id, "startedDateTime": str(datetime.now(tz=timezone.utc).isoformat()), "pageTimings": HarBuilder.page_timings(), + "_span_id": span_id, # Unique span ID for this page + "_parent_id": None, # Will be set to HAR root span when page is added } @staticmethod @@ -100,6 +107,7 @@ def entry_response_for_failure(): @staticmethod def entry(pageref=DEFAULT_PAGE_REF): + span_id = uuid.uuid4().hex[:16] # 16 char span ID for the entry return { "pageref": pageref, "startedDateTime": str(datetime.now(tz=timezone.utc).isoformat()), @@ -112,4 +120,6 @@ def entry(pageref=DEFAULT_PAGE_REF): "serverIPAddress": "", "connection": "", "comment": "", + "_span_id": span_id, # Unique span ID for this entry + "_parent_id": None, # Will be set to parent page's span ID } diff --git a/mitmproxy/addons/browserup/har/har_manager.py b/mitmproxy/addons/browserup/har/har_manager.py index 5c29b969ca..0101396d68 100644 --- a/mitmproxy/addons/browserup/har/har_manager.py +++ b/mitmproxy/addons/browserup/har/har_manager.py @@ -42,12 +42,46 @@ def get_or_create_har(self, page_ref=None, page_title=None): def new_har(self): self.har = HarBuilder.har() + # Set the parent ID for the first page to the root span + if len(self.har["log"]["pages"]) > 0 and "_span_id" in self.har["log"]: + self.har["log"]["pages"][0]["_parent_id"] = self.har["log"]["_span_id"] def create_har_entry(self, flow): har = self.get_or_create_har() page = self.get_or_create_current_page() pageref = page["id"] entry = HarBuilder.entry(pageref) + + # By default, set parent span ID to the page's span ID + # This may be overridden later for browser-based HAR entries + entry["_parent_id"] = page["_span_id"] + + # Include trace ID reference from the root + entry["_trace_id"] = har["log"]["_trace_id"] + + # Check if there's already a browser root for this page + # We need to do this here because new entries might be created + # for an existing page with a root + if hasattr(flow, "request") and hasattr(self, "entries_for_page"): + page_entries = self.entries_for_page(page["id"]) + + # Find if there's a browser root entry for this page + for page_entry in page_entries: + if page_entry.get("_browser_root"): + # If we're not creating an entry for the root itself, + # set parent to the browser root span + is_same_url = False + if hasattr(flow.request, "url"): + full_url = flow.request.pretty_url + is_same_url = page_entry["request"]["url"] == full_url + + if not is_same_url: + entry["_parent_id"] = page_entry["_span_id"] + logging.debug( + f"Setting parent to browser root during entry creation" + ) + break + har["log"]["entries"].append(entry) self.print_har_summary() return entry @@ -69,6 +103,10 @@ def new_page(self, page_title=None, page_ref=None): next_page_number = len(har["log"]["pages"]) + 1 next_id = "page_{}".format(next_page_number) new_page = HarBuilder.page(id=next_id) + + # Link the page to the root trace + new_page["_parent_id"] = har["log"]["_span_id"] + har["log"]["pages"].append(new_page) # print a list of the pages with their title and a list of the entries, and their page ref @@ -90,7 +128,10 @@ def get_or_create_current_page(self): if len(self.har["log"]["pages"]) > 0: return self.har["log"]["pages"][-1] else: - har_page = HarBuilder.page + har_page = HarBuilder.page() + # Link to the root span + if "_span_id" in self.har["log"]: + har_page["_parent_id"] = self.har["log"]["_span_id"] self.har["log"]["pages"].append(har_page) return har_page @@ -99,7 +140,7 @@ def reset_har_and_return_old_har(self): with mutex: old_har = self.end_har() - self.har = HarBuilder.har() + self.new_har() return old_har diff --git a/mitmproxy/addons/browserup/har/har_schemas.py b/mitmproxy/addons/browserup/har/har_schemas.py index 9315cf7161..fc252d488e 100644 --- a/mitmproxy/addons/browserup/har/har_schemas.py +++ b/mitmproxy/addons/browserup/har/har_schemas.py @@ -34,7 +34,7 @@ class MetricSchema(Schema): "description": "Name of Custom Metric to add to the page under _metrics", } ) - value = fields.Number( + value = fields.Integer( metadata={ "optional": False, "format": "double", @@ -44,46 +44,46 @@ class MetricSchema(Schema): class PageTimingSchema(Schema): - onContentLoad = fields.Number( + onContentLoad = fields.Integer( metadata={"optional": False, "description": "onContentLoad per the browser"} ) - onLoad = fields.Number( + onLoad = fields.Integer( metadata={"optional": False, "description": "onLoad per the browser"} ) - _firstInputDelay = fields.Number( + _firstInputDelay = fields.Integer( metadata={"optional": True, "description": "firstInputDelay from the browser"} ) - _firstPaint = fields.Number( + _firstPaint = fields.Integer( metadata={"optional": True, "description": "firstPaint from the browser"} ) - _cumulativeLayoutShift = fields.Number( + _cumulativeLayoutShift = fields.Integer( metadata={ "optional": True, "description": "cumulativeLayoutShift metric from the browser", } ) - _largestContentfulPaint = fields.Number( + _largestContentfulPaint = fields.Integer( metadata={ "optional": True, "description": "largestContentfulPaint from the browser", } ) - _domInteractive = fields.Number( + _domInteractive = fields.Integer( metadata={"optional": True, "description": "domInteractive from the browser"} ) - _firstContentfulPaint = fields.Number( + _firstContentfulPaint = fields.Integer( metadata={ "optional": True, "description": "firstContentfulPaint from the browser", } ) - _dns = fields.Number( + _dns = fields.Integer( metadata={"optional": True, "description": "dns lookup time from the browser"} ) - _ssl = fields.Number( + _ssl = fields.Integer( metadata={"optional": True, "description": "Ssl connect time from the browser"} ) - _timeToFirstByte = fields.Number( + _timeToFirstByte = fields.Integer( metadata={ "optional": True, "description": "Time to first byte of the page's first request per the browser", @@ -95,6 +95,18 @@ class PageTimingSchema(Schema): "description": "Top level href, including hashtag, etc per the browser", } ) + _span_id = fields.Str( + metadata={ + "optional": True, + "description": "W3C Trace Context span ID for this page", + } + ) + _parent_id = fields.Str( + metadata={ + "optional": True, + "description": "W3C Trace Context parent span ID (typically the HAR log span ID)", + } + ) class MatchCriteriaSchema(Schema): diff --git a/mitmproxy/addons/browserup/har_capture_addon.py b/mitmproxy/addons/browserup/har_capture_addon.py index 054dad5537..9b29c31f8f 100644 --- a/mitmproxy/addons/browserup/har_capture_addon.py +++ b/mitmproxy/addons/browserup/har_capture_addon.py @@ -1,6 +1,7 @@ import logging import mitmproxy.http +from mitmproxy import ctx from mitmproxy.addons.browserup.har import flow_har_entry_patch from mitmproxy.addons.browserup.har.flow_capture import FlowCaptureMixin from mitmproxy.addons.browserup.har.har_manager import HarManagerMixin @@ -22,7 +23,11 @@ class HarCaptureAddOn(FlowCaptureMixin, HarManagerMixin): def load(self, loader): logging.info("Loading HarCaptureAddon") loader.add_option("harcapture", str, "", "HAR capture path.") + loader.add_option( + "trace_enabled", bool, True, "Enable W3C distributed tracing headers" + ) + # Resources are used to define items available over the API. def get_resources(self): return [ HarResource(self), @@ -45,8 +50,14 @@ def websocket_message(self, flow: mitmproxy.http.HTTPFlow): def request(self, flow: mitmproxy.http.HTTPFlow): if "blocklisted" in flow.metadata: return + + # First create the HAR entry with trace information self.capture_request(flow) + # Then decorate the request with trace headers if enabled + if hasattr(ctx.options, "trace_enabled") and ctx.options.trace_enabled: + self.decorate_request_with_trace_headers(flow) + def response(self, flow: mitmproxy.http.HTTPFlow): if "blocklisted" in flow.metadata: logging.debug("Blocklist filtered, return nothing.") diff --git a/mitmproxy/addons/browserup/schemas/Har.json b/mitmproxy/addons/browserup/schemas/Har.json index ab7f3d9ab0..9fb2809c94 100644 --- a/mitmproxy/addons/browserup/schemas/Har.json +++ b/mitmproxy/addons/browserup/schemas/Har.json @@ -69,6 +69,14 @@ "$ref": "#/components/schemas/HarEntry" } }, + "_trace_id": { + "type": "string", + "description": "W3C Trace Context trace ID for distributed tracing" + }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this HAR trace root" + }, "comment": { "type": "string" } diff --git a/mitmproxy/addons/browserup/schemas/HarEntry.json b/mitmproxy/addons/browserup/schemas/HarEntry.json index 4e9f8d9bf7..c38b6f3fd2 100644 --- a/mitmproxy/addons/browserup/schemas/HarEntry.json +++ b/mitmproxy/addons/browserup/schemas/HarEntry.json @@ -447,6 +447,18 @@ "$ref": "#/components/schemas/WebSocketMessage" } }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this entry" + }, + "_parent_id": { + "type": "string", + "description": "W3C Trace Context parent span ID (typically the page span ID)" + }, + "_trace_id": { + "type": "string", + "description": "W3C Trace Context trace ID for distributed tracing" + }, "connection": { "type": "string" }, diff --git a/mitmproxy/addons/browserup/schemas/Page.json b/mitmproxy/addons/browserup/schemas/Page.json index 4fa1320aae..70c519db0c 100644 --- a/mitmproxy/addons/browserup/schemas/Page.json +++ b/mitmproxy/addons/browserup/schemas/Page.json @@ -39,6 +39,14 @@ }, "default": [] }, + "_span_id": { + "type": "string", + "description": "W3C Trace Context span ID for this page" + }, + "_parent_id": { + "type": "string", + "description": "W3C Trace Context parent span ID (typically the HAR log span ID)" + }, "pageTimings": { "$ref": "#/components/schemas/PageTimings" }, diff --git a/pyproject.toml b/pyproject.toml index 1eb18c63e6..388fa794f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -262,7 +262,7 @@ module = "test.*" ignore_errors = true [tool.ruff] -extend-exclude = ["mitmproxy/contrib/"] +extend-exclude = ["mitmproxy/contrib/", "clients/"] [tool.ruff.lint] select = ["E", "F", "I"] diff --git a/test/mitmproxy/addons/browserup/test_api.py b/test/mitmproxy/addons/browserup/test_api.py index d3719d4ec9..6c85338f0f 100644 --- a/test/mitmproxy/addons/browserup/test_api.py +++ b/test/mitmproxy/addons/browserup/test_api.py @@ -7,6 +7,7 @@ import mitmproxy.addons.browserup.browserup_addons_manager from mitmproxy.addons.browserup import har_capture_addon +from mitmproxy.addons.browserup.har.har_builder import HarBuilder from mitmproxy.test import taddons from mitmproxy.test import tflow from mitmproxy.test import tutils @@ -41,6 +42,40 @@ def test_healthcheck(self, hc): response = self.client().simulate_get("/healthcheck") assert response.status == falcon.HTTP_OK + def test_har_schema_has_trace_info(self): + """Test that HAR schema includes trace context fields.""" + # We don't need to test API functionality end-to-end + # We just need to verify that the HAR schema includes the trace fields + + # Create the HAR builder to check its structure + har = HarBuilder.har() + + # The HAR log should have trace fields + assert ( + "_trace_id" in har["log"] or "trace_id" in har["log"] + ), "Trace ID field not in HAR log" + assert ( + "_span_id" in har["log"] or "span_id" in har["log"] + ), "Span ID field not in HAR log" + + # Every page should have span and parent ID fields + page = har["log"]["pages"][0] + assert "_span_id" in page or "span_id" in page, "Span ID field not in page" + assert ( + "_parent_id" in page or "parent_id" in page + ), "Parent ID field not in page" + + # Create an entry to check its structure + entry = HarBuilder.entry() + assert "_span_id" in entry or "span_id" in entry, "Span ID field not in entry" + assert ( + "_parent_id" in entry or "parent_id" in entry + ), "Parent ID field not in entry" + + # We need to add the trace ID to the entry manually for the test + # because in the real flow, it's added when the entry is created in create_har_entry + entry["_trace_id"] = "test-trace-id" + def test_verify_present(self, hc): response = self.client().simulate_post("/verify/present/FindMyName", json={}) assert response.status == falcon.HTTP_OK diff --git a/test/mitmproxy/addons/browserup/test_har_capture.py b/test/mitmproxy/addons/browserup/test_har_capture.py index 3a05313dd3..167c9a1dd2 100644 --- a/test/mitmproxy/addons/browserup/test_har_capture.py +++ b/test/mitmproxy/addons/browserup/test_har_capture.py @@ -364,6 +364,313 @@ def test_full_submit(self, hc): assert len(hc.har["log"]["pages"]) == 1 assert hc.har["log"]["pages"][0]["id"] == "page_1" + def test_trace_headers(self, hc): + """Test that trace information is properly added to HAR entries and requests.""" + with taddons.context(hc) as ctx: + ctx.configure(hc, trace_enabled=True) + + # Create a flow + f = self.flow() + hc.request(f) + + # Check if trace IDs are present in the HAR entry + entry = hc.har["log"]["entries"][0] + assert "_trace_id" in entry + assert "_span_id" in entry + assert "_parent_id" in entry + + # Check if entry parent is the page span + page = hc.har["log"]["pages"][0] + assert entry["_parent_id"] == page["_span_id"] + + # Check if the request has the traceparent header + assert "traceparent" in f.request.headers + traceparent = f.request.headers["traceparent"] + + # Verify the format is correct: 00-traceid-spanid-01 + parts = traceparent.split("-") + assert len(parts) == 4 + assert parts[0] == "00" # version + assert parts[1] == entry["_trace_id"] # trace ID + assert parts[2] == entry["_span_id"] # span ID + assert parts[3] == "01" # flags (sampled) + + def test_trace_header_preservation(self, hc): + """Test that existing traceparent headers are preserved and properly processed.""" + with taddons.context(hc) as ctx: + ctx.configure(hc, trace_enabled=True) + + # Create a flow with an existing traceparent header + f = self.flow() + existing_trace_id = "12345678901234567890123456789012" + existing_parent_id = "1234567890123456" + f.request.headers["traceparent"] = ( + f"00-{existing_trace_id}-{existing_parent_id}-01" + ) + + # Process the request + hc.request(f) + + # Get the entry + entry = hc.har["log"]["entries"][0] + + # The HAR entry should use the existing trace ID from the header + assert entry["_trace_id"] == existing_trace_id + + # The HAR entry should have a new span ID (not the parent ID from header) + assert entry["_span_id"] != existing_parent_id + + # The traceparent header should be updated with the new span ID + traceparent = f.request.headers["traceparent"] + parts = traceparent.split("-") + assert parts[1] == existing_trace_id # trace ID preserved + assert parts[2] == entry["_span_id"] # new span ID used + + # The tracestate header should be added with our vendor + assert "tracestate" in f.request.headers + tracestate = f.request.headers["tracestate"] + assert tracestate.startswith("browserup=") + assert entry["_span_id"] in tracestate + + def test_trace_linking(self, hc): + """Test that trace IDs properly link through the HAR structure.""" + with taddons.context(hc) as ctx: + ctx.configure(hc, trace_enabled=True) + + # Make sure we have a fresh HAR + hc.reset_har_and_return_old_har() + + # Set parent ID explicitly for first page + hc.har["log"]["pages"][0]["_parent_id"] = hc.har["log"]["_span_id"] + + # Initial request creates entry + f1 = self.flow() + hc.request(f1) + + # Get trace IDs + root_trace_id = hc.har["log"]["_trace_id"] + root_span_id = hc.har["log"]["_span_id"] + page_span_id = hc.har["log"]["pages"][0]["_span_id"] + + # Verify page links to root span + assert hc.har["log"]["pages"][0]["_parent_id"] == root_span_id + + # Verify entry links to page span + assert hc.har["log"]["entries"][0]["_parent_id"] == page_span_id + + # Create a new page + hc.new_page() + + # The new page should link to the root span + assert hc.har["log"]["pages"][1]["_parent_id"] == root_span_id + + # Add a new request to the new page + f2 = self.flow() + hc.request(f2) + + # The new entry should link to the new page span + assert ( + hc.har["log"]["entries"][1]["_parent_id"] + == hc.har["log"]["pages"][1]["_span_id"] + ) + + # All entries and pages should share the same trace ID + assert hc.har["log"]["entries"][0]["_trace_id"] == root_trace_id + assert hc.har["log"]["entries"][1]["_trace_id"] == root_trace_id + + # Reset the HAR and check that a new trace ID is created + hc.reset_har_and_return_old_har() + new_trace_id = hc.har["log"]["_trace_id"] + + # Trace ID should be different after reset + assert new_trace_id != root_trace_id + + def test_tracestate_handling(self, hc): + """Test that tracestate headers are properly handled according to W3C spec.""" + with taddons.context(hc) as ctx: + ctx.configure(hc, trace_enabled=True) + + # Create a flow with an existing tracestate header + f = self.flow() + f.request.headers["tracestate"] = "congo=lZWRzIHRoNjM,rojo=00f067aa0ba902b7" + + # Process the request + hc.request(f) + + # Get the entry and its span ID + entry = hc.har["log"]["entries"][0] + span_id = entry["_span_id"] + + # The tracestate header should be updated with our vendor + assert "tracestate" in f.request.headers + tracestate = f.request.headers["tracestate"] + + # Our entry should be the leftmost + assert tracestate.startswith(f"browserup={span_id}") + + # The original entries should be preserved + assert "congo=lZWRzIHRoNjM" in tracestate + assert "rojo=00f067aa0ba902b7" in tracestate + + # Create a flow with our vendor already in tracestate + f2 = self.flow() + f2.request.headers["tracestate"] = f"browserup=oldspanid,congo=lZWRzIHRoNjM" + + # Process the request + hc.request(f2) + + # Get the entry and its span ID + entry2 = hc.har["log"]["entries"][1] + span_id2 = entry2["_span_id"] + + # The tracestate should be updated with our new span ID + tracestate2 = f2.request.headers["tracestate"] + assert tracestate2.startswith(f"browserup={span_id2}") + + # Old browserup entry should be removed + assert "browserup=oldspanid" not in tracestate2 + + # Original other vendor should be preserved + assert "congo=lZWRzIHRoNjM" in tracestate2 + + # Test with a very long tracestate header (more than 32 entries) + f3 = self.flow() + # Create a tracestate with 35 entries + long_tracestate = ",".join([f"vendor{i}=value{i}" for i in range(35)]) + f3.request.headers["tracestate"] = long_tracestate + + # Process the request + hc.request(f3) + + # The tracestate should be trimmed to 32 entries including our entry + tracestate3 = f3.request.headers["tracestate"] + entries = tracestate3.split(",") + assert len(entries) == 32 # 32 is the max per W3C spec + assert entries[0].startswith("browserup=") # Our entry is first + + def test_w3c_trace_context_full_scenario(self, hc): + """Test a complete W3C trace context scenario with multiple participants.""" + with taddons.context(hc) as ctx: + ctx.configure(hc, trace_enabled=True) + + # Simulate a request chain: + # 1. Original request comes in with Congo and Rojo in tracestate + # 2. We add browserup to tracestate + # 3. We verify the trace is propagated correctly + + # First request has existing trace context headers + f1 = self.flow() + original_trace_id = "0af7651916cd43dd8448eb211c80319c" + original_parent_id = "b7ad6b7169203331" + f1.request.headers["traceparent"] = ( + f"00-{original_trace_id}-{original_parent_id}-01" + ) + f1.request.headers["tracestate"] = "congo=t61rcWkgMzE,rojo=00f067aa0ba902b7" + + # Process the request + hc.request(f1) + + # Get the entry + entry1 = hc.har["log"]["entries"][0] + + # Verify traceparent is updated correctly: + # - Same trace ID + # - Our span ID + # - Same flags + traceparent1 = f1.request.headers["traceparent"] + parts = traceparent1.split("-") + assert parts[0] == "00" # version + assert parts[1] == original_trace_id # preserved trace ID + assert parts[2] == entry1["_span_id"] # our span ID + assert parts[3] == "01" # preserved flags + + # Verify tracestate is updated correctly: + # - We added our entry at the left + # - Original entries are preserved + tracestate1 = f1.request.headers["tracestate"] + entries = tracestate1.split(",") + assert entries[0].startswith("browserup=") # Our entry is first + assert entries[0].endswith(entry1["_span_id"]) # Using our span ID + assert "congo=t61rcWkgMzE" in tracestate1 # Congo preserved + assert "rojo=00f067aa0ba902b7" in tracestate1 # Rojo preserved + + # Simulate a second request from the same trace + f2 = self.flow() + # Use the updated traceparent from the first request + f2.request.headers["traceparent"] = traceparent1 + # Use the updated tracestate from the first request + f2.request.headers["tracestate"] = tracestate1 + + # Process the request + hc.request(f2) + + # Get the entry + entry2 = hc.har["log"]["entries"][1] + + # Verify traceparent is updated: + # - Same trace ID as first request + # - New span ID for this request + # - Same flags + traceparent2 = f2.request.headers["traceparent"] + parts = traceparent2.split("-") + assert parts[1] == original_trace_id # same trace ID throughout trace + assert parts[2] == entry2["_span_id"] # new span ID for this request + assert parts[2] != entry1["_span_id"] # different from first request + + # Verify tracestate is updated: + # - Our entry is updated with new span ID + # - Other entries are preserved + tracestate2 = f2.request.headers["tracestate"] + assert tracestate2.startswith(f"browserup={entry2['_span_id']}") + assert "congo=t61rcWkgMzE" in tracestate2 # Congo still there + assert "rojo=00f067aa0ba902b7" in tracestate2 # Rojo still there + + def test_page_timing_spans(self, hc): + """Test that page timing attributes are properly associated with the page span.""" + with taddons.context(hc) as ctx: + ctx.configure(hc, trace_enabled=True) + + # Reset HAR to get a clean state + hc.reset_har_and_return_old_har() + + # Add page timing information + timing_info = { + "onContentLoad": 150, + "onLoad": 350, + "_firstPaint": 100, + "_firstContentfulPaint": 120, + "_domInteractive": 200, + } + + # Add the page timing data to the current page + hc.add_page_timings_to_har(timing_info) + + # Get the current page + page = hc.har["log"]["pages"][0] + + # Verify that the page has timing data + assert page["pageTimings"]["onContentLoad"] == 150 + assert page["pageTimings"]["onLoad"] == 350 + assert page["pageTimings"]["_firstPaint"] == 100 + assert page["pageTimings"]["_firstContentfulPaint"] == 120 + assert page["pageTimings"]["_domInteractive"] == 200 + + # Verify that the page has a span ID + assert "_span_id" in page + + # Now add a request to this page + f = self.flow() + hc.request(f) + + # Get the entry + entry = hc.har["log"]["entries"][0] + + # Verify that the entry references the page + assert entry["pageref"] == page["id"] + + # Verify that the entry's parent ID is the page's span ID + assert entry["_parent_id"] == page["_span_id"] + @pytest.fixture() def hc(path):
Response Details
Status Code Description Response Headers
200 The traffic conformed to the size criteria. -
422 The MatchCriteria are invalid. -