From 26d12f90d91520d4406ccf61eb484b2ad39b3d6a Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Tue, 5 May 2026 15:35:45 +0530 Subject: [PATCH 1/9] Add unit tests for various DTOs and configure testing environment - Created unit tests for TestMetaDto, TimingsDto, TlsCertificateDto, TlsCertificateIssuerDto, TlsProtocolsDto, TlsScanDataDto, TlsScanDto, TlsScanMetaDto, TlsScanResponseDto, Url2PdfDto, Url2PdfMetaDto, Url2PdfResponseDto, WebScrapeDto, WebScrapeMetaDto, and WebScrapeResponseDto. - Added a tox.ini file to configure the testing environment with pytest and coverage. --- .github/workflows/python.yml | 34 + .gitignore | 172 +- .gitlab-ci.yml | 31 + .openapi-generator-ignore | 23 + .openapi-generator/FILES | 275 + .openapi-generator/VERSION | 1 + .travis.yml | 17 + README.md | 222 +- docs/ApiToolApi.md | 1387 +++++ docs/BaseErrorResponseDto.md | 33 + docs/BrokenLinkDto.md | 31 + docs/BrokenLinkMetaDto.md | 33 + docs/BrokenLinkResponseDto.md | 35 + docs/BrokenLinkSummaryDto.md | 33 + docs/DefaultExtractionFieldDto.md | 30 + docs/DnsMetaDto.md | 31 + docs/DnsRecordDto.md | 30 + docs/DnsRecordResponseDto.md | 33 + docs/DnsSecDataDto.md | 31 + docs/DnsSecDto.md | 29 + docs/DnsSecMetaDto.md | 30 + docs/DnsSecResponseDto.md | 33 + docs/ExtractionSchemaDto.md | 31 + docs/ExtractionSchemaDtoFieldsInner.md | 35 + docs/HealthResponseDto.md | 32 + docs/ImageSearchResponseDto.md | 33 + docs/ImageSearchResultItemDto.md | 33 + docs/LighthouseDto.md | 33 + docs/LighthouseMetaDto.md | 34 + docs/LighthouseResponseDto.md | 33 + docs/LoadTimeDataDto.md | 40 + docs/LoadTimeDto.md | 31 + docs/LoadTimeMetaDto.md | 33 + docs/LoadTimeResponseDto.md | 34 + docs/MarginDto.md | 32 + docs/MetaScrapeDto.md | 35 + docs/MetaScrapeMetaDto.md | 36 + docs/MetaScrapeResponseDto.md | 33 + docs/MetaScrapeResponseDtoData.md | 29 + docs/MixedContentDataDto.md | 30 + docs/MixedContentDto.md | 31 + docs/MixedContentMetaDto.md | 33 + docs/MixedContentResponseDto.md | 34 + docs/MixedContentResponseDtoData.md | 31 + docs/MtrDataDto.md | 38 + docs/MtrDto.md | 31 + docs/MtrMetaDto.md | 33 + docs/MtrResponseDto.md | 33 + docs/NetworkDto.md | 31 + docs/OpenPortDto.md | 31 + docs/OpenPortMetaDto.md | 32 + docs/OpenPortResponseDto.md | 33 + docs/PingDataDto.md | 36 + docs/PingDto.md | 29 + docs/PingMetaDto.md | 30 + docs/PingResponseDto.md | 33 + docs/ProtocolSupportDto.md | 33 + docs/RedirectCheckDto.md | 30 + docs/RedirectCheckMetaDto.md | 31 + docs/RedirectCheckResponseDto.md | 33 + docs/RedirectHopDto.md | 31 + docs/ScreenshotDto.md | 48 + docs/ScreenshotMetaDto.md | 49 + docs/ScreenshotResponseDto.md | 33 + docs/Search200Response.md | 33 + docs/SearchHtmlResponseDto.md | 33 + docs/SearchMarkdownResponseDto.md | 33 + docs/SearchMetaDto.md | 36 + docs/SearchRequestDto.md | 39 + docs/SearchResponseDto.md | 33 + docs/SearchResultItemDto.md | 34 + docs/SelectorExtractionFieldDto.md | 33 + docs/ServiceHealthResponseDto.md | 33 + docs/ServiceStatus.md | 31 + docs/SiteStatusDto.md | 31 + docs/SiteStatusMetaDto.md | 33 + docs/SiteStatusResponseDto.md | 34 + docs/TestMetaDto.md | 29 + docs/TimingsDto.md | 37 + docs/TlsCertificateDto.md | 32 + docs/TlsCertificateIssuerDto.md | 31 + docs/TlsProtocolsDto.md | 32 + docs/TlsScanDataDto.md | 30 + docs/TlsScanDto.md | 29 + docs/TlsScanMetaDto.md | 30 + docs/TlsScanResponseDto.md | 33 + docs/Url2PdfDto.md | 38 + docs/Url2PdfMetaDto.md | 36 + docs/Url2PdfResponseDto.md | 33 + docs/WebScrapeDto.md | 39 + docs/WebScrapeMetaDto.md | 40 + docs/WebScrapeResponseDto.md | 33 + geekflare_api/__init__.py | 214 + geekflare_api/api/__init__.py | 5 + geekflare_api/api/api_tool_api.py | 4780 +++++++++++++++++ geekflare_api/api_client.py | 804 +++ geekflare_api/api_response.py | 21 + geekflare_api/configuration.py | 626 +++ geekflare_api/exceptions.py | 218 + geekflare_api/models/__init__.py | 99 + .../models/base_error_response_dto.py | 103 + geekflare_api/models/broken_link_dto.py | 92 + geekflare_api/models/broken_link_meta_dto.py | 100 + .../models/broken_link_response_dto.py | 115 + .../models/broken_link_summary_dto.py | 96 + .../models/default_extraction_field_dto.py | 90 + geekflare_api/models/dns_meta_dto.py | 103 + geekflare_api/models/dns_record_dto.py | 101 + .../models/dns_record_response_dto.py | 107 + geekflare_api/models/dns_sec_data_dto.py | 92 + geekflare_api/models/dns_sec_dto.py | 88 + geekflare_api/models/dns_sec_meta_dto.py | 94 + geekflare_api/models/dns_sec_response_dto.py | 111 + geekflare_api/models/extraction_schema_dto.py | 100 + .../extraction_schema_dto_fields_inner.py | 137 + geekflare_api/models/health_response_dto.py | 101 + .../models/image_search_response_dto.py | 115 + .../models/image_search_result_item_dto.py | 96 + geekflare_api/models/lighthouse_dto.py | 106 + geekflare_api/models/lighthouse_meta_dto.py | 109 + .../models/lighthouse_response_dto.py | 107 + geekflare_api/models/load_time_data_dto.py | 122 + geekflare_api/models/load_time_dto.py | 92 + geekflare_api/models/load_time_meta_dto.py | 100 + .../models/load_time_response_dto.py | 113 + geekflare_api/models/margin_dto.py | 94 + geekflare_api/models/meta_scrape_dto.py | 120 + geekflare_api/models/meta_scrape_meta_dto.py | 120 + .../models/meta_scrape_response_dto.py | 111 + .../models/meta_scrape_response_dto_data.py | 143 + .../models/mixed_content_data_dto.py | 90 + geekflare_api/models/mixed_content_dto.py | 92 + .../models/mixed_content_meta_dto.py | 100 + .../models/mixed_content_response_dto.py | 113 + .../models/mixed_content_response_dto_data.py | 140 + geekflare_api/models/mtr_data_dto.py | 106 + geekflare_api/models/mtr_dto.py | 92 + geekflare_api/models/mtr_meta_dto.py | 100 + geekflare_api/models/mtr_response_dto.py | 115 + geekflare_api/models/network_dto.py | 92 + geekflare_api/models/open_port_dto.py | 102 + geekflare_api/models/open_port_meta_dto.py | 108 + .../models/open_port_response_dto.py | 107 + geekflare_api/models/ping_data_dto.py | 102 + geekflare_api/models/ping_dto.py | 88 + geekflare_api/models/ping_meta_dto.py | 94 + geekflare_api/models/ping_response_dto.py | 111 + geekflare_api/models/protocol_support_dto.py | 96 + geekflare_api/models/redirect_check_dto.py | 90 + .../models/redirect_check_meta_dto.py | 96 + .../models/redirect_check_response_dto.py | 115 + geekflare_api/models/redirect_hop_dto.py | 92 + geekflare_api/models/screenshot_dto.py | 157 + geekflare_api/models/screenshot_meta_dto.py | 132 + .../models/screenshot_response_dto.py | 107 + geekflare_api/models/search200_response.py | 165 + .../models/search_html_response_dto.py | 107 + .../models/search_markdown_response_dto.py | 107 + geekflare_api/models/search_meta_dto.py | 106 + geekflare_api/models/search_request_dto.py | 139 + geekflare_api/models/search_response_dto.py | 115 + .../models/search_result_item_dto.py | 98 + .../models/selector_extraction_field_dto.py | 105 + .../models/service_health_response_dto.py | 111 + geekflare_api/models/service_status.py | 92 + geekflare_api/models/site_status_dto.py | 92 + geekflare_api/models/site_status_meta_dto.py | 100 + .../models/site_status_response_dto.py | 109 + geekflare_api/models/test_meta_dto.py | 88 + geekflare_api/models/timings_dto.py | 104 + geekflare_api/models/tls_certificate_dto.py | 98 + .../models/tls_certificate_issuer_dto.py | 92 + geekflare_api/models/tls_protocols_dto.py | 94 + geekflare_api/models/tls_scan_data_dto.py | 98 + geekflare_api/models/tls_scan_dto.py | 88 + geekflare_api/models/tls_scan_meta_dto.py | 94 + geekflare_api/models/tls_scan_response_dto.py | 111 + geekflare_api/models/url2_pdf_dto.py | 140 + geekflare_api/models/url2_pdf_meta_dto.py | 110 + geekflare_api/models/url2_pdf_response_dto.py | 107 + geekflare_api/models/web_scrape_dto.py | 143 + geekflare_api/models/web_scrape_meta_dto.py | 133 + .../models/web_scrape_response_dto.py | 111 + geekflare_api/py.typed | 0 geekflare_api/rest.py | 263 + git_push.sh | 57 + openapi.json | 4138 ++++++++++++++ openapitools.json | 7 + pyproject.toml | 95 + requirements.txt | 4 + setup.cfg | 2 + setup.py | 48 + test-requirements.txt | 6 + test/__init__.py | 0 test/test_api_tool_api.py | 150 + test/test_base_error_response_dto.py | 59 + test/test_broken_link_dto.py | 54 + test/test_broken_link_meta_dto.py | 62 + test/test_broken_link_response_dto.py | 84 + test/test_broken_link_summary_dto.py | 60 + test/test_default_extraction_field_dto.py | 54 + test/test_dns_meta_dto.py | 58 + test/test_dns_record_dto.py | 53 + test/test_dns_record_response_dto.py | 66 + test/test_dns_sec_data_dto.py | 54 + test/test_dns_sec_dto.py | 52 + test/test_dns_sec_meta_dto.py | 56 + test/test_dns_sec_response_dto.py | 70 + test/test_extraction_schema_dto.py | 59 + ...test_extraction_schema_dto_fields_inner.py | 68 + test/test_health_response_dto.py | 58 + test/test_image_search_response_dto.py | 90 + test/test_image_search_result_item_dto.py | 60 + test/test_lighthouse_dto.py | 56 + test/test_lighthouse_meta_dto.py | 63 + test/test_lighthouse_response_dto.py | 72 + test/test_load_time_data_dto.py | 108 + test/test_load_time_dto.py | 54 + test/test_load_time_meta_dto.py | 60 + test/test_load_time_response_dto.py | 95 + test/test_margin_dto.py | 54 + test/test_meta_scrape_dto.py | 58 + test/test_meta_scrape_meta_dto.py | 67 + test/test_meta_scrape_response_dto.py | 76 + test/test_meta_scrape_response_dto_data.py | 50 + test/test_mixed_content_data_dto.py | 54 + test/test_mixed_content_dto.py | 54 + test/test_mixed_content_meta_dto.py | 59 + test/test_mixed_content_response_dto.py | 72 + test/test_mixed_content_response_dto_data.py | 54 + test/test_mtr_data_dto.py | 70 + test/test_mtr_dto.py | 54 + test/test_mtr_meta_dto.py | 60 + test/test_mtr_response_dto.py | 70 + test/test_network_dto.py | 55 + test/test_open_port_dto.py | 54 + test/test_open_port_meta_dto.py | 58 + test/test_open_port_response_dto.py | 72 + test/test_ping_data_dto.py | 66 + test/test_ping_dto.py | 52 + test/test_ping_meta_dto.py | 56 + test/test_ping_response_dto.py | 80 + test/test_protocol_support_dto.py | 59 + test/test_redirect_check_dto.py | 53 + test/test_redirect_check_meta_dto.py | 58 + test/test_redirect_check_response_dto.py | 76 + test/test_redirect_hop_dto.py | 56 + test/test_screenshot_dto.py | 71 + test/test_screenshot_meta_dto.py | 82 + test/test_screenshot_response_dto.py | 102 + test/test_search200_response.py | 76 + test/test_search_html_response_dto.py | 76 + test/test_search_markdown_response_dto.py | 78 + test/test_search_meta_dto.py | 68 + test/test_search_request_dto.py | 62 + test/test_search_response_dto.py | 92 + test/test_search_result_item_dto.py | 60 + test/test_selector_extraction_field_dto.py | 71 + test/test_service_health_response_dto.py | 70 + test/test_service_status.py | 56 + test/test_site_status_dto.py | 54 + test/test_site_status_meta_dto.py | 61 + test/test_site_status_response_dto.py | 72 + test/test_test_meta_dto.py | 52 + test/test_timings_dto.py | 68 + test/test_tls_certificate_dto.py | 64 + test/test_tls_certificate_issuer_dto.py | 56 + test/test_tls_protocols_dto.py | 58 + test/test_tls_scan_data_dto.py | 70 + test/test_tls_scan_dto.py | 52 + test/test_tls_scan_meta_dto.py | 56 + test/test_tls_scan_response_dto.py | 68 + test/test_url2_pdf_dto.py | 65 + test/test_url2_pdf_meta_dto.py | 70 + test/test_url2_pdf_response_dto.py | 76 + test/test_web_scrape_dto.py | 67 + test/test_web_scrape_meta_dto.py | 85 + test/test_web_scrape_response_dto.py | 84 + tox.ini | 9 + 279 files changed, 30585 insertions(+), 163 deletions(-) create mode 100644 .github/workflows/python.yml create mode 100644 .gitlab-ci.yml create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .travis.yml create mode 100644 docs/ApiToolApi.md create mode 100644 docs/BaseErrorResponseDto.md create mode 100644 docs/BrokenLinkDto.md create mode 100644 docs/BrokenLinkMetaDto.md create mode 100644 docs/BrokenLinkResponseDto.md create mode 100644 docs/BrokenLinkSummaryDto.md create mode 100644 docs/DefaultExtractionFieldDto.md create mode 100644 docs/DnsMetaDto.md create mode 100644 docs/DnsRecordDto.md create mode 100644 docs/DnsRecordResponseDto.md create mode 100644 docs/DnsSecDataDto.md create mode 100644 docs/DnsSecDto.md create mode 100644 docs/DnsSecMetaDto.md create mode 100644 docs/DnsSecResponseDto.md create mode 100644 docs/ExtractionSchemaDto.md create mode 100644 docs/ExtractionSchemaDtoFieldsInner.md create mode 100644 docs/HealthResponseDto.md create mode 100644 docs/ImageSearchResponseDto.md create mode 100644 docs/ImageSearchResultItemDto.md create mode 100644 docs/LighthouseDto.md create mode 100644 docs/LighthouseMetaDto.md create mode 100644 docs/LighthouseResponseDto.md create mode 100644 docs/LoadTimeDataDto.md create mode 100644 docs/LoadTimeDto.md create mode 100644 docs/LoadTimeMetaDto.md create mode 100644 docs/LoadTimeResponseDto.md create mode 100644 docs/MarginDto.md create mode 100644 docs/MetaScrapeDto.md create mode 100644 docs/MetaScrapeMetaDto.md create mode 100644 docs/MetaScrapeResponseDto.md create mode 100644 docs/MetaScrapeResponseDtoData.md create mode 100644 docs/MixedContentDataDto.md create mode 100644 docs/MixedContentDto.md create mode 100644 docs/MixedContentMetaDto.md create mode 100644 docs/MixedContentResponseDto.md create mode 100644 docs/MixedContentResponseDtoData.md create mode 100644 docs/MtrDataDto.md create mode 100644 docs/MtrDto.md create mode 100644 docs/MtrMetaDto.md create mode 100644 docs/MtrResponseDto.md create mode 100644 docs/NetworkDto.md create mode 100644 docs/OpenPortDto.md create mode 100644 docs/OpenPortMetaDto.md create mode 100644 docs/OpenPortResponseDto.md create mode 100644 docs/PingDataDto.md create mode 100644 docs/PingDto.md create mode 100644 docs/PingMetaDto.md create mode 100644 docs/PingResponseDto.md create mode 100644 docs/ProtocolSupportDto.md create mode 100644 docs/RedirectCheckDto.md create mode 100644 docs/RedirectCheckMetaDto.md create mode 100644 docs/RedirectCheckResponseDto.md create mode 100644 docs/RedirectHopDto.md create mode 100644 docs/ScreenshotDto.md create mode 100644 docs/ScreenshotMetaDto.md create mode 100644 docs/ScreenshotResponseDto.md create mode 100644 docs/Search200Response.md create mode 100644 docs/SearchHtmlResponseDto.md create mode 100644 docs/SearchMarkdownResponseDto.md create mode 100644 docs/SearchMetaDto.md create mode 100644 docs/SearchRequestDto.md create mode 100644 docs/SearchResponseDto.md create mode 100644 docs/SearchResultItemDto.md create mode 100644 docs/SelectorExtractionFieldDto.md create mode 100644 docs/ServiceHealthResponseDto.md create mode 100644 docs/ServiceStatus.md create mode 100644 docs/SiteStatusDto.md create mode 100644 docs/SiteStatusMetaDto.md create mode 100644 docs/SiteStatusResponseDto.md create mode 100644 docs/TestMetaDto.md create mode 100644 docs/TimingsDto.md create mode 100644 docs/TlsCertificateDto.md create mode 100644 docs/TlsCertificateIssuerDto.md create mode 100644 docs/TlsProtocolsDto.md create mode 100644 docs/TlsScanDataDto.md create mode 100644 docs/TlsScanDto.md create mode 100644 docs/TlsScanMetaDto.md create mode 100644 docs/TlsScanResponseDto.md create mode 100644 docs/Url2PdfDto.md create mode 100644 docs/Url2PdfMetaDto.md create mode 100644 docs/Url2PdfResponseDto.md create mode 100644 docs/WebScrapeDto.md create mode 100644 docs/WebScrapeMetaDto.md create mode 100644 docs/WebScrapeResponseDto.md create mode 100644 geekflare_api/__init__.py create mode 100644 geekflare_api/api/__init__.py create mode 100644 geekflare_api/api/api_tool_api.py create mode 100644 geekflare_api/api_client.py create mode 100644 geekflare_api/api_response.py create mode 100644 geekflare_api/configuration.py create mode 100644 geekflare_api/exceptions.py create mode 100644 geekflare_api/models/__init__.py create mode 100644 geekflare_api/models/base_error_response_dto.py create mode 100644 geekflare_api/models/broken_link_dto.py create mode 100644 geekflare_api/models/broken_link_meta_dto.py create mode 100644 geekflare_api/models/broken_link_response_dto.py create mode 100644 geekflare_api/models/broken_link_summary_dto.py create mode 100644 geekflare_api/models/default_extraction_field_dto.py create mode 100644 geekflare_api/models/dns_meta_dto.py create mode 100644 geekflare_api/models/dns_record_dto.py create mode 100644 geekflare_api/models/dns_record_response_dto.py create mode 100644 geekflare_api/models/dns_sec_data_dto.py create mode 100644 geekflare_api/models/dns_sec_dto.py create mode 100644 geekflare_api/models/dns_sec_meta_dto.py create mode 100644 geekflare_api/models/dns_sec_response_dto.py create mode 100644 geekflare_api/models/extraction_schema_dto.py create mode 100644 geekflare_api/models/extraction_schema_dto_fields_inner.py create mode 100644 geekflare_api/models/health_response_dto.py create mode 100644 geekflare_api/models/image_search_response_dto.py create mode 100644 geekflare_api/models/image_search_result_item_dto.py create mode 100644 geekflare_api/models/lighthouse_dto.py create mode 100644 geekflare_api/models/lighthouse_meta_dto.py create mode 100644 geekflare_api/models/lighthouse_response_dto.py create mode 100644 geekflare_api/models/load_time_data_dto.py create mode 100644 geekflare_api/models/load_time_dto.py create mode 100644 geekflare_api/models/load_time_meta_dto.py create mode 100644 geekflare_api/models/load_time_response_dto.py create mode 100644 geekflare_api/models/margin_dto.py create mode 100644 geekflare_api/models/meta_scrape_dto.py create mode 100644 geekflare_api/models/meta_scrape_meta_dto.py create mode 100644 geekflare_api/models/meta_scrape_response_dto.py create mode 100644 geekflare_api/models/meta_scrape_response_dto_data.py create mode 100644 geekflare_api/models/mixed_content_data_dto.py create mode 100644 geekflare_api/models/mixed_content_dto.py create mode 100644 geekflare_api/models/mixed_content_meta_dto.py create mode 100644 geekflare_api/models/mixed_content_response_dto.py create mode 100644 geekflare_api/models/mixed_content_response_dto_data.py create mode 100644 geekflare_api/models/mtr_data_dto.py create mode 100644 geekflare_api/models/mtr_dto.py create mode 100644 geekflare_api/models/mtr_meta_dto.py create mode 100644 geekflare_api/models/mtr_response_dto.py create mode 100644 geekflare_api/models/network_dto.py create mode 100644 geekflare_api/models/open_port_dto.py create mode 100644 geekflare_api/models/open_port_meta_dto.py create mode 100644 geekflare_api/models/open_port_response_dto.py create mode 100644 geekflare_api/models/ping_data_dto.py create mode 100644 geekflare_api/models/ping_dto.py create mode 100644 geekflare_api/models/ping_meta_dto.py create mode 100644 geekflare_api/models/ping_response_dto.py create mode 100644 geekflare_api/models/protocol_support_dto.py create mode 100644 geekflare_api/models/redirect_check_dto.py create mode 100644 geekflare_api/models/redirect_check_meta_dto.py create mode 100644 geekflare_api/models/redirect_check_response_dto.py create mode 100644 geekflare_api/models/redirect_hop_dto.py create mode 100644 geekflare_api/models/screenshot_dto.py create mode 100644 geekflare_api/models/screenshot_meta_dto.py create mode 100644 geekflare_api/models/screenshot_response_dto.py create mode 100644 geekflare_api/models/search200_response.py create mode 100644 geekflare_api/models/search_html_response_dto.py create mode 100644 geekflare_api/models/search_markdown_response_dto.py create mode 100644 geekflare_api/models/search_meta_dto.py create mode 100644 geekflare_api/models/search_request_dto.py create mode 100644 geekflare_api/models/search_response_dto.py create mode 100644 geekflare_api/models/search_result_item_dto.py create mode 100644 geekflare_api/models/selector_extraction_field_dto.py create mode 100644 geekflare_api/models/service_health_response_dto.py create mode 100644 geekflare_api/models/service_status.py create mode 100644 geekflare_api/models/site_status_dto.py create mode 100644 geekflare_api/models/site_status_meta_dto.py create mode 100644 geekflare_api/models/site_status_response_dto.py create mode 100644 geekflare_api/models/test_meta_dto.py create mode 100644 geekflare_api/models/timings_dto.py create mode 100644 geekflare_api/models/tls_certificate_dto.py create mode 100644 geekflare_api/models/tls_certificate_issuer_dto.py create mode 100644 geekflare_api/models/tls_protocols_dto.py create mode 100644 geekflare_api/models/tls_scan_data_dto.py create mode 100644 geekflare_api/models/tls_scan_dto.py create mode 100644 geekflare_api/models/tls_scan_meta_dto.py create mode 100644 geekflare_api/models/tls_scan_response_dto.py create mode 100644 geekflare_api/models/url2_pdf_dto.py create mode 100644 geekflare_api/models/url2_pdf_meta_dto.py create mode 100644 geekflare_api/models/url2_pdf_response_dto.py create mode 100644 geekflare_api/models/web_scrape_dto.py create mode 100644 geekflare_api/models/web_scrape_meta_dto.py create mode 100644 geekflare_api/models/web_scrape_response_dto.py create mode 100644 geekflare_api/py.typed create mode 100644 geekflare_api/rest.py create mode 100644 git_push.sh create mode 100644 openapi.json create mode 100644 openapitools.json create mode 100644 pyproject.toml create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt create mode 100644 test/__init__.py create mode 100644 test/test_api_tool_api.py create mode 100644 test/test_base_error_response_dto.py create mode 100644 test/test_broken_link_dto.py create mode 100644 test/test_broken_link_meta_dto.py create mode 100644 test/test_broken_link_response_dto.py create mode 100644 test/test_broken_link_summary_dto.py create mode 100644 test/test_default_extraction_field_dto.py create mode 100644 test/test_dns_meta_dto.py create mode 100644 test/test_dns_record_dto.py create mode 100644 test/test_dns_record_response_dto.py create mode 100644 test/test_dns_sec_data_dto.py create mode 100644 test/test_dns_sec_dto.py create mode 100644 test/test_dns_sec_meta_dto.py create mode 100644 test/test_dns_sec_response_dto.py create mode 100644 test/test_extraction_schema_dto.py create mode 100644 test/test_extraction_schema_dto_fields_inner.py create mode 100644 test/test_health_response_dto.py create mode 100644 test/test_image_search_response_dto.py create mode 100644 test/test_image_search_result_item_dto.py create mode 100644 test/test_lighthouse_dto.py create mode 100644 test/test_lighthouse_meta_dto.py create mode 100644 test/test_lighthouse_response_dto.py create mode 100644 test/test_load_time_data_dto.py create mode 100644 test/test_load_time_dto.py create mode 100644 test/test_load_time_meta_dto.py create mode 100644 test/test_load_time_response_dto.py create mode 100644 test/test_margin_dto.py create mode 100644 test/test_meta_scrape_dto.py create mode 100644 test/test_meta_scrape_meta_dto.py create mode 100644 test/test_meta_scrape_response_dto.py create mode 100644 test/test_meta_scrape_response_dto_data.py create mode 100644 test/test_mixed_content_data_dto.py create mode 100644 test/test_mixed_content_dto.py create mode 100644 test/test_mixed_content_meta_dto.py create mode 100644 test/test_mixed_content_response_dto.py create mode 100644 test/test_mixed_content_response_dto_data.py create mode 100644 test/test_mtr_data_dto.py create mode 100644 test/test_mtr_dto.py create mode 100644 test/test_mtr_meta_dto.py create mode 100644 test/test_mtr_response_dto.py create mode 100644 test/test_network_dto.py create mode 100644 test/test_open_port_dto.py create mode 100644 test/test_open_port_meta_dto.py create mode 100644 test/test_open_port_response_dto.py create mode 100644 test/test_ping_data_dto.py create mode 100644 test/test_ping_dto.py create mode 100644 test/test_ping_meta_dto.py create mode 100644 test/test_ping_response_dto.py create mode 100644 test/test_protocol_support_dto.py create mode 100644 test/test_redirect_check_dto.py create mode 100644 test/test_redirect_check_meta_dto.py create mode 100644 test/test_redirect_check_response_dto.py create mode 100644 test/test_redirect_hop_dto.py create mode 100644 test/test_screenshot_dto.py create mode 100644 test/test_screenshot_meta_dto.py create mode 100644 test/test_screenshot_response_dto.py create mode 100644 test/test_search200_response.py create mode 100644 test/test_search_html_response_dto.py create mode 100644 test/test_search_markdown_response_dto.py create mode 100644 test/test_search_meta_dto.py create mode 100644 test/test_search_request_dto.py create mode 100644 test/test_search_response_dto.py create mode 100644 test/test_search_result_item_dto.py create mode 100644 test/test_selector_extraction_field_dto.py create mode 100644 test/test_service_health_response_dto.py create mode 100644 test/test_service_status.py create mode 100644 test/test_site_status_dto.py create mode 100644 test/test_site_status_meta_dto.py create mode 100644 test/test_site_status_response_dto.py create mode 100644 test/test_test_meta_dto.py create mode 100644 test/test_timings_dto.py create mode 100644 test/test_tls_certificate_dto.py create mode 100644 test/test_tls_certificate_issuer_dto.py create mode 100644 test/test_tls_protocols_dto.py create mode 100644 test/test_tls_scan_data_dto.py create mode 100644 test/test_tls_scan_dto.py create mode 100644 test/test_tls_scan_meta_dto.py create mode 100644 test/test_tls_scan_response_dto.py create mode 100644 test/test_url2_pdf_dto.py create mode 100644 test/test_url2_pdf_meta_dto.py create mode 100644 test/test_url2_pdf_response_dto.py create mode 100644 test/test_web_scrape_dto.py create mode 100644 test/test_web_scrape_meta_dto.py create mode 100644 test/test_web_scrape_response_dto.py create mode 100644 tox.ini diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..b801702 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,34 @@ +# 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: geekflare_api Python package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + + 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=geekflare_api diff --git a/.gitignore b/.gitignore index 83972fa..65b06b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Byte-compiled / optimized / DLL files __pycache__/ -*.py[codz] +*.py[cod] *$py.class # C extensions @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python +env/ build/ develop-eggs/ dist/ @@ -19,16 +20,13 @@ lib64/ parts/ sdist/ var/ -wheels/ -share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST # 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. +# 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 @@ -39,17 +37,17 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ -.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml -*.cover -*.py.cover +*,cover .hypothesis/ -.pytest_cache/ -cover/ +venv/ +.venv/ +.python-version +.pytest_cache # Translations *.mo @@ -57,162 +55,12 @@ cover/ # Django stuff: *.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy # Sphinx documentation docs/_build/ # PyBuilder -.pybuilder/ target/ -# Jupyter Notebook +# Ipython Notebook .ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -# Pipfile.lock - -# UV -# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# uv.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -# poetry.lock -# poetry.toml - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. -# https://pdm-project.org/en/latest/usage/project/#working-with-version-control -# pdm.lock -# pdm.toml -.pdm-python -.pdm-build/ - -# pixi -# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. -# pixi.lock -# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one -# in the .venv directory. It is recommended not to include this directory in version control. -.pixi - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# Redis -*.rdb -*.aof -*.pid - -# RabbitMQ -mnesia/ -rabbitmq/ -rabbitmq-data/ - -# ActiveMQ -activemq-data/ - -# SageMath parsed files -*.sage.py - -# Environments -.env -.envrc -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -# .idea/ - -# Abstra -# Abstra is an AI-powered process automation framework. -# Ignore directories containing user credentials, local state, and settings. -# Learn more at https://abstra.io/docs -.abstra/ - -# Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore -# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, -# you could uncomment the following to ignore the entire vscode folder -# .vscode/ -# Temporary file for partial code execution -tempCodeRunnerFile.py - -# Ruff stuff: -.ruff_cache/ - -# PyPI configuration file -.pypirc - -# Marimo -marimo/_static/ -marimo/_lsp/ -__marimo__/ - -# Streamlit -.streamlit/secrets.toml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6961663 --- /dev/null +++ b/.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=geekflare_api + +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 +pytest-3.13: + extends: .pytest + image: python:3.13-alpine +pytest-3.14: + extends: .pytest + image: python:3.14-alpine diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.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/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..c51afec --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,275 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/ApiToolApi.md +docs/BaseErrorResponseDto.md +docs/BrokenLinkDto.md +docs/BrokenLinkMetaDto.md +docs/BrokenLinkResponseDto.md +docs/BrokenLinkSummaryDto.md +docs/DefaultExtractionFieldDto.md +docs/DnsMetaDto.md +docs/DnsRecordDto.md +docs/DnsRecordResponseDto.md +docs/DnsSecDataDto.md +docs/DnsSecDto.md +docs/DnsSecMetaDto.md +docs/DnsSecResponseDto.md +docs/ExtractionSchemaDto.md +docs/ExtractionSchemaDtoFieldsInner.md +docs/HealthResponseDto.md +docs/ImageSearchResponseDto.md +docs/ImageSearchResultItemDto.md +docs/LighthouseDto.md +docs/LighthouseMetaDto.md +docs/LighthouseResponseDto.md +docs/LoadTimeDataDto.md +docs/LoadTimeDto.md +docs/LoadTimeMetaDto.md +docs/LoadTimeResponseDto.md +docs/MarginDto.md +docs/MetaScrapeDto.md +docs/MetaScrapeMetaDto.md +docs/MetaScrapeResponseDto.md +docs/MetaScrapeResponseDtoData.md +docs/MixedContentDataDto.md +docs/MixedContentDto.md +docs/MixedContentMetaDto.md +docs/MixedContentResponseDto.md +docs/MixedContentResponseDtoData.md +docs/MtrDataDto.md +docs/MtrDto.md +docs/MtrMetaDto.md +docs/MtrResponseDto.md +docs/NetworkDto.md +docs/OpenPortDto.md +docs/OpenPortMetaDto.md +docs/OpenPortResponseDto.md +docs/PingDataDto.md +docs/PingDto.md +docs/PingMetaDto.md +docs/PingResponseDto.md +docs/ProtocolSupportDto.md +docs/RedirectCheckDto.md +docs/RedirectCheckMetaDto.md +docs/RedirectCheckResponseDto.md +docs/RedirectHopDto.md +docs/ScreenshotDto.md +docs/ScreenshotMetaDto.md +docs/ScreenshotResponseDto.md +docs/Search200Response.md +docs/SearchHtmlResponseDto.md +docs/SearchMarkdownResponseDto.md +docs/SearchMetaDto.md +docs/SearchRequestDto.md +docs/SearchResponseDto.md +docs/SearchResultItemDto.md +docs/SelectorExtractionFieldDto.md +docs/ServiceHealthResponseDto.md +docs/ServiceStatus.md +docs/SiteStatusDto.md +docs/SiteStatusMetaDto.md +docs/SiteStatusResponseDto.md +docs/TestMetaDto.md +docs/TimingsDto.md +docs/TlsCertificateDto.md +docs/TlsCertificateIssuerDto.md +docs/TlsProtocolsDto.md +docs/TlsScanDataDto.md +docs/TlsScanDto.md +docs/TlsScanMetaDto.md +docs/TlsScanResponseDto.md +docs/Url2PdfDto.md +docs/Url2PdfMetaDto.md +docs/Url2PdfResponseDto.md +docs/WebScrapeDto.md +docs/WebScrapeMetaDto.md +docs/WebScrapeResponseDto.md +geekflare_api/__init__.py +geekflare_api/api/__init__.py +geekflare_api/api/api_tool_api.py +geekflare_api/api_client.py +geekflare_api/api_response.py +geekflare_api/configuration.py +geekflare_api/exceptions.py +geekflare_api/models/__init__.py +geekflare_api/models/base_error_response_dto.py +geekflare_api/models/broken_link_dto.py +geekflare_api/models/broken_link_meta_dto.py +geekflare_api/models/broken_link_response_dto.py +geekflare_api/models/broken_link_summary_dto.py +geekflare_api/models/default_extraction_field_dto.py +geekflare_api/models/dns_meta_dto.py +geekflare_api/models/dns_record_dto.py +geekflare_api/models/dns_record_response_dto.py +geekflare_api/models/dns_sec_data_dto.py +geekflare_api/models/dns_sec_dto.py +geekflare_api/models/dns_sec_meta_dto.py +geekflare_api/models/dns_sec_response_dto.py +geekflare_api/models/extraction_schema_dto.py +geekflare_api/models/extraction_schema_dto_fields_inner.py +geekflare_api/models/health_response_dto.py +geekflare_api/models/image_search_response_dto.py +geekflare_api/models/image_search_result_item_dto.py +geekflare_api/models/lighthouse_dto.py +geekflare_api/models/lighthouse_meta_dto.py +geekflare_api/models/lighthouse_response_dto.py +geekflare_api/models/load_time_data_dto.py +geekflare_api/models/load_time_dto.py +geekflare_api/models/load_time_meta_dto.py +geekflare_api/models/load_time_response_dto.py +geekflare_api/models/margin_dto.py +geekflare_api/models/meta_scrape_dto.py +geekflare_api/models/meta_scrape_meta_dto.py +geekflare_api/models/meta_scrape_response_dto.py +geekflare_api/models/meta_scrape_response_dto_data.py +geekflare_api/models/mixed_content_data_dto.py +geekflare_api/models/mixed_content_dto.py +geekflare_api/models/mixed_content_meta_dto.py +geekflare_api/models/mixed_content_response_dto.py +geekflare_api/models/mixed_content_response_dto_data.py +geekflare_api/models/mtr_data_dto.py +geekflare_api/models/mtr_dto.py +geekflare_api/models/mtr_meta_dto.py +geekflare_api/models/mtr_response_dto.py +geekflare_api/models/network_dto.py +geekflare_api/models/open_port_dto.py +geekflare_api/models/open_port_meta_dto.py +geekflare_api/models/open_port_response_dto.py +geekflare_api/models/ping_data_dto.py +geekflare_api/models/ping_dto.py +geekflare_api/models/ping_meta_dto.py +geekflare_api/models/ping_response_dto.py +geekflare_api/models/protocol_support_dto.py +geekflare_api/models/redirect_check_dto.py +geekflare_api/models/redirect_check_meta_dto.py +geekflare_api/models/redirect_check_response_dto.py +geekflare_api/models/redirect_hop_dto.py +geekflare_api/models/screenshot_dto.py +geekflare_api/models/screenshot_meta_dto.py +geekflare_api/models/screenshot_response_dto.py +geekflare_api/models/search200_response.py +geekflare_api/models/search_html_response_dto.py +geekflare_api/models/search_markdown_response_dto.py +geekflare_api/models/search_meta_dto.py +geekflare_api/models/search_request_dto.py +geekflare_api/models/search_response_dto.py +geekflare_api/models/search_result_item_dto.py +geekflare_api/models/selector_extraction_field_dto.py +geekflare_api/models/service_health_response_dto.py +geekflare_api/models/service_status.py +geekflare_api/models/site_status_dto.py +geekflare_api/models/site_status_meta_dto.py +geekflare_api/models/site_status_response_dto.py +geekflare_api/models/test_meta_dto.py +geekflare_api/models/timings_dto.py +geekflare_api/models/tls_certificate_dto.py +geekflare_api/models/tls_certificate_issuer_dto.py +geekflare_api/models/tls_protocols_dto.py +geekflare_api/models/tls_scan_data_dto.py +geekflare_api/models/tls_scan_dto.py +geekflare_api/models/tls_scan_meta_dto.py +geekflare_api/models/tls_scan_response_dto.py +geekflare_api/models/url2_pdf_dto.py +geekflare_api/models/url2_pdf_meta_dto.py +geekflare_api/models/url2_pdf_response_dto.py +geekflare_api/models/web_scrape_dto.py +geekflare_api/models/web_scrape_meta_dto.py +geekflare_api/models/web_scrape_response_dto.py +geekflare_api/py.typed +geekflare_api/rest.py +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_api_tool_api.py +test/test_base_error_response_dto.py +test/test_broken_link_dto.py +test/test_broken_link_meta_dto.py +test/test_broken_link_response_dto.py +test/test_broken_link_summary_dto.py +test/test_default_extraction_field_dto.py +test/test_dns_meta_dto.py +test/test_dns_record_dto.py +test/test_dns_record_response_dto.py +test/test_dns_sec_data_dto.py +test/test_dns_sec_dto.py +test/test_dns_sec_meta_dto.py +test/test_dns_sec_response_dto.py +test/test_extraction_schema_dto.py +test/test_extraction_schema_dto_fields_inner.py +test/test_health_response_dto.py +test/test_image_search_response_dto.py +test/test_image_search_result_item_dto.py +test/test_lighthouse_dto.py +test/test_lighthouse_meta_dto.py +test/test_lighthouse_response_dto.py +test/test_load_time_data_dto.py +test/test_load_time_dto.py +test/test_load_time_meta_dto.py +test/test_load_time_response_dto.py +test/test_margin_dto.py +test/test_meta_scrape_dto.py +test/test_meta_scrape_meta_dto.py +test/test_meta_scrape_response_dto.py +test/test_meta_scrape_response_dto_data.py +test/test_mixed_content_data_dto.py +test/test_mixed_content_dto.py +test/test_mixed_content_meta_dto.py +test/test_mixed_content_response_dto.py +test/test_mixed_content_response_dto_data.py +test/test_mtr_data_dto.py +test/test_mtr_dto.py +test/test_mtr_meta_dto.py +test/test_mtr_response_dto.py +test/test_network_dto.py +test/test_open_port_dto.py +test/test_open_port_meta_dto.py +test/test_open_port_response_dto.py +test/test_ping_data_dto.py +test/test_ping_dto.py +test/test_ping_meta_dto.py +test/test_ping_response_dto.py +test/test_protocol_support_dto.py +test/test_redirect_check_dto.py +test/test_redirect_check_meta_dto.py +test/test_redirect_check_response_dto.py +test/test_redirect_hop_dto.py +test/test_screenshot_dto.py +test/test_screenshot_meta_dto.py +test/test_screenshot_response_dto.py +test/test_search200_response.py +test/test_search_html_response_dto.py +test/test_search_markdown_response_dto.py +test/test_search_meta_dto.py +test/test_search_request_dto.py +test/test_search_response_dto.py +test/test_search_result_item_dto.py +test/test_selector_extraction_field_dto.py +test/test_service_health_response_dto.py +test/test_service_status.py +test/test_site_status_dto.py +test/test_site_status_meta_dto.py +test/test_site_status_response_dto.py +test/test_test_meta_dto.py +test/test_timings_dto.py +test/test_tls_certificate_dto.py +test/test_tls_certificate_issuer_dto.py +test/test_tls_protocols_dto.py +test/test_tls_scan_data_dto.py +test/test_tls_scan_dto.py +test/test_tls_scan_meta_dto.py +test/test_tls_scan_response_dto.py +test/test_url2_pdf_dto.py +test/test_url2_pdf_meta_dto.py +test/test_url2_pdf_response_dto.py +test/test_web_scrape_dto.py +test/test_web_scrape_meta_dto.py +test/test_web_scrape_response_dto.py +tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..ca7bf6e --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.23.0-SNAPSHOT diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7dbfa7c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + # uncomment the following if needed + #- "3.14-dev" # 3.14 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=geekflare_api diff --git a/README.md b/README.md index 29b22f0..2c979ac 100644 --- a/README.md +++ b/README.md @@ -1 +1,221 @@ -# geekflare-api-python \ No newline at end of file +# geekflare-api +Official OpenAPI specification for all Geekflare API endpoints. + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 0.1.0 +- Generator version: 7.23.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.10+ + +## 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 geekflare_api +``` + +### 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 geekflare_api +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import geekflare_api +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + broken_link_dto = geekflare_api.BrokenLinkDto() # BrokenLinkDto | + + try: + # Check if a webpage contains broken links + api_response = api_instance.broken_link(broken_link_dto) + print("The response of ApiToolApi->broken_link:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling ApiToolApi->broken_link: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.geekflare.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ApiToolApi* | [**broken_link**](docs/ApiToolApi.md#broken_link) | **POST** /brokenlink | Check if a webpage contains broken links +*ApiToolApi* | [**dns_record**](docs/ApiToolApi.md#dns_record) | **POST** /dnsrecord | Retrieve DNS records for a given domain +*ApiToolApi* | [**dns_sec**](docs/ApiToolApi.md#dns_sec) | **POST** /dnssec | Check if DNSSEC is enabled for a domain +*ApiToolApi* | [**lighthouse**](docs/ApiToolApi.md#lighthouse) | **POST** /lighthouse | Run Lighthouse audit on a website +*ApiToolApi* | [**load_time**](docs/ApiToolApi.md#load_time) | **POST** /loadtime | Measure the page load time for a given URL +*ApiToolApi* | [**meta_scrape**](docs/ApiToolApi.md#meta_scrape) | **POST** /metascraping | Scrape a webpage meta with custom options +*ApiToolApi* | [**mixed_content**](docs/ApiToolApi.md#mixed_content) | **POST** /mixedcontent | Check for mixed content on a site +*ApiToolApi* | [**mtr**](docs/ApiToolApi.md#mtr) | **POST** /mtr | Perform MTR (My Traceroute) network diagnostic test +*ApiToolApi* | [**open_ports**](docs/ApiToolApi.md#open_ports) | **POST** /openport | Scan a website for open ports +*ApiToolApi* | [**ping**](docs/ApiToolApi.md#ping) | **POST** /ping | Perform ICMP Ping test on a given URL or IP +*ApiToolApi* | [**redirect_check**](docs/ApiToolApi.md#redirect_check) | **POST** /redirectcheck | Check the redirection chain of a given URL +*ApiToolApi* | [**screenshot**](docs/ApiToolApi.md#screenshot) | **POST** /screenshot | Capture a full-page screenshot of a website +*ApiToolApi* | [**search**](docs/ApiToolApi.md#search) | **POST** /search | Search API for AI Agents & LLMs +*ApiToolApi* | [**site_status**](docs/ApiToolApi.md#site_status) | **POST** /up | Check if a site is up or down +*ApiToolApi* | [**tls_scan**](docs/ApiToolApi.md#tls_scan) | **POST** /tlsscan | Perform TLS scan for a given domain +*ApiToolApi* | [**url2_pdf**](docs/ApiToolApi.md#url2_pdf) | **POST** /url2pdf | Capture a full-page Url2Pdf of a website +*ApiToolApi* | [**web_scrape**](docs/ApiToolApi.md#web_scrape) | **POST** /webscraping | Scrape a webpage with custom options + + +## Documentation For Models + + - [BaseErrorResponseDto](docs/BaseErrorResponseDto.md) + - [BrokenLinkDto](docs/BrokenLinkDto.md) + - [BrokenLinkMetaDto](docs/BrokenLinkMetaDto.md) + - [BrokenLinkResponseDto](docs/BrokenLinkResponseDto.md) + - [BrokenLinkSummaryDto](docs/BrokenLinkSummaryDto.md) + - [DefaultExtractionFieldDto](docs/DefaultExtractionFieldDto.md) + - [DnsMetaDto](docs/DnsMetaDto.md) + - [DnsRecordDto](docs/DnsRecordDto.md) + - [DnsRecordResponseDto](docs/DnsRecordResponseDto.md) + - [DnsSecDataDto](docs/DnsSecDataDto.md) + - [DnsSecDto](docs/DnsSecDto.md) + - [DnsSecMetaDto](docs/DnsSecMetaDto.md) + - [DnsSecResponseDto](docs/DnsSecResponseDto.md) + - [ExtractionSchemaDto](docs/ExtractionSchemaDto.md) + - [ExtractionSchemaDtoFieldsInner](docs/ExtractionSchemaDtoFieldsInner.md) + - [HealthResponseDto](docs/HealthResponseDto.md) + - [ImageSearchResponseDto](docs/ImageSearchResponseDto.md) + - [ImageSearchResultItemDto](docs/ImageSearchResultItemDto.md) + - [LighthouseDto](docs/LighthouseDto.md) + - [LighthouseMetaDto](docs/LighthouseMetaDto.md) + - [LighthouseResponseDto](docs/LighthouseResponseDto.md) + - [LoadTimeDataDto](docs/LoadTimeDataDto.md) + - [LoadTimeDto](docs/LoadTimeDto.md) + - [LoadTimeMetaDto](docs/LoadTimeMetaDto.md) + - [LoadTimeResponseDto](docs/LoadTimeResponseDto.md) + - [MarginDto](docs/MarginDto.md) + - [MetaScrapeDto](docs/MetaScrapeDto.md) + - [MetaScrapeMetaDto](docs/MetaScrapeMetaDto.md) + - [MetaScrapeResponseDto](docs/MetaScrapeResponseDto.md) + - [MetaScrapeResponseDtoData](docs/MetaScrapeResponseDtoData.md) + - [MixedContentDataDto](docs/MixedContentDataDto.md) + - [MixedContentDto](docs/MixedContentDto.md) + - [MixedContentMetaDto](docs/MixedContentMetaDto.md) + - [MixedContentResponseDto](docs/MixedContentResponseDto.md) + - [MixedContentResponseDtoData](docs/MixedContentResponseDtoData.md) + - [MtrDataDto](docs/MtrDataDto.md) + - [MtrDto](docs/MtrDto.md) + - [MtrMetaDto](docs/MtrMetaDto.md) + - [MtrResponseDto](docs/MtrResponseDto.md) + - [NetworkDto](docs/NetworkDto.md) + - [OpenPortDto](docs/OpenPortDto.md) + - [OpenPortMetaDto](docs/OpenPortMetaDto.md) + - [OpenPortResponseDto](docs/OpenPortResponseDto.md) + - [PingDataDto](docs/PingDataDto.md) + - [PingDto](docs/PingDto.md) + - [PingMetaDto](docs/PingMetaDto.md) + - [PingResponseDto](docs/PingResponseDto.md) + - [ProtocolSupportDto](docs/ProtocolSupportDto.md) + - [RedirectCheckDto](docs/RedirectCheckDto.md) + - [RedirectCheckMetaDto](docs/RedirectCheckMetaDto.md) + - [RedirectCheckResponseDto](docs/RedirectCheckResponseDto.md) + - [RedirectHopDto](docs/RedirectHopDto.md) + - [ScreenshotDto](docs/ScreenshotDto.md) + - [ScreenshotMetaDto](docs/ScreenshotMetaDto.md) + - [ScreenshotResponseDto](docs/ScreenshotResponseDto.md) + - [Search200Response](docs/Search200Response.md) + - [SearchHtmlResponseDto](docs/SearchHtmlResponseDto.md) + - [SearchMarkdownResponseDto](docs/SearchMarkdownResponseDto.md) + - [SearchMetaDto](docs/SearchMetaDto.md) + - [SearchRequestDto](docs/SearchRequestDto.md) + - [SearchResponseDto](docs/SearchResponseDto.md) + - [SearchResultItemDto](docs/SearchResultItemDto.md) + - [SelectorExtractionFieldDto](docs/SelectorExtractionFieldDto.md) + - [ServiceHealthResponseDto](docs/ServiceHealthResponseDto.md) + - [ServiceStatus](docs/ServiceStatus.md) + - [SiteStatusDto](docs/SiteStatusDto.md) + - [SiteStatusMetaDto](docs/SiteStatusMetaDto.md) + - [SiteStatusResponseDto](docs/SiteStatusResponseDto.md) + - [TestMetaDto](docs/TestMetaDto.md) + - [TimingsDto](docs/TimingsDto.md) + - [TlsCertificateDto](docs/TlsCertificateDto.md) + - [TlsCertificateIssuerDto](docs/TlsCertificateIssuerDto.md) + - [TlsProtocolsDto](docs/TlsProtocolsDto.md) + - [TlsScanDataDto](docs/TlsScanDataDto.md) + - [TlsScanDto](docs/TlsScanDto.md) + - [TlsScanMetaDto](docs/TlsScanMetaDto.md) + - [TlsScanResponseDto](docs/TlsScanResponseDto.md) + - [Url2PdfDto](docs/Url2PdfDto.md) + - [Url2PdfMetaDto](docs/Url2PdfMetaDto.md) + - [Url2PdfResponseDto](docs/Url2PdfResponseDto.md) + - [WebScrapeDto](docs/WebScrapeDto.md) + - [WebScrapeMetaDto](docs/WebScrapeMetaDto.md) + - [WebScrapeResponseDto](docs/WebScrapeResponseDto.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### x-api-key + +- **Type**: API key +- **API key parameter name**: x-api-key +- **Location**: HTTP header + + +## Author + + + + diff --git a/docs/ApiToolApi.md b/docs/ApiToolApi.md new file mode 100644 index 0000000..c26cc07 --- /dev/null +++ b/docs/ApiToolApi.md @@ -0,0 +1,1387 @@ +# geekflare_api.ApiToolApi + +All URIs are relative to *https://api.geekflare.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**broken_link**](ApiToolApi.md#broken_link) | **POST** /brokenlink | Check if a webpage contains broken links +[**dns_record**](ApiToolApi.md#dns_record) | **POST** /dnsrecord | Retrieve DNS records for a given domain +[**dns_sec**](ApiToolApi.md#dns_sec) | **POST** /dnssec | Check if DNSSEC is enabled for a domain +[**lighthouse**](ApiToolApi.md#lighthouse) | **POST** /lighthouse | Run Lighthouse audit on a website +[**load_time**](ApiToolApi.md#load_time) | **POST** /loadtime | Measure the page load time for a given URL +[**meta_scrape**](ApiToolApi.md#meta_scrape) | **POST** /metascraping | Scrape a webpage meta with custom options +[**mixed_content**](ApiToolApi.md#mixed_content) | **POST** /mixedcontent | Check for mixed content on a site +[**mtr**](ApiToolApi.md#mtr) | **POST** /mtr | Perform MTR (My Traceroute) network diagnostic test +[**open_ports**](ApiToolApi.md#open_ports) | **POST** /openport | Scan a website for open ports +[**ping**](ApiToolApi.md#ping) | **POST** /ping | Perform ICMP Ping test on a given URL or IP +[**redirect_check**](ApiToolApi.md#redirect_check) | **POST** /redirectcheck | Check the redirection chain of a given URL +[**screenshot**](ApiToolApi.md#screenshot) | **POST** /screenshot | Capture a full-page screenshot of a website +[**search**](ApiToolApi.md#search) | **POST** /search | Search API for AI Agents & LLMs +[**site_status**](ApiToolApi.md#site_status) | **POST** /up | Check if a site is up or down +[**tls_scan**](ApiToolApi.md#tls_scan) | **POST** /tlsscan | Perform TLS scan for a given domain +[**url2_pdf**](ApiToolApi.md#url2_pdf) | **POST** /url2pdf | Capture a full-page Url2Pdf of a website +[**web_scrape**](ApiToolApi.md#web_scrape) | **POST** /webscraping | Scrape a webpage with custom options + + +# **broken_link** +> BrokenLinkResponseDto broken_link(broken_link_dto) + +Check if a webpage contains broken links + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.broken_link_dto import BrokenLinkDto +from geekflare_api.models.broken_link_response_dto import BrokenLinkResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + broken_link_dto = geekflare_api.BrokenLinkDto() # BrokenLinkDto | + + try: + # Check if a webpage contains broken links + api_response = api_instance.broken_link(broken_link_dto) + print("The response of ApiToolApi->broken_link:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->broken_link: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **broken_link_dto** | [**BrokenLinkDto**](BrokenLinkDto.md)| | + +### Return type + +[**BrokenLinkResponseDto**](BrokenLinkResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully checked for broken links | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **dns_record** +> DnsRecordResponseDto dns_record(dns_record_dto) + +Retrieve DNS records for a given domain + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.dns_record_dto import DnsRecordDto +from geekflare_api.models.dns_record_response_dto import DnsRecordResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + dns_record_dto = geekflare_api.DnsRecordDto() # DnsRecordDto | + + try: + # Retrieve DNS records for a given domain + api_response = api_instance.dns_record(dns_record_dto) + print("The response of ApiToolApi->dns_record:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->dns_record: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_record_dto** | [**DnsRecordDto**](DnsRecordDto.md)| | + +### Return type + +[**DnsRecordResponseDto**](DnsRecordResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved DNS records | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **dns_sec** +> DnsSecResponseDto dns_sec(dns_sec_dto) + +Check if DNSSEC is enabled for a domain + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.dns_sec_dto import DnsSecDto +from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + dns_sec_dto = geekflare_api.DnsSecDto() # DnsSecDto | + + try: + # Check if DNSSEC is enabled for a domain + api_response = api_instance.dns_sec(dns_sec_dto) + print("The response of ApiToolApi->dns_sec:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->dns_sec: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_sec_dto** | [**DnsSecDto**](DnsSecDto.md)| | + +### Return type + +[**DnsSecResponseDto**](DnsSecResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | DNSSEC test result retrieved successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **lighthouse** +> LighthouseResponseDto lighthouse(lighthouse_dto) + +Run Lighthouse audit on a website + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.lighthouse_dto import LighthouseDto +from geekflare_api.models.lighthouse_response_dto import LighthouseResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + lighthouse_dto = geekflare_api.LighthouseDto() # LighthouseDto | + + try: + # Run Lighthouse audit on a website + api_response = api_instance.lighthouse(lighthouse_dto) + print("The response of ApiToolApi->lighthouse:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->lighthouse: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **lighthouse_dto** | [**LighthouseDto**](LighthouseDto.md)| | + +### Return type + +[**LighthouseResponseDto**](LighthouseResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully ran Lighthouse audit | - | +**400** | Bad request (e.g. invalid URL or parameters) | - | +**500** | Internal server error while running Lighthouse audit | - | + +[[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) + +# **load_time** +> LoadTimeResponseDto load_time(load_time_dto) + +Measure the page load time for a given URL + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.load_time_dto import LoadTimeDto +from geekflare_api.models.load_time_response_dto import LoadTimeResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + load_time_dto = geekflare_api.LoadTimeDto() # LoadTimeDto | + + try: + # Measure the page load time for a given URL + api_response = api_instance.load_time(load_time_dto) + print("The response of ApiToolApi->load_time:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->load_time: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **load_time_dto** | [**LoadTimeDto**](LoadTimeDto.md)| | + +### Return type + +[**LoadTimeResponseDto**](LoadTimeResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Load time retrieved successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **meta_scrape** +> MetaScrapeResponseDto meta_scrape(meta_scrape_dto) + +Scrape a webpage meta with custom options + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.meta_scrape_dto import MetaScrapeDto +from geekflare_api.models.meta_scrape_response_dto import MetaScrapeResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + meta_scrape_dto = geekflare_api.MetaScrapeDto() # MetaScrapeDto | + + try: + # Scrape a webpage meta with custom options + api_response = api_instance.meta_scrape(meta_scrape_dto) + print("The response of ApiToolApi->meta_scrape:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->meta_scrape: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **meta_scrape_dto** | [**MetaScrapeDto**](MetaScrapeDto.md)| | + +### Return type + +[**MetaScrapeResponseDto**](MetaScrapeResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully scraped webpage meta | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **mixed_content** +> MixedContentResponseDto mixed_content(mixed_content_dto) + +Check for mixed content on a site + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.mixed_content_dto import MixedContentDto +from geekflare_api.models.mixed_content_response_dto import MixedContentResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + mixed_content_dto = geekflare_api.MixedContentDto() # MixedContentDto | + + try: + # Check for mixed content on a site + api_response = api_instance.mixed_content(mixed_content_dto) + print("The response of ApiToolApi->mixed_content:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->mixed_content: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **mixed_content_dto** | [**MixedContentDto**](MixedContentDto.md)| | + +### Return type + +[**MixedContentResponseDto**](MixedContentResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Site status retrieved successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **mtr** +> MtrResponseDto mtr(mtr_dto) + +Perform MTR (My Traceroute) network diagnostic test + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.mtr_dto import MtrDto +from geekflare_api.models.mtr_response_dto import MtrResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + mtr_dto = geekflare_api.MtrDto() # MtrDto | + + try: + # Perform MTR (My Traceroute) network diagnostic test + api_response = api_instance.mtr(mtr_dto) + print("The response of ApiToolApi->mtr:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->mtr: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **mtr_dto** | [**MtrDto**](MtrDto.md)| | + +### Return type + +[**MtrResponseDto**](MtrResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | MTR test completed successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **open_ports** +> OpenPortResponseDto open_ports(open_port_dto) + +Scan a website for open ports + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.open_port_dto import OpenPortDto +from geekflare_api.models.open_port_response_dto import OpenPortResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + open_port_dto = geekflare_api.OpenPortDto() # OpenPortDto | + + try: + # Scan a website for open ports + api_response = api_instance.open_ports(open_port_dto) + print("The response of ApiToolApi->open_ports:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->open_ports: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **open_port_dto** | [**OpenPortDto**](OpenPortDto.md)| | + +### Return type + +[**OpenPortResponseDto**](OpenPortResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Open ports retrieved successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ping** +> PingResponseDto ping(ping_dto) + +Perform ICMP Ping test on a given URL or IP + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.ping_dto import PingDto +from geekflare_api.models.ping_response_dto import PingResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + ping_dto = geekflare_api.PingDto() # PingDto | + + try: + # Perform ICMP Ping test on a given URL or IP + api_response = api_instance.ping(ping_dto) + print("The response of ApiToolApi->ping:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->ping: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ping_dto** | [**PingDto**](PingDto.md)| | + +### Return type + +[**PingResponseDto**](PingResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Ping test completed successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **redirect_check** +> RedirectCheckResponseDto redirect_check(redirect_check_dto) + +Check the redirection chain of a given URL + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.redirect_check_dto import RedirectCheckDto +from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + redirect_check_dto = geekflare_api.RedirectCheckDto() # RedirectCheckDto | + + try: + # Check the redirection chain of a given URL + api_response = api_instance.redirect_check(redirect_check_dto) + print("The response of ApiToolApi->redirect_check:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->redirect_check: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **redirect_check_dto** | [**RedirectCheckDto**](RedirectCheckDto.md)| | + +### Return type + +[**RedirectCheckResponseDto**](RedirectCheckResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved redirect chain | - | +**400** | Bad request | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **screenshot** +> ScreenshotResponseDto screenshot(screenshot_dto) + +Capture a full-page screenshot of a website + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.screenshot_dto import ScreenshotDto +from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + screenshot_dto = geekflare_api.ScreenshotDto() # ScreenshotDto | + + try: + # Capture a full-page screenshot of a website + api_response = api_instance.screenshot(screenshot_dto) + print("The response of ApiToolApi->screenshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->screenshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenshot_dto** | [**ScreenshotDto**](ScreenshotDto.md)| | + +### Return type + +[**ScreenshotResponseDto**](ScreenshotResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully captured screenshot | - | +**400** | Bad request (e.g. invalid URL or parameters) | - | +**500** | Internal server error while capturing screenshot | - | + +[[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) + +# **search** +> Search200Response search(search_request_dto) + +Search API for AI Agents & LLMs + +Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.search200_response import Search200Response +from geekflare_api.models.search_request_dto import SearchRequestDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + search_request_dto = geekflare_api.SearchRequestDto() # SearchRequestDto | + + try: + # Search API for AI Agents & LLMs + api_response = api_instance.search(search_request_dto) + print("The response of ApiToolApi->search:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->search: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search_request_dto** | [**SearchRequestDto**](SearchRequestDto.md)| | + +### Return type + +[**Search200Response**](Search200Response.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Search results (format depends on request) | - | +**400** | Bad request | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **site_status** +> SiteStatusResponseDto site_status(site_status_dto) + +Check if a site is up or down + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.site_status_dto import SiteStatusDto +from geekflare_api.models.site_status_response_dto import SiteStatusResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + site_status_dto = geekflare_api.SiteStatusDto() # SiteStatusDto | + + try: + # Check if a site is up or down + api_response = api_instance.site_status(site_status_dto) + print("The response of ApiToolApi->site_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->site_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **site_status_dto** | [**SiteStatusDto**](SiteStatusDto.md)| | + +### Return type + +[**SiteStatusResponseDto**](SiteStatusResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Site status retrieved successfully | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tls_scan** +> TlsScanResponseDto tls_scan(tls_scan_dto) + +Perform TLS scan for a given domain + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.tls_scan_dto import TlsScanDto +from geekflare_api.models.tls_scan_response_dto import TlsScanResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + tls_scan_dto = geekflare_api.TlsScanDto() # TlsScanDto | + + try: + # Perform TLS scan for a given domain + api_response = api_instance.tls_scan(tls_scan_dto) + print("The response of ApiToolApi->tls_scan:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->tls_scan: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tls_scan_dto** | [**TlsScanDto**](TlsScanDto.md)| | + +### Return type + +[**TlsScanResponseDto**](TlsScanResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved TLS scan information | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **url2_pdf** +> Url2PdfResponseDto url2_pdf(url2_pdf_dto) + +Capture a full-page Url2Pdf of a website + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.url2_pdf_dto import Url2PdfDto +from geekflare_api.models.url2_pdf_response_dto import Url2PdfResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + url2_pdf_dto = geekflare_api.Url2PdfDto() # Url2PdfDto | + + try: + # Capture a full-page Url2Pdf of a website + api_response = api_instance.url2_pdf(url2_pdf_dto) + print("The response of ApiToolApi->url2_pdf:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->url2_pdf: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **url2_pdf_dto** | [**Url2PdfDto**](Url2PdfDto.md)| | + +### Return type + +[**Url2PdfResponseDto**](Url2PdfResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully captured Url2Pdf | - | +**400** | Bad request (e.g. invalid URL or parameters) | - | +**500** | Internal server error while capturing Url2Pdf | - | + +[[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) + +# **web_scrape** +> WebScrapeResponseDto web_scrape(web_scrape_dto) + +Scrape a webpage with custom options + +### Example + +* Api Key Authentication (x-api-key): + +```python +import geekflare_api +from geekflare_api.models.web_scrape_dto import WebScrapeDto +from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto +from geekflare_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.geekflare.com +# See configuration.py for a list of all supported configuration parameters. +configuration = geekflare_api.Configuration( + host = "https://api.geekflare.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x-api-key +configuration.api_key['x-api-key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# Enter a context with an instance of the API client +with geekflare_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = geekflare_api.ApiToolApi(api_client) + web_scrape_dto = geekflare_api.WebScrapeDto() # WebScrapeDto | + + try: + # Scrape a webpage with custom options + api_response = api_instance.web_scrape(web_scrape_dto) + print("The response of ApiToolApi->web_scrape:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiToolApi->web_scrape: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **web_scrape_dto** | [**WebScrapeDto**](WebScrapeDto.md)| | + +### Return type + +[**WebScrapeResponseDto**](WebScrapeResponseDto.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully scraped webpage | - | +**400** | Bad request (invalid parameters) | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/BaseErrorResponseDto.md b/docs/BaseErrorResponseDto.md new file mode 100644 index 0000000..50c62be --- /dev/null +++ b/docs/BaseErrorResponseDto.md @@ -0,0 +1,33 @@ +# BaseErrorResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Error message | +**details** | **str** | Detailed error information | [optional] + +## Example + +```python +from geekflare_api.models.base_error_response_dto import BaseErrorResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseErrorResponseDto from a JSON string +base_error_response_dto_instance = BaseErrorResponseDto.from_json(json) +# print the JSON string representation of the object +print(BaseErrorResponseDto.to_json()) + +# convert the object into a dict +base_error_response_dto_dict = base_error_response_dto_instance.to_dict() +# create an instance of BaseErrorResponseDto from a dict +base_error_response_dto_from_dict = BaseErrorResponseDto.from_dict(base_error_response_dto_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/docs/BrokenLinkDto.md b/docs/BrokenLinkDto.md new file mode 100644 index 0000000..d2a77c8 --- /dev/null +++ b/docs/BrokenLinkDto.md @@ -0,0 +1,31 @@ +# BrokenLinkDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**follow_redirect** | **bool** | Whether to follow redirects when checking site status | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.broken_link_dto import BrokenLinkDto + +# TODO update the JSON string below +json = "{}" +# create an instance of BrokenLinkDto from a JSON string +broken_link_dto_instance = BrokenLinkDto.from_json(json) +# print the JSON string representation of the object +print(BrokenLinkDto.to_json()) + +# convert the object into a dict +broken_link_dto_dict = broken_link_dto_instance.to_dict() +# create an instance of BrokenLinkDto from a dict +broken_link_dto_from_dict = BrokenLinkDto.from_dict(broken_link_dto_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/docs/BrokenLinkMetaDto.md b/docs/BrokenLinkMetaDto.md new file mode 100644 index 0000000..05facb3 --- /dev/null +++ b/docs/BrokenLinkMetaDto.md @@ -0,0 +1,33 @@ +# BrokenLinkMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL checked for broken links | +**proxy_country** | **str** | Proxy country used for this request | +**follow_redirect** | **bool** | Whether redirection was followed | +**redirected_url** | **str** | Final URL after redirection (if any) | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.broken_link_meta_dto import BrokenLinkMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of BrokenLinkMetaDto from a JSON string +broken_link_meta_dto_instance = BrokenLinkMetaDto.from_json(json) +# print the JSON string representation of the object +print(BrokenLinkMetaDto.to_json()) + +# convert the object into a dict +broken_link_meta_dto_dict = broken_link_meta_dto_instance.to_dict() +# create an instance of BrokenLinkMetaDto from a dict +broken_link_meta_dto_from_dict = BrokenLinkMetaDto.from_dict(broken_link_meta_dto_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/docs/BrokenLinkResponseDto.md b/docs/BrokenLinkResponseDto.md new file mode 100644 index 0000000..7c50a90 --- /dev/null +++ b/docs/BrokenLinkResponseDto.md @@ -0,0 +1,35 @@ +# BrokenLinkResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Human-readable message about the broken link scan result | +**meta** | [**BrokenLinkMetaDto**](BrokenLinkMetaDto.md) | Metadata about the broken link request | +**summary** | [**BrokenLinkSummaryDto**](BrokenLinkSummaryDto.md) | Summary of link check results categorized by status | +**data** | **List[str]** | List of links found on the page and their HTTP status | + +## Example + +```python +from geekflare_api.models.broken_link_response_dto import BrokenLinkResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of BrokenLinkResponseDto from a JSON string +broken_link_response_dto_instance = BrokenLinkResponseDto.from_json(json) +# print the JSON string representation of the object +print(BrokenLinkResponseDto.to_json()) + +# convert the object into a dict +broken_link_response_dto_dict = broken_link_response_dto_instance.to_dict() +# create an instance of BrokenLinkResponseDto from a dict +broken_link_response_dto_from_dict = BrokenLinkResponseDto.from_dict(broken_link_response_dto_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/docs/BrokenLinkSummaryDto.md b/docs/BrokenLinkSummaryDto.md new file mode 100644 index 0000000..1750de3 --- /dev/null +++ b/docs/BrokenLinkSummaryDto.md @@ -0,0 +1,33 @@ +# BrokenLinkSummaryDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | Total number of links checked | +**successful** | **float** | Number of successful links (2xx status codes) | +**redirects** | **float** | Number of redirect links (3xx status codes) | +**broken** | **float** | Number of broken links (4xx status codes and DNS/network failures) | +**server_error** | **float** | Number of server errors (5xx status codes) | + +## Example + +```python +from geekflare_api.models.broken_link_summary_dto import BrokenLinkSummaryDto + +# TODO update the JSON string below +json = "{}" +# create an instance of BrokenLinkSummaryDto from a JSON string +broken_link_summary_dto_instance = BrokenLinkSummaryDto.from_json(json) +# print the JSON string representation of the object +print(BrokenLinkSummaryDto.to_json()) + +# convert the object into a dict +broken_link_summary_dto_dict = broken_link_summary_dto_instance.to_dict() +# create an instance of BrokenLinkSummaryDto from a dict +broken_link_summary_dto_from_dict = BrokenLinkSummaryDto.from_dict(broken_link_summary_dto_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/docs/DefaultExtractionFieldDto.md b/docs/DefaultExtractionFieldDto.md new file mode 100644 index 0000000..d4156de --- /dev/null +++ b/docs/DefaultExtractionFieldDto.md @@ -0,0 +1,30 @@ +# DefaultExtractionFieldDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | Title/key of the extracted field | +**value** | **object** | Static value to assign to this field | + +## Example + +```python +from geekflare_api.models.default_extraction_field_dto import DefaultExtractionFieldDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DefaultExtractionFieldDto from a JSON string +default_extraction_field_dto_instance = DefaultExtractionFieldDto.from_json(json) +# print the JSON string representation of the object +print(DefaultExtractionFieldDto.to_json()) + +# convert the object into a dict +default_extraction_field_dto_dict = default_extraction_field_dto_instance.to_dict() +# create an instance of DefaultExtractionFieldDto from a dict +default_extraction_field_dto_from_dict = DefaultExtractionFieldDto.from_dict(default_extraction_field_dto_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/docs/DnsMetaDto.md b/docs/DnsMetaDto.md new file mode 100644 index 0000000..50f2945 --- /dev/null +++ b/docs/DnsMetaDto.md @@ -0,0 +1,31 @@ +# DnsMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL that was scraped | +**types** | **str** | List of DNS record types to query. If omitted, all supported types will be returned. | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.dns_meta_dto import DnsMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsMetaDto from a JSON string +dns_meta_dto_instance = DnsMetaDto.from_json(json) +# print the JSON string representation of the object +print(DnsMetaDto.to_json()) + +# convert the object into a dict +dns_meta_dto_dict = dns_meta_dto_instance.to_dict() +# create an instance of DnsMetaDto from a dict +dns_meta_dto_from_dict = DnsMetaDto.from_dict(dns_meta_dto_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/docs/DnsRecordDto.md b/docs/DnsRecordDto.md new file mode 100644 index 0000000..0a182dc --- /dev/null +++ b/docs/DnsRecordDto.md @@ -0,0 +1,30 @@ +# DnsRecordDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**types** | **List[str]** | List of DNS record types to query. If omitted, all supported types will be returned. | [optional] + +## Example + +```python +from geekflare_api.models.dns_record_dto import DnsRecordDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsRecordDto from a JSON string +dns_record_dto_instance = DnsRecordDto.from_json(json) +# print the JSON string representation of the object +print(DnsRecordDto.to_json()) + +# convert the object into a dict +dns_record_dto_dict = dns_record_dto_instance.to_dict() +# create an instance of DnsRecordDto from a dict +dns_record_dto_from_dict = DnsRecordDto.from_dict(dns_record_dto_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/docs/DnsRecordResponseDto.md b/docs/DnsRecordResponseDto.md new file mode 100644 index 0000000..6e15536 --- /dev/null +++ b/docs/DnsRecordResponseDto.md @@ -0,0 +1,33 @@ +# DnsRecordResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**DnsMetaDto**](DnsMetaDto.md) | Metadata about the request. | +**data** | **object** | DNS records grouped by type. | + +## Example + +```python +from geekflare_api.models.dns_record_response_dto import DnsRecordResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsRecordResponseDto from a JSON string +dns_record_response_dto_instance = DnsRecordResponseDto.from_json(json) +# print the JSON string representation of the object +print(DnsRecordResponseDto.to_json()) + +# convert the object into a dict +dns_record_response_dto_dict = dns_record_response_dto_instance.to_dict() +# create an instance of DnsRecordResponseDto from a dict +dns_record_response_dto_from_dict = DnsRecordResponseDto.from_dict(dns_record_response_dto_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/docs/DnsSecDataDto.md b/docs/DnsSecDataDto.md new file mode 100644 index 0000000..e86aa4b --- /dev/null +++ b/docs/DnsSecDataDto.md @@ -0,0 +1,31 @@ +# DnsSecDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_enabled** | **bool** | Indicates if DNSSEC is enabled for the domain | +**dnskey** | **List[str]** | List of DNSKEY records if DNSSEC is enabled | [optional] +**rrsig** | **List[str]** | List of RRSIG records if DNSSEC is enabled | [optional] + +## Example + +```python +from geekflare_api.models.dns_sec_data_dto import DnsSecDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecDataDto from a JSON string +dns_sec_data_dto_instance = DnsSecDataDto.from_json(json) +# print the JSON string representation of the object +print(DnsSecDataDto.to_json()) + +# convert the object into a dict +dns_sec_data_dto_dict = dns_sec_data_dto_instance.to_dict() +# create an instance of DnsSecDataDto from a dict +dns_sec_data_dto_from_dict = DnsSecDataDto.from_dict(dns_sec_data_dto_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/docs/DnsSecDto.md b/docs/DnsSecDto.md new file mode 100644 index 0000000..b3bcae9 --- /dev/null +++ b/docs/DnsSecDto.md @@ -0,0 +1,29 @@ +# DnsSecDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | + +## Example + +```python +from geekflare_api.models.dns_sec_dto import DnsSecDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecDto from a JSON string +dns_sec_dto_instance = DnsSecDto.from_json(json) +# print the JSON string representation of the object +print(DnsSecDto.to_json()) + +# convert the object into a dict +dns_sec_dto_dict = dns_sec_dto_instance.to_dict() +# create an instance of DnsSecDto from a dict +dns_sec_dto_from_dict = DnsSecDto.from_dict(dns_sec_dto_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/docs/DnsSecMetaDto.md b/docs/DnsSecMetaDto.md new file mode 100644 index 0000000..96fbaaa --- /dev/null +++ b/docs/DnsSecMetaDto.md @@ -0,0 +1,30 @@ +# DnsSecMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The tested domain name | +**test** | [**TestMetaDto**](TestMetaDto.md) | Metadata about the test execution | + +## Example + +```python +from geekflare_api.models.dns_sec_meta_dto import DnsSecMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecMetaDto from a JSON string +dns_sec_meta_dto_instance = DnsSecMetaDto.from_json(json) +# print the JSON string representation of the object +print(DnsSecMetaDto.to_json()) + +# convert the object into a dict +dns_sec_meta_dto_dict = dns_sec_meta_dto_instance.to_dict() +# create an instance of DnsSecMetaDto from a dict +dns_sec_meta_dto_from_dict = DnsSecMetaDto.from_dict(dns_sec_meta_dto_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/docs/DnsSecResponseDto.md b/docs/DnsSecResponseDto.md new file mode 100644 index 0000000..b6ff573 --- /dev/null +++ b/docs/DnsSecResponseDto.md @@ -0,0 +1,33 @@ +# DnsSecResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**DnsSecMetaDto**](DnsSecMetaDto.md) | Metadata about the DNSSEC test | +**data** | [**DnsSecDataDto**](DnsSecDataDto.md) | DNSSEC test result data | + +## Example + +```python +from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecResponseDto from a JSON string +dns_sec_response_dto_instance = DnsSecResponseDto.from_json(json) +# print the JSON string representation of the object +print(DnsSecResponseDto.to_json()) + +# convert the object into a dict +dns_sec_response_dto_dict = dns_sec_response_dto_instance.to_dict() +# create an instance of DnsSecResponseDto from a dict +dns_sec_response_dto_from_dict = DnsSecResponseDto.from_dict(dns_sec_response_dto_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/docs/ExtractionSchemaDto.md b/docs/ExtractionSchemaDto.md new file mode 100644 index 0000000..6bdec07 --- /dev/null +++ b/docs/ExtractionSchemaDto.md @@ -0,0 +1,31 @@ +# ExtractionSchemaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name/Label for this extraction schema | +**base_selector** | **str** | Base selector for scoping extraction (css/xpath only) | [optional] +**fields** | [**List[ExtractionSchemaDtoFieldsInner]**](ExtractionSchemaDtoFieldsInner.md) | List of fields to extract | + +## Example + +```python +from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ExtractionSchemaDto from a JSON string +extraction_schema_dto_instance = ExtractionSchemaDto.from_json(json) +# print the JSON string representation of the object +print(ExtractionSchemaDto.to_json()) + +# convert the object into a dict +extraction_schema_dto_dict = extraction_schema_dto_instance.to_dict() +# create an instance of ExtractionSchemaDto from a dict +extraction_schema_dto_from_dict = ExtractionSchemaDto.from_dict(extraction_schema_dto_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/docs/ExtractionSchemaDtoFieldsInner.md b/docs/ExtractionSchemaDtoFieldsInner.md new file mode 100644 index 0000000..304bbd6 --- /dev/null +++ b/docs/ExtractionSchemaDtoFieldsInner.md @@ -0,0 +1,35 @@ +# ExtractionSchemaDtoFieldsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | Title/key of the extracted field | +**value** | **object** | Static value to assign to this field | +**name** | **str** | Field name in the extracted JSON | +**selector** | **str** | Selector or XPath to extract value | +**type** | **str** | Type of data to extract | +**attribute** | **str** | If type=attr, specify attribute name | [optional] +**fields** | [**List[SelectorExtractionFieldDto]**](SelectorExtractionFieldDto.md) | Nested fields | [optional] + +## Example + +```python +from geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ExtractionSchemaDtoFieldsInner from a JSON string +extraction_schema_dto_fields_inner_instance = ExtractionSchemaDtoFieldsInner.from_json(json) +# print the JSON string representation of the object +print(ExtractionSchemaDtoFieldsInner.to_json()) + +# convert the object into a dict +extraction_schema_dto_fields_inner_dict = extraction_schema_dto_fields_inner_instance.to_dict() +# create an instance of ExtractionSchemaDtoFieldsInner from a dict +extraction_schema_dto_fields_inner_from_dict = ExtractionSchemaDtoFieldsInner.from_dict(extraction_schema_dto_fields_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/docs/HealthResponseDto.md b/docs/HealthResponseDto.md new file mode 100644 index 0000000..d84e28f --- /dev/null +++ b/docs/HealthResponseDto.md @@ -0,0 +1,32 @@ +# HealthResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Metadata about the request | + +## Example + +```python +from geekflare_api.models.health_response_dto import HealthResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of HealthResponseDto from a JSON string +health_response_dto_instance = HealthResponseDto.from_json(json) +# print the JSON string representation of the object +print(HealthResponseDto.to_json()) + +# convert the object into a dict +health_response_dto_dict = health_response_dto_instance.to_dict() +# create an instance of HealthResponseDto from a dict +health_response_dto_from_dict = HealthResponseDto.from_dict(health_response_dto_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/docs/ImageSearchResponseDto.md b/docs/ImageSearchResponseDto.md new file mode 100644 index 0000000..f0d1990 --- /dev/null +++ b/docs/ImageSearchResponseDto.md @@ -0,0 +1,33 @@ +# ImageSearchResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**SearchMetaDto**](SearchMetaDto.md) | | +**data** | [**List[ImageSearchResultItemDto]**](ImageSearchResultItemDto.md) | | + +## Example + +```python +from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageSearchResponseDto from a JSON string +image_search_response_dto_instance = ImageSearchResponseDto.from_json(json) +# print the JSON string representation of the object +print(ImageSearchResponseDto.to_json()) + +# convert the object into a dict +image_search_response_dto_dict = image_search_response_dto_instance.to_dict() +# create an instance of ImageSearchResponseDto from a dict +image_search_response_dto_from_dict = ImageSearchResponseDto.from_dict(image_search_response_dto_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/docs/ImageSearchResultItemDto.md b/docs/ImageSearchResultItemDto.md new file mode 100644 index 0000000..efcd477 --- /dev/null +++ b/docs/ImageSearchResultItemDto.md @@ -0,0 +1,33 @@ +# ImageSearchResultItemDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | +**image_url** | **str** | | +**source_url** | **str** | | +**width** | **float** | | +**height** | **float** | | + +## Example + +```python +from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageSearchResultItemDto from a JSON string +image_search_result_item_dto_instance = ImageSearchResultItemDto.from_json(json) +# print the JSON string representation of the object +print(ImageSearchResultItemDto.to_json()) + +# convert the object into a dict +image_search_result_item_dto_dict = image_search_result_item_dto_instance.to_dict() +# create an instance of ImageSearchResultItemDto from a dict +image_search_result_item_dto_from_dict = ImageSearchResultItemDto.from_dict(image_search_result_item_dto_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/docs/LighthouseDto.md b/docs/LighthouseDto.md new file mode 100644 index 0000000..bc31d15 --- /dev/null +++ b/docs/LighthouseDto.md @@ -0,0 +1,33 @@ +# LighthouseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**device** | **str** | Device type to emulate. Defaults to desktop. | [optional] [default to 'desktop'] +**follow_redirect** | **bool** | Whether to follow redirects when checking site status | [optional] [default to False] +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**parameters** | **List[str]** | Extra Lighthouse CLI parameters | [optional] + +## Example + +```python +from geekflare_api.models.lighthouse_dto import LighthouseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LighthouseDto from a JSON string +lighthouse_dto_instance = LighthouseDto.from_json(json) +# print the JSON string representation of the object +print(LighthouseDto.to_json()) + +# convert the object into a dict +lighthouse_dto_dict = lighthouse_dto_instance.to_dict() +# create an instance of LighthouseDto from a dict +lighthouse_dto_from_dict = LighthouseDto.from_dict(lighthouse_dto_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/docs/LighthouseMetaDto.md b/docs/LighthouseMetaDto.md new file mode 100644 index 0000000..c8dede9 --- /dev/null +++ b/docs/LighthouseMetaDto.md @@ -0,0 +1,34 @@ +# LighthouseMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**device** | **str** | Device type used | +**follow_redirect** | **bool** | Whether redirects were followed | +**redirected_url** | **str** | Final URL after redirection (if any) | +**proxy_country** | **str** | Proxy country used, if any | [optional] +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.lighthouse_meta_dto import LighthouseMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LighthouseMetaDto from a JSON string +lighthouse_meta_dto_instance = LighthouseMetaDto.from_json(json) +# print the JSON string representation of the object +print(LighthouseMetaDto.to_json()) + +# convert the object into a dict +lighthouse_meta_dto_dict = lighthouse_meta_dto_instance.to_dict() +# create an instance of LighthouseMetaDto from a dict +lighthouse_meta_dto_from_dict = LighthouseMetaDto.from_dict(lighthouse_meta_dto_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/docs/LighthouseResponseDto.md b/docs/LighthouseResponseDto.md new file mode 100644 index 0000000..6d3a063 --- /dev/null +++ b/docs/LighthouseResponseDto.md @@ -0,0 +1,33 @@ +# LighthouseResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**LighthouseMetaDto**](LighthouseMetaDto.md) | Metadata about the request | +**data** | **str** | URL to the Lighthouse report | + +## Example + +```python +from geekflare_api.models.lighthouse_response_dto import LighthouseResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LighthouseResponseDto from a JSON string +lighthouse_response_dto_instance = LighthouseResponseDto.from_json(json) +# print the JSON string representation of the object +print(LighthouseResponseDto.to_json()) + +# convert the object into a dict +lighthouse_response_dto_dict = lighthouse_response_dto_instance.to_dict() +# create an instance of LighthouseResponseDto from a dict +lighthouse_response_dto_from_dict = LighthouseResponseDto.from_dict(lighthouse_response_dto_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/docs/LoadTimeDataDto.md b/docs/LoadTimeDataDto.md new file mode 100644 index 0000000..47a526c --- /dev/null +++ b/docs/LoadTimeDataDto.md @@ -0,0 +1,40 @@ +# LoadTimeDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dns** | **float** | Time spent in DNS lookup (ms) | +**connect** | **float** | Time to establish TCP connection (ms) | +**tls** | **float** | Time to complete TLS handshake (ms) | +**send** | **float** | Time to send request (ms) | +**wait** | **float** | Time waiting for response (ms) | +**total** | **float** | Total load time (ms) | +**status_code** | **float** | HTTP status code of the response | +**reason_phrase** | **str** | HTTP reason phrase | +**timings** | [**TimingsDto**](TimingsDto.md) | Detailed timing breakdown | +**network** | [**NetworkDto**](NetworkDto.md) | Network information | +**headers** | **object** | Response headers as key-value pairs | +**protocol_support** | [**ProtocolSupportDto**](ProtocolSupportDto.md) | HTTP protocol support information | + +## Example + +```python +from geekflare_api.models.load_time_data_dto import LoadTimeDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LoadTimeDataDto from a JSON string +load_time_data_dto_instance = LoadTimeDataDto.from_json(json) +# print the JSON string representation of the object +print(LoadTimeDataDto.to_json()) + +# convert the object into a dict +load_time_data_dto_dict = load_time_data_dto_instance.to_dict() +# create an instance of LoadTimeDataDto from a dict +load_time_data_dto_from_dict = LoadTimeDataDto.from_dict(load_time_data_dto_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/docs/LoadTimeDto.md b/docs/LoadTimeDto.md new file mode 100644 index 0000000..d276e76 --- /dev/null +++ b/docs/LoadTimeDto.md @@ -0,0 +1,31 @@ +# LoadTimeDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**follow_redirect** | **bool** | Whether to follow redirects when checking site status | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.load_time_dto import LoadTimeDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LoadTimeDto from a JSON string +load_time_dto_instance = LoadTimeDto.from_json(json) +# print the JSON string representation of the object +print(LoadTimeDto.to_json()) + +# convert the object into a dict +load_time_dto_dict = load_time_dto_instance.to_dict() +# create an instance of LoadTimeDto from a dict +load_time_dto_from_dict = LoadTimeDto.from_dict(load_time_dto_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/docs/LoadTimeMetaDto.md b/docs/LoadTimeMetaDto.md new file mode 100644 index 0000000..8f3d082 --- /dev/null +++ b/docs/LoadTimeMetaDto.md @@ -0,0 +1,33 @@ +# LoadTimeMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The tested URL | +**proxy_country** | **str** | Proxy country used for the test | [optional] +**follow_redirect** | **bool** | Indicates if redirects were followed during the test | [optional] +**redirected_url** | **str** | Final URL after redirection (if any) | +**test** | [**TestMetaDto**](TestMetaDto.md) | Metadata about the test execution | + +## Example + +```python +from geekflare_api.models.load_time_meta_dto import LoadTimeMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LoadTimeMetaDto from a JSON string +load_time_meta_dto_instance = LoadTimeMetaDto.from_json(json) +# print the JSON string representation of the object +print(LoadTimeMetaDto.to_json()) + +# convert the object into a dict +load_time_meta_dto_dict = load_time_meta_dto_instance.to_dict() +# create an instance of LoadTimeMetaDto from a dict +load_time_meta_dto_from_dict = LoadTimeMetaDto.from_dict(load_time_meta_dto_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/docs/LoadTimeResponseDto.md b/docs/LoadTimeResponseDto.md new file mode 100644 index 0000000..3b229a7 --- /dev/null +++ b/docs/LoadTimeResponseDto.md @@ -0,0 +1,34 @@ +# LoadTimeResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Overall message about site reachability | [optional] +**meta** | [**LoadTimeMetaDto**](LoadTimeMetaDto.md) | Metadata about the load time test | +**data** | [**LoadTimeDataDto**](LoadTimeDataDto.md) | Comprehensive site load time metrics | + +## Example + +```python +from geekflare_api.models.load_time_response_dto import LoadTimeResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of LoadTimeResponseDto from a JSON string +load_time_response_dto_instance = LoadTimeResponseDto.from_json(json) +# print the JSON string representation of the object +print(LoadTimeResponseDto.to_json()) + +# convert the object into a dict +load_time_response_dto_dict = load_time_response_dto_instance.to_dict() +# create an instance of LoadTimeResponseDto from a dict +load_time_response_dto_from_dict = LoadTimeResponseDto.from_dict(load_time_response_dto_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/docs/MarginDto.md b/docs/MarginDto.md new file mode 100644 index 0000000..4c0ada8 --- /dev/null +++ b/docs/MarginDto.md @@ -0,0 +1,32 @@ +# MarginDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**top** | **float** | Top margin in mm | [optional] +**bottom** | **float** | Bottom margin in mm | [optional] +**right** | **float** | Right margin in mm | [optional] +**left** | **float** | Left margin in mm | [optional] + +## Example + +```python +from geekflare_api.models.margin_dto import MarginDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MarginDto from a JSON string +margin_dto_instance = MarginDto.from_json(json) +# print the JSON string representation of the object +print(MarginDto.to_json()) + +# convert the object into a dict +margin_dto_dict = margin_dto_instance.to_dict() +# create an instance of MarginDto from a dict +margin_dto_from_dict = MarginDto.from_dict(margin_dto_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/docs/MetaScrapeDto.md b/docs/MetaScrapeDto.md new file mode 100644 index 0000000..d851282 --- /dev/null +++ b/docs/MetaScrapeDto.md @@ -0,0 +1,35 @@ +# MetaScrapeDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**device** | **str** | Device type to emulate. Defaults to desktop. | [optional] [default to 'desktop'] +**block_ads** | **bool** | Whether to block ads | [optional] [default to True] +**render_js** | **bool** | Whether to render JavaScript | [optional] [default to True] +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**format** | **str** | Format of the scraped result. Defaults to html. | [optional] [default to 'json'] +**file_output** | **bool** | Whether to get response in file format | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.meta_scrape_dto import MetaScrapeDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MetaScrapeDto from a JSON string +meta_scrape_dto_instance = MetaScrapeDto.from_json(json) +# print the JSON string representation of the object +print(MetaScrapeDto.to_json()) + +# convert the object into a dict +meta_scrape_dto_dict = meta_scrape_dto_instance.to_dict() +# create an instance of MetaScrapeDto from a dict +meta_scrape_dto_from_dict = MetaScrapeDto.from_dict(meta_scrape_dto_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/docs/MetaScrapeMetaDto.md b/docs/MetaScrapeMetaDto.md new file mode 100644 index 0000000..36fcd35 --- /dev/null +++ b/docs/MetaScrapeMetaDto.md @@ -0,0 +1,36 @@ +# MetaScrapeMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL that was scraped | +**device** | **str** | Device type used | +**format** | **str** | Output format of the result | +**file_output** | **bool** | Whether to get response in file format | +**block_ads** | **bool** | Whether ads were blocked | +**render_js** | **bool** | Whether JavaScript was rendered | +**proxy_country** | **str** | Proxy country used, if any | [optional] +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.meta_scrape_meta_dto import MetaScrapeMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MetaScrapeMetaDto from a JSON string +meta_scrape_meta_dto_instance = MetaScrapeMetaDto.from_json(json) +# print the JSON string representation of the object +print(MetaScrapeMetaDto.to_json()) + +# convert the object into a dict +meta_scrape_meta_dto_dict = meta_scrape_meta_dto_instance.to_dict() +# create an instance of MetaScrapeMetaDto from a dict +meta_scrape_meta_dto_from_dict = MetaScrapeMetaDto.from_dict(meta_scrape_meta_dto_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/docs/MetaScrapeResponseDto.md b/docs/MetaScrapeResponseDto.md new file mode 100644 index 0000000..94d1c4b --- /dev/null +++ b/docs/MetaScrapeResponseDto.md @@ -0,0 +1,33 @@ +# MetaScrapeResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**MetaScrapeMetaDto**](MetaScrapeMetaDto.md) | Metadata about the request | +**data** | [**MetaScrapeResponseDtoData**](MetaScrapeResponseDtoData.md) | | + +## Example + +```python +from geekflare_api.models.meta_scrape_response_dto import MetaScrapeResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MetaScrapeResponseDto from a JSON string +meta_scrape_response_dto_instance = MetaScrapeResponseDto.from_json(json) +# print the JSON string representation of the object +print(MetaScrapeResponseDto.to_json()) + +# convert the object into a dict +meta_scrape_response_dto_dict = meta_scrape_response_dto_instance.to_dict() +# create an instance of MetaScrapeResponseDto from a dict +meta_scrape_response_dto_from_dict = MetaScrapeResponseDto.from_dict(meta_scrape_response_dto_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/docs/MetaScrapeResponseDtoData.md b/docs/MetaScrapeResponseDtoData.md new file mode 100644 index 0000000..a19c1fe --- /dev/null +++ b/docs/MetaScrapeResponseDtoData.md @@ -0,0 +1,29 @@ +# MetaScrapeResponseDtoData + +Scraped data (URL or inline content depending on output) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData + +# TODO update the JSON string below +json = "{}" +# create an instance of MetaScrapeResponseDtoData from a JSON string +meta_scrape_response_dto_data_instance = MetaScrapeResponseDtoData.from_json(json) +# print the JSON string representation of the object +print(MetaScrapeResponseDtoData.to_json()) + +# convert the object into a dict +meta_scrape_response_dto_data_dict = meta_scrape_response_dto_data_instance.to_dict() +# create an instance of MetaScrapeResponseDtoData from a dict +meta_scrape_response_dto_data_from_dict = MetaScrapeResponseDtoData.from_dict(meta_scrape_response_dto_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/docs/MixedContentDataDto.md b/docs/MixedContentDataDto.md new file mode 100644 index 0000000..5fadc80 --- /dev/null +++ b/docs/MixedContentDataDto.md @@ -0,0 +1,30 @@ +# MixedContentDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**insecure** | **List[str]** | List of insecure (HTTP) resources found on the page | +**secure** | **List[str]** | List of secure (HTTPS) resources found on the page | + +## Example + +```python +from geekflare_api.models.mixed_content_data_dto import MixedContentDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MixedContentDataDto from a JSON string +mixed_content_data_dto_instance = MixedContentDataDto.from_json(json) +# print the JSON string representation of the object +print(MixedContentDataDto.to_json()) + +# convert the object into a dict +mixed_content_data_dto_dict = mixed_content_data_dto_instance.to_dict() +# create an instance of MixedContentDataDto from a dict +mixed_content_data_dto_from_dict = MixedContentDataDto.from_dict(mixed_content_data_dto_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/docs/MixedContentDto.md b/docs/MixedContentDto.md new file mode 100644 index 0000000..e73776b --- /dev/null +++ b/docs/MixedContentDto.md @@ -0,0 +1,31 @@ +# MixedContentDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**follow_redirect** | **bool** | Whether to follow redirects when checking site status | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.mixed_content_dto import MixedContentDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MixedContentDto from a JSON string +mixed_content_dto_instance = MixedContentDto.from_json(json) +# print the JSON string representation of the object +print(MixedContentDto.to_json()) + +# convert the object into a dict +mixed_content_dto_dict = mixed_content_dto_instance.to_dict() +# create an instance of MixedContentDto from a dict +mixed_content_dto_from_dict = MixedContentDto.from_dict(mixed_content_dto_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/docs/MixedContentMetaDto.md b/docs/MixedContentMetaDto.md new file mode 100644 index 0000000..72679b8 --- /dev/null +++ b/docs/MixedContentMetaDto.md @@ -0,0 +1,33 @@ +# MixedContentMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The tested URL | +**proxy_country** | **str** | Country used for proxy | [optional] +**follow_redirect** | **bool** | Indicates if redirects should be followed | [optional] +**redirected_url** | **str** | Final URL after redirection (if any) | [optional] +**test** | [**TestMetaDto**](TestMetaDto.md) | Metadata about the test execution | + +## Example + +```python +from geekflare_api.models.mixed_content_meta_dto import MixedContentMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MixedContentMetaDto from a JSON string +mixed_content_meta_dto_instance = MixedContentMetaDto.from_json(json) +# print the JSON string representation of the object +print(MixedContentMetaDto.to_json()) + +# convert the object into a dict +mixed_content_meta_dto_dict = mixed_content_meta_dto_instance.to_dict() +# create an instance of MixedContentMetaDto from a dict +mixed_content_meta_dto_from_dict = MixedContentMetaDto.from_dict(mixed_content_meta_dto_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/docs/MixedContentResponseDto.md b/docs/MixedContentResponseDto.md new file mode 100644 index 0000000..13ceab7 --- /dev/null +++ b/docs/MixedContentResponseDto.md @@ -0,0 +1,34 @@ +# MixedContentResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Indicates whether mixed content found or not. It can either be \"Mixed content(s) found.\" or \"No mixed content found.\" | +**meta** | [**MixedContentMetaDto**](MixedContentMetaDto.md) | Metadata about the mixed content test | +**data** | [**MixedContentResponseDtoData**](MixedContentResponseDtoData.md) | | + +## Example + +```python +from geekflare_api.models.mixed_content_response_dto import MixedContentResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MixedContentResponseDto from a JSON string +mixed_content_response_dto_instance = MixedContentResponseDto.from_json(json) +# print the JSON string representation of the object +print(MixedContentResponseDto.to_json()) + +# convert the object into a dict +mixed_content_response_dto_dict = mixed_content_response_dto_instance.to_dict() +# create an instance of MixedContentResponseDto from a dict +mixed_content_response_dto_from_dict = MixedContentResponseDto.from_dict(mixed_content_response_dto_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/docs/MixedContentResponseDtoData.md b/docs/MixedContentResponseDtoData.md new file mode 100644 index 0000000..e68a5ec --- /dev/null +++ b/docs/MixedContentResponseDtoData.md @@ -0,0 +1,31 @@ +# MixedContentResponseDtoData + +Contains either an array of all resources (when no mixed content) or an object with insecure/secure arrays (when mixed content found) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**insecure** | **List[str]** | List of insecure (HTTP) resources found on the page | +**secure** | **List[str]** | List of secure (HTTPS) resources found on the page | + +## Example + +```python +from geekflare_api.models.mixed_content_response_dto_data import MixedContentResponseDtoData + +# TODO update the JSON string below +json = "{}" +# create an instance of MixedContentResponseDtoData from a JSON string +mixed_content_response_dto_data_instance = MixedContentResponseDtoData.from_json(json) +# print the JSON string representation of the object +print(MixedContentResponseDtoData.to_json()) + +# convert the object into a dict +mixed_content_response_dto_data_dict = mixed_content_response_dto_data_instance.to_dict() +# create an instance of MixedContentResponseDtoData from a dict +mixed_content_response_dto_data_from_dict = MixedContentResponseDtoData.from_dict(mixed_content_response_dto_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/docs/MtrDataDto.md b/docs/MtrDataDto.md new file mode 100644 index 0000000..c578fdb --- /dev/null +++ b/docs/MtrDataDto.md @@ -0,0 +1,38 @@ +# MtrDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hop** | **float** | Hop number in the traceroute path | +**host** | **str** | Host IP or domain name at this hop | +**asn** | **str** | Autonomous System Number (ASN) for the host | +**loss** | **float** | Packet loss percentage at this hop | +**sent** | **float** | Number of packets sent to this hop | +**last** | **float** | Last recorded round-trip time (RTT) in milliseconds | +**avg** | **float** | Average RTT across packets | +**best** | **float** | Best (lowest) RTT observed | +**worst** | **float** | Worst (highest) RTT observed | +**std_dev** | **float** | Standard deviation of RTT measurements | + +## Example + +```python +from geekflare_api.models.mtr_data_dto import MtrDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MtrDataDto from a JSON string +mtr_data_dto_instance = MtrDataDto.from_json(json) +# print the JSON string representation of the object +print(MtrDataDto.to_json()) + +# convert the object into a dict +mtr_data_dto_dict = mtr_data_dto_instance.to_dict() +# create an instance of MtrDataDto from a dict +mtr_data_dto_from_dict = MtrDataDto.from_dict(mtr_data_dto_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/docs/MtrDto.md b/docs/MtrDto.md new file mode 100644 index 0000000..267cfdf --- /dev/null +++ b/docs/MtrDto.md @@ -0,0 +1,31 @@ +# MtrDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**follow_redirect** | **bool** | Whether to follow redirects when checking site status | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.mtr_dto import MtrDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MtrDto from a JSON string +mtr_dto_instance = MtrDto.from_json(json) +# print the JSON string representation of the object +print(MtrDto.to_json()) + +# convert the object into a dict +mtr_dto_dict = mtr_dto_instance.to_dict() +# create an instance of MtrDto from a dict +mtr_dto_from_dict = MtrDto.from_dict(mtr_dto_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/docs/MtrMetaDto.md b/docs/MtrMetaDto.md new file mode 100644 index 0000000..fb6ca84 --- /dev/null +++ b/docs/MtrMetaDto.md @@ -0,0 +1,33 @@ +# MtrMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The tested URL or IP address | +**proxy_country** | **str** | Country used for proxy | [optional] +**follow_redirect** | **bool** | Indicates if redirects should be followed | [optional] +**redirected_url** | **str** | Final URL after redirection (if any) | +**test** | [**TestMetaDto**](TestMetaDto.md) | Metadata about the test execution | + +## Example + +```python +from geekflare_api.models.mtr_meta_dto import MtrMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MtrMetaDto from a JSON string +mtr_meta_dto_instance = MtrMetaDto.from_json(json) +# print the JSON string representation of the object +print(MtrMetaDto.to_json()) + +# convert the object into a dict +mtr_meta_dto_dict = mtr_meta_dto_instance.to_dict() +# create an instance of MtrMetaDto from a dict +mtr_meta_dto_from_dict = MtrMetaDto.from_dict(mtr_meta_dto_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/docs/MtrResponseDto.md b/docs/MtrResponseDto.md new file mode 100644 index 0000000..54d4c47 --- /dev/null +++ b/docs/MtrResponseDto.md @@ -0,0 +1,33 @@ +# MtrResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**MtrMetaDto**](MtrMetaDto.md) | Metadata about the MTR test execution | +**data** | [**List[MtrDataDto]**](MtrDataDto.md) | Array of hop details observed in the MTR trace route | + +## Example + +```python +from geekflare_api.models.mtr_response_dto import MtrResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of MtrResponseDto from a JSON string +mtr_response_dto_instance = MtrResponseDto.from_json(json) +# print the JSON string representation of the object +print(MtrResponseDto.to_json()) + +# convert the object into a dict +mtr_response_dto_dict = mtr_response_dto_instance.to_dict() +# create an instance of MtrResponseDto from a dict +mtr_response_dto_from_dict = MtrResponseDto.from_dict(mtr_response_dto_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/docs/NetworkDto.md b/docs/NetworkDto.md new file mode 100644 index 0000000..87df61c --- /dev/null +++ b/docs/NetworkDto.md @@ -0,0 +1,31 @@ +# NetworkDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**protocol** | **str** | The actual HTTP protocol used (e.g. h2, h3, http/1.1, http/1.0) | +**remote_ip** | **str** | Remote IP address of the server | [optional] +**bytes_read** | **float** | Total bytes read from the response | + +## Example + +```python +from geekflare_api.models.network_dto import NetworkDto + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkDto from a JSON string +network_dto_instance = NetworkDto.from_json(json) +# print the JSON string representation of the object +print(NetworkDto.to_json()) + +# convert the object into a dict +network_dto_dict = network_dto_instance.to_dict() +# create an instance of NetworkDto from a dict +network_dto_from_dict = NetworkDto.from_dict(network_dto_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/docs/OpenPortDto.md b/docs/OpenPortDto.md new file mode 100644 index 0000000..3a9ffaa --- /dev/null +++ b/docs/OpenPortDto.md @@ -0,0 +1,31 @@ +# OpenPortDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The URL to be checked | +**top_ports** | **float** | Scan only the top N ports (optional) | [optional] +**port_ranges** | **str** | Custom port ranges to scan, e.g., \"80,443,1000-1010\" | [optional] + +## Example + +```python +from geekflare_api.models.open_port_dto import OpenPortDto + +# TODO update the JSON string below +json = "{}" +# create an instance of OpenPortDto from a JSON string +open_port_dto_instance = OpenPortDto.from_json(json) +# print the JSON string representation of the object +print(OpenPortDto.to_json()) + +# convert the object into a dict +open_port_dto_dict = open_port_dto_instance.to_dict() +# create an instance of OpenPortDto from a dict +open_port_dto_from_dict = OpenPortDto.from_dict(open_port_dto_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/docs/OpenPortMetaDto.md b/docs/OpenPortMetaDto.md new file mode 100644 index 0000000..1d1443e --- /dev/null +++ b/docs/OpenPortMetaDto.md @@ -0,0 +1,32 @@ +# OpenPortMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The scanned URL | +**top_ports** | **float** | Top ports scanned (if any) | [optional] +**port_ranges** | **str** | Custom port ranges scanned (if any) | [optional] +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.open_port_meta_dto import OpenPortMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of OpenPortMetaDto from a JSON string +open_port_meta_dto_instance = OpenPortMetaDto.from_json(json) +# print the JSON string representation of the object +print(OpenPortMetaDto.to_json()) + +# convert the object into a dict +open_port_meta_dto_dict = open_port_meta_dto_instance.to_dict() +# create an instance of OpenPortMetaDto from a dict +open_port_meta_dto_from_dict = OpenPortMetaDto.from_dict(open_port_meta_dto_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/docs/OpenPortResponseDto.md b/docs/OpenPortResponseDto.md new file mode 100644 index 0000000..6b37ea0 --- /dev/null +++ b/docs/OpenPortResponseDto.md @@ -0,0 +1,33 @@ +# OpenPortResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**OpenPortMetaDto**](OpenPortMetaDto.md) | Metadata about the request | +**data** | **List[float]** | List of open ports found | + +## Example + +```python +from geekflare_api.models.open_port_response_dto import OpenPortResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of OpenPortResponseDto from a JSON string +open_port_response_dto_instance = OpenPortResponseDto.from_json(json) +# print the JSON string representation of the object +print(OpenPortResponseDto.to_json()) + +# convert the object into a dict +open_port_response_dto_dict = open_port_response_dto_instance.to_dict() +# create an instance of OpenPortResponseDto from a dict +open_port_response_dto_from_dict = OpenPortResponseDto.from_dict(open_port_response_dto_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/docs/PingDataDto.md b/docs/PingDataDto.md new file mode 100644 index 0000000..163b1e7 --- /dev/null +++ b/docs/PingDataDto.md @@ -0,0 +1,36 @@ +# PingDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | **float** | Number of ping requests sent | +**loss** | **float** | Packet loss percentage | +**latency** | **float** | Average latency in milliseconds | +**min** | **float** | Minimum round-trip time (RTT) in milliseconds | +**max** | **float** | Maximum round-trip time (RTT) in milliseconds | +**avg** | **float** | Average round-trip time (RTT) in milliseconds | +**std_dev** | **float** | Standard deviation of RTT in milliseconds | +**ip** | **str** | Resolved IP address of the tested domain | + +## Example + +```python +from geekflare_api.models.ping_data_dto import PingDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of PingDataDto from a JSON string +ping_data_dto_instance = PingDataDto.from_json(json) +# print the JSON string representation of the object +print(PingDataDto.to_json()) + +# convert the object into a dict +ping_data_dto_dict = ping_data_dto_instance.to_dict() +# create an instance of PingDataDto from a dict +ping_data_dto_from_dict = PingDataDto.from_dict(ping_data_dto_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/docs/PingDto.md b/docs/PingDto.md new file mode 100644 index 0000000..1a885de --- /dev/null +++ b/docs/PingDto.md @@ -0,0 +1,29 @@ +# PingDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | + +## Example + +```python +from geekflare_api.models.ping_dto import PingDto + +# TODO update the JSON string below +json = "{}" +# create an instance of PingDto from a JSON string +ping_dto_instance = PingDto.from_json(json) +# print the JSON string representation of the object +print(PingDto.to_json()) + +# convert the object into a dict +ping_dto_dict = ping_dto_instance.to_dict() +# create an instance of PingDto from a dict +ping_dto_from_dict = PingDto.from_dict(ping_dto_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/docs/PingMetaDto.md b/docs/PingMetaDto.md new file mode 100644 index 0000000..a8655f2 --- /dev/null +++ b/docs/PingMetaDto.md @@ -0,0 +1,30 @@ +# PingMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The tested URL or IP address | +**test** | [**TestMetaDto**](TestMetaDto.md) | Metadata about the test execution | + +## Example + +```python +from geekflare_api.models.ping_meta_dto import PingMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of PingMetaDto from a JSON string +ping_meta_dto_instance = PingMetaDto.from_json(json) +# print the JSON string representation of the object +print(PingMetaDto.to_json()) + +# convert the object into a dict +ping_meta_dto_dict = ping_meta_dto_instance.to_dict() +# create an instance of PingMetaDto from a dict +ping_meta_dto_from_dict = PingMetaDto.from_dict(ping_meta_dto_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/docs/PingResponseDto.md b/docs/PingResponseDto.md new file mode 100644 index 0000000..793a374 --- /dev/null +++ b/docs/PingResponseDto.md @@ -0,0 +1,33 @@ +# PingResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**PingMetaDto**](PingMetaDto.md) | Metadata about the Ping test execution | +**data** | [**PingDataDto**](PingDataDto.md) | Ping result statistics | + +## Example + +```python +from geekflare_api.models.ping_response_dto import PingResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of PingResponseDto from a JSON string +ping_response_dto_instance = PingResponseDto.from_json(json) +# print the JSON string representation of the object +print(PingResponseDto.to_json()) + +# convert the object into a dict +ping_response_dto_dict = ping_response_dto_instance.to_dict() +# create an instance of PingResponseDto from a dict +ping_response_dto_from_dict = PingResponseDto.from_dict(ping_response_dto_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/docs/ProtocolSupportDto.md b/docs/ProtocolSupportDto.md new file mode 100644 index 0000000..49bce3c --- /dev/null +++ b/docs/ProtocolSupportDto.md @@ -0,0 +1,33 @@ +# ProtocolSupportDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**http10** | **bool** | Whether HTTP/1.0 is supported | +**http11** | **bool** | Whether HTTP/1.1 is supported | +**http2** | **bool** | Whether HTTP/2 is supported | +**http3** | **bool** | Whether HTTP/3 is supported | +**http3_supported_version** | **List[str]** | HTTP/3 supported versions if available | [optional] + +## Example + +```python +from geekflare_api.models.protocol_support_dto import ProtocolSupportDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ProtocolSupportDto from a JSON string +protocol_support_dto_instance = ProtocolSupportDto.from_json(json) +# print the JSON string representation of the object +print(ProtocolSupportDto.to_json()) + +# convert the object into a dict +protocol_support_dto_dict = protocol_support_dto_instance.to_dict() +# create an instance of ProtocolSupportDto from a dict +protocol_support_dto_from_dict = ProtocolSupportDto.from_dict(protocol_support_dto_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/docs/RedirectCheckDto.md b/docs/RedirectCheckDto.md new file mode 100644 index 0000000..fb41ac6 --- /dev/null +++ b/docs/RedirectCheckDto.md @@ -0,0 +1,30 @@ +# RedirectCheckDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**proxy_country** | **str** | Proxy country code to route the request | [optional] + +## Example + +```python +from geekflare_api.models.redirect_check_dto import RedirectCheckDto + +# TODO update the JSON string below +json = "{}" +# create an instance of RedirectCheckDto from a JSON string +redirect_check_dto_instance = RedirectCheckDto.from_json(json) +# print the JSON string representation of the object +print(RedirectCheckDto.to_json()) + +# convert the object into a dict +redirect_check_dto_dict = redirect_check_dto_instance.to_dict() +# create an instance of RedirectCheckDto from a dict +redirect_check_dto_from_dict = RedirectCheckDto.from_dict(redirect_check_dto_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/docs/RedirectCheckMetaDto.md b/docs/RedirectCheckMetaDto.md new file mode 100644 index 0000000..46a9fcb --- /dev/null +++ b/docs/RedirectCheckMetaDto.md @@ -0,0 +1,31 @@ +# RedirectCheckMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The original URL checked | +**proxy_country** | **object** | Proxy country used (if any) | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.redirect_check_meta_dto import RedirectCheckMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of RedirectCheckMetaDto from a JSON string +redirect_check_meta_dto_instance = RedirectCheckMetaDto.from_json(json) +# print the JSON string representation of the object +print(RedirectCheckMetaDto.to_json()) + +# convert the object into a dict +redirect_check_meta_dto_dict = redirect_check_meta_dto_instance.to_dict() +# create an instance of RedirectCheckMetaDto from a dict +redirect_check_meta_dto_from_dict = RedirectCheckMetaDto.from_dict(redirect_check_meta_dto_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/docs/RedirectCheckResponseDto.md b/docs/RedirectCheckResponseDto.md new file mode 100644 index 0000000..2abd169 --- /dev/null +++ b/docs/RedirectCheckResponseDto.md @@ -0,0 +1,33 @@ +# RedirectCheckResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**RedirectCheckMetaDto**](RedirectCheckMetaDto.md) | Metadata about the redirection check. | +**data** | [**List[RedirectHopDto]**](RedirectHopDto.md) | List of redirection hops with status and headers. | + +## Example + +```python +from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of RedirectCheckResponseDto from a JSON string +redirect_check_response_dto_instance = RedirectCheckResponseDto.from_json(json) +# print the JSON string representation of the object +print(RedirectCheckResponseDto.to_json()) + +# convert the object into a dict +redirect_check_response_dto_dict = redirect_check_response_dto_instance.to_dict() +# create an instance of RedirectCheckResponseDto from a dict +redirect_check_response_dto_from_dict = RedirectCheckResponseDto.from_dict(redirect_check_response_dto_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/docs/RedirectHopDto.md b/docs/RedirectHopDto.md new file mode 100644 index 0000000..5f3958f --- /dev/null +++ b/docs/RedirectHopDto.md @@ -0,0 +1,31 @@ +# RedirectHopDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The URL at this hop | +**status** | **float** | HTTP status code at this hop | +**headers** | **List[str]** | Response headers | + +## Example + +```python +from geekflare_api.models.redirect_hop_dto import RedirectHopDto + +# TODO update the JSON string below +json = "{}" +# create an instance of RedirectHopDto from a JSON string +redirect_hop_dto_instance = RedirectHopDto.from_json(json) +# print the JSON string representation of the object +print(RedirectHopDto.to_json()) + +# convert the object into a dict +redirect_hop_dto_dict = redirect_hop_dto_instance.to_dict() +# create an instance of RedirectHopDto from a dict +redirect_hop_dto_from_dict = RedirectHopDto.from_dict(redirect_hop_dto_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/docs/ScreenshotDto.md b/docs/ScreenshotDto.md new file mode 100644 index 0000000..7ea9d3b --- /dev/null +++ b/docs/ScreenshotDto.md @@ -0,0 +1,48 @@ +# ScreenshotDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**device** | **str** | Device type to emulate. Defaults to desktop. | [optional] [default to 'desktop'] +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**type** | **str** | File type of screenshot. Defaults to png. | [optional] [default to 'png'] +**full_page** | **bool** | Take full-page screenshot | [optional] [default to False] +**block_ads** | **bool** | Block ads on the page | [optional] [default to True] +**hide_cookie** | **bool** | Hide cookie popups | [optional] [default to True] +**skip_captcha** | **bool** | Try to bypass captcha | [optional] [default to True] +**add_timestamp** | **bool** | Add timestamp watermark | [optional] [default to False] +**page_height** | **float** | Height of the page (for partial screenshot) | [optional] +**viewport_width** | **float** | Width of the viewport | [optional] +**viewport_height** | **float** | Height of the viewport | [optional] +**theme** | **str** | Theme to use for rendering | [optional] [default to 'auto'] +**remove_background** | **bool** | Remove background from screenshot | [optional] +**highlight_links** | **bool** | Highlight links on the page | [optional] +**delay** | **float** | Delay before taking screenshot (in seconds) | [optional] +**disable_animations** | **bool** | Disable animations on the page | [optional] +**quality** | **float** | Image quality (for JPEG/WEBP) | [optional] +**scale_factor** | **float** | Device scale factor | [optional] +**capture_beyond_viewport** | **bool** | Capture beyond viewport if possible | [optional] + +## Example + +```python +from geekflare_api.models.screenshot_dto import ScreenshotDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ScreenshotDto from a JSON string +screenshot_dto_instance = ScreenshotDto.from_json(json) +# print the JSON string representation of the object +print(ScreenshotDto.to_json()) + +# convert the object into a dict +screenshot_dto_dict = screenshot_dto_instance.to_dict() +# create an instance of ScreenshotDto from a dict +screenshot_dto_from_dict = ScreenshotDto.from_dict(screenshot_dto_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/docs/ScreenshotMetaDto.md b/docs/ScreenshotMetaDto.md new file mode 100644 index 0000000..112919a --- /dev/null +++ b/docs/ScreenshotMetaDto.md @@ -0,0 +1,49 @@ +# ScreenshotMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL that was captured | +**type** | **str** | File type of screenshot | +**device** | **str** | Device type used | +**full_page** | **bool** | Whether full-page screenshot was taken | +**block_ads** | **bool** | Whether ads were blocked | +**hide_cookie** | **bool** | Whether cookie popups were hidden | +**skip_captcha** | **bool** | Whether captcha was bypassed | +**add_timestamp** | **bool** | Whether timestamp watermark was added | +**proxy_country** | **str** | Proxy country used, if any | [optional] +**page_height** | **float** | Height of the page | [optional] +**viewport_width** | **float** | Width of the viewport | [optional] +**viewport_height** | **float** | Height of the viewport | [optional] +**theme** | **str** | Theme used | [optional] +**remove_background** | **bool** | Whether background was removed | [optional] +**highlight_links** | **bool** | Whether links were highlighted | [optional] +**delay** | **float** | Delay before screenshot | [optional] +**disable_animations** | **bool** | Whether animations were disabled | [optional] +**quality** | **float** | Image quality (JPEG/WEBP) | [optional] +**scale_factor** | **float** | Device scale factor | [optional] +**capture_beyond_viewport** | **bool** | Capture beyond viewport | [optional] +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details | + +## Example + +```python +from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ScreenshotMetaDto from a JSON string +screenshot_meta_dto_instance = ScreenshotMetaDto.from_json(json) +# print the JSON string representation of the object +print(ScreenshotMetaDto.to_json()) + +# convert the object into a dict +screenshot_meta_dto_dict = screenshot_meta_dto_instance.to_dict() +# create an instance of ScreenshotMetaDto from a dict +screenshot_meta_dto_from_dict = ScreenshotMetaDto.from_dict(screenshot_meta_dto_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/docs/ScreenshotResponseDto.md b/docs/ScreenshotResponseDto.md new file mode 100644 index 0000000..a4f4b2a --- /dev/null +++ b/docs/ScreenshotResponseDto.md @@ -0,0 +1,33 @@ +# ScreenshotResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**ScreenshotMetaDto**](ScreenshotMetaDto.md) | Metadata about the request | +**data** | **str** | Screenshot URL or base64 string | + +## Example + +```python +from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ScreenshotResponseDto from a JSON string +screenshot_response_dto_instance = ScreenshotResponseDto.from_json(json) +# print the JSON string representation of the object +print(ScreenshotResponseDto.to_json()) + +# convert the object into a dict +screenshot_response_dto_dict = screenshot_response_dto_instance.to_dict() +# create an instance of ScreenshotResponseDto from a dict +screenshot_response_dto_from_dict = ScreenshotResponseDto.from_dict(screenshot_response_dto_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/docs/Search200Response.md b/docs/Search200Response.md new file mode 100644 index 0000000..672b778 --- /dev/null +++ b/docs/Search200Response.md @@ -0,0 +1,33 @@ +# Search200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**SearchMetaDto**](SearchMetaDto.md) | | +**data** | **object** | | + +## Example + +```python +from geekflare_api.models.search200_response import Search200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of Search200Response from a JSON string +search200_response_instance = Search200Response.from_json(json) +# print the JSON string representation of the object +print(Search200Response.to_json()) + +# convert the object into a dict +search200_response_dict = search200_response_instance.to_dict() +# create an instance of Search200Response from a dict +search200_response_from_dict = Search200Response.from_dict(search200_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/docs/SearchHtmlResponseDto.md b/docs/SearchHtmlResponseDto.md new file mode 100644 index 0000000..2a0c8e7 --- /dev/null +++ b/docs/SearchHtmlResponseDto.md @@ -0,0 +1,33 @@ +# SearchHtmlResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**SearchMetaDto**](SearchMetaDto.md) | | +**data** | **object** | | + +## Example + +```python +from geekflare_api.models.search_html_response_dto import SearchHtmlResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchHtmlResponseDto from a JSON string +search_html_response_dto_instance = SearchHtmlResponseDto.from_json(json) +# print the JSON string representation of the object +print(SearchHtmlResponseDto.to_json()) + +# convert the object into a dict +search_html_response_dto_dict = search_html_response_dto_instance.to_dict() +# create an instance of SearchHtmlResponseDto from a dict +search_html_response_dto_from_dict = SearchHtmlResponseDto.from_dict(search_html_response_dto_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/docs/SearchMarkdownResponseDto.md b/docs/SearchMarkdownResponseDto.md new file mode 100644 index 0000000..3cf4262 --- /dev/null +++ b/docs/SearchMarkdownResponseDto.md @@ -0,0 +1,33 @@ +# SearchMarkdownResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**SearchMetaDto**](SearchMetaDto.md) | | +**data** | **object** | | + +## Example + +```python +from geekflare_api.models.search_markdown_response_dto import SearchMarkdownResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchMarkdownResponseDto from a JSON string +search_markdown_response_dto_instance = SearchMarkdownResponseDto.from_json(json) +# print the JSON string representation of the object +print(SearchMarkdownResponseDto.to_json()) + +# convert the object into a dict +search_markdown_response_dto_dict = search_markdown_response_dto_instance.to_dict() +# create an instance of SearchMarkdownResponseDto from a dict +search_markdown_response_dto_from_dict = SearchMarkdownResponseDto.from_dict(search_markdown_response_dto_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/docs/SearchMetaDto.md b/docs/SearchMetaDto.md new file mode 100644 index 0000000..a34dd0e --- /dev/null +++ b/docs/SearchMetaDto.md @@ -0,0 +1,36 @@ +# SearchMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **str** | Original query | +**count** | **float** | Number of results returned | +**source** | **List[str]** | Search source used | +**location** | **str** | Country used for ranking | +**time** | **str** | Time filter applied | +**scrape** | **bool** | Whether URL scraping was enabled | +**scrape_limit** | **float** | Number of URLs scraped | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test metadata | + +## Example + +```python +from geekflare_api.models.search_meta_dto import SearchMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchMetaDto from a JSON string +search_meta_dto_instance = SearchMetaDto.from_json(json) +# print the JSON string representation of the object +print(SearchMetaDto.to_json()) + +# convert the object into a dict +search_meta_dto_dict = search_meta_dto_instance.to_dict() +# create an instance of SearchMetaDto from a dict +search_meta_dto_from_dict = SearchMetaDto.from_dict(search_meta_dto_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/docs/SearchRequestDto.md b/docs/SearchRequestDto.md new file mode 100644 index 0000000..a70406d --- /dev/null +++ b/docs/SearchRequestDto.md @@ -0,0 +1,39 @@ +# SearchRequestDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **str** | Search query | +**limit** | **float** | Number of results | [optional] [default to 10] +**time** | **str** | Time filter (h, d, w, m, y or h2, d7, etc.) | [optional] [default to 'any'] +**location** | **str** | Country code (ISO alpha-2) | [optional] [default to 'us'] +**source** | **str** | Search source | [optional] [default to 'web'] +**category** | **str** | Category filter | [optional] [default to 'general'] +**include_domains** | **List[str]** | Include only these domains | [optional] +**exclude_domains** | **List[str]** | Exclude these domains | [optional] +**format** | **str** | Output format | [optional] [default to 'json'] +**scrape** | **bool** | scrape and extract content from SERP result URLs | [optional] [default to False] +**scrape_limit** | **float** | Number of URLs to scrape (requires scrape: true) | [optional] [default to 3] + +## Example + +```python +from geekflare_api.models.search_request_dto import SearchRequestDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchRequestDto from a JSON string +search_request_dto_instance = SearchRequestDto.from_json(json) +# print the JSON string representation of the object +print(SearchRequestDto.to_json()) + +# convert the object into a dict +search_request_dto_dict = search_request_dto_instance.to_dict() +# create an instance of SearchRequestDto from a dict +search_request_dto_from_dict = SearchRequestDto.from_dict(search_request_dto_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/docs/SearchResponseDto.md b/docs/SearchResponseDto.md new file mode 100644 index 0000000..aaa4a8a --- /dev/null +++ b/docs/SearchResponseDto.md @@ -0,0 +1,33 @@ +# SearchResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**SearchMetaDto**](SearchMetaDto.md) | | +**data** | [**List[SearchResultItemDto]**](SearchResultItemDto.md) | | + +## Example + +```python +from geekflare_api.models.search_response_dto import SearchResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchResponseDto from a JSON string +search_response_dto_instance = SearchResponseDto.from_json(json) +# print the JSON string representation of the object +print(SearchResponseDto.to_json()) + +# convert the object into a dict +search_response_dto_dict = search_response_dto_instance.to_dict() +# create an instance of SearchResponseDto from a dict +search_response_dto_from_dict = SearchResponseDto.from_dict(search_response_dto_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/docs/SearchResultItemDto.md b/docs/SearchResultItemDto.md new file mode 100644 index 0000000..211dbc9 --- /dev/null +++ b/docs/SearchResultItemDto.md @@ -0,0 +1,34 @@ +# SearchResultItemDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | Result title | +**url** | **str** | Canonical URL | +**snippet** | **str** | Clean snippet (ads/HTML removed) | +**var_date** | **str** | Published date (if available) | [optional] +**position** | **float** | Rank position | +**content** | **object** | Scraped cleaned HTML content from the result URL | [optional] + +## Example + +```python +from geekflare_api.models.search_result_item_dto import SearchResultItemDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchResultItemDto from a JSON string +search_result_item_dto_instance = SearchResultItemDto.from_json(json) +# print the JSON string representation of the object +print(SearchResultItemDto.to_json()) + +# convert the object into a dict +search_result_item_dto_dict = search_result_item_dto_instance.to_dict() +# create an instance of SearchResultItemDto from a dict +search_result_item_dto_from_dict = SearchResultItemDto.from_dict(search_result_item_dto_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/docs/SelectorExtractionFieldDto.md b/docs/SelectorExtractionFieldDto.md new file mode 100644 index 0000000..2cebcef --- /dev/null +++ b/docs/SelectorExtractionFieldDto.md @@ -0,0 +1,33 @@ +# SelectorExtractionFieldDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Field name in the extracted JSON | +**selector** | **str** | Selector or XPath to extract value | +**type** | **str** | Type of data to extract | +**attribute** | **str** | If type=attr, specify attribute name | [optional] +**fields** | [**List[SelectorExtractionFieldDto]**](SelectorExtractionFieldDto.md) | Nested fields | [optional] + +## Example + +```python +from geekflare_api.models.selector_extraction_field_dto import SelectorExtractionFieldDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SelectorExtractionFieldDto from a JSON string +selector_extraction_field_dto_instance = SelectorExtractionFieldDto.from_json(json) +# print the JSON string representation of the object +print(SelectorExtractionFieldDto.to_json()) + +# convert the object into a dict +selector_extraction_field_dto_dict = selector_extraction_field_dto_instance.to_dict() +# create an instance of SelectorExtractionFieldDto from a dict +selector_extraction_field_dto_from_dict = SelectorExtractionFieldDto.from_dict(selector_extraction_field_dto_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/docs/ServiceHealthResponseDto.md b/docs/ServiceHealthResponseDto.md new file mode 100644 index 0000000..2a3b6b8 --- /dev/null +++ b/docs/ServiceHealthResponseDto.md @@ -0,0 +1,33 @@ +# ServiceHealthResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Top-level message summarizing the overall health check | +**services** | [**List[ServiceStatus]**](ServiceStatus.md) | Status of individual internal services | + +## Example + +```python +from geekflare_api.models.service_health_response_dto import ServiceHealthResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ServiceHealthResponseDto from a JSON string +service_health_response_dto_instance = ServiceHealthResponseDto.from_json(json) +# print the JSON string representation of the object +print(ServiceHealthResponseDto.to_json()) + +# convert the object into a dict +service_health_response_dto_dict = service_health_response_dto_instance.to_dict() +# create an instance of ServiceHealthResponseDto from a dict +service_health_response_dto_from_dict = ServiceHealthResponseDto.from_dict(service_health_response_dto_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/docs/ServiceStatus.md b/docs/ServiceStatus.md new file mode 100644 index 0000000..6f3d64b --- /dev/null +++ b/docs/ServiceStatus.md @@ -0,0 +1,31 @@ +# ServiceStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the service | +**status** | **str** | Health status of the service (e.g., healthy, degraded, down) | +**message** | **str** | Additional info or error message if any | + +## Example + +```python +from geekflare_api.models.service_status import ServiceStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ServiceStatus from a JSON string +service_status_instance = ServiceStatus.from_json(json) +# print the JSON string representation of the object +print(ServiceStatus.to_json()) + +# convert the object into a dict +service_status_dict = service_status_instance.to_dict() +# create an instance of ServiceStatus from a dict +service_status_from_dict = ServiceStatus.from_dict(service_status_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/docs/SiteStatusDto.md b/docs/SiteStatusDto.md new file mode 100644 index 0000000..3c43ab6 --- /dev/null +++ b/docs/SiteStatusDto.md @@ -0,0 +1,31 @@ +# SiteStatusDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**follow_redirect** | **bool** | Whether to follow redirects when checking site status | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.site_status_dto import SiteStatusDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SiteStatusDto from a JSON string +site_status_dto_instance = SiteStatusDto.from_json(json) +# print the JSON string representation of the object +print(SiteStatusDto.to_json()) + +# convert the object into a dict +site_status_dto_dict = site_status_dto_instance.to_dict() +# create an instance of SiteStatusDto from a dict +site_status_dto_from_dict = SiteStatusDto.from_dict(site_status_dto_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/docs/SiteStatusMetaDto.md b/docs/SiteStatusMetaDto.md new file mode 100644 index 0000000..6661900 --- /dev/null +++ b/docs/SiteStatusMetaDto.md @@ -0,0 +1,33 @@ +# SiteStatusMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL checked | +**follow_redirect** | **bool** | Whether redirects were followed | +**redirected_url** | **object** | Final redirected URL (if applicable) | [optional] +**proxy_country** | **str** | Proxy country used (if any) | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.site_status_meta_dto import SiteStatusMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SiteStatusMetaDto from a JSON string +site_status_meta_dto_instance = SiteStatusMetaDto.from_json(json) +# print the JSON string representation of the object +print(SiteStatusMetaDto.to_json()) + +# convert the object into a dict +site_status_meta_dto_dict = site_status_meta_dto_instance.to_dict() +# create an instance of SiteStatusMetaDto from a dict +site_status_meta_dto_from_dict = SiteStatusMetaDto.from_dict(site_status_meta_dto_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/docs/SiteStatusResponseDto.md b/docs/SiteStatusResponseDto.md new file mode 100644 index 0000000..54bb1bd --- /dev/null +++ b/docs/SiteStatusResponseDto.md @@ -0,0 +1,34 @@ +# SiteStatusResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**message** | **str** | Indicates the current status of the site. It can either be \"Site is up\" or \"Unable to reach the URL.\" | +**meta** | [**SiteStatusMetaDto**](SiteStatusMetaDto.md) | Metadata about the site status check. | +**data** | **object** | HTTP status information from the site check. | + +## Example + +```python +from geekflare_api.models.site_status_response_dto import SiteStatusResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of SiteStatusResponseDto from a JSON string +site_status_response_dto_instance = SiteStatusResponseDto.from_json(json) +# print the JSON string representation of the object +print(SiteStatusResponseDto.to_json()) + +# convert the object into a dict +site_status_response_dto_dict = site_status_response_dto_instance.to_dict() +# create an instance of SiteStatusResponseDto from a dict +site_status_response_dto_from_dict = SiteStatusResponseDto.from_dict(site_status_response_dto_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/docs/TestMetaDto.md b/docs/TestMetaDto.md new file mode 100644 index 0000000..54d76fb --- /dev/null +++ b/docs/TestMetaDto.md @@ -0,0 +1,29 @@ +# TestMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique test identifier | + +## Example + +```python +from geekflare_api.models.test_meta_dto import TestMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TestMetaDto from a JSON string +test_meta_dto_instance = TestMetaDto.from_json(json) +# print the JSON string representation of the object +print(TestMetaDto.to_json()) + +# convert the object into a dict +test_meta_dto_dict = test_meta_dto_instance.to_dict() +# create an instance of TestMetaDto from a dict +test_meta_dto_from_dict = TestMetaDto.from_dict(test_meta_dto_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/docs/TimingsDto.md b/docs/TimingsDto.md new file mode 100644 index 0000000..1a96d8c --- /dev/null +++ b/docs/TimingsDto.md @@ -0,0 +1,37 @@ +# TimingsDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dns** | **float** | Time spent in DNS lookup (ms) | +**connect** | **float** | Time to establish TCP connection (ms) | +**tls** | **float** | Time to complete TLS handshake (ms) | +**send** | **float** | Time to send request (ms) | +**wait** | **float** | Server processing time (ms) | +**ttfb** | **float** | Time to First Byte - calculated as dns+connect+tls+send+wait (ms) | +**download** | **float** | Time to download response body (ms) | +**total** | **float** | Total load time (ms) | +**redirect_duration** | **float** | Time spent in redirects before reaching final URL (ms) | + +## Example + +```python +from geekflare_api.models.timings_dto import TimingsDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TimingsDto from a JSON string +timings_dto_instance = TimingsDto.from_json(json) +# print the JSON string representation of the object +print(TimingsDto.to_json()) + +# convert the object into a dict +timings_dto_dict = timings_dto_instance.to_dict() +# create an instance of TimingsDto from a dict +timings_dto_from_dict = TimingsDto.from_dict(timings_dto_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/docs/TlsCertificateDto.md b/docs/TlsCertificateDto.md new file mode 100644 index 0000000..9e33971 --- /dev/null +++ b/docs/TlsCertificateDto.md @@ -0,0 +1,32 @@ +# TlsCertificateDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**common_name** | **str** | Common name (CN) on the certificate | +**subject_alt_name** | **str** | Subject Alternative Names (SAN) | +**issuer** | [**TlsCertificateIssuerDto**](TlsCertificateIssuerDto.md) | Issuer details | +**expiry** | **str** | Certificate expiry date | + +## Example + +```python +from geekflare_api.models.tls_certificate_dto import TlsCertificateDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsCertificateDto from a JSON string +tls_certificate_dto_instance = TlsCertificateDto.from_json(json) +# print the JSON string representation of the object +print(TlsCertificateDto.to_json()) + +# convert the object into a dict +tls_certificate_dto_dict = tls_certificate_dto_instance.to_dict() +# create an instance of TlsCertificateDto from a dict +tls_certificate_dto_from_dict = TlsCertificateDto.from_dict(tls_certificate_dto_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/docs/TlsCertificateIssuerDto.md b/docs/TlsCertificateIssuerDto.md new file mode 100644 index 0000000..4a1e782 --- /dev/null +++ b/docs/TlsCertificateIssuerDto.md @@ -0,0 +1,31 @@ +# TlsCertificateIssuerDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | Issuer country | +**organization** | **str** | Issuer organization | +**common_name** | **str** | Issuer common name | + +## Example + +```python +from geekflare_api.models.tls_certificate_issuer_dto import TlsCertificateIssuerDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsCertificateIssuerDto from a JSON string +tls_certificate_issuer_dto_instance = TlsCertificateIssuerDto.from_json(json) +# print the JSON string representation of the object +print(TlsCertificateIssuerDto.to_json()) + +# convert the object into a dict +tls_certificate_issuer_dto_dict = tls_certificate_issuer_dto_instance.to_dict() +# create an instance of TlsCertificateIssuerDto from a dict +tls_certificate_issuer_dto_from_dict = TlsCertificateIssuerDto.from_dict(tls_certificate_issuer_dto_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/docs/TlsProtocolsDto.md b/docs/TlsProtocolsDto.md new file mode 100644 index 0000000..e7149ef --- /dev/null +++ b/docs/TlsProtocolsDto.md @@ -0,0 +1,32 @@ +# TlsProtocolsDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tls10** | **bool** | Whether TLS 1.0 is supported | +**tls11** | **bool** | Whether TLS 1.1 is supported | +**tls12** | **bool** | Whether TLS 1.2 is supported | +**tls13** | **bool** | Whether TLS 1.3 is supported | + +## Example + +```python +from geekflare_api.models.tls_protocols_dto import TlsProtocolsDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsProtocolsDto from a JSON string +tls_protocols_dto_instance = TlsProtocolsDto.from_json(json) +# print the JSON string representation of the object +print(TlsProtocolsDto.to_json()) + +# convert the object into a dict +tls_protocols_dto_dict = tls_protocols_dto_instance.to_dict() +# create an instance of TlsProtocolsDto from a dict +tls_protocols_dto_from_dict = TlsProtocolsDto.from_dict(tls_protocols_dto_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/docs/TlsScanDataDto.md b/docs/TlsScanDataDto.md new file mode 100644 index 0000000..a246cd8 --- /dev/null +++ b/docs/TlsScanDataDto.md @@ -0,0 +1,30 @@ +# TlsScanDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**protocols** | [**TlsProtocolsDto**](TlsProtocolsDto.md) | Protocols supported | +**certificate** | [**TlsCertificateDto**](TlsCertificateDto.md) | Certificate details | + +## Example + +```python +from geekflare_api.models.tls_scan_data_dto import TlsScanDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsScanDataDto from a JSON string +tls_scan_data_dto_instance = TlsScanDataDto.from_json(json) +# print the JSON string representation of the object +print(TlsScanDataDto.to_json()) + +# convert the object into a dict +tls_scan_data_dto_dict = tls_scan_data_dto_instance.to_dict() +# create an instance of TlsScanDataDto from a dict +tls_scan_data_dto_from_dict = TlsScanDataDto.from_dict(tls_scan_data_dto_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/docs/TlsScanDto.md b/docs/TlsScanDto.md new file mode 100644 index 0000000..736e783 --- /dev/null +++ b/docs/TlsScanDto.md @@ -0,0 +1,29 @@ +# TlsScanDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | + +## Example + +```python +from geekflare_api.models.tls_scan_dto import TlsScanDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsScanDto from a JSON string +tls_scan_dto_instance = TlsScanDto.from_json(json) +# print the JSON string representation of the object +print(TlsScanDto.to_json()) + +# convert the object into a dict +tls_scan_dto_dict = tls_scan_dto_instance.to_dict() +# create an instance of TlsScanDto from a dict +tls_scan_dto_from_dict = TlsScanDto.from_dict(tls_scan_dto_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/docs/TlsScanMetaDto.md b/docs/TlsScanMetaDto.md new file mode 100644 index 0000000..a2df334 --- /dev/null +++ b/docs/TlsScanMetaDto.md @@ -0,0 +1,30 @@ +# TlsScanMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL checked for TLS support | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test metadata object | + +## Example + +```python +from geekflare_api.models.tls_scan_meta_dto import TlsScanMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsScanMetaDto from a JSON string +tls_scan_meta_dto_instance = TlsScanMetaDto.from_json(json) +# print the JSON string representation of the object +print(TlsScanMetaDto.to_json()) + +# convert the object into a dict +tls_scan_meta_dto_dict = tls_scan_meta_dto_instance.to_dict() +# create an instance of TlsScanMetaDto from a dict +tls_scan_meta_dto_from_dict = TlsScanMetaDto.from_dict(tls_scan_meta_dto_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/docs/TlsScanResponseDto.md b/docs/TlsScanResponseDto.md new file mode 100644 index 0000000..ef9dc37 --- /dev/null +++ b/docs/TlsScanResponseDto.md @@ -0,0 +1,33 @@ +# TlsScanResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**TlsScanMetaDto**](TlsScanMetaDto.md) | Metadata about the TLS scan request | +**data** | [**TlsScanDataDto**](TlsScanDataDto.md) | TLS scan result data | + +## Example + +```python +from geekflare_api.models.tls_scan_response_dto import TlsScanResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of TlsScanResponseDto from a JSON string +tls_scan_response_dto_instance = TlsScanResponseDto.from_json(json) +# print the JSON string representation of the object +print(TlsScanResponseDto.to_json()) + +# convert the object into a dict +tls_scan_response_dto_dict = tls_scan_response_dto_instance.to_dict() +# create an instance of TlsScanResponseDto from a dict +tls_scan_response_dto_from_dict = TlsScanResponseDto.from_dict(tls_scan_response_dto_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/docs/Url2PdfDto.md b/docs/Url2PdfDto.md new file mode 100644 index 0000000..23e83c5 --- /dev/null +++ b/docs/Url2PdfDto.md @@ -0,0 +1,38 @@ +# Url2PdfDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**device** | **str** | Device type to emulate. Defaults to desktop. | [optional] [default to 'desktop'] +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**format** | **str** | Paper format | [optional] [default to 'a4'] +**orientation** | **str** | Orientation | [optional] [default to 'portrait'] +**margin** | [**MarginDto**](MarginDto.md) | Margins in mm | [optional] +**scale** | **float** | Rendering scale between 0–2 | [optional] [default to 1] +**hide_cookie** | **bool** | Hide cookie popups | [optional] [default to False] +**skip_captcha** | **bool** | Try to skip captcha | [optional] [default to False] +**add_timestamp** | **bool** | Add timestamp watermark | [optional] [default to False] + +## Example + +```python +from geekflare_api.models.url2_pdf_dto import Url2PdfDto + +# TODO update the JSON string below +json = "{}" +# create an instance of Url2PdfDto from a JSON string +url2_pdf_dto_instance = Url2PdfDto.from_json(json) +# print the JSON string representation of the object +print(Url2PdfDto.to_json()) + +# convert the object into a dict +url2_pdf_dto_dict = url2_pdf_dto_instance.to_dict() +# create an instance of Url2PdfDto from a dict +url2_pdf_dto_from_dict = Url2PdfDto.from_dict(url2_pdf_dto_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/docs/Url2PdfMetaDto.md b/docs/Url2PdfMetaDto.md new file mode 100644 index 0000000..2891241 --- /dev/null +++ b/docs/Url2PdfMetaDto.md @@ -0,0 +1,36 @@ +# Url2PdfMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL | +**device** | **str** | Device type used | +**proxy_country** | **str** | Proxy country used, if any | [optional] +**format** | **str** | Paper format | +**orientation** | **str** | Orientation | +**margin** | [**MarginDto**](MarginDto.md) | Margins in mm | [optional] +**scale** | **float** | Rendering scale | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details | + +## Example + +```python +from geekflare_api.models.url2_pdf_meta_dto import Url2PdfMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of Url2PdfMetaDto from a JSON string +url2_pdf_meta_dto_instance = Url2PdfMetaDto.from_json(json) +# print the JSON string representation of the object +print(Url2PdfMetaDto.to_json()) + +# convert the object into a dict +url2_pdf_meta_dto_dict = url2_pdf_meta_dto_instance.to_dict() +# create an instance of Url2PdfMetaDto from a dict +url2_pdf_meta_dto_from_dict = Url2PdfMetaDto.from_dict(url2_pdf_meta_dto_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/docs/Url2PdfResponseDto.md b/docs/Url2PdfResponseDto.md new file mode 100644 index 0000000..2c94862 --- /dev/null +++ b/docs/Url2PdfResponseDto.md @@ -0,0 +1,33 @@ +# Url2PdfResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**Url2PdfMetaDto**](Url2PdfMetaDto.md) | Metadata about the request | +**data** | **str** | Generated PDF URL | + +## Example + +```python +from geekflare_api.models.url2_pdf_response_dto import Url2PdfResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of Url2PdfResponseDto from a JSON string +url2_pdf_response_dto_instance = Url2PdfResponseDto.from_json(json) +# print the JSON string representation of the object +print(Url2PdfResponseDto.to_json()) + +# convert the object into a dict +url2_pdf_response_dto_dict = url2_pdf_response_dto_instance.to_dict() +# create an instance of Url2PdfResponseDto from a dict +url2_pdf_response_dto_from_dict = Url2PdfResponseDto.from_dict(url2_pdf_response_dto_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/docs/WebScrapeDto.md b/docs/WebScrapeDto.md new file mode 100644 index 0000000..40e0811 --- /dev/null +++ b/docs/WebScrapeDto.md @@ -0,0 +1,39 @@ +# WebScrapeDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | Target URL | +**device** | **str** | Device type to emulate. Defaults to desktop. | [optional] [default to 'desktop'] +**block_ads** | **bool** | Whether to block ads | [optional] [default to True] +**render_js** | **bool** | Whether to render JavaScript | [optional] [default to True] +**proxy_country** | **str** | Proxy country code to route the request | [optional] +**format** | **List[str]** | Format(s) of the scraped result. Comma-separated or array. Defaults to html. | [optional] [default to [html-llm]] +**file_output** | **bool** | Whether to get response in file format | [optional] [default to False] +**stealth** | **bool** | Enable stealth mode to bypass basic bot detection (removes webdriver signals, patches navigator properties) | [optional] [default to False] +**wait_time** | **float** | Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks. | [optional] [default to 0] +**extraction_mode** | **str** | Extraction mode (only used if format=json) | [optional] [default to 'default'] +**extraction_schema** | [**ExtractionSchemaDto**](ExtractionSchemaDto.md) | Extraction schema (optional in default mode, required in css/xpath) | [optional] + +## Example + +```python +from geekflare_api.models.web_scrape_dto import WebScrapeDto + +# TODO update the JSON string below +json = "{}" +# create an instance of WebScrapeDto from a JSON string +web_scrape_dto_instance = WebScrapeDto.from_json(json) +# print the JSON string representation of the object +print(WebScrapeDto.to_json()) + +# convert the object into a dict +web_scrape_dto_dict = web_scrape_dto_instance.to_dict() +# create an instance of WebScrapeDto from a dict +web_scrape_dto_from_dict = WebScrapeDto.from_dict(web_scrape_dto_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/docs/WebScrapeMetaDto.md b/docs/WebScrapeMetaDto.md new file mode 100644 index 0000000..ebf305d --- /dev/null +++ b/docs/WebScrapeMetaDto.md @@ -0,0 +1,40 @@ +# WebScrapeMetaDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | The target URL that was scraped | +**device** | **str** | Device type used | +**format** | **List[str]** | Output format(s) of the result | +**file_output** | **bool** | Whether to get response in file format | +**block_ads** | **bool** | Whether ads were blocked | +**render_js** | **bool** | Whether JavaScript was rendered | +**stealth** | **bool** | Whether stealth mode was enabled | +**wait_time** | **float** | Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks. | [default to 0] +**proxy_country** | **str** | Proxy country used, if any | [optional] +**extraction_mode** | **str** | Extraction mode (only used if format=json) | +**extraction_schema** | [**ExtractionSchemaDto**](ExtractionSchemaDto.md) | Extraction schema (optional in default mode, required in css/xpath) | +**test** | [**TestMetaDto**](TestMetaDto.md) | Test details object | + +## Example + +```python +from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto + +# TODO update the JSON string below +json = "{}" +# create an instance of WebScrapeMetaDto from a JSON string +web_scrape_meta_dto_instance = WebScrapeMetaDto.from_json(json) +# print the JSON string representation of the object +print(WebScrapeMetaDto.to_json()) + +# convert the object into a dict +web_scrape_meta_dto_dict = web_scrape_meta_dto_instance.to_dict() +# create an instance of WebScrapeMetaDto from a dict +web_scrape_meta_dto_from_dict = WebScrapeMetaDto.from_dict(web_scrape_meta_dto_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/docs/WebScrapeResponseDto.md b/docs/WebScrapeResponseDto.md new file mode 100644 index 0000000..25bb4b8 --- /dev/null +++ b/docs/WebScrapeResponseDto.md @@ -0,0 +1,33 @@ +# WebScrapeResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**WebScrapeMetaDto**](WebScrapeMetaDto.md) | Metadata about the request | +**data** | [**MetaScrapeResponseDtoData**](MetaScrapeResponseDtoData.md) | | + +## Example + +```python +from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of WebScrapeResponseDto from a JSON string +web_scrape_response_dto_instance = WebScrapeResponseDto.from_json(json) +# print the JSON string representation of the object +print(WebScrapeResponseDto.to_json()) + +# convert the object into a dict +web_scrape_response_dto_dict = web_scrape_response_dto_instance.to_dict() +# create an instance of WebScrapeResponseDto from a dict +web_scrape_response_dto_from_dict = WebScrapeResponseDto.from_dict(web_scrape_response_dto_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/geekflare_api/__init__.py b/geekflare_api/__init__.py new file mode 100644 index 0000000..6ab2490 --- /dev/null +++ b/geekflare_api/__init__.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "0.1.0" + +# Define package exports +__all__ = [ + "ApiToolApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "BaseErrorResponseDto", + "BrokenLinkDto", + "BrokenLinkMetaDto", + "BrokenLinkResponseDto", + "BrokenLinkSummaryDto", + "DefaultExtractionFieldDto", + "DnsMetaDto", + "DnsRecordDto", + "DnsRecordResponseDto", + "DnsSecDataDto", + "DnsSecDto", + "DnsSecMetaDto", + "DnsSecResponseDto", + "ExtractionSchemaDto", + "ExtractionSchemaDtoFieldsInner", + "HealthResponseDto", + "ImageSearchResponseDto", + "ImageSearchResultItemDto", + "LighthouseDto", + "LighthouseMetaDto", + "LighthouseResponseDto", + "LoadTimeDataDto", + "LoadTimeDto", + "LoadTimeMetaDto", + "LoadTimeResponseDto", + "MarginDto", + "MetaScrapeDto", + "MetaScrapeMetaDto", + "MetaScrapeResponseDto", + "MetaScrapeResponseDtoData", + "MixedContentDataDto", + "MixedContentDto", + "MixedContentMetaDto", + "MixedContentResponseDto", + "MixedContentResponseDtoData", + "MtrDataDto", + "MtrDto", + "MtrMetaDto", + "MtrResponseDto", + "NetworkDto", + "OpenPortDto", + "OpenPortMetaDto", + "OpenPortResponseDto", + "PingDataDto", + "PingDto", + "PingMetaDto", + "PingResponseDto", + "ProtocolSupportDto", + "RedirectCheckDto", + "RedirectCheckMetaDto", + "RedirectCheckResponseDto", + "RedirectHopDto", + "ScreenshotDto", + "ScreenshotMetaDto", + "ScreenshotResponseDto", + "Search200Response", + "SearchHtmlResponseDto", + "SearchMarkdownResponseDto", + "SearchMetaDto", + "SearchRequestDto", + "SearchResponseDto", + "SearchResultItemDto", + "SelectorExtractionFieldDto", + "ServiceHealthResponseDto", + "ServiceStatus", + "SiteStatusDto", + "SiteStatusMetaDto", + "SiteStatusResponseDto", + "TestMetaDto", + "TimingsDto", + "TlsCertificateDto", + "TlsCertificateIssuerDto", + "TlsProtocolsDto", + "TlsScanDataDto", + "TlsScanDto", + "TlsScanMetaDto", + "TlsScanResponseDto", + "Url2PdfDto", + "Url2PdfMetaDto", + "Url2PdfResponseDto", + "WebScrapeDto", + "WebScrapeMetaDto", + "WebScrapeResponseDto", +] + +# import apis into sdk package +from geekflare_api.api.api_tool_api import ApiToolApi as ApiToolApi + +# import ApiClient +from geekflare_api.api_response import ApiResponse as ApiResponse +from geekflare_api.api_client import ApiClient as ApiClient +from geekflare_api.configuration import Configuration as Configuration +from geekflare_api.exceptions import OpenApiException as OpenApiException +from geekflare_api.exceptions import ApiTypeError as ApiTypeError +from geekflare_api.exceptions import ApiValueError as ApiValueError +from geekflare_api.exceptions import ApiKeyError as ApiKeyError +from geekflare_api.exceptions import ApiAttributeError as ApiAttributeError +from geekflare_api.exceptions import ApiException as ApiException + +# import models into sdk package +from geekflare_api.models.base_error_response_dto import BaseErrorResponseDto as BaseErrorResponseDto +from geekflare_api.models.broken_link_dto import BrokenLinkDto as BrokenLinkDto +from geekflare_api.models.broken_link_meta_dto import BrokenLinkMetaDto as BrokenLinkMetaDto +from geekflare_api.models.broken_link_response_dto import BrokenLinkResponseDto as BrokenLinkResponseDto +from geekflare_api.models.broken_link_summary_dto import BrokenLinkSummaryDto as BrokenLinkSummaryDto +from geekflare_api.models.default_extraction_field_dto import DefaultExtractionFieldDto as DefaultExtractionFieldDto +from geekflare_api.models.dns_meta_dto import DnsMetaDto as DnsMetaDto +from geekflare_api.models.dns_record_dto import DnsRecordDto as DnsRecordDto +from geekflare_api.models.dns_record_response_dto import DnsRecordResponseDto as DnsRecordResponseDto +from geekflare_api.models.dns_sec_data_dto import DnsSecDataDto as DnsSecDataDto +from geekflare_api.models.dns_sec_dto import DnsSecDto as DnsSecDto +from geekflare_api.models.dns_sec_meta_dto import DnsSecMetaDto as DnsSecMetaDto +from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto as DnsSecResponseDto +from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto as ExtractionSchemaDto +from geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner as ExtractionSchemaDtoFieldsInner +from geekflare_api.models.health_response_dto import HealthResponseDto as HealthResponseDto +from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto as ImageSearchResponseDto +from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto as ImageSearchResultItemDto +from geekflare_api.models.lighthouse_dto import LighthouseDto as LighthouseDto +from geekflare_api.models.lighthouse_meta_dto import LighthouseMetaDto as LighthouseMetaDto +from geekflare_api.models.lighthouse_response_dto import LighthouseResponseDto as LighthouseResponseDto +from geekflare_api.models.load_time_data_dto import LoadTimeDataDto as LoadTimeDataDto +from geekflare_api.models.load_time_dto import LoadTimeDto as LoadTimeDto +from geekflare_api.models.load_time_meta_dto import LoadTimeMetaDto as LoadTimeMetaDto +from geekflare_api.models.load_time_response_dto import LoadTimeResponseDto as LoadTimeResponseDto +from geekflare_api.models.margin_dto import MarginDto as MarginDto +from geekflare_api.models.meta_scrape_dto import MetaScrapeDto as MetaScrapeDto +from geekflare_api.models.meta_scrape_meta_dto import MetaScrapeMetaDto as MetaScrapeMetaDto +from geekflare_api.models.meta_scrape_response_dto import MetaScrapeResponseDto as MetaScrapeResponseDto +from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData as MetaScrapeResponseDtoData +from geekflare_api.models.mixed_content_data_dto import MixedContentDataDto as MixedContentDataDto +from geekflare_api.models.mixed_content_dto import MixedContentDto as MixedContentDto +from geekflare_api.models.mixed_content_meta_dto import MixedContentMetaDto as MixedContentMetaDto +from geekflare_api.models.mixed_content_response_dto import MixedContentResponseDto as MixedContentResponseDto +from geekflare_api.models.mixed_content_response_dto_data import MixedContentResponseDtoData as MixedContentResponseDtoData +from geekflare_api.models.mtr_data_dto import MtrDataDto as MtrDataDto +from geekflare_api.models.mtr_dto import MtrDto as MtrDto +from geekflare_api.models.mtr_meta_dto import MtrMetaDto as MtrMetaDto +from geekflare_api.models.mtr_response_dto import MtrResponseDto as MtrResponseDto +from geekflare_api.models.network_dto import NetworkDto as NetworkDto +from geekflare_api.models.open_port_dto import OpenPortDto as OpenPortDto +from geekflare_api.models.open_port_meta_dto import OpenPortMetaDto as OpenPortMetaDto +from geekflare_api.models.open_port_response_dto import OpenPortResponseDto as OpenPortResponseDto +from geekflare_api.models.ping_data_dto import PingDataDto as PingDataDto +from geekflare_api.models.ping_dto import PingDto as PingDto +from geekflare_api.models.ping_meta_dto import PingMetaDto as PingMetaDto +from geekflare_api.models.ping_response_dto import PingResponseDto as PingResponseDto +from geekflare_api.models.protocol_support_dto import ProtocolSupportDto as ProtocolSupportDto +from geekflare_api.models.redirect_check_dto import RedirectCheckDto as RedirectCheckDto +from geekflare_api.models.redirect_check_meta_dto import RedirectCheckMetaDto as RedirectCheckMetaDto +from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto as RedirectCheckResponseDto +from geekflare_api.models.redirect_hop_dto import RedirectHopDto as RedirectHopDto +from geekflare_api.models.screenshot_dto import ScreenshotDto as ScreenshotDto +from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto as ScreenshotMetaDto +from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto as ScreenshotResponseDto +from geekflare_api.models.search200_response import Search200Response as Search200Response +from geekflare_api.models.search_html_response_dto import SearchHtmlResponseDto as SearchHtmlResponseDto +from geekflare_api.models.search_markdown_response_dto import SearchMarkdownResponseDto as SearchMarkdownResponseDto +from geekflare_api.models.search_meta_dto import SearchMetaDto as SearchMetaDto +from geekflare_api.models.search_request_dto import SearchRequestDto as SearchRequestDto +from geekflare_api.models.search_response_dto import SearchResponseDto as SearchResponseDto +from geekflare_api.models.search_result_item_dto import SearchResultItemDto as SearchResultItemDto +from geekflare_api.models.selector_extraction_field_dto import SelectorExtractionFieldDto as SelectorExtractionFieldDto +from geekflare_api.models.service_health_response_dto import ServiceHealthResponseDto as ServiceHealthResponseDto +from geekflare_api.models.service_status import ServiceStatus as ServiceStatus +from geekflare_api.models.site_status_dto import SiteStatusDto as SiteStatusDto +from geekflare_api.models.site_status_meta_dto import SiteStatusMetaDto as SiteStatusMetaDto +from geekflare_api.models.site_status_response_dto import SiteStatusResponseDto as SiteStatusResponseDto +from geekflare_api.models.test_meta_dto import TestMetaDto as TestMetaDto +from geekflare_api.models.timings_dto import TimingsDto as TimingsDto +from geekflare_api.models.tls_certificate_dto import TlsCertificateDto as TlsCertificateDto +from geekflare_api.models.tls_certificate_issuer_dto import TlsCertificateIssuerDto as TlsCertificateIssuerDto +from geekflare_api.models.tls_protocols_dto import TlsProtocolsDto as TlsProtocolsDto +from geekflare_api.models.tls_scan_data_dto import TlsScanDataDto as TlsScanDataDto +from geekflare_api.models.tls_scan_dto import TlsScanDto as TlsScanDto +from geekflare_api.models.tls_scan_meta_dto import TlsScanMetaDto as TlsScanMetaDto +from geekflare_api.models.tls_scan_response_dto import TlsScanResponseDto as TlsScanResponseDto +from geekflare_api.models.url2_pdf_dto import Url2PdfDto as Url2PdfDto +from geekflare_api.models.url2_pdf_meta_dto import Url2PdfMetaDto as Url2PdfMetaDto +from geekflare_api.models.url2_pdf_response_dto import Url2PdfResponseDto as Url2PdfResponseDto +from geekflare_api.models.web_scrape_dto import WebScrapeDto as WebScrapeDto +from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto as WebScrapeMetaDto +from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto as WebScrapeResponseDto + diff --git a/geekflare_api/api/__init__.py b/geekflare_api/api/__init__.py new file mode 100644 index 0000000..5e518af --- /dev/null +++ b/geekflare_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from geekflare_api.api.api_tool_api import ApiToolApi + diff --git a/geekflare_api/api/api_tool_api.py b/geekflare_api/api/api_tool_api.py new file mode 100644 index 0000000..917c25b --- /dev/null +++ b/geekflare_api/api/api_tool_api.py @@ -0,0 +1,4780 @@ +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.models.broken_link_dto import BrokenLinkDto +from geekflare_api.models.broken_link_response_dto import BrokenLinkResponseDto +from geekflare_api.models.dns_record_dto import DnsRecordDto +from geekflare_api.models.dns_record_response_dto import DnsRecordResponseDto +from geekflare_api.models.dns_sec_dto import DnsSecDto +from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto +from geekflare_api.models.lighthouse_dto import LighthouseDto +from geekflare_api.models.lighthouse_response_dto import LighthouseResponseDto +from geekflare_api.models.load_time_dto import LoadTimeDto +from geekflare_api.models.load_time_response_dto import LoadTimeResponseDto +from geekflare_api.models.meta_scrape_dto import MetaScrapeDto +from geekflare_api.models.meta_scrape_response_dto import MetaScrapeResponseDto +from geekflare_api.models.mixed_content_dto import MixedContentDto +from geekflare_api.models.mixed_content_response_dto import MixedContentResponseDto +from geekflare_api.models.mtr_dto import MtrDto +from geekflare_api.models.mtr_response_dto import MtrResponseDto +from geekflare_api.models.open_port_dto import OpenPortDto +from geekflare_api.models.open_port_response_dto import OpenPortResponseDto +from geekflare_api.models.ping_dto import PingDto +from geekflare_api.models.ping_response_dto import PingResponseDto +from geekflare_api.models.redirect_check_dto import RedirectCheckDto +from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto +from geekflare_api.models.screenshot_dto import ScreenshotDto +from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto +from geekflare_api.models.search200_response import Search200Response +from geekflare_api.models.search_request_dto import SearchRequestDto +from geekflare_api.models.site_status_dto import SiteStatusDto +from geekflare_api.models.site_status_response_dto import SiteStatusResponseDto +from geekflare_api.models.tls_scan_dto import TlsScanDto +from geekflare_api.models.tls_scan_response_dto import TlsScanResponseDto +from geekflare_api.models.url2_pdf_dto import Url2PdfDto +from geekflare_api.models.url2_pdf_response_dto import Url2PdfResponseDto +from geekflare_api.models.web_scrape_dto import WebScrapeDto +from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto + +from geekflare_api.api_client import ApiClient, RequestSerialized +from geekflare_api.api_response import ApiResponse +from geekflare_api.rest import RESTResponseType + + +class ApiToolApi: + """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 broken_link( + self, + broken_link_dto: BrokenLinkDto, + _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, + ) -> BrokenLinkResponseDto: + """Check if a webpage contains broken links + + + :param broken_link_dto: (required) + :type broken_link_dto: BrokenLinkDto + :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._broken_link_serialize( + broken_link_dto=broken_link_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BrokenLinkResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 broken_link_with_http_info( + self, + broken_link_dto: BrokenLinkDto, + _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[BrokenLinkResponseDto]: + """Check if a webpage contains broken links + + + :param broken_link_dto: (required) + :type broken_link_dto: BrokenLinkDto + :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._broken_link_serialize( + broken_link_dto=broken_link_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BrokenLinkResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 broken_link_without_preload_content( + self, + broken_link_dto: BrokenLinkDto, + _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: + """Check if a webpage contains broken links + + + :param broken_link_dto: (required) + :type broken_link_dto: BrokenLinkDto + :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._broken_link_serialize( + broken_link_dto=broken_link_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BrokenLinkResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _broken_link_serialize( + self, + broken_link_dto, + _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 broken_link_dto is not None: + _body_params = broken_link_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/brokenlink', + 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 dns_record( + self, + dns_record_dto: DnsRecordDto, + _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, + ) -> DnsRecordResponseDto: + """Retrieve DNS records for a given domain + + + :param dns_record_dto: (required) + :type dns_record_dto: DnsRecordDto + :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._dns_record_serialize( + dns_record_dto=dns_record_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsRecordResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 dns_record_with_http_info( + self, + dns_record_dto: DnsRecordDto, + _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[DnsRecordResponseDto]: + """Retrieve DNS records for a given domain + + + :param dns_record_dto: (required) + :type dns_record_dto: DnsRecordDto + :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._dns_record_serialize( + dns_record_dto=dns_record_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsRecordResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 dns_record_without_preload_content( + self, + dns_record_dto: DnsRecordDto, + _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: + """Retrieve DNS records for a given domain + + + :param dns_record_dto: (required) + :type dns_record_dto: DnsRecordDto + :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._dns_record_serialize( + dns_record_dto=dns_record_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsRecordResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _dns_record_serialize( + self, + dns_record_dto, + _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 dns_record_dto is not None: + _body_params = dns_record_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/dnsrecord', + 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 dns_sec( + self, + dns_sec_dto: DnsSecDto, + _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, + ) -> DnsSecResponseDto: + """Check if DNSSEC is enabled for a domain + + + :param dns_sec_dto: (required) + :type dns_sec_dto: DnsSecDto + :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._dns_sec_serialize( + dns_sec_dto=dns_sec_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 dns_sec_with_http_info( + self, + dns_sec_dto: DnsSecDto, + _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[DnsSecResponseDto]: + """Check if DNSSEC is enabled for a domain + + + :param dns_sec_dto: (required) + :type dns_sec_dto: DnsSecDto + :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._dns_sec_serialize( + dns_sec_dto=dns_sec_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 dns_sec_without_preload_content( + self, + dns_sec_dto: DnsSecDto, + _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: + """Check if DNSSEC is enabled for a domain + + + :param dns_sec_dto: (required) + :type dns_sec_dto: DnsSecDto + :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._dns_sec_serialize( + dns_sec_dto=dns_sec_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _dns_sec_serialize( + self, + dns_sec_dto, + _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 dns_sec_dto is not None: + _body_params = dns_sec_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/dnssec', + 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 lighthouse( + self, + lighthouse_dto: LighthouseDto, + _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, + ) -> LighthouseResponseDto: + """Run Lighthouse audit on a website + + + :param lighthouse_dto: (required) + :type lighthouse_dto: LighthouseDto + :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._lighthouse_serialize( + lighthouse_dto=lighthouse_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LighthouseResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 lighthouse_with_http_info( + self, + lighthouse_dto: LighthouseDto, + _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[LighthouseResponseDto]: + """Run Lighthouse audit on a website + + + :param lighthouse_dto: (required) + :type lighthouse_dto: LighthouseDto + :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._lighthouse_serialize( + lighthouse_dto=lighthouse_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LighthouseResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 lighthouse_without_preload_content( + self, + lighthouse_dto: LighthouseDto, + _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: + """Run Lighthouse audit on a website + + + :param lighthouse_dto: (required) + :type lighthouse_dto: LighthouseDto + :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._lighthouse_serialize( + lighthouse_dto=lighthouse_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LighthouseResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _lighthouse_serialize( + self, + lighthouse_dto, + _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 lighthouse_dto is not None: + _body_params = lighthouse_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/lighthouse', + 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 load_time( + self, + load_time_dto: LoadTimeDto, + _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, + ) -> LoadTimeResponseDto: + """Measure the page load time for a given URL + + + :param load_time_dto: (required) + :type load_time_dto: LoadTimeDto + :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._load_time_serialize( + load_time_dto=load_time_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoadTimeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 load_time_with_http_info( + self, + load_time_dto: LoadTimeDto, + _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[LoadTimeResponseDto]: + """Measure the page load time for a given URL + + + :param load_time_dto: (required) + :type load_time_dto: LoadTimeDto + :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._load_time_serialize( + load_time_dto=load_time_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoadTimeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 load_time_without_preload_content( + self, + load_time_dto: LoadTimeDto, + _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: + """Measure the page load time for a given URL + + + :param load_time_dto: (required) + :type load_time_dto: LoadTimeDto + :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._load_time_serialize( + load_time_dto=load_time_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoadTimeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _load_time_serialize( + self, + load_time_dto, + _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 load_time_dto is not None: + _body_params = load_time_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/loadtime', + 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 meta_scrape( + self, + meta_scrape_dto: MetaScrapeDto, + _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, + ) -> MetaScrapeResponseDto: + """Scrape a webpage meta with custom options + + + :param meta_scrape_dto: (required) + :type meta_scrape_dto: MetaScrapeDto + :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._meta_scrape_serialize( + meta_scrape_dto=meta_scrape_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaScrapeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 meta_scrape_with_http_info( + self, + meta_scrape_dto: MetaScrapeDto, + _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[MetaScrapeResponseDto]: + """Scrape a webpage meta with custom options + + + :param meta_scrape_dto: (required) + :type meta_scrape_dto: MetaScrapeDto + :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._meta_scrape_serialize( + meta_scrape_dto=meta_scrape_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaScrapeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 meta_scrape_without_preload_content( + self, + meta_scrape_dto: MetaScrapeDto, + _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: + """Scrape a webpage meta with custom options + + + :param meta_scrape_dto: (required) + :type meta_scrape_dto: MetaScrapeDto + :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._meta_scrape_serialize( + meta_scrape_dto=meta_scrape_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaScrapeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _meta_scrape_serialize( + self, + meta_scrape_dto, + _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 meta_scrape_dto is not None: + _body_params = meta_scrape_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/metascraping', + 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 mixed_content( + self, + mixed_content_dto: MixedContentDto, + _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, + ) -> MixedContentResponseDto: + """Check for mixed content on a site + + + :param mixed_content_dto: (required) + :type mixed_content_dto: MixedContentDto + :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._mixed_content_serialize( + mixed_content_dto=mixed_content_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MixedContentResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 mixed_content_with_http_info( + self, + mixed_content_dto: MixedContentDto, + _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[MixedContentResponseDto]: + """Check for mixed content on a site + + + :param mixed_content_dto: (required) + :type mixed_content_dto: MixedContentDto + :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._mixed_content_serialize( + mixed_content_dto=mixed_content_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MixedContentResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 mixed_content_without_preload_content( + self, + mixed_content_dto: MixedContentDto, + _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: + """Check for mixed content on a site + + + :param mixed_content_dto: (required) + :type mixed_content_dto: MixedContentDto + :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._mixed_content_serialize( + mixed_content_dto=mixed_content_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MixedContentResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mixed_content_serialize( + self, + mixed_content_dto, + _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 mixed_content_dto is not None: + _body_params = mixed_content_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/mixedcontent', + 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 mtr( + self, + mtr_dto: MtrDto, + _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, + ) -> MtrResponseDto: + """Perform MTR (My Traceroute) network diagnostic test + + + :param mtr_dto: (required) + :type mtr_dto: MtrDto + :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._mtr_serialize( + mtr_dto=mtr_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MtrResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 mtr_with_http_info( + self, + mtr_dto: MtrDto, + _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[MtrResponseDto]: + """Perform MTR (My Traceroute) network diagnostic test + + + :param mtr_dto: (required) + :type mtr_dto: MtrDto + :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._mtr_serialize( + mtr_dto=mtr_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MtrResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 mtr_without_preload_content( + self, + mtr_dto: MtrDto, + _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: + """Perform MTR (My Traceroute) network diagnostic test + + + :param mtr_dto: (required) + :type mtr_dto: MtrDto + :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._mtr_serialize( + mtr_dto=mtr_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MtrResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mtr_serialize( + self, + mtr_dto, + _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 mtr_dto is not None: + _body_params = mtr_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/mtr', + 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 open_ports( + self, + open_port_dto: OpenPortDto, + _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, + ) -> OpenPortResponseDto: + """Scan a website for open ports + + + :param open_port_dto: (required) + :type open_port_dto: OpenPortDto + :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._open_ports_serialize( + open_port_dto=open_port_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OpenPortResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 open_ports_with_http_info( + self, + open_port_dto: OpenPortDto, + _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[OpenPortResponseDto]: + """Scan a website for open ports + + + :param open_port_dto: (required) + :type open_port_dto: OpenPortDto + :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._open_ports_serialize( + open_port_dto=open_port_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OpenPortResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 open_ports_without_preload_content( + self, + open_port_dto: OpenPortDto, + _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: + """Scan a website for open ports + + + :param open_port_dto: (required) + :type open_port_dto: OpenPortDto + :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._open_ports_serialize( + open_port_dto=open_port_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OpenPortResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _open_ports_serialize( + self, + open_port_dto, + _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 open_port_dto is not None: + _body_params = open_port_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/openport', + 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 ping( + self, + ping_dto: PingDto, + _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, + ) -> PingResponseDto: + """Perform ICMP Ping test on a given URL or IP + + + :param ping_dto: (required) + :type ping_dto: PingDto + :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._ping_serialize( + ping_dto=ping_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PingResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 ping_with_http_info( + self, + ping_dto: PingDto, + _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[PingResponseDto]: + """Perform ICMP Ping test on a given URL or IP + + + :param ping_dto: (required) + :type ping_dto: PingDto + :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._ping_serialize( + ping_dto=ping_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PingResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 ping_without_preload_content( + self, + ping_dto: PingDto, + _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: + """Perform ICMP Ping test on a given URL or IP + + + :param ping_dto: (required) + :type ping_dto: PingDto + :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._ping_serialize( + ping_dto=ping_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PingResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _ping_serialize( + self, + ping_dto, + _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 ping_dto is not None: + _body_params = ping_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ping', + 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 redirect_check( + self, + redirect_check_dto: RedirectCheckDto, + _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, + ) -> RedirectCheckResponseDto: + """Check the redirection chain of a given URL + + + :param redirect_check_dto: (required) + :type redirect_check_dto: RedirectCheckDto + :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._redirect_check_serialize( + redirect_check_dto=redirect_check_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RedirectCheckResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 redirect_check_with_http_info( + self, + redirect_check_dto: RedirectCheckDto, + _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[RedirectCheckResponseDto]: + """Check the redirection chain of a given URL + + + :param redirect_check_dto: (required) + :type redirect_check_dto: RedirectCheckDto + :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._redirect_check_serialize( + redirect_check_dto=redirect_check_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RedirectCheckResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 redirect_check_without_preload_content( + self, + redirect_check_dto: RedirectCheckDto, + _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: + """Check the redirection chain of a given URL + + + :param redirect_check_dto: (required) + :type redirect_check_dto: RedirectCheckDto + :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._redirect_check_serialize( + redirect_check_dto=redirect_check_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RedirectCheckResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _redirect_check_serialize( + self, + redirect_check_dto, + _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 redirect_check_dto is not None: + _body_params = redirect_check_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/redirectcheck', + 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 screenshot( + self, + screenshot_dto: ScreenshotDto, + _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, + ) -> ScreenshotResponseDto: + """Capture a full-page screenshot of a website + + + :param screenshot_dto: (required) + :type screenshot_dto: ScreenshotDto + :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._screenshot_serialize( + screenshot_dto=screenshot_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScreenshotResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 screenshot_with_http_info( + self, + screenshot_dto: ScreenshotDto, + _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[ScreenshotResponseDto]: + """Capture a full-page screenshot of a website + + + :param screenshot_dto: (required) + :type screenshot_dto: ScreenshotDto + :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._screenshot_serialize( + screenshot_dto=screenshot_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScreenshotResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 screenshot_without_preload_content( + self, + screenshot_dto: ScreenshotDto, + _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: + """Capture a full-page screenshot of a website + + + :param screenshot_dto: (required) + :type screenshot_dto: ScreenshotDto + :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._screenshot_serialize( + screenshot_dto=screenshot_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScreenshotResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _screenshot_serialize( + self, + screenshot_dto, + _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 screenshot_dto is not None: + _body_params = screenshot_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/screenshot', + 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 search( + self, + search_request_dto: SearchRequestDto, + _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, + ) -> Search200Response: + """Search API for AI Agents & LLMs + + Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + + :param search_request_dto: (required) + :type search_request_dto: SearchRequestDto + :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._search_serialize( + search_request_dto=search_request_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Search200Response", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 search_with_http_info( + self, + search_request_dto: SearchRequestDto, + _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[Search200Response]: + """Search API for AI Agents & LLMs + + Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + + :param search_request_dto: (required) + :type search_request_dto: SearchRequestDto + :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._search_serialize( + search_request_dto=search_request_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Search200Response", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 search_without_preload_content( + self, + search_request_dto: SearchRequestDto, + _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: + """Search API for AI Agents & LLMs + + Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + + :param search_request_dto: (required) + :type search_request_dto: SearchRequestDto + :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._search_serialize( + search_request_dto=search_request_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Search200Response", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_serialize( + self, + search_request_dto, + _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 search_request_dto is not None: + _body_params = search_request_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/search', + 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 site_status( + self, + site_status_dto: SiteStatusDto, + _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, + ) -> SiteStatusResponseDto: + """Check if a site is up or down + + + :param site_status_dto: (required) + :type site_status_dto: SiteStatusDto + :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._site_status_serialize( + site_status_dto=site_status_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SiteStatusResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 site_status_with_http_info( + self, + site_status_dto: SiteStatusDto, + _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[SiteStatusResponseDto]: + """Check if a site is up or down + + + :param site_status_dto: (required) + :type site_status_dto: SiteStatusDto + :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._site_status_serialize( + site_status_dto=site_status_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SiteStatusResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 site_status_without_preload_content( + self, + site_status_dto: SiteStatusDto, + _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: + """Check if a site is up or down + + + :param site_status_dto: (required) + :type site_status_dto: SiteStatusDto + :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._site_status_serialize( + site_status_dto=site_status_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SiteStatusResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _site_status_serialize( + self, + site_status_dto, + _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 site_status_dto is not None: + _body_params = site_status_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/up', + 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 tls_scan( + self, + tls_scan_dto: TlsScanDto, + _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, + ) -> TlsScanResponseDto: + """Perform TLS scan for a given domain + + + :param tls_scan_dto: (required) + :type tls_scan_dto: TlsScanDto + :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._tls_scan_serialize( + tls_scan_dto=tls_scan_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TlsScanResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 tls_scan_with_http_info( + self, + tls_scan_dto: TlsScanDto, + _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[TlsScanResponseDto]: + """Perform TLS scan for a given domain + + + :param tls_scan_dto: (required) + :type tls_scan_dto: TlsScanDto + :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._tls_scan_serialize( + tls_scan_dto=tls_scan_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TlsScanResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 tls_scan_without_preload_content( + self, + tls_scan_dto: TlsScanDto, + _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: + """Perform TLS scan for a given domain + + + :param tls_scan_dto: (required) + :type tls_scan_dto: TlsScanDto + :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._tls_scan_serialize( + tls_scan_dto=tls_scan_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TlsScanResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tls_scan_serialize( + self, + tls_scan_dto, + _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 tls_scan_dto is not None: + _body_params = tls_scan_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tlsscan', + 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 url2_pdf( + self, + url2_pdf_dto: Url2PdfDto, + _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, + ) -> Url2PdfResponseDto: + """Capture a full-page Url2Pdf of a website + + + :param url2_pdf_dto: (required) + :type url2_pdf_dto: Url2PdfDto + :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._url2_pdf_serialize( + url2_pdf_dto=url2_pdf_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Url2PdfResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 url2_pdf_with_http_info( + self, + url2_pdf_dto: Url2PdfDto, + _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[Url2PdfResponseDto]: + """Capture a full-page Url2Pdf of a website + + + :param url2_pdf_dto: (required) + :type url2_pdf_dto: Url2PdfDto + :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._url2_pdf_serialize( + url2_pdf_dto=url2_pdf_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Url2PdfResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 url2_pdf_without_preload_content( + self, + url2_pdf_dto: Url2PdfDto, + _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: + """Capture a full-page Url2Pdf of a website + + + :param url2_pdf_dto: (required) + :type url2_pdf_dto: Url2PdfDto + :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._url2_pdf_serialize( + url2_pdf_dto=url2_pdf_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Url2PdfResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _url2_pdf_serialize( + self, + url2_pdf_dto, + _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 url2_pdf_dto is not None: + _body_params = url2_pdf_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/url2pdf', + 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 web_scrape( + self, + web_scrape_dto: WebScrapeDto, + _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, + ) -> WebScrapeResponseDto: + """Scrape a webpage with custom options + + + :param web_scrape_dto: (required) + :type web_scrape_dto: WebScrapeDto + :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._web_scrape_serialize( + web_scrape_dto=web_scrape_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebScrapeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 web_scrape_with_http_info( + self, + web_scrape_dto: WebScrapeDto, + _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[WebScrapeResponseDto]: + """Scrape a webpage with custom options + + + :param web_scrape_dto: (required) + :type web_scrape_dto: WebScrapeDto + :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._web_scrape_serialize( + web_scrape_dto=web_scrape_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebScrapeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + 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 web_scrape_without_preload_content( + self, + web_scrape_dto: WebScrapeDto, + _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: + """Scrape a webpage with custom options + + + :param web_scrape_dto: (required) + :type web_scrape_dto: WebScrapeDto + :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._web_scrape_serialize( + web_scrape_dto=web_scrape_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebScrapeResponseDto", + '400': "BaseErrorResponseDto", + '500': "BaseErrorResponseDto", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _web_scrape_serialize( + self, + web_scrape_dto, + _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 web_scrape_dto is not None: + _body_params = web_scrape_dto + + + # 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] = [ + 'x-api-key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/webscraping', + 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/geekflare_api/api_client.py b/geekflare_api/api_client.py new file mode 100644 index 0000000..ecd1df4 --- /dev/null +++ b/geekflare_api/api_client.py @@ -0,0 +1,804 @@ +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +import uuid + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from geekflare_api.configuration import Configuration +from geekflare_api.api_response import ApiResponse, T as ApiResponseT +import geekflare_api.models +from geekflare_api import rest +from geekflare_api.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, + 'UUID': uuid.UUID, + '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/0.1.0/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 in ("bytearray", "bytes"): + 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.headers.get('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.headers, + 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, uuid.UUID): + return str(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): + return { + key: self.sanitize_for_serialization(val) + for key, val in obj.items() + } + + # 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 self.sanitize_for_serialization(obj_dict) + + + 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(geekflare_api.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(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.headers.get("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) + 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/geekflare_api/api_response.py b/geekflare_api/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/geekflare_api/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/geekflare_api/configuration.py b/geekflare_api/configuration.py new file mode 100644 index 0000000..21f20f7 --- /dev/null +++ b/geekflare_api/configuration.py @@ -0,0 +1,626 @@ +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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", + { + "x-api-key": APIKeyAuthSetting, + }, + 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 verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | urllib3.util.retry.Retry - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = geekflare_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _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[Union[int, urllib3.util.retry.Retry]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.geekflare.com" 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("geekflare_api") + 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 = verify_ssl + """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 = cert_file + """client certificate file + """ + self.key_file = key_file + """client key file + """ + self.assert_hostname = assert_hostname + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = tls_server_name + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. None in the constructor is coerced to cpu_count * 5. + """ + + self.proxy = proxy + """Proxy URL + """ + self.proxy_headers = proxy_headers + """Proxy headers + """ + self.safe_chars_for_path_param = safe_chars_for_path_param + """Safe chars for path_param + """ + self.retries = retries + """Retry configuration + """ + # Enable client side validation + self.client_side_validation = client_side_validation + + self.socket_options = socket_options + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = datetime_format + """datetime format + """ + + self.date_format = date_format + """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 = {} + if 'x-api-key' in self.api_key: + auth['x-api-key'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'x-api-key', + 'value': self.get_api_key_with_prefix( + 'x-api-key', + ), + } + 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.0.0\n"\ + "SDK Package Version: 0.1.0".\ + 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': "https://api.geekflare.com", + 'description': "No description provided", + } + ] + + 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 variable['enum_values'] \ + 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/geekflare_api/exceptions.py b/geekflare_api/exceptions.py new file mode 100644 index 0000000..133dd45 --- /dev/null +++ b/geekflare_api/exceptions.py @@ -0,0 +1,218 @@ +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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.headers + + @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.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + 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/geekflare_api/models/__init__.py b/geekflare_api/models/__init__.py new file mode 100644 index 0000000..c442012 --- /dev/null +++ b/geekflare_api/models/__init__.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +# flake8: noqa +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from geekflare_api.models.base_error_response_dto import BaseErrorResponseDto +from geekflare_api.models.broken_link_dto import BrokenLinkDto +from geekflare_api.models.broken_link_meta_dto import BrokenLinkMetaDto +from geekflare_api.models.broken_link_response_dto import BrokenLinkResponseDto +from geekflare_api.models.broken_link_summary_dto import BrokenLinkSummaryDto +from geekflare_api.models.default_extraction_field_dto import DefaultExtractionFieldDto +from geekflare_api.models.dns_meta_dto import DnsMetaDto +from geekflare_api.models.dns_record_dto import DnsRecordDto +from geekflare_api.models.dns_record_response_dto import DnsRecordResponseDto +from geekflare_api.models.dns_sec_data_dto import DnsSecDataDto +from geekflare_api.models.dns_sec_dto import DnsSecDto +from geekflare_api.models.dns_sec_meta_dto import DnsSecMetaDto +from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto +from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto +from geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner +from geekflare_api.models.health_response_dto import HealthResponseDto +from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto +from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto +from geekflare_api.models.lighthouse_dto import LighthouseDto +from geekflare_api.models.lighthouse_meta_dto import LighthouseMetaDto +from geekflare_api.models.lighthouse_response_dto import LighthouseResponseDto +from geekflare_api.models.load_time_data_dto import LoadTimeDataDto +from geekflare_api.models.load_time_dto import LoadTimeDto +from geekflare_api.models.load_time_meta_dto import LoadTimeMetaDto +from geekflare_api.models.load_time_response_dto import LoadTimeResponseDto +from geekflare_api.models.margin_dto import MarginDto +from geekflare_api.models.meta_scrape_dto import MetaScrapeDto +from geekflare_api.models.meta_scrape_meta_dto import MetaScrapeMetaDto +from geekflare_api.models.meta_scrape_response_dto import MetaScrapeResponseDto +from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData +from geekflare_api.models.mixed_content_data_dto import MixedContentDataDto +from geekflare_api.models.mixed_content_dto import MixedContentDto +from geekflare_api.models.mixed_content_meta_dto import MixedContentMetaDto +from geekflare_api.models.mixed_content_response_dto import MixedContentResponseDto +from geekflare_api.models.mixed_content_response_dto_data import MixedContentResponseDtoData +from geekflare_api.models.mtr_data_dto import MtrDataDto +from geekflare_api.models.mtr_dto import MtrDto +from geekflare_api.models.mtr_meta_dto import MtrMetaDto +from geekflare_api.models.mtr_response_dto import MtrResponseDto +from geekflare_api.models.network_dto import NetworkDto +from geekflare_api.models.open_port_dto import OpenPortDto +from geekflare_api.models.open_port_meta_dto import OpenPortMetaDto +from geekflare_api.models.open_port_response_dto import OpenPortResponseDto +from geekflare_api.models.ping_data_dto import PingDataDto +from geekflare_api.models.ping_dto import PingDto +from geekflare_api.models.ping_meta_dto import PingMetaDto +from geekflare_api.models.ping_response_dto import PingResponseDto +from geekflare_api.models.protocol_support_dto import ProtocolSupportDto +from geekflare_api.models.redirect_check_dto import RedirectCheckDto +from geekflare_api.models.redirect_check_meta_dto import RedirectCheckMetaDto +from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto +from geekflare_api.models.redirect_hop_dto import RedirectHopDto +from geekflare_api.models.screenshot_dto import ScreenshotDto +from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto +from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto +from geekflare_api.models.search200_response import Search200Response +from geekflare_api.models.search_html_response_dto import SearchHtmlResponseDto +from geekflare_api.models.search_markdown_response_dto import SearchMarkdownResponseDto +from geekflare_api.models.search_meta_dto import SearchMetaDto +from geekflare_api.models.search_request_dto import SearchRequestDto +from geekflare_api.models.search_response_dto import SearchResponseDto +from geekflare_api.models.search_result_item_dto import SearchResultItemDto +from geekflare_api.models.selector_extraction_field_dto import SelectorExtractionFieldDto +from geekflare_api.models.service_health_response_dto import ServiceHealthResponseDto +from geekflare_api.models.service_status import ServiceStatus +from geekflare_api.models.site_status_dto import SiteStatusDto +from geekflare_api.models.site_status_meta_dto import SiteStatusMetaDto +from geekflare_api.models.site_status_response_dto import SiteStatusResponseDto +from geekflare_api.models.test_meta_dto import TestMetaDto +from geekflare_api.models.timings_dto import TimingsDto +from geekflare_api.models.tls_certificate_dto import TlsCertificateDto +from geekflare_api.models.tls_certificate_issuer_dto import TlsCertificateIssuerDto +from geekflare_api.models.tls_protocols_dto import TlsProtocolsDto +from geekflare_api.models.tls_scan_data_dto import TlsScanDataDto +from geekflare_api.models.tls_scan_dto import TlsScanDto +from geekflare_api.models.tls_scan_meta_dto import TlsScanMetaDto +from geekflare_api.models.tls_scan_response_dto import TlsScanResponseDto +from geekflare_api.models.url2_pdf_dto import Url2PdfDto +from geekflare_api.models.url2_pdf_meta_dto import Url2PdfMetaDto +from geekflare_api.models.url2_pdf_response_dto import Url2PdfResponseDto +from geekflare_api.models.web_scrape_dto import WebScrapeDto +from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto +from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto + diff --git a/geekflare_api/models/base_error_response_dto.py b/geekflare_api/models/base_error_response_dto.py new file mode 100644 index 0000000..874ca90 --- /dev/null +++ b/geekflare_api/models/base_error_response_dto.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BaseErrorResponseDto(BaseModel): + """ + BaseErrorResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: StrictStr = Field(description="Error message", json_schema_extra={"examples": ["Invalid URL provided"]}) + details: Optional[StrictStr] = Field(default=None, description="Detailed error information", json_schema_extra={"examples": ["The URL must be a valid HTTP or HTTPS URL"]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message", "details"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BaseErrorResponseDto 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 BaseErrorResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message"), + "details": obj.get("details") + }) + return _obj + + diff --git a/geekflare_api/models/broken_link_dto.py b/geekflare_api/models/broken_link_dto.py new file mode 100644 index 0000000..01d0ff3 --- /dev/null +++ b/geekflare_api/models/broken_link_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class BrokenLinkDto(BaseModel): + """ + BrokenLinkDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + follow_redirect: Optional[StrictBool] = Field(default=False, description="Whether to follow redirects when checking site status", alias="followRedirect", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BrokenLinkDto 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 BrokenLinkDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect") if obj.get("followRedirect") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/broken_link_meta_dto.py b/geekflare_api/models/broken_link_meta_dto.py new file mode 100644 index 0000000..a516fdd --- /dev/null +++ b/geekflare_api/models/broken_link_meta_dto.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BrokenLinkMetaDto(BaseModel): + """ + BrokenLinkMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL checked for broken links", json_schema_extra={"examples": ["example.com"]}) + proxy_country: StrictStr = Field(description="Proxy country used for this request", alias="proxyCountry", json_schema_extra={"examples": ["United States"]}) + follow_redirect: StrictBool = Field(description="Whether redirection was followed", alias="followRedirect", json_schema_extra={"examples": [True]}) + redirected_url: StrictStr = Field(description="Final URL after redirection (if any)", alias="redirectedURL", json_schema_extra={"examples": ["https://example.com/"]}) + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect", "redirectedURL", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BrokenLinkMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BrokenLinkMetaDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect"), + "redirectedURL": obj.get("redirectedURL"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/broken_link_response_dto.py b/geekflare_api/models/broken_link_response_dto.py new file mode 100644 index 0000000..cde6539 --- /dev/null +++ b/geekflare_api/models/broken_link_response_dto.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.broken_link_meta_dto import BrokenLinkMetaDto +from geekflare_api.models.broken_link_summary_dto import BrokenLinkSummaryDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BrokenLinkResponseDto(BaseModel): + """ + BrokenLinkResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: StrictStr = Field(description="Human-readable message about the broken link scan result", json_schema_extra={"examples": ["No broken links found."]}) + meta: BrokenLinkMetaDto = Field(description="Metadata about the broken link request") + summary: BrokenLinkSummaryDto = Field(description="Summary of link check results categorized by status") + data: List[StrictStr] = Field(description="List of links found on the page and their HTTP status", json_schema_extra={"examples": [[{"link": "https://example.com/", "status": 200}, {"link": "https://example.com/articles", "status": 200}]]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message", "meta", "summary", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BrokenLinkResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of summary + if self.summary: + _dict['summary'] = self.summary.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BrokenLinkResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message"), + "meta": BrokenLinkMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "summary": BrokenLinkSummaryDto.from_dict(obj["summary"]) if obj.get("summary") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/broken_link_summary_dto.py b/geekflare_api/models/broken_link_summary_dto.py new file mode 100644 index 0000000..6af48ef --- /dev/null +++ b/geekflare_api/models/broken_link_summary_dto.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BrokenLinkSummaryDto(BaseModel): + """ + BrokenLinkSummaryDto + """ # noqa: E501 + total: Union[StrictFloat, StrictInt] = Field(description="Total number of links checked", json_schema_extra={"examples": [5]}) + successful: Union[StrictFloat, StrictInt] = Field(description="Number of successful links (2xx status codes)", json_schema_extra={"examples": [2]}) + redirects: Union[StrictFloat, StrictInt] = Field(description="Number of redirect links (3xx status codes)", json_schema_extra={"examples": [2]}) + broken: Union[StrictFloat, StrictInt] = Field(description="Number of broken links (4xx status codes and DNS/network failures)", json_schema_extra={"examples": [1]}) + server_error: Union[StrictFloat, StrictInt] = Field(description="Number of server errors (5xx status codes)", alias="serverError", json_schema_extra={"examples": [0]}) + __properties: ClassVar[List[str]] = ["total", "successful", "redirects", "broken", "serverError"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BrokenLinkSummaryDto 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 BrokenLinkSummaryDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "successful": obj.get("successful"), + "redirects": obj.get("redirects"), + "broken": obj.get("broken"), + "serverError": obj.get("serverError") + }) + return _obj + + diff --git a/geekflare_api/models/default_extraction_field_dto.py b/geekflare_api/models/default_extraction_field_dto.py new file mode 100644 index 0000000..db11ecb --- /dev/null +++ b/geekflare_api/models/default_extraction_field_dto.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DefaultExtractionFieldDto(BaseModel): + """ + DefaultExtractionFieldDto + """ # noqa: E501 + title: StrictStr = Field(description="Title/key of the extracted field", json_schema_extra={"examples": ["Product Name"]}) + value: Dict[str, Any] = Field(description="Static value to assign to this field", json_schema_extra={"examples": ["Some hardcoded string"]}) + __properties: ClassVar[List[str]] = ["title", "value"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DefaultExtractionFieldDto 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 DefaultExtractionFieldDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "value": obj.get("value") + }) + return _obj + + diff --git a/geekflare_api/models/dns_meta_dto.py b/geekflare_api/models/dns_meta_dto.py new file mode 100644 index 0000000..b561394 --- /dev/null +++ b/geekflare_api/models/dns_meta_dto.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DnsMetaDto(BaseModel): + """ + DnsMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL that was scraped", json_schema_extra={"examples": ["https://example.com"]}) + types: StrictStr = Field(description="List of DNS record types to query. If omitted, all supported types will be returned.", json_schema_extra={"examples": [["A", "MX"]]}) + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "types", "test"] + + @field_validator('types') + def types_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['A', 'AAAA', 'CNAME', 'MX', 'CAA', 'NS', 'SOA', 'SRV', 'TXT']): + raise ValueError("must be one of enum values ('A', 'AAAA', 'CNAME', 'MX', 'CAA', 'NS', 'SOA', 'SRV', 'TXT')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsMetaDto 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"), + "types": obj.get("types"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/dns_record_dto.py b/geekflare_api/models/dns_record_dto.py new file mode 100644 index 0000000..8eba91d --- /dev/null +++ b/geekflare_api/models/dns_record_dto.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DnsRecordDto(BaseModel): + """ + DnsRecordDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + types: Optional[List[StrictStr]] = Field(default=None, description="List of DNS record types to query. If omitted, all supported types will be returned.", json_schema_extra={"examples": [["A", "MX"]]}) + __properties: ClassVar[List[str]] = ["url", "types"] + + @field_validator('types') + def types_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['A', 'AAAA', 'CNAME', 'MX', 'CAA', 'NS', 'SOA', 'SRV', 'TXT']): + raise ValueError("each list item must be one of ('A', 'AAAA', 'CNAME', 'MX', 'CAA', 'NS', 'SOA', 'SRV', 'TXT')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsRecordDto 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 DnsRecordDto 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"), + "types": obj.get("types") + }) + return _obj + + diff --git a/geekflare_api/models/dns_record_response_dto.py b/geekflare_api/models/dns_record_response_dto.py new file mode 100644 index 0000000..2db444e --- /dev/null +++ b/geekflare_api/models/dns_record_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.dns_meta_dto import DnsMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DnsRecordResponseDto(BaseModel): + """ + DnsRecordResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: DnsMetaDto = Field(description="Metadata about the request.") + data: Dict[str, Any] = Field(description="DNS records grouped by type.", json_schema_extra={"examples": [{"A": ["172.67.70.213", "104.26.11.88", "104.26.10.88"], "MX": [{"exchange": "alt3.aspmx.l.google.com", "priority": 10}, {"exchange": "aspmx.l.google.com", "priority": 1}]}]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsRecordResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsRecordResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": DnsMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/dns_sec_data_dto.py b/geekflare_api/models/dns_sec_data_dto.py new file mode 100644 index 0000000..d61ac19 --- /dev/null +++ b/geekflare_api/models/dns_sec_data_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class DnsSecDataDto(BaseModel): + """ + DnsSecDataDto + """ # noqa: E501 + is_enabled: StrictBool = Field(description="Indicates if DNSSEC is enabled for the domain", alias="isEnabled", json_schema_extra={"examples": [True]}) + dnskey: Optional[List[StrictStr]] = Field(default=None, description="List of DNSKEY records if DNSSEC is enabled", json_schema_extra={"examples": [["DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA=="]]}) + rrsig: Optional[List[StrictStr]] = Field(default=None, description="List of RRSIG records if DNSSEC is enabled", json_schema_extra={"examples": [["RRSIG DNSKEY 13 2 3600 20251124121323 20250924121323 2371 geekflare.com. LUeqKWfw4GcaqSaCbFT7ik6mTgFdWsRdVzn1hHGSwMGZ4HuwlVFB3e1K 9Os+4DnxyYNkfWkBHJcBfFN7e4snHg=="]]}) + __properties: ClassVar[List[str]] = ["isEnabled", "dnskey", "rrsig"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecDataDto 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 DnsSecDataDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "isEnabled": obj.get("isEnabled"), + "dnskey": obj.get("dnskey"), + "rrsig": obj.get("rrsig") + }) + return _obj + + diff --git a/geekflare_api/models/dns_sec_dto.py b/geekflare_api/models/dns_sec_dto.py new file mode 100644 index 0000000..83c19dc --- /dev/null +++ b/geekflare_api/models/dns_sec_dto.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DnsSecDto(BaseModel): + """ + DnsSecDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecDto 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 DnsSecDto 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") + }) + return _obj + + diff --git a/geekflare_api/models/dns_sec_meta_dto.py b/geekflare_api/models/dns_sec_meta_dto.py new file mode 100644 index 0000000..190c6a3 --- /dev/null +++ b/geekflare_api/models/dns_sec_meta_dto.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DnsSecMetaDto(BaseModel): + """ + DnsSecMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The tested domain name", json_schema_extra={"examples": ["example.com"]}) + test: TestMetaDto = Field(description="Metadata about the test execution") + __properties: ClassVar[List[str]] = ["url", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsSecMetaDto 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"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/dns_sec_response_dto.py b/geekflare_api/models/dns_sec_response_dto.py new file mode 100644 index 0000000..916b8c1 --- /dev/null +++ b/geekflare_api/models/dns_sec_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.dns_sec_data_dto import DnsSecDataDto +from geekflare_api.models.dns_sec_meta_dto import DnsSecMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DnsSecResponseDto(BaseModel): + """ + DnsSecResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: DnsSecMetaDto = Field(description="Metadata about the DNSSEC test") + data: DnsSecDataDto = Field(description="DNSSEC test result data") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsSecResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": DnsSecMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": DnsSecDataDto.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/extraction_schema_dto.py b/geekflare_api/models/extraction_schema_dto.py new file mode 100644 index 0000000..37d67dd --- /dev/null +++ b/geekflare_api/models/extraction_schema_dto.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractionSchemaDto(BaseModel): + """ + ExtractionSchemaDto + """ # noqa: E501 + name: StrictStr = Field(description="Name/Label for this extraction schema", json_schema_extra={"examples": ["Product Schema"]}) + base_selector: Optional[StrictStr] = Field(default=None, description="Base selector for scoping extraction (css/xpath only)", alias="baseSelector", json_schema_extra={"examples": [".product"]}) + fields: List[ExtractionSchemaDtoFieldsInner] = Field(description="List of fields to extract") + __properties: ClassVar[List[str]] = ["name", "baseSelector", "fields"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractionSchemaDto 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 fields (list) + _items = [] + if self.fields: + for _item_fields in self.fields: + if _item_fields: + _items.append(_item_fields.to_dict()) + _dict['fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractionSchemaDto 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"), + "baseSelector": obj.get("baseSelector"), + "fields": [ExtractionSchemaDtoFieldsInner.from_dict(_item) for _item in obj["fields"]] if obj.get("fields") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/extraction_schema_dto_fields_inner.py b/geekflare_api/models/extraction_schema_dto_fields_inner.py new file mode 100644 index 0000000..7fbe466 --- /dev/null +++ b/geekflare_api/models/extraction_schema_dto_fields_inner.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from geekflare_api.models.default_extraction_field_dto import DefaultExtractionFieldDto +from geekflare_api.models.selector_extraction_field_dto import SelectorExtractionFieldDto +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EXTRACTIONSCHEMADTOFIELDSINNER_ONE_OF_SCHEMAS = ["DefaultExtractionFieldDto", "SelectorExtractionFieldDto"] + +class ExtractionSchemaDtoFieldsInner(BaseModel): + """ + ExtractionSchemaDtoFieldsInner + """ + # data type: DefaultExtractionFieldDto + oneof_schema_1_validator: Optional[DefaultExtractionFieldDto] = None + # data type: SelectorExtractionFieldDto + oneof_schema_2_validator: Optional[SelectorExtractionFieldDto] = None + actual_instance: Optional[Union[DefaultExtractionFieldDto, SelectorExtractionFieldDto]] = None + one_of_schemas: Set[str] = { "DefaultExtractionFieldDto", "SelectorExtractionFieldDto" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ExtractionSchemaDtoFieldsInner.model_construct() + error_messages = [] + match = 0 + # validate data type: DefaultExtractionFieldDto + if not isinstance(v, DefaultExtractionFieldDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `DefaultExtractionFieldDto`") + else: + match += 1 + # validate data type: SelectorExtractionFieldDto + if not isinstance(v, SelectorExtractionFieldDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `SelectorExtractionFieldDto`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ExtractionSchemaDtoFieldsInner with oneOf schemas: DefaultExtractionFieldDto, SelectorExtractionFieldDto. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ExtractionSchemaDtoFieldsInner with oneOf schemas: DefaultExtractionFieldDto, SelectorExtractionFieldDto. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into DefaultExtractionFieldDto + try: + instance.actual_instance = DefaultExtractionFieldDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SelectorExtractionFieldDto + try: + instance.actual_instance = SelectorExtractionFieldDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into ExtractionSchemaDtoFieldsInner with oneOf schemas: DefaultExtractionFieldDto, SelectorExtractionFieldDto. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ExtractionSchemaDtoFieldsInner with oneOf schemas: DefaultExtractionFieldDto, SelectorExtractionFieldDto. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DefaultExtractionFieldDto, SelectorExtractionFieldDto]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/geekflare_api/models/health_response_dto.py b/geekflare_api/models/health_response_dto.py new file mode 100644 index 0000000..bb22e17 --- /dev/null +++ b/geekflare_api/models/health_response_dto.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HealthResponseDto(BaseModel): + """ + HealthResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: StrictStr = Field(description="Metadata about the request") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HealthResponseDto 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 HealthResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message") + }) + return _obj + + diff --git a/geekflare_api/models/image_search_response_dto.py b/geekflare_api/models/image_search_response_dto.py new file mode 100644 index 0000000..7e71596 --- /dev/null +++ b/geekflare_api/models/image_search_response_dto.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto +from geekflare_api.models.search_meta_dto import SearchMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ImageSearchResponseDto(BaseModel): + """ + ImageSearchResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: SearchMetaDto + data: List[ImageSearchResultItemDto] + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImageSearchResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageSearchResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": SearchMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [ImageSearchResultItemDto.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/image_search_result_item_dto.py b/geekflare_api/models/image_search_result_item_dto.py new file mode 100644 index 0000000..eeb906c --- /dev/null +++ b/geekflare_api/models/image_search_result_item_dto.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ImageSearchResultItemDto(BaseModel): + """ + ImageSearchResultItemDto + """ # noqa: E501 + title: StrictStr = Field(json_schema_extra={"examples": ["Nike Alphafly 3"]}) + image_url: StrictStr = Field(alias="imageUrl", json_schema_extra={"examples": ["https://example.com/img.jpg"]}) + source_url: StrictStr = Field(alias="sourceUrl", json_schema_extra={"examples": ["https://example.com/page"]}) + width: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [1024]}) + height: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [768]}) + __properties: ClassVar[List[str]] = ["title", "imageUrl", "sourceUrl", "width", "height"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImageSearchResultItemDto 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 ImageSearchResultItemDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "imageUrl": obj.get("imageUrl"), + "sourceUrl": obj.get("sourceUrl"), + "width": obj.get("width"), + "height": obj.get("height") + }) + return _obj + + diff --git a/geekflare_api/models/lighthouse_dto.py b/geekflare_api/models/lighthouse_dto.py new file mode 100644 index 0000000..58351f0 --- /dev/null +++ b/geekflare_api/models/lighthouse_dto.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LighthouseDto(BaseModel): + """ + LighthouseDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: Optional[StrictStr] = Field(default='desktop', description="Device type to emulate. Defaults to desktop.", json_schema_extra={"examples": ["desktop"]}) + follow_redirect: Optional[StrictBool] = Field(default=False, description="Whether to follow redirects when checking site status", alias="followRedirect", json_schema_extra={"examples": [False]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + parameters: Optional[List[StrictStr]] = Field(default=None, description="Extra Lighthouse CLI parameters", json_schema_extra={"examples": [["--only-categories=seo"]]}) + __properties: ClassVar[List[str]] = ["url", "device", "followRedirect", "proxyCountry", "parameters"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LighthouseDto 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 LighthouseDto 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"), + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "followRedirect": obj.get("followRedirect") if obj.get("followRedirect") is not None else False, + "proxyCountry": obj.get("proxyCountry"), + "parameters": obj.get("parameters") + }) + return _obj + + diff --git a/geekflare_api/models/lighthouse_meta_dto.py b/geekflare_api/models/lighthouse_meta_dto.py new file mode 100644 index 0000000..0707e2b --- /dev/null +++ b/geekflare_api/models/lighthouse_meta_dto.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LighthouseMetaDto(BaseModel): + """ + LighthouseMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: StrictStr = Field(description="Device type used") + follow_redirect: StrictBool = Field(description="Whether redirects were followed", alias="followRedirect") + redirected_url: StrictStr = Field(description="Final URL after redirection (if any)", alias="redirectedURL", json_schema_extra={"examples": ["https://example.com/"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country used, if any", alias="proxyCountry") + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "device", "followRedirect", "redirectedURL", "proxyCountry", "test"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LighthouseMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LighthouseMetaDto 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"), + "device": obj.get("device"), + "followRedirect": obj.get("followRedirect"), + "redirectedURL": obj.get("redirectedURL"), + "proxyCountry": obj.get("proxyCountry"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/lighthouse_response_dto.py b/geekflare_api/models/lighthouse_response_dto.py new file mode 100644 index 0000000..12f3e05 --- /dev/null +++ b/geekflare_api/models/lighthouse_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.lighthouse_meta_dto import LighthouseMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LighthouseResponseDto(BaseModel): + """ + LighthouseResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: LighthouseMetaDto = Field(description="Metadata about the request") + data: StrictStr = Field(description="URL to the Lighthouse report", json_schema_extra={"examples": ["https://example.com/report.html"]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LighthouseResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LighthouseResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": LighthouseMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/load_time_data_dto.py b/geekflare_api/models/load_time_data_dto.py new file mode 100644 index 0000000..f520a60 --- /dev/null +++ b/geekflare_api/models/load_time_data_dto.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.network_dto import NetworkDto +from geekflare_api.models.protocol_support_dto import ProtocolSupportDto +from geekflare_api.models.timings_dto import TimingsDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LoadTimeDataDto(BaseModel): + """ + LoadTimeDataDto + """ # noqa: E501 + dns: Union[StrictFloat, StrictInt] = Field(description="Time spent in DNS lookup (ms)", json_schema_extra={"examples": [10]}) + connect: Union[StrictFloat, StrictInt] = Field(description="Time to establish TCP connection (ms)", json_schema_extra={"examples": [12]}) + tls: Union[StrictFloat, StrictInt] = Field(description="Time to complete TLS handshake (ms)", json_schema_extra={"examples": [9]}) + send: Union[StrictFloat, StrictInt] = Field(description="Time to send request (ms)", json_schema_extra={"examples": [19]}) + wait: Union[StrictFloat, StrictInt] = Field(description="Time waiting for response (ms)", json_schema_extra={"examples": [86]}) + total: Union[StrictFloat, StrictInt] = Field(description="Total load time (ms)", json_schema_extra={"examples": [88]}) + status_code: Union[StrictFloat, StrictInt] = Field(description="HTTP status code of the response", alias="statusCode", json_schema_extra={"examples": [404]}) + reason_phrase: StrictStr = Field(description="HTTP reason phrase", alias="reasonPhrase", json_schema_extra={"examples": ["Not Found"]}) + timings: TimingsDto = Field(description="Detailed timing breakdown") + network: NetworkDto = Field(description="Network information") + headers: Dict[str, Any] = Field(description="Response headers as key-value pairs", json_schema_extra={"examples": [{"server": "cloudflare", "content-type": "text/html; charset=utf-8", "cache-control": "no-cache"}]}) + protocol_support: ProtocolSupportDto = Field(description="HTTP protocol support information", alias="protocolSupport") + __properties: ClassVar[List[str]] = ["dns", "connect", "tls", "send", "wait", "total", "statusCode", "reasonPhrase", "timings", "network", "headers", "protocolSupport"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoadTimeDataDto 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 timings + if self.timings: + _dict['timings'] = self.timings.to_dict() + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict['network'] = self.network.to_dict() + # override the default output from pydantic by calling `to_dict()` of protocol_support + if self.protocol_support: + _dict['protocolSupport'] = self.protocol_support.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LoadTimeDataDto 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"), + "connect": obj.get("connect"), + "tls": obj.get("tls"), + "send": obj.get("send"), + "wait": obj.get("wait"), + "total": obj.get("total"), + "statusCode": obj.get("statusCode"), + "reasonPhrase": obj.get("reasonPhrase"), + "timings": TimingsDto.from_dict(obj["timings"]) if obj.get("timings") is not None else None, + "network": NetworkDto.from_dict(obj["network"]) if obj.get("network") is not None else None, + "headers": obj.get("headers"), + "protocolSupport": ProtocolSupportDto.from_dict(obj["protocolSupport"]) if obj.get("protocolSupport") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/load_time_dto.py b/geekflare_api/models/load_time_dto.py new file mode 100644 index 0000000..9c2a5ba --- /dev/null +++ b/geekflare_api/models/load_time_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class LoadTimeDto(BaseModel): + """ + LoadTimeDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + follow_redirect: Optional[StrictBool] = Field(default=False, description="Whether to follow redirects when checking site status", alias="followRedirect", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoadTimeDto 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 LoadTimeDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect") if obj.get("followRedirect") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/load_time_meta_dto.py b/geekflare_api/models/load_time_meta_dto.py new file mode 100644 index 0000000..ec11c7f --- /dev/null +++ b/geekflare_api/models/load_time_meta_dto.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LoadTimeMetaDto(BaseModel): + """ + LoadTimeMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The tested URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country used for the test", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + follow_redirect: Optional[StrictBool] = Field(default=None, description="Indicates if redirects were followed during the test", alias="followRedirect", json_schema_extra={"examples": [True]}) + redirected_url: StrictStr = Field(description="Final URL after redirection (if any)", alias="redirectedURL", json_schema_extra={"examples": ["https://example.com/"]}) + test: TestMetaDto = Field(description="Metadata about the test execution") + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect", "redirectedURL", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoadTimeMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LoadTimeMetaDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect"), + "redirectedURL": obj.get("redirectedURL"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/load_time_response_dto.py b/geekflare_api/models/load_time_response_dto.py new file mode 100644 index 0000000..c16731f --- /dev/null +++ b/geekflare_api/models/load_time_response_dto.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.load_time_data_dto import LoadTimeDataDto +from geekflare_api.models.load_time_meta_dto import LoadTimeMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LoadTimeResponseDto(BaseModel): + """ + LoadTimeResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: Optional[StrictStr] = Field(default=None, description="Overall message about site reachability", json_schema_extra={"examples": ["Site is reachable."]}) + meta: LoadTimeMetaDto = Field(description="Metadata about the load time test") + data: LoadTimeDataDto = Field(description="Comprehensive site load time metrics") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoadTimeResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LoadTimeResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message"), + "meta": LoadTimeMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": LoadTimeDataDto.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/margin_dto.py b/geekflare_api/models/margin_dto.py new file mode 100644 index 0000000..468a3f1 --- /dev/null +++ b/geekflare_api/models/margin_dto.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MarginDto(BaseModel): + """ + MarginDto + """ # noqa: E501 + top: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Top margin in mm", json_schema_extra={"examples": [25.4]}) + bottom: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Bottom margin in mm", json_schema_extra={"examples": [25.4]}) + right: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Right margin in mm", json_schema_extra={"examples": [25.4]}) + left: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Left margin in mm", json_schema_extra={"examples": [25.4]}) + __properties: ClassVar[List[str]] = ["top", "bottom", "right", "left"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MarginDto 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 MarginDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "top": obj.get("top"), + "bottom": obj.get("bottom"), + "right": obj.get("right"), + "left": obj.get("left") + }) + return _obj + + diff --git a/geekflare_api/models/meta_scrape_dto.py b/geekflare_api/models/meta_scrape_dto.py new file mode 100644 index 0000000..b0a69ab --- /dev/null +++ b/geekflare_api/models/meta_scrape_dto.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MetaScrapeDto(BaseModel): + """ + MetaScrapeDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: Optional[StrictStr] = Field(default='desktop', description="Device type to emulate. Defaults to desktop.", json_schema_extra={"examples": ["desktop"]}) + block_ads: Optional[StrictBool] = Field(default=True, description="Whether to block ads", alias="blockAds", json_schema_extra={"examples": [True]}) + render_js: Optional[StrictBool] = Field(default=True, description="Whether to render JavaScript", alias="renderJS", json_schema_extra={"examples": [True]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + format: Optional[StrictStr] = Field(default='json', description="Format of the scraped result. Defaults to html.", json_schema_extra={"examples": ["json"]}) + file_output: Optional[StrictBool] = Field(default=False, description="Whether to get response in file format", alias="fileOutput", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "device", "blockAds", "renderJS", "proxyCountry", "format", "fileOutput"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['markdown', 'json']): + raise ValueError("must be one of enum values ('markdown', 'json')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MetaScrapeDto 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 MetaScrapeDto 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"), + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "blockAds": obj.get("blockAds") if obj.get("blockAds") is not None else True, + "renderJS": obj.get("renderJS") if obj.get("renderJS") is not None else True, + "proxyCountry": obj.get("proxyCountry"), + "format": obj.get("format") if obj.get("format") is not None else 'json', + "fileOutput": obj.get("fileOutput") if obj.get("fileOutput") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/meta_scrape_meta_dto.py b/geekflare_api/models/meta_scrape_meta_dto.py new file mode 100644 index 0000000..233826c --- /dev/null +++ b/geekflare_api/models/meta_scrape_meta_dto.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MetaScrapeMetaDto(BaseModel): + """ + MetaScrapeMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL that was scraped", json_schema_extra={"examples": ["https://example.com"]}) + device: StrictStr = Field(description="Device type used", json_schema_extra={"examples": ["desktop"]}) + format: StrictStr = Field(description="Output format of the result", json_schema_extra={"examples": ["json"]}) + file_output: StrictBool = Field(description="Whether to get response in file format", alias="fileOutput", json_schema_extra={"examples": [False]}) + block_ads: StrictBool = Field(description="Whether ads were blocked", alias="blockAds", json_schema_extra={"examples": [True]}) + render_js: StrictBool = Field(description="Whether JavaScript was rendered", alias="renderJS", json_schema_extra={"examples": [True]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country used, if any", alias="proxyCountry") + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "device", "format", "fileOutput", "blockAds", "renderJS", "proxyCountry", "test"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['markdown', 'json']): + raise ValueError("must be one of enum values ('markdown', 'json')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MetaScrapeMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetaScrapeMetaDto 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"), + "device": obj.get("device"), + "format": obj.get("format"), + "fileOutput": obj.get("fileOutput"), + "blockAds": obj.get("blockAds"), + "renderJS": obj.get("renderJS"), + "proxyCountry": obj.get("proxyCountry"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/meta_scrape_response_dto.py b/geekflare_api/models/meta_scrape_response_dto.py new file mode 100644 index 0000000..72b64c2 --- /dev/null +++ b/geekflare_api/models/meta_scrape_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.meta_scrape_meta_dto import MetaScrapeMetaDto +from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MetaScrapeResponseDto(BaseModel): + """ + MetaScrapeResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: MetaScrapeMetaDto = Field(description="Metadata about the request") + data: MetaScrapeResponseDtoData + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MetaScrapeResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetaScrapeResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": MetaScrapeMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": MetaScrapeResponseDtoData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/meta_scrape_response_dto_data.py b/geekflare_api/models/meta_scrape_response_dto_data.py new file mode 100644 index 0000000..77b40be --- /dev/null +++ b/geekflare_api/models/meta_scrape_response_dto_data.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, List, Optional +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +METASCRAPERESPONSEDTODATA_ONE_OF_SCHEMAS = ["object", "str"] + +class MetaScrapeResponseDtoData(BaseModel): + """ + Scraped data (URL or inline content depending on output) + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = None + # data type: object + oneof_schema_2_validator: Optional[Dict[str, Any]] = None + actual_instance: Optional[Union[object, str]] = None + one_of_schemas: Set[str] = { "object", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = MetaScrapeResponseDtoData.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in MetaScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in MetaScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into MetaScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into MetaScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/geekflare_api/models/mixed_content_data_dto.py b/geekflare_api/models/mixed_content_data_dto.py new file mode 100644 index 0000000..028d7b8 --- /dev/null +++ b/geekflare_api/models/mixed_content_data_dto.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MixedContentDataDto(BaseModel): + """ + MixedContentDataDto + """ # noqa: E501 + insecure: List[StrictStr] = Field(description="List of insecure (HTTP) resources found on the page", json_schema_extra={"examples": [["http://example.com/style.css", "http://example.com/script.js"]]}) + secure: List[StrictStr] = Field(description="List of secure (HTTPS) resources found on the page", json_schema_extra={"examples": [["https://example.com/", "https://fonts.googleapis.com/css?family=Open+Sans", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0i..."]]}) + __properties: ClassVar[List[str]] = ["insecure", "secure"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MixedContentDataDto 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 MixedContentDataDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "insecure": obj.get("insecure"), + "secure": obj.get("secure") + }) + return _obj + + diff --git a/geekflare_api/models/mixed_content_dto.py b/geekflare_api/models/mixed_content_dto.py new file mode 100644 index 0000000..70e690d --- /dev/null +++ b/geekflare_api/models/mixed_content_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class MixedContentDto(BaseModel): + """ + MixedContentDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + follow_redirect: Optional[StrictBool] = Field(default=False, description="Whether to follow redirects when checking site status", alias="followRedirect", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MixedContentDto 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 MixedContentDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect") if obj.get("followRedirect") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/mixed_content_meta_dto.py b/geekflare_api/models/mixed_content_meta_dto.py new file mode 100644 index 0000000..85bbb90 --- /dev/null +++ b/geekflare_api/models/mixed_content_meta_dto.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MixedContentMetaDto(BaseModel): + """ + MixedContentMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The tested URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Country used for proxy", alias="proxyCountry", json_schema_extra={"examples": ["United States"]}) + follow_redirect: Optional[StrictBool] = Field(default=None, description="Indicates if redirects should be followed", alias="followRedirect", json_schema_extra={"examples": [True]}) + redirected_url: Optional[StrictStr] = Field(default=None, description="Final URL after redirection (if any)", alias="redirectedURL", json_schema_extra={"examples": ["https://example.com/"]}) + test: TestMetaDto = Field(description="Metadata about the test execution") + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect", "redirectedURL", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MixedContentMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MixedContentMetaDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect"), + "redirectedURL": obj.get("redirectedURL"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/mixed_content_response_dto.py b/geekflare_api/models/mixed_content_response_dto.py new file mode 100644 index 0000000..80bfd9c --- /dev/null +++ b/geekflare_api/models/mixed_content_response_dto.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.mixed_content_meta_dto import MixedContentMetaDto +from geekflare_api.models.mixed_content_response_dto_data import MixedContentResponseDtoData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MixedContentResponseDto(BaseModel): + """ + MixedContentResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: StrictStr = Field(description="Indicates whether mixed content found or not. It can either be \"Mixed content(s) found.\" or \"No mixed content found.\"", json_schema_extra={"examples": ["Mixed content(s) found."]}) + meta: MixedContentMetaDto = Field(description="Metadata about the mixed content test") + data: MixedContentResponseDtoData + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MixedContentResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MixedContentResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message"), + "meta": MixedContentMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": MixedContentResponseDtoData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/mixed_content_response_dto_data.py b/geekflare_api/models/mixed_content_response_dto_data.py new file mode 100644 index 0000000..6206fda --- /dev/null +++ b/geekflare_api/models/mixed_content_response_dto_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from geekflare_api.models.mixed_content_data_dto import MixedContentDataDto +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +MIXEDCONTENTRESPONSEDTODATA_ONE_OF_SCHEMAS = ["List[str]", "MixedContentDataDto"] + +class MixedContentResponseDtoData(BaseModel): + """ + Contains either an array of all resources (when no mixed content) or an object with insecure/secure arrays (when mixed content found) + """ + # data type: List[str] + oneof_schema_1_validator: Optional[List[StrictStr]] = Field(default=None, description="Simple array of all resources when no mixed content found", json_schema_extra={"examples": [["https://example.com/", "https://example.com/style.css", "https://example.com/script.js"]]}) + # data type: MixedContentDataDto + oneof_schema_2_validator: Optional[MixedContentDataDto] = Field(default=None, description="Object with insecure and secure arrays when mixed content found") + actual_instance: Optional[Union[List[str], MixedContentDataDto]] = None + one_of_schemas: Set[str] = { "List[str]", "MixedContentDataDto" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = MixedContentResponseDtoData.model_construct() + error_messages = [] + match = 0 + # validate data type: List[str] + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: MixedContentDataDto + if not isinstance(v, MixedContentDataDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `MixedContentDataDto`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in MixedContentResponseDtoData with oneOf schemas: List[str], MixedContentDataDto. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in MixedContentResponseDtoData with oneOf schemas: List[str], MixedContentDataDto. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into List[str] + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MixedContentDataDto + try: + instance.actual_instance = MixedContentDataDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into MixedContentResponseDtoData with oneOf schemas: List[str], MixedContentDataDto. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into MixedContentResponseDtoData with oneOf schemas: List[str], MixedContentDataDto. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], MixedContentDataDto]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/geekflare_api/models/mtr_data_dto.py b/geekflare_api/models/mtr_data_dto.py new file mode 100644 index 0000000..934015f --- /dev/null +++ b/geekflare_api/models/mtr_data_dto.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MtrDataDto(BaseModel): + """ + MtrDataDto + """ # noqa: E501 + hop: Union[StrictFloat, StrictInt] = Field(description="Hop number in the traceroute path", json_schema_extra={"examples": [1]}) + host: StrictStr = Field(description="Host IP or domain name at this hop", json_schema_extra={"examples": ["240.192.18.19"]}) + asn: StrictStr = Field(description="Autonomous System Number (ASN) for the host", json_schema_extra={"examples": ["AS???"]}) + loss: Union[StrictFloat, StrictInt] = Field(description="Packet loss percentage at this hop", json_schema_extra={"examples": [0]}) + sent: Union[StrictFloat, StrictInt] = Field(description="Number of packets sent to this hop", json_schema_extra={"examples": [2]}) + last: Union[StrictFloat, StrictInt] = Field(description="Last recorded round-trip time (RTT) in milliseconds", json_schema_extra={"examples": [0.28]}) + avg: Union[StrictFloat, StrictInt] = Field(description="Average RTT across packets", json_schema_extra={"examples": [0.29]}) + best: Union[StrictFloat, StrictInt] = Field(description="Best (lowest) RTT observed", json_schema_extra={"examples": [0.28]}) + worst: Union[StrictFloat, StrictInt] = Field(description="Worst (highest) RTT observed", json_schema_extra={"examples": [0.3]}) + std_dev: Union[StrictFloat, StrictInt] = Field(description="Standard deviation of RTT measurements", alias="stdDev", json_schema_extra={"examples": [0.01]}) + __properties: ClassVar[List[str]] = ["hop", "host", "asn", "loss", "sent", "last", "avg", "best", "worst", "stdDev"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MtrDataDto 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 MtrDataDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hop": obj.get("hop"), + "host": obj.get("host"), + "asn": obj.get("asn"), + "loss": obj.get("loss"), + "sent": obj.get("sent"), + "last": obj.get("last"), + "avg": obj.get("avg"), + "best": obj.get("best"), + "worst": obj.get("worst"), + "stdDev": obj.get("stdDev") + }) + return _obj + + diff --git a/geekflare_api/models/mtr_dto.py b/geekflare_api/models/mtr_dto.py new file mode 100644 index 0000000..924f5d3 --- /dev/null +++ b/geekflare_api/models/mtr_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class MtrDto(BaseModel): + """ + MtrDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + follow_redirect: Optional[StrictBool] = Field(default=False, description="Whether to follow redirects when checking site status", alias="followRedirect", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MtrDto 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 MtrDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect") if obj.get("followRedirect") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/mtr_meta_dto.py b/geekflare_api/models/mtr_meta_dto.py new file mode 100644 index 0000000..709dddd --- /dev/null +++ b/geekflare_api/models/mtr_meta_dto.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MtrMetaDto(BaseModel): + """ + MtrMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The tested URL or IP address", json_schema_extra={"examples": ["example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Country used for proxy", alias="proxyCountry", json_schema_extra={"examples": ["United States"]}) + follow_redirect: Optional[StrictBool] = Field(default=None, description="Indicates if redirects should be followed", alias="followRedirect", json_schema_extra={"examples": [True]}) + redirected_url: StrictStr = Field(description="Final URL after redirection (if any)", alias="redirectedURL", json_schema_extra={"examples": ["https://example.com/"]}) + test: TestMetaDto = Field(description="Metadata about the test execution") + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect", "redirectedURL", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MtrMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MtrMetaDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect"), + "redirectedURL": obj.get("redirectedURL"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/mtr_response_dto.py b/geekflare_api/models/mtr_response_dto.py new file mode 100644 index 0000000..5c07835 --- /dev/null +++ b/geekflare_api/models/mtr_response_dto.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.mtr_data_dto import MtrDataDto +from geekflare_api.models.mtr_meta_dto import MtrMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MtrResponseDto(BaseModel): + """ + MtrResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: MtrMetaDto = Field(description="Metadata about the MTR test execution") + data: List[MtrDataDto] = Field(description="Array of hop details observed in the MTR trace route", json_schema_extra={"examples": [[{"hop": 1, "host": "240.192.18.19", "asn": "AS???", "loss": 0, "sent": 2, "last": 0.28, "avg": 0.29, "best": 0.28, "worst": 0.3, "stdDev": 0.01}, {"hop": 2, "host": "240.0.60.49", "asn": "AS???", "loss": 0, "sent": 2, "last": 0.28, "avg": 0.29, "best": 0.28, "worst": 0.29, "stdDev": 0.01}]]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MtrResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MtrResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": MtrMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [MtrDataDto.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/network_dto.py b/geekflare_api/models/network_dto.py new file mode 100644 index 0000000..689da4d --- /dev/null +++ b/geekflare_api/models/network_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class NetworkDto(BaseModel): + """ + NetworkDto + """ # noqa: E501 + protocol: StrictStr = Field(description="The actual HTTP protocol used (e.g. h2, h3, http/1.1, http/1.0)", json_schema_extra={"examples": ["h2"]}) + remote_ip: Optional[StrictStr] = Field(default=None, description="Remote IP address of the server", alias="remoteIp", json_schema_extra={"examples": ["1.1.1.1"]}) + bytes_read: Union[StrictFloat, StrictInt] = Field(description="Total bytes read from the response", alias="bytesRead", json_schema_extra={"examples": [15400]}) + __properties: ClassVar[List[str]] = ["protocol", "remoteIp", "bytesRead"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkDto 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 NetworkDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "protocol": obj.get("protocol"), + "remoteIp": obj.get("remoteIp"), + "bytesRead": obj.get("bytesRead") + }) + return _obj + + diff --git a/geekflare_api/models/open_port_dto.py b/geekflare_api/models/open_port_dto.py new file mode 100644 index 0000000..a2f75e8 --- /dev/null +++ b/geekflare_api/models/open_port_dto.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OpenPortDto(BaseModel): + """ + OpenPortDto + """ # noqa: E501 + url: StrictStr = Field(description="The URL to be checked", json_schema_extra={"examples": ["https://example.com"]}) + top_ports: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Scan only the top N ports (optional)", alias="topPorts", json_schema_extra={"examples": [100]}) + port_ranges: Optional[StrictStr] = Field(default=None, description="Custom port ranges to scan, e.g., \"80,443,1000-1010\"", alias="portRanges", json_schema_extra={"examples": ["80,443,1000-1010"]}) + __properties: ClassVar[List[str]] = ["url", "topPorts", "portRanges"] + + @field_validator('top_ports') + def top_ports_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([50, 100, 500, 1000, 5000]): + raise ValueError("must be one of enum values (50, 100, 500, 1000, 5000)") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OpenPortDto 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 OpenPortDto 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"), + "topPorts": obj.get("topPorts"), + "portRanges": obj.get("portRanges") + }) + return _obj + + diff --git a/geekflare_api/models/open_port_meta_dto.py b/geekflare_api/models/open_port_meta_dto.py new file mode 100644 index 0000000..62dcf44 --- /dev/null +++ b/geekflare_api/models/open_port_meta_dto.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OpenPortMetaDto(BaseModel): + """ + OpenPortMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The scanned URL", json_schema_extra={"examples": ["https://example.com"]}) + top_ports: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Top ports scanned (if any)", alias="topPorts", json_schema_extra={"examples": [100]}) + port_ranges: Optional[StrictStr] = Field(default=None, description="Custom port ranges scanned (if any)", alias="portRanges", json_schema_extra={"examples": ["80,443,1000-1010"]}) + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "topPorts", "portRanges", "test"] + + @field_validator('top_ports') + def top_ports_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([50, 100, 500, 1000, 5000]): + raise ValueError("must be one of enum values (50, 100, 500, 1000, 5000)") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OpenPortMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OpenPortMetaDto 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"), + "topPorts": obj.get("topPorts"), + "portRanges": obj.get("portRanges"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/open_port_response_dto.py b/geekflare_api/models/open_port_response_dto.py new file mode 100644 index 0000000..a47e601 --- /dev/null +++ b/geekflare_api/models/open_port_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.open_port_meta_dto import OpenPortMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OpenPortResponseDto(BaseModel): + """ + OpenPortResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: OpenPortMetaDto = Field(description="Metadata about the request") + data: List[Union[StrictFloat, StrictInt]] = Field(description="List of open ports found") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OpenPortResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OpenPortResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": OpenPortMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/ping_data_dto.py b/geekflare_api/models/ping_data_dto.py new file mode 100644 index 0000000..02d8355 --- /dev/null +++ b/geekflare_api/models/ping_data_dto.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PingDataDto(BaseModel): + """ + PingDataDto + """ # noqa: E501 + requests: Union[StrictFloat, StrictInt] = Field(description="Number of ping requests sent", json_schema_extra={"examples": [4]}) + loss: Union[StrictFloat, StrictInt] = Field(description="Packet loss percentage", json_schema_extra={"examples": [0]}) + latency: Union[StrictFloat, StrictInt] = Field(description="Average latency in milliseconds", json_schema_extra={"examples": [32.5]}) + min: Union[StrictFloat, StrictInt] = Field(description="Minimum round-trip time (RTT) in milliseconds", json_schema_extra={"examples": [30]}) + max: Union[StrictFloat, StrictInt] = Field(description="Maximum round-trip time (RTT) in milliseconds", json_schema_extra={"examples": [35]}) + avg: Union[StrictFloat, StrictInt] = Field(description="Average round-trip time (RTT) in milliseconds", json_schema_extra={"examples": [32.5]}) + std_dev: Union[StrictFloat, StrictInt] = Field(description="Standard deviation of RTT in milliseconds", alias="stdDev", json_schema_extra={"examples": [1.5]}) + ip: StrictStr = Field(description="Resolved IP address of the tested domain", json_schema_extra={"examples": ["142.250.183.206"]}) + __properties: ClassVar[List[str]] = ["requests", "loss", "latency", "min", "max", "avg", "stdDev", "ip"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PingDataDto 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 PingDataDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requests": obj.get("requests"), + "loss": obj.get("loss"), + "latency": obj.get("latency"), + "min": obj.get("min"), + "max": obj.get("max"), + "avg": obj.get("avg"), + "stdDev": obj.get("stdDev"), + "ip": obj.get("ip") + }) + return _obj + + diff --git a/geekflare_api/models/ping_dto.py b/geekflare_api/models/ping_dto.py new file mode 100644 index 0000000..c853ad1 --- /dev/null +++ b/geekflare_api/models/ping_dto.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PingDto(BaseModel): + """ + PingDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PingDto 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 PingDto 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") + }) + return _obj + + diff --git a/geekflare_api/models/ping_meta_dto.py b/geekflare_api/models/ping_meta_dto.py new file mode 100644 index 0000000..de1565d --- /dev/null +++ b/geekflare_api/models/ping_meta_dto.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PingMetaDto(BaseModel): + """ + PingMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The tested URL or IP address", json_schema_extra={"examples": ["example.com"]}) + test: TestMetaDto = Field(description="Metadata about the test execution") + __properties: ClassVar[List[str]] = ["url", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PingMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PingMetaDto 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"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/ping_response_dto.py b/geekflare_api/models/ping_response_dto.py new file mode 100644 index 0000000..02fce3c --- /dev/null +++ b/geekflare_api/models/ping_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.ping_data_dto import PingDataDto +from geekflare_api.models.ping_meta_dto import PingMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PingResponseDto(BaseModel): + """ + PingResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: PingMetaDto = Field(description="Metadata about the Ping test execution") + data: PingDataDto = Field(description="Ping result statistics") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PingResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PingResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": PingMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": PingDataDto.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/protocol_support_dto.py b/geekflare_api/models/protocol_support_dto.py new file mode 100644 index 0000000..046912b --- /dev/null +++ b/geekflare_api/models/protocol_support_dto.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class ProtocolSupportDto(BaseModel): + """ + ProtocolSupportDto + """ # noqa: E501 + http10: StrictBool = Field(description="Whether HTTP/1.0 is supported", json_schema_extra={"examples": [False]}) + http11: StrictBool = Field(description="Whether HTTP/1.1 is supported", json_schema_extra={"examples": [True]}) + http2: StrictBool = Field(description="Whether HTTP/2 is supported", json_schema_extra={"examples": [True]}) + http3: StrictBool = Field(description="Whether HTTP/3 is supported", json_schema_extra={"examples": [False]}) + http3_supported_version: Optional[List[StrictStr]] = Field(default=None, description="HTTP/3 supported versions if available", alias="http3SupportedVersion", json_schema_extra={"examples": [["h3-29", "h3"]]}) + __properties: ClassVar[List[str]] = ["http10", "http11", "http2", "http3", "http3SupportedVersion"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProtocolSupportDto 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 ProtocolSupportDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "http10": obj.get("http10"), + "http11": obj.get("http11"), + "http2": obj.get("http2"), + "http3": obj.get("http3"), + "http3SupportedVersion": obj.get("http3SupportedVersion") + }) + return _obj + + diff --git a/geekflare_api/models/redirect_check_dto.py b/geekflare_api/models/redirect_check_dto.py new file mode 100644 index 0000000..962df54 --- /dev/null +++ b/geekflare_api/models/redirect_check_dto.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class RedirectCheckDto(BaseModel): + """ + RedirectCheckDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + __properties: ClassVar[List[str]] = ["url", "proxyCountry"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RedirectCheckDto 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 RedirectCheckDto 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"), + "proxyCountry": obj.get("proxyCountry") + }) + return _obj + + diff --git a/geekflare_api/models/redirect_check_meta_dto.py b/geekflare_api/models/redirect_check_meta_dto.py new file mode 100644 index 0000000..8f813b6 --- /dev/null +++ b/geekflare_api/models/redirect_check_meta_dto.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RedirectCheckMetaDto(BaseModel): + """ + RedirectCheckMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The original URL checked", json_schema_extra={"examples": ["example.com"]}) + proxy_country: Dict[str, Any] = Field(description="Proxy country used (if any)", alias="proxyCountry", json_schema_extra={"examples": ["US"]}) + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RedirectCheckMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RedirectCheckMetaDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/redirect_check_response_dto.py b/geekflare_api/models/redirect_check_response_dto.py new file mode 100644 index 0000000..9205533 --- /dev/null +++ b/geekflare_api/models/redirect_check_response_dto.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.redirect_check_meta_dto import RedirectCheckMetaDto +from geekflare_api.models.redirect_hop_dto import RedirectHopDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RedirectCheckResponseDto(BaseModel): + """ + RedirectCheckResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: RedirectCheckMetaDto = Field(description="Metadata about the redirection check.") + data: List[RedirectHopDto] = Field(description="List of redirection hops with status and headers.") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RedirectCheckResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RedirectCheckResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": RedirectCheckMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [RedirectHopDto.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/redirect_hop_dto.py b/geekflare_api/models/redirect_hop_dto.py new file mode 100644 index 0000000..72936a6 --- /dev/null +++ b/geekflare_api/models/redirect_hop_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RedirectHopDto(BaseModel): + """ + RedirectHopDto + """ # noqa: E501 + url: StrictStr = Field(description="The URL at this hop", json_schema_extra={"examples": ["http://example.com/"]}) + status: Union[StrictFloat, StrictInt] = Field(description="HTTP status code at this hop", json_schema_extra={"examples": [301]}) + headers: List[StrictStr] = Field(description="Response headers", json_schema_extra={"examples": [[{"name": "location", "value": "https://example.com/"}, {"name": "date", "value": "Mon, 29 Aug 2022 07:17:31 GMT"}]]}) + __properties: ClassVar[List[str]] = ["url", "status", "headers"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RedirectHopDto 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 RedirectHopDto 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"), + "status": obj.get("status"), + "headers": obj.get("headers") + }) + return _obj + + diff --git a/geekflare_api/models/screenshot_dto.py b/geekflare_api/models/screenshot_dto.py new file mode 100644 index 0000000..35d4e98 --- /dev/null +++ b/geekflare_api/models/screenshot_dto.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScreenshotDto(BaseModel): + """ + ScreenshotDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: Optional[StrictStr] = Field(default='desktop', description="Device type to emulate. Defaults to desktop.", json_schema_extra={"examples": ["desktop"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + type: Optional[StrictStr] = Field(default='png', description="File type of screenshot. Defaults to png.", json_schema_extra={"examples": ["png"]}) + full_page: Optional[StrictBool] = Field(default=False, description="Take full-page screenshot", alias="fullPage", json_schema_extra={"examples": [True]}) + block_ads: Optional[StrictBool] = Field(default=True, description="Block ads on the page", alias="blockAds", json_schema_extra={"examples": [True]}) + hide_cookie: Optional[StrictBool] = Field(default=True, description="Hide cookie popups", alias="hideCookie", json_schema_extra={"examples": [True]}) + skip_captcha: Optional[StrictBool] = Field(default=True, description="Try to bypass captcha", alias="skipCaptcha", json_schema_extra={"examples": [True]}) + add_timestamp: Optional[StrictBool] = Field(default=False, description="Add timestamp watermark", alias="addTimestamp", json_schema_extra={"examples": [True]}) + page_height: Optional[Union[Annotated[float, Field(le=5000, strict=True, ge=100)], Annotated[int, Field(le=5000, strict=True, ge=100)]]] = Field(default=None, description="Height of the page (for partial screenshot)", alias="pageHeight", json_schema_extra={"examples": [2000]}) + viewport_width: Optional[Union[Annotated[float, Field(le=3840, strict=True, ge=320)], Annotated[int, Field(le=3840, strict=True, ge=320)]]] = Field(default=None, description="Width of the viewport", alias="viewportWidth", json_schema_extra={"examples": [1280]}) + viewport_height: Optional[Union[Annotated[float, Field(le=2160, strict=True, ge=240)], Annotated[int, Field(le=2160, strict=True, ge=240)]]] = Field(default=None, description="Height of the viewport", alias="viewportHeight", json_schema_extra={"examples": [800]}) + theme: Optional[StrictStr] = Field(default='auto', description="Theme to use for rendering", json_schema_extra={"examples": ["auto"]}) + remove_background: Optional[StrictBool] = Field(default=None, description="Remove background from screenshot", alias="removeBackground", json_schema_extra={"examples": [False]}) + highlight_links: Optional[StrictBool] = Field(default=None, description="Highlight links on the page", alias="highlightLinks", json_schema_extra={"examples": [False]}) + delay: Optional[Union[Annotated[float, Field(le=10, strict=True, ge=0)], Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Delay before taking screenshot (in seconds)", json_schema_extra={"examples": [2]}) + disable_animations: Optional[StrictBool] = Field(default=None, description="Disable animations on the page", alias="disableAnimations", json_schema_extra={"examples": [False]}) + quality: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=10)], Annotated[int, Field(le=100, strict=True, ge=10)]]] = Field(default=None, description="Image quality (for JPEG/WEBP)", json_schema_extra={"examples": [90]}) + scale_factor: Optional[Union[Annotated[float, Field(le=5, strict=True, ge=0.1)], Annotated[int, Field(le=5, strict=True, ge=1)]]] = Field(default=None, description="Device scale factor", alias="scaleFactor", json_schema_extra={"examples": [1]}) + capture_beyond_viewport: Optional[StrictBool] = Field(default=None, description="Capture beyond viewport if possible", alias="captureBeyondViewport", json_schema_extra={"examples": [True]}) + __properties: ClassVar[List[str]] = ["url", "device", "proxyCountry", "type", "fullPage", "blockAds", "hideCookie", "skipCaptcha", "addTimestamp", "pageHeight", "viewportWidth", "viewportHeight", "theme", "removeBackground", "highlightLinks", "delay", "disableAnimations", "quality", "scaleFactor", "captureBeyondViewport"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['png', 'jpeg', 'webp']): + raise ValueError("must be one of enum values ('png', 'jpeg', 'webp')") + return value + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['light', 'dark', 'auto']): + raise ValueError("must be one of enum values ('light', 'dark', 'auto')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScreenshotDto 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 ScreenshotDto 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"), + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "proxyCountry": obj.get("proxyCountry"), + "type": obj.get("type") if obj.get("type") is not None else 'png', + "fullPage": obj.get("fullPage") if obj.get("fullPage") is not None else False, + "blockAds": obj.get("blockAds") if obj.get("blockAds") is not None else True, + "hideCookie": obj.get("hideCookie") if obj.get("hideCookie") is not None else True, + "skipCaptcha": obj.get("skipCaptcha") if obj.get("skipCaptcha") is not None else True, + "addTimestamp": obj.get("addTimestamp") if obj.get("addTimestamp") is not None else False, + "pageHeight": obj.get("pageHeight"), + "viewportWidth": obj.get("viewportWidth"), + "viewportHeight": obj.get("viewportHeight"), + "theme": obj.get("theme") if obj.get("theme") is not None else 'auto', + "removeBackground": obj.get("removeBackground"), + "highlightLinks": obj.get("highlightLinks"), + "delay": obj.get("delay"), + "disableAnimations": obj.get("disableAnimations"), + "quality": obj.get("quality"), + "scaleFactor": obj.get("scaleFactor"), + "captureBeyondViewport": obj.get("captureBeyondViewport") + }) + return _obj + + diff --git a/geekflare_api/models/screenshot_meta_dto.py b/geekflare_api/models/screenshot_meta_dto.py new file mode 100644 index 0000000..611f374 --- /dev/null +++ b/geekflare_api/models/screenshot_meta_dto.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScreenshotMetaDto(BaseModel): + """ + ScreenshotMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL that was captured", json_schema_extra={"examples": ["https://example.com"]}) + type: StrictStr = Field(description="File type of screenshot", json_schema_extra={"examples": ["png"]}) + device: StrictStr = Field(description="Device type used", json_schema_extra={"examples": ["desktop"]}) + full_page: StrictBool = Field(description="Whether full-page screenshot was taken", alias="fullPage", json_schema_extra={"examples": [False]}) + block_ads: StrictBool = Field(description="Whether ads were blocked", alias="blockAds", json_schema_extra={"examples": [False]}) + hide_cookie: StrictBool = Field(description="Whether cookie popups were hidden", alias="hideCookie", json_schema_extra={"examples": [False]}) + skip_captcha: StrictBool = Field(description="Whether captcha was bypassed", alias="skipCaptcha", json_schema_extra={"examples": [False]}) + add_timestamp: StrictBool = Field(description="Whether timestamp watermark was added", alias="addTimestamp", json_schema_extra={"examples": [False]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country used, if any", alias="proxyCountry") + page_height: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Height of the page", alias="pageHeight", json_schema_extra={"examples": [2000]}) + viewport_width: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Width of the viewport", alias="viewportWidth", json_schema_extra={"examples": [1280]}) + viewport_height: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Height of the viewport", alias="viewportHeight", json_schema_extra={"examples": [800]}) + theme: Optional[StrictStr] = Field(default=None, description="Theme used", json_schema_extra={"examples": ["auto"]}) + remove_background: Optional[StrictBool] = Field(default=None, description="Whether background was removed", alias="removeBackground", json_schema_extra={"examples": [False]}) + highlight_links: Optional[StrictBool] = Field(default=None, description="Whether links were highlighted", alias="highlightLinks", json_schema_extra={"examples": [False]}) + delay: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Delay before screenshot", json_schema_extra={"examples": [2]}) + disable_animations: Optional[StrictBool] = Field(default=None, description="Whether animations were disabled", alias="disableAnimations", json_schema_extra={"examples": [False]}) + quality: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Image quality (JPEG/WEBP)", json_schema_extra={"examples": [90]}) + scale_factor: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Device scale factor", alias="scaleFactor", json_schema_extra={"examples": [1]}) + capture_beyond_viewport: Optional[StrictBool] = Field(default=None, description="Capture beyond viewport", alias="captureBeyondViewport", json_schema_extra={"examples": [True]}) + test: TestMetaDto = Field(description="Test details") + __properties: ClassVar[List[str]] = ["url", "type", "device", "fullPage", "blockAds", "hideCookie", "skipCaptcha", "addTimestamp", "proxyCountry", "pageHeight", "viewportWidth", "viewportHeight", "theme", "removeBackground", "highlightLinks", "delay", "disableAnimations", "quality", "scaleFactor", "captureBeyondViewport", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScreenshotMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotMetaDto 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"), + "type": obj.get("type"), + "device": obj.get("device"), + "fullPage": obj.get("fullPage"), + "blockAds": obj.get("blockAds"), + "hideCookie": obj.get("hideCookie"), + "skipCaptcha": obj.get("skipCaptcha"), + "addTimestamp": obj.get("addTimestamp"), + "proxyCountry": obj.get("proxyCountry"), + "pageHeight": obj.get("pageHeight"), + "viewportWidth": obj.get("viewportWidth"), + "viewportHeight": obj.get("viewportHeight"), + "theme": obj.get("theme"), + "removeBackground": obj.get("removeBackground"), + "highlightLinks": obj.get("highlightLinks"), + "delay": obj.get("delay"), + "disableAnimations": obj.get("disableAnimations"), + "quality": obj.get("quality"), + "scaleFactor": obj.get("scaleFactor"), + "captureBeyondViewport": obj.get("captureBeyondViewport"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/screenshot_response_dto.py b/geekflare_api/models/screenshot_response_dto.py new file mode 100644 index 0000000..dfcfc6e --- /dev/null +++ b/geekflare_api/models/screenshot_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScreenshotResponseDto(BaseModel): + """ + ScreenshotResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: ScreenshotMetaDto = Field(description="Metadata about the request") + data: StrictStr = Field(description="Screenshot URL or base64 string", json_schema_extra={"examples": ["https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png"]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScreenshotResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": ScreenshotMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/search200_response.py b/geekflare_api/models/search200_response.py new file mode 100644 index 0000000..47b0775 --- /dev/null +++ b/geekflare_api/models/search200_response.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto +from geekflare_api.models.search_html_response_dto import SearchHtmlResponseDto +from geekflare_api.models.search_markdown_response_dto import SearchMarkdownResponseDto +from geekflare_api.models.search_response_dto import SearchResponseDto +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +SEARCH200RESPONSE_ONE_OF_SCHEMAS = ["ImageSearchResponseDto", "SearchHtmlResponseDto", "SearchMarkdownResponseDto", "SearchResponseDto"] + +class Search200Response(BaseModel): + """ + Search200Response + """ + # data type: SearchResponseDto + oneof_schema_1_validator: Optional[SearchResponseDto] = None + # data type: ImageSearchResponseDto + oneof_schema_2_validator: Optional[ImageSearchResponseDto] = None + # data type: SearchMarkdownResponseDto + oneof_schema_3_validator: Optional[SearchMarkdownResponseDto] = None + # data type: SearchHtmlResponseDto + oneof_schema_4_validator: Optional[SearchHtmlResponseDto] = None + actual_instance: Optional[Union[ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto]] = None + one_of_schemas: Set[str] = { "ImageSearchResponseDto", "SearchHtmlResponseDto", "SearchMarkdownResponseDto", "SearchResponseDto" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = Search200Response.model_construct() + error_messages = [] + match = 0 + # validate data type: SearchResponseDto + if not isinstance(v, SearchResponseDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `SearchResponseDto`") + else: + match += 1 + # validate data type: ImageSearchResponseDto + if not isinstance(v, ImageSearchResponseDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `ImageSearchResponseDto`") + else: + match += 1 + # validate data type: SearchMarkdownResponseDto + if not isinstance(v, SearchMarkdownResponseDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `SearchMarkdownResponseDto`") + else: + match += 1 + # validate data type: SearchHtmlResponseDto + if not isinstance(v, SearchHtmlResponseDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `SearchHtmlResponseDto`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into SearchResponseDto + try: + instance.actual_instance = SearchResponseDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ImageSearchResponseDto + try: + instance.actual_instance = ImageSearchResponseDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SearchMarkdownResponseDto + try: + instance.actual_instance = SearchMarkdownResponseDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SearchHtmlResponseDto + try: + instance.actual_instance = SearchHtmlResponseDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/geekflare_api/models/search_html_response_dto.py b/geekflare_api/models/search_html_response_dto.py new file mode 100644 index 0000000..0fa2cc2 --- /dev/null +++ b/geekflare_api/models/search_html_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.search_meta_dto import SearchMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchHtmlResponseDto(BaseModel): + """ + SearchHtmlResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: SearchMetaDto + data: Dict[str, Any] = Field(json_schema_extra={"examples": [""]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchHtmlResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchHtmlResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": SearchMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/search_markdown_response_dto.py b/geekflare_api/models/search_markdown_response_dto.py new file mode 100644 index 0000000..56eaa63 --- /dev/null +++ b/geekflare_api/models/search_markdown_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.search_meta_dto import SearchMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchMarkdownResponseDto(BaseModel): + """ + SearchMarkdownResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: SearchMetaDto + data: Dict[str, Any] = Field(json_schema_extra={"examples": ["1. [Title](https://example.com)\n - snippet"]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchMarkdownResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchMarkdownResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": SearchMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/search_meta_dto.py b/geekflare_api/models/search_meta_dto.py new file mode 100644 index 0000000..f4ea51d --- /dev/null +++ b/geekflare_api/models/search_meta_dto.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchMetaDto(BaseModel): + """ + SearchMetaDto + """ # noqa: E501 + query: StrictStr = Field(description="Original query", json_schema_extra={"examples": ["best running shoes"]}) + count: Union[StrictFloat, StrictInt] = Field(description="Number of results returned", json_schema_extra={"examples": [10]}) + source: List[StrictStr] = Field(description="Search source used", json_schema_extra={"examples": ["web"]}) + location: StrictStr = Field(description="Country used for ranking", json_schema_extra={"examples": ["us"]}) + time: StrictStr = Field(description="Time filter applied", json_schema_extra={"examples": ["d"]}) + scrape: StrictBool = Field(description="Whether URL scraping was enabled", json_schema_extra={"examples": [False]}) + scrape_limit: Union[StrictFloat, StrictInt] = Field(description="Number of URLs scraped", alias="scrapeLimit", json_schema_extra={"examples": [3]}) + test: TestMetaDto = Field(description="Test metadata") + __properties: ClassVar[List[str]] = ["query", "count", "source", "location", "time", "scrape", "scrapeLimit", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchMetaDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "query": obj.get("query"), + "count": obj.get("count"), + "source": obj.get("source"), + "location": obj.get("location"), + "time": obj.get("time"), + "scrape": obj.get("scrape"), + "scrapeLimit": obj.get("scrapeLimit"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/search_request_dto.py b/geekflare_api/models/search_request_dto.py new file mode 100644 index 0000000..0814dc8 --- /dev/null +++ b/geekflare_api/models/search_request_dto.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchRequestDto(BaseModel): + """ + SearchRequestDto + """ # noqa: E501 + query: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="Search query", json_schema_extra={"examples": ["best running shoes"]}) + limit: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]] = Field(default=10, description="Number of results", json_schema_extra={"examples": [10]}) + time: Optional[StrictStr] = Field(default='any', description="Time filter (h, d, w, m, y or h2, d7, etc.)", json_schema_extra={"examples": ["d"]}) + location: Optional[StrictStr] = Field(default='us', description="Country code (ISO alpha-2)", json_schema_extra={"examples": ["us"]}) + source: Optional[StrictStr] = Field(default='web', description="Search source", json_schema_extra={"examples": ["web"]}) + category: Optional[StrictStr] = Field(default='general', description="Category filter", json_schema_extra={"examples": ["code"]}) + include_domains: Optional[List[StrictStr]] = Field(default=None, description="Include only these domains", alias="includeDomains", json_schema_extra={"examples": [["reddit.com", "stackoverflow.com"]]}) + exclude_domains: Optional[List[StrictStr]] = Field(default=None, description="Exclude these domains", alias="excludeDomains", json_schema_extra={"examples": [["pinterest.com"]]}) + format: Optional[StrictStr] = Field(default='json', description="Output format") + scrape: Optional[StrictBool] = Field(default=False, description="scrape and extract content from SERP result URLs", json_schema_extra={"examples": [False]}) + scrape_limit: Optional[Union[Annotated[float, Field(le=10, strict=True, ge=1)], Annotated[int, Field(le=10, strict=True, ge=1)]]] = Field(default=3, description="Number of URLs to scrape (requires scrape: true)", alias="scrapeLimit", json_schema_extra={"examples": [3]}) + __properties: ClassVar[List[str]] = ["query", "limit", "time", "location", "source", "category", "includeDomains", "excludeDomains", "format", "scrape", "scrapeLimit"] + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['web', 'news', 'images']): + raise ValueError("must be one of enum values ('web', 'news', 'images')") + return value + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['general', 'code', 'pdf', 'research', 'linkedin', 'wiki']): + raise ValueError("must be one of enum values ('general', 'code', 'pdf', 'research', 'linkedin', 'wiki')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['json', 'markdown', 'html']): + raise ValueError("must be one of enum values ('json', 'markdown', 'html')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchRequestDto 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 SearchRequestDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "query": obj.get("query"), + "limit": obj.get("limit") if obj.get("limit") is not None else 10, + "time": obj.get("time") if obj.get("time") is not None else 'any', + "location": obj.get("location") if obj.get("location") is not None else 'us', + "source": obj.get("source") if obj.get("source") is not None else 'web', + "category": obj.get("category") if obj.get("category") is not None else 'general', + "includeDomains": obj.get("includeDomains"), + "excludeDomains": obj.get("excludeDomains"), + "format": obj.get("format") if obj.get("format") is not None else 'json', + "scrape": obj.get("scrape") if obj.get("scrape") is not None else False, + "scrapeLimit": obj.get("scrapeLimit") if obj.get("scrapeLimit") is not None else 3 + }) + return _obj + + diff --git a/geekflare_api/models/search_response_dto.py b/geekflare_api/models/search_response_dto.py new file mode 100644 index 0000000..d63d354 --- /dev/null +++ b/geekflare_api/models/search_response_dto.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.search_meta_dto import SearchMetaDto +from geekflare_api.models.search_result_item_dto import SearchResultItemDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchResponseDto(BaseModel): + """ + SearchResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: SearchMetaDto + data: List[SearchResultItemDto] + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": SearchMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [SearchResultItemDto.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/search_result_item_dto.py b/geekflare_api/models/search_result_item_dto.py new file mode 100644 index 0000000..bb19b96 --- /dev/null +++ b/geekflare_api/models/search_result_item_dto.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchResultItemDto(BaseModel): + """ + SearchResultItemDto + """ # noqa: E501 + title: StrictStr = Field(description="Result title", json_schema_extra={"examples": ["Best Running Shoes of 2025"]}) + url: StrictStr = Field(description="Canonical URL", json_schema_extra={"examples": ["https://example.com/running-shoes"]}) + snippet: StrictStr = Field(description="Clean snippet (ads/HTML removed)", json_schema_extra={"examples": ["We tested over 100 pairs to find the best running shoes..."]}) + var_date: Optional[StrictStr] = Field(default=None, description="Published date (if available)", alias="date", json_schema_extra={"examples": ["Dec 18, 2025"]}) + position: Union[StrictFloat, StrictInt] = Field(description="Rank position", json_schema_extra={"examples": [1]}) + content: Optional[Dict[str, Any]] = Field(default=None, description="Scraped cleaned HTML content from the result URL", json_schema_extra={"examples": ["Full article cleaned for LLM consumption..."]}) + __properties: ClassVar[List[str]] = ["title", "url", "snippet", "date", "position", "content"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchResultItemDto 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 SearchResultItemDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "url": obj.get("url"), + "snippet": obj.get("snippet"), + "date": obj.get("date"), + "position": obj.get("position"), + "content": obj.get("content") + }) + return _obj + + diff --git a/geekflare_api/models/selector_extraction_field_dto.py b/geekflare_api/models/selector_extraction_field_dto.py new file mode 100644 index 0000000..69f2bfa --- /dev/null +++ b/geekflare_api/models/selector_extraction_field_dto.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class SelectorExtractionFieldDto(BaseModel): + """ + SelectorExtractionFieldDto + """ # noqa: E501 + name: StrictStr = Field(description="Field name in the extracted JSON", json_schema_extra={"examples": ["title"]}) + selector: StrictStr = Field(description="Selector or XPath to extract value", json_schema_extra={"examples": ["h1.product-title"]}) + type: StrictStr = Field(description="Type of data to extract", json_schema_extra={"examples": ["text"]}) + attribute: Optional[StrictStr] = Field(default=None, description="If type=attr, specify attribute name", json_schema_extra={"examples": ["href"]}) + fields: Optional[List[SelectorExtractionFieldDto]] = Field(default=None, description="Nested fields") + __properties: ClassVar[List[str]] = ["name", "selector", "type", "attribute", "fields"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SelectorExtractionFieldDto 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 fields (list) + _items = [] + if self.fields: + for _item_fields in self.fields: + if _item_fields: + _items.append(_item_fields.to_dict()) + _dict['fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelectorExtractionFieldDto 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"), + "selector": obj.get("selector"), + "type": obj.get("type"), + "attribute": obj.get("attribute"), + "fields": [SelectorExtractionFieldDto.from_dict(_item) for _item in obj["fields"]] if obj.get("fields") is not None else None + }) + return _obj + +# TODO: Rewrite to not use raise_errors +SelectorExtractionFieldDto.model_rebuild(raise_errors=False) + diff --git a/geekflare_api/models/service_health_response_dto.py b/geekflare_api/models/service_health_response_dto.py new file mode 100644 index 0000000..f2ada53 --- /dev/null +++ b/geekflare_api/models/service_health_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.service_status import ServiceStatus +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ServiceHealthResponseDto(BaseModel): + """ + ServiceHealthResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: StrictStr = Field(description="Top-level message summarizing the overall health check", json_schema_extra={"examples": ["Service health check completed"]}) + services: List[ServiceStatus] = Field(description="Status of individual internal services") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message", "services"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceHealthResponseDto 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 services (list) + _items = [] + if self.services: + for _item_services in self.services: + if _item_services: + _items.append(_item_services.to_dict()) + _dict['services'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceHealthResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message"), + "services": [ServiceStatus.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/service_status.py b/geekflare_api/models/service_status.py new file mode 100644 index 0000000..0803848 --- /dev/null +++ b/geekflare_api/models/service_status.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ServiceStatus(BaseModel): + """ + ServiceStatus + """ # noqa: E501 + name: StrictStr = Field(description="Name of the service", json_schema_extra={"examples": ["r2"]}) + status: StrictStr = Field(description="Health status of the service (e.g., healthy, degraded, down)", json_schema_extra={"examples": ["healthy"]}) + message: StrictStr = Field(description="Additional info or error message if any", json_schema_extra={"examples": ["All systems operational"]}) + __properties: ClassVar[List[str]] = ["name", "status", "message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceStatus 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 ServiceStatus 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"), + "status": obj.get("status"), + "message": obj.get("message") + }) + return _obj + + diff --git a/geekflare_api/models/site_status_dto.py b/geekflare_api/models/site_status_dto.py new file mode 100644 index 0000000..f428f0a --- /dev/null +++ b/geekflare_api/models/site_status_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from pydantic_core import to_jsonable_python + +class SiteStatusDto(BaseModel): + """ + SiteStatusDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + follow_redirect: Optional[StrictBool] = Field(default=False, description="Whether to follow redirects when checking site status", alias="followRedirect", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "proxyCountry", "followRedirect"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SiteStatusDto 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 SiteStatusDto 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"), + "proxyCountry": obj.get("proxyCountry"), + "followRedirect": obj.get("followRedirect") if obj.get("followRedirect") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/site_status_meta_dto.py b/geekflare_api/models/site_status_meta_dto.py new file mode 100644 index 0000000..54f504c --- /dev/null +++ b/geekflare_api/models/site_status_meta_dto.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SiteStatusMetaDto(BaseModel): + """ + SiteStatusMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL checked", json_schema_extra={"examples": ["https://example.com"]}) + follow_redirect: StrictBool = Field(description="Whether redirects were followed", alias="followRedirect", json_schema_extra={"examples": [True]}) + redirected_url: Optional[Dict[str, Any]] = Field(default=None, description="Final redirected URL (if applicable)", alias="redirectedURL", json_schema_extra={"examples": ["https://www.example.com/home"]}) + proxy_country: StrictStr = Field(description="Proxy country used (if any)", alias="proxyCountry", json_schema_extra={"examples": ["US"]}) + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "followRedirect", "redirectedURL", "proxyCountry", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SiteStatusMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SiteStatusMetaDto 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"), + "followRedirect": obj.get("followRedirect"), + "redirectedURL": obj.get("redirectedURL"), + "proxyCountry": obj.get("proxyCountry"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/site_status_response_dto.py b/geekflare_api/models/site_status_response_dto.py new file mode 100644 index 0000000..3907f7a --- /dev/null +++ b/geekflare_api/models/site_status_response_dto.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.site_status_meta_dto import SiteStatusMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SiteStatusResponseDto(BaseModel): + """ + SiteStatusResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + message: StrictStr = Field(description="Indicates the current status of the site. It can either be \"Site is up\" or \"Unable to reach the URL.\"", json_schema_extra={"examples": ["Site is up"]}) + meta: SiteStatusMetaDto = Field(description="Metadata about the site status check.") + data: Dict[str, Any] = Field(description="HTTP status information from the site check.", json_schema_extra={"examples": [{"statusCode": 200, "reasonPhrase": "OK"}]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "message", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SiteStatusResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SiteStatusResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "message": obj.get("message"), + "meta": SiteStatusMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/test_meta_dto.py b/geekflare_api/models/test_meta_dto.py new file mode 100644 index 0000000..d0d753d --- /dev/null +++ b/geekflare_api/models/test_meta_dto.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TestMetaDto(BaseModel): + """ + TestMetaDto + """ # noqa: E501 + id: StrictStr = Field(description="Unique test identifier", json_schema_extra={"examples": ["mxqx9v9y0742lap6altwdteqd28t23nq"]}) + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestMetaDto 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 TestMetaDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id") + }) + return _obj + + diff --git a/geekflare_api/models/timings_dto.py b/geekflare_api/models/timings_dto.py new file mode 100644 index 0000000..916a179 --- /dev/null +++ b/geekflare_api/models/timings_dto.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TimingsDto(BaseModel): + """ + TimingsDto + """ # noqa: E501 + dns: Union[StrictFloat, StrictInt] = Field(description="Time spent in DNS lookup (ms)", json_schema_extra={"examples": [21]}) + connect: Union[StrictFloat, StrictInt] = Field(description="Time to establish TCP connection (ms)", json_schema_extra={"examples": [15]}) + tls: Union[StrictFloat, StrictInt] = Field(description="Time to complete TLS handshake (ms)", json_schema_extra={"examples": [40]}) + send: Union[StrictFloat, StrictInt] = Field(description="Time to send request (ms)", json_schema_extra={"examples": [1]}) + wait: Union[StrictFloat, StrictInt] = Field(description="Server processing time (ms)", json_schema_extra={"examples": [457]}) + ttfb: Union[StrictFloat, StrictInt] = Field(description="Time to First Byte - calculated as dns+connect+tls+send+wait (ms)", json_schema_extra={"examples": [534]}) + download: Union[StrictFloat, StrictInt] = Field(description="Time to download response body (ms)", json_schema_extra={"examples": [4]}) + total: Union[StrictFloat, StrictInt] = Field(description="Total load time (ms)", json_schema_extra={"examples": [538]}) + redirect_duration: Union[StrictFloat, StrictInt] = Field(description="Time spent in redirects before reaching final URL (ms)", alias="redirectDuration", json_schema_extra={"examples": [0]}) + __properties: ClassVar[List[str]] = ["dns", "connect", "tls", "send", "wait", "ttfb", "download", "total", "redirectDuration"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimingsDto 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 TimingsDto 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"), + "connect": obj.get("connect"), + "tls": obj.get("tls"), + "send": obj.get("send"), + "wait": obj.get("wait"), + "ttfb": obj.get("ttfb"), + "download": obj.get("download"), + "total": obj.get("total"), + "redirectDuration": obj.get("redirectDuration") + }) + return _obj + + diff --git a/geekflare_api/models/tls_certificate_dto.py b/geekflare_api/models/tls_certificate_dto.py new file mode 100644 index 0000000..7f9a0fd --- /dev/null +++ b/geekflare_api/models/tls_certificate_dto.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from geekflare_api.models.tls_certificate_issuer_dto import TlsCertificateIssuerDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsCertificateDto(BaseModel): + """ + TlsCertificateDto + """ # noqa: E501 + common_name: StrictStr = Field(description="Common name (CN) on the certificate", alias="commonName", json_schema_extra={"examples": ["sni.cloudflaressl.com"]}) + subject_alt_name: StrictStr = Field(description="Subject Alternative Names (SAN)", alias="subjectAltName", json_schema_extra={"examples": ["DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com"]}) + issuer: TlsCertificateIssuerDto = Field(description="Issuer details") + expiry: StrictStr = Field(description="Certificate expiry date", json_schema_extra={"examples": ["Jun 6 23:59:59 2023 GMT"]}) + __properties: ClassVar[List[str]] = ["commonName", "subjectAltName", "issuer", "expiry"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsCertificateDto 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 issuer + if self.issuer: + _dict['issuer'] = self.issuer.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TlsCertificateDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "commonName": obj.get("commonName"), + "subjectAltName": obj.get("subjectAltName"), + "issuer": TlsCertificateIssuerDto.from_dict(obj["issuer"]) if obj.get("issuer") is not None else None, + "expiry": obj.get("expiry") + }) + return _obj + + diff --git a/geekflare_api/models/tls_certificate_issuer_dto.py b/geekflare_api/models/tls_certificate_issuer_dto.py new file mode 100644 index 0000000..548940a --- /dev/null +++ b/geekflare_api/models/tls_certificate_issuer_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsCertificateIssuerDto(BaseModel): + """ + TlsCertificateIssuerDto + """ # noqa: E501 + country: StrictStr = Field(description="Issuer country", json_schema_extra={"examples": ["US"]}) + organization: StrictStr = Field(description="Issuer organization", json_schema_extra={"examples": ["Cloudflare, Inc."]}) + common_name: StrictStr = Field(description="Issuer common name", alias="commonName", json_schema_extra={"examples": ["Cloudflare Inc ECC CA-3"]}) + __properties: ClassVar[List[str]] = ["country", "organization", "commonName"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsCertificateIssuerDto 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 TlsCertificateIssuerDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "organization": obj.get("organization"), + "commonName": obj.get("commonName") + }) + return _obj + + diff --git a/geekflare_api/models/tls_protocols_dto.py b/geekflare_api/models/tls_protocols_dto.py new file mode 100644 index 0000000..1b5e0f5 --- /dev/null +++ b/geekflare_api/models/tls_protocols_dto.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsProtocolsDto(BaseModel): + """ + TlsProtocolsDto + """ # noqa: E501 + tls10: StrictBool = Field(description="Whether TLS 1.0 is supported", json_schema_extra={"examples": [False]}) + tls11: StrictBool = Field(description="Whether TLS 1.1 is supported", json_schema_extra={"examples": [False]}) + tls12: StrictBool = Field(description="Whether TLS 1.2 is supported", json_schema_extra={"examples": [True]}) + tls13: StrictBool = Field(description="Whether TLS 1.3 is supported", json_schema_extra={"examples": [True]}) + __properties: ClassVar[List[str]] = ["tls10", "tls11", "tls12", "tls13"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsProtocolsDto 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 TlsProtocolsDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tls10": obj.get("tls10"), + "tls11": obj.get("tls11"), + "tls12": obj.get("tls12"), + "tls13": obj.get("tls13") + }) + return _obj + + diff --git a/geekflare_api/models/tls_scan_data_dto.py b/geekflare_api/models/tls_scan_data_dto.py new file mode 100644 index 0000000..85594ee --- /dev/null +++ b/geekflare_api/models/tls_scan_data_dto.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Any, ClassVar, Dict, List +from geekflare_api.models.tls_certificate_dto import TlsCertificateDto +from geekflare_api.models.tls_protocols_dto import TlsProtocolsDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsScanDataDto(BaseModel): + """ + TlsScanDataDto + """ # noqa: E501 + protocols: TlsProtocolsDto = Field(description="Protocols supported") + certificate: TlsCertificateDto = Field(description="Certificate details") + __properties: ClassVar[List[str]] = ["protocols", "certificate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsScanDataDto 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 protocols + if self.protocols: + _dict['protocols'] = self.protocols.to_dict() + # override the default output from pydantic by calling `to_dict()` of certificate + if self.certificate: + _dict['certificate'] = self.certificate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TlsScanDataDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "protocols": TlsProtocolsDto.from_dict(obj["protocols"]) if obj.get("protocols") is not None else None, + "certificate": TlsCertificateDto.from_dict(obj["certificate"]) if obj.get("certificate") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/tls_scan_dto.py b/geekflare_api/models/tls_scan_dto.py new file mode 100644 index 0000000..b1d4cec --- /dev/null +++ b/geekflare_api/models/tls_scan_dto.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsScanDto(BaseModel): + """ + TlsScanDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsScanDto 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 TlsScanDto 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") + }) + return _obj + + diff --git a/geekflare_api/models/tls_scan_meta_dto.py b/geekflare_api/models/tls_scan_meta_dto.py new file mode 100644 index 0000000..bd101fb --- /dev/null +++ b/geekflare_api/models/tls_scan_meta_dto.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsScanMetaDto(BaseModel): + """ + TlsScanMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL checked for TLS support", json_schema_extra={"examples": ["example.com"]}) + test: TestMetaDto = Field(description="Test metadata object") + __properties: ClassVar[List[str]] = ["url", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsScanMetaDto 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 test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TlsScanMetaDto 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"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/tls_scan_response_dto.py b/geekflare_api/models/tls_scan_response_dto.py new file mode 100644 index 0000000..6680ea0 --- /dev/null +++ b/geekflare_api/models/tls_scan_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.tls_scan_data_dto import TlsScanDataDto +from geekflare_api.models.tls_scan_meta_dto import TlsScanMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TlsScanResponseDto(BaseModel): + """ + TlsScanResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: TlsScanMetaDto = Field(description="Metadata about the TLS scan request") + data: TlsScanDataDto = Field(description="TLS scan result data") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TlsScanResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TlsScanResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": TlsScanMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": TlsScanDataDto.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/url2_pdf_dto.py b/geekflare_api/models/url2_pdf_dto.py new file mode 100644 index 0000000..c351e7b --- /dev/null +++ b/geekflare_api/models/url2_pdf_dto.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.margin_dto import MarginDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Url2PdfDto(BaseModel): + """ + Url2PdfDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: Optional[StrictStr] = Field(default='desktop', description="Device type to emulate. Defaults to desktop.", json_schema_extra={"examples": ["desktop"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + format: Optional[StrictStr] = Field(default='a4', description="Paper format", json_schema_extra={"examples": ["a4"]}) + orientation: Optional[StrictStr] = Field(default='portrait', description="Orientation", json_schema_extra={"examples": ["portrait"]}) + margin: Optional[MarginDto] = Field(default=None, description="Margins in mm") + scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=1, description="Rendering scale between 0–2", json_schema_extra={"examples": [1.5]}) + hide_cookie: Optional[StrictBool] = Field(default=False, description="Hide cookie popups", alias="hideCookie", json_schema_extra={"examples": [False]}) + skip_captcha: Optional[StrictBool] = Field(default=False, description="Try to skip captcha", alias="skipCaptcha", json_schema_extra={"examples": [False]}) + add_timestamp: Optional[StrictBool] = Field(default=False, description="Add timestamp watermark", alias="addTimestamp", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "device", "proxyCountry", "format", "orientation", "margin", "scale", "hideCookie", "skipCaptcha", "addTimestamp"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['letter', 'legal', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6']): + raise ValueError("must be one of enum values ('letter', 'legal', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6')") + return value + + @field_validator('orientation') + def orientation_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['portrait', 'landscape']): + raise ValueError("must be one of enum values ('portrait', 'landscape')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Url2PdfDto 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 margin + if self.margin: + _dict['margin'] = self.margin.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Url2PdfDto 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"), + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "proxyCountry": obj.get("proxyCountry"), + "format": obj.get("format") if obj.get("format") is not None else 'a4', + "orientation": obj.get("orientation") if obj.get("orientation") is not None else 'portrait', + "margin": MarginDto.from_dict(obj["margin"]) if obj.get("margin") is not None else None, + "scale": obj.get("scale") if obj.get("scale") is not None else 1, + "hideCookie": obj.get("hideCookie") if obj.get("hideCookie") is not None else False, + "skipCaptcha": obj.get("skipCaptcha") if obj.get("skipCaptcha") is not None else False, + "addTimestamp": obj.get("addTimestamp") if obj.get("addTimestamp") is not None else False + }) + return _obj + + diff --git a/geekflare_api/models/url2_pdf_meta_dto.py b/geekflare_api/models/url2_pdf_meta_dto.py new file mode 100644 index 0000000..7330d6d --- /dev/null +++ b/geekflare_api/models/url2_pdf_meta_dto.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.margin_dto import MarginDto +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Url2PdfMetaDto(BaseModel): + """ + Url2PdfMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: StrictStr = Field(description="Device type used", json_schema_extra={"examples": ["desktop"]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country used, if any", alias="proxyCountry") + format: StrictStr = Field(description="Paper format", json_schema_extra={"examples": ["letter"]}) + orientation: StrictStr = Field(description="Orientation", json_schema_extra={"examples": ["landscape"]}) + margin: Optional[MarginDto] = Field(default=None, description="Margins in mm") + scale: Union[StrictFloat, StrictInt] = Field(description="Rendering scale", json_schema_extra={"examples": [1.5]}) + test: TestMetaDto = Field(description="Test details") + __properties: ClassVar[List[str]] = ["url", "device", "proxyCountry", "format", "orientation", "margin", "scale", "test"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Url2PdfMetaDto 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 margin + if self.margin: + _dict['margin'] = self.margin.to_dict() + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Url2PdfMetaDto 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"), + "device": obj.get("device"), + "proxyCountry": obj.get("proxyCountry"), + "format": obj.get("format"), + "orientation": obj.get("orientation"), + "margin": MarginDto.from_dict(obj["margin"]) if obj.get("margin") is not None else None, + "scale": obj.get("scale"), + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/url2_pdf_response_dto.py b/geekflare_api/models/url2_pdf_response_dto.py new file mode 100644 index 0000000..c29376b --- /dev/null +++ b/geekflare_api/models/url2_pdf_response_dto.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.url2_pdf_meta_dto import Url2PdfMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Url2PdfResponseDto(BaseModel): + """ + Url2PdfResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: Url2PdfMetaDto = Field(description="Metadata about the request") + data: StrictStr = Field(description="Generated PDF URL", json_schema_extra={"examples": ["https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf"]}) + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Url2PdfResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Url2PdfResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": Url2PdfMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": obj.get("data") + }) + return _obj + + diff --git a/geekflare_api/models/web_scrape_dto.py b/geekflare_api/models/web_scrape_dto.py new file mode 100644 index 0000000..8de372a --- /dev/null +++ b/geekflare_api/models/web_scrape_dto.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebScrapeDto(BaseModel): + """ + WebScrapeDto + """ # noqa: E501 + url: StrictStr = Field(description="Target URL", json_schema_extra={"examples": ["https://example.com"]}) + device: Optional[StrictStr] = Field(default='desktop', description="Device type to emulate. Defaults to desktop.", json_schema_extra={"examples": ["desktop"]}) + block_ads: Optional[StrictBool] = Field(default=True, description="Whether to block ads", alias="blockAds", json_schema_extra={"examples": [True]}) + render_js: Optional[StrictBool] = Field(default=True, description="Whether to render JavaScript", alias="renderJS", json_schema_extra={"examples": [True]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country code to route the request", alias="proxyCountry", json_schema_extra={"examples": ["us"]}) + format: Optional[List[StrictStr]] = Field(default=None, description="Format(s) of the scraped result. Comma-separated or array. Defaults to html.", json_schema_extra={"examples": ["html,markdown"]}) + file_output: Optional[StrictBool] = Field(default=False, description="Whether to get response in file format", alias="fileOutput", json_schema_extra={"examples": [False]}) + stealth: Optional[StrictBool] = Field(default=False, description="Enable stealth mode to bypass basic bot detection (removes webdriver signals, patches navigator properties)", json_schema_extra={"examples": [False]}) + wait_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=0, description="Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks.", alias="waitTime", json_schema_extra={"examples": [2.5]}) + extraction_mode: Optional[StrictStr] = Field(default='default', description="Extraction mode (only used if format=json)", alias="extractionMode", json_schema_extra={"examples": ["default"]}) + extraction_schema: Optional[ExtractionSchemaDto] = Field(default=None, description="Extraction schema (optional in default mode, required in css/xpath)", alias="extractionSchema") + __properties: ClassVar[List[str]] = ["url", "device", "blockAds", "renderJS", "proxyCountry", "format", "fileOutput", "stealth", "waitTime", "extractionMode", "extractionSchema"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'json', 'markdown-llm', 'html-llm', 'text', 'text-llm']): + raise ValueError("each list item must be one of ('html', 'markdown', 'json', 'markdown-llm', 'html-llm', 'text', 'text-llm')") + return value + + @field_validator('extraction_mode') + def extraction_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'cssSchema', 'xpathSchema']): + raise ValueError("must be one of enum values ('default', 'cssSchema', 'xpathSchema')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebScrapeDto 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 extraction_schema + if self.extraction_schema: + _dict['extractionSchema'] = self.extraction_schema.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebScrapeDto 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"), + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "blockAds": obj.get("blockAds") if obj.get("blockAds") is not None else True, + "renderJS": obj.get("renderJS") if obj.get("renderJS") is not None else True, + "proxyCountry": obj.get("proxyCountry"), + "format": obj.get("format"), + "fileOutput": obj.get("fileOutput") if obj.get("fileOutput") is not None else False, + "stealth": obj.get("stealth") if obj.get("stealth") is not None else False, + "waitTime": obj.get("waitTime") if obj.get("waitTime") is not None else 0, + "extractionMode": obj.get("extractionMode") if obj.get("extractionMode") is not None else 'default', + "extractionSchema": ExtractionSchemaDto.from_dict(obj["extractionSchema"]) if obj.get("extractionSchema") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/web_scrape_meta_dto.py b/geekflare_api/models/web_scrape_meta_dto.py new file mode 100644 index 0000000..5f0b675 --- /dev/null +++ b/geekflare_api/models/web_scrape_meta_dto.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto +from geekflare_api.models.test_meta_dto import TestMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebScrapeMetaDto(BaseModel): + """ + WebScrapeMetaDto + """ # noqa: E501 + url: StrictStr = Field(description="The target URL that was scraped", json_schema_extra={"examples": ["https://example.com"]}) + device: StrictStr = Field(description="Device type used", json_schema_extra={"examples": ["desktop"]}) + format: List[StrictStr] = Field(description="Output format(s) of the result", json_schema_extra={"examples": [["html-llm"]]}) + file_output: StrictBool = Field(description="Whether to get response in file format", alias="fileOutput", json_schema_extra={"examples": [False]}) + block_ads: StrictBool = Field(description="Whether ads were blocked", alias="blockAds", json_schema_extra={"examples": [True]}) + render_js: StrictBool = Field(description="Whether JavaScript was rendered", alias="renderJS", json_schema_extra={"examples": [True]}) + stealth: StrictBool = Field(description="Whether stealth mode was enabled", json_schema_extra={"examples": [False]}) + wait_time: Union[StrictFloat, StrictInt] = Field(description="Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks.", alias="waitTime", json_schema_extra={"examples": [2.5]}) + proxy_country: Optional[StrictStr] = Field(default=None, description="Proxy country used, if any", alias="proxyCountry") + extraction_mode: StrictStr = Field(description="Extraction mode (only used if format=json)", alias="extractionMode", json_schema_extra={"examples": ["default"]}) + extraction_schema: ExtractionSchemaDto = Field(description="Extraction schema (optional in default mode, required in css/xpath)", alias="extractionSchema") + test: TestMetaDto = Field(description="Test details object") + __properties: ClassVar[List[str]] = ["url", "device", "format", "fileOutput", "blockAds", "renderJS", "stealth", "waitTime", "proxyCountry", "extractionMode", "extractionSchema", "test"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['html', 'markdown', 'json', 'markdown-llm', 'html-llm', 'text', 'text-llm']): + raise ValueError("each list item must be one of ('html', 'markdown', 'json', 'markdown-llm', 'html-llm', 'text', 'text-llm')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebScrapeMetaDto 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 extraction_schema + if self.extraction_schema: + _dict['extractionSchema'] = self.extraction_schema.to_dict() + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebScrapeMetaDto 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"), + "device": obj.get("device"), + "format": obj.get("format"), + "fileOutput": obj.get("fileOutput"), + "blockAds": obj.get("blockAds"), + "renderJS": obj.get("renderJS"), + "stealth": obj.get("stealth"), + "waitTime": obj.get("waitTime") if obj.get("waitTime") is not None else 0, + "proxyCountry": obj.get("proxyCountry"), + "extractionMode": obj.get("extractionMode"), + "extractionSchema": ExtractionSchemaDto.from_dict(obj["extractionSchema"]) if obj.get("extractionSchema") is not None else None, + "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/web_scrape_response_dto.py b/geekflare_api/models/web_scrape_response_dto.py new file mode 100644 index 0000000..a55fc95 --- /dev/null +++ b/geekflare_api/models/web_scrape_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData +from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebScrapeResponseDto(BaseModel): + """ + WebScrapeResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: WebScrapeMetaDto = Field(description="Metadata about the request") + data: MetaScrapeResponseDtoData + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebScrapeResponseDto 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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebScrapeResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": WebScrapeMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": MetaScrapeResponseDtoData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/py.typed b/geekflare_api/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/geekflare_api/rest.py b/geekflare_api/rest.py new file mode 100644 index 0000000..5b0160b --- /dev/null +++ b/geekflare_api/rest.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 geekflare_api.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 + + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers + + def getheaders(self): + """Returns a dictionary of the response headers; use ``headers`` instead.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header; use ``headers.get()`` instead.""" + 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/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/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/openapi.json b/openapi.json new file mode 100644 index 0000000..61a1b33 --- /dev/null +++ b/openapi.json @@ -0,0 +1,4138 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Geekflare API", + "description": "Official OpenAPI specification for all Geekflare API endpoints.", + "version": "1.0.0", + "license": { "name": "MIT" } + }, + "servers": [{ "url": "https://api.geekflare.com" }], + "security": [ + { + "x-api-key": [] + } + ], + "paths": { + "/metascraping": { + "post": { + "operationId": "metaScrape", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetaScrapeDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully scraped webpage meta", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetaScrapeResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Scrape a webpage meta with custom options", + "tags": ["api-tool"] + } + }, + "/webscraping": { + "post": { + "operationId": "webScrape", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebScrapeDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully scraped webpage", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebScrapeResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Scrape a webpage with custom options", + "tags": ["api-tool"] + } + }, + "/dnsrecord": { + "post": { + "operationId": "dnsRecord", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DnsRecordDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully retrieved DNS records", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DnsRecordResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Retrieve DNS records for a given domain", + "tags": ["api-tool"] + } + }, + "/screenshot": { + "post": { + "operationId": "screenshot", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenshotDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully captured screenshot", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenshotResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (e.g. invalid URL or parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error while capturing screenshot", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Capture a full-page screenshot of a website", + "tags": ["api-tool"] + } + }, + "/up": { + "post": { + "operationId": "siteStatus", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SiteStatusDto" + } + } + } + }, + "responses": { + "200": { + "description": "Site status retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SiteStatusResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Check if a site is up or down", + "tags": ["api-tool"] + } + }, + "/redirectcheck": { + "post": { + "operationId": "redirectCheck", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedirectCheckDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully retrieved redirect chain", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedirectCheckResponseDto" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Check the redirection chain of a given URL", + "tags": ["api-tool"] + } + }, + "/brokenlink": { + "post": { + "operationId": "brokenLink", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BrokenLinkDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully checked for broken links", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BrokenLinkResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Check if a webpage contains broken links", + "tags": ["api-tool"] + } + }, + "/url2pdf": { + "post": { + "operationId": "url2Pdf", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Url2PdfDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully captured Url2Pdf", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Url2PdfResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (e.g. invalid URL or parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error while capturing Url2Pdf", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Capture a full-page Url2Pdf of a website", + "tags": ["api-tool"] + } + }, + "/openport": { + "post": { + "operationId": "openPorts", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenPortDto" + } + } + } + }, + "responses": { + "200": { + "description": "Open ports retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenPortResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Scan a website for open ports", + "tags": ["api-tool"] + } + }, + "/tlsscan": { + "post": { + "operationId": "tlsScan", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TlsScanDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully retrieved TLS scan information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TlsScanResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Perform TLS scan for a given domain", + "tags": ["api-tool"] + } + }, + "/loadtime": { + "post": { + "operationId": "loadTime", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoadTimeDto" + } + } + } + }, + "responses": { + "200": { + "description": "Load time retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoadTimeResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Measure the page load time for a given URL", + "tags": ["api-tool"] + } + }, + "/mixedcontent": { + "post": { + "operationId": "mixedContent", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MixedContentDto" + } + } + } + }, + "responses": { + "200": { + "description": "Site status retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MixedContentResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Check for mixed content on a site", + "tags": ["api-tool"] + } + }, + "/dnssec": { + "post": { + "operationId": "dnsSec", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DnsSecDto" + } + } + } + }, + "responses": { + "200": { + "description": "DNSSEC test result retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DnsSecResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Check if DNSSEC is enabled for a domain", + "tags": ["api-tool"] + } + }, + "/mtr": { + "post": { + "operationId": "mtr", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MtrDto" + } + } + } + }, + "responses": { + "200": { + "description": "MTR test completed successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MtrResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Perform MTR (My Traceroute) network diagnostic test", + "tags": ["api-tool"] + } + }, + "/ping": { + "post": { + "operationId": "ping", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PingDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ping test completed successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PingResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (invalid parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Perform ICMP Ping test on a given URL or IP", + "tags": ["api-tool"] + } + }, + "/lighthouse": { + "post": { + "operationId": "lighthouse", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LighthouseDto" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully ran Lighthouse audit", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LighthouseResponseDto" + } + } + } + }, + "400": { + "description": "Bad request (e.g. invalid URL or parameters)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error while running Lighthouse audit", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Run Lighthouse audit on a website", + "tags": ["api-tool"] + } + }, + "/search": { + "post": { + "description": "Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news.", + "operationId": "search", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Search results (format depends on request)", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SearchResponseDto" + }, + { + "$ref": "#/components/schemas/ImageSearchResponseDto" + }, + { + "$ref": "#/components/schemas/SearchMarkdownResponseDto" + }, + { + "$ref": "#/components/schemas/SearchHtmlResponseDto" + } + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseErrorResponseDto" + } + } + } + } + }, + "summary": "Search API for AI Agents & LLMs", + "tags": ["api-tool"] + } + } + }, + "components": { + "securitySchemes": { + "x-api-key": { + "type": "apiKey", + "in": "header", + "name": "x-api-key", + "description": "API Key required for all endpoints" + } + }, + "schemas": { + "MetaScrapeDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type to emulate. Defaults to desktop.", + "example": "desktop", + "enum": ["desktop", "mobile"], + "default": "desktop" + }, + "blockAds": { + "type": "boolean", + "description": "Whether to block ads", + "example": true, + "default": true + }, + "renderJS": { + "type": "boolean", + "description": "Whether to render JavaScript", + "example": true, + "default": true + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "format": { + "type": "string", + "description": "Format of the scraped result. Defaults to html.", + "example": "json", + "enum": ["markdown", "json"], + "default": "json" + }, + "fileOutput": { + "type": "boolean", + "description": "Whether to get response in file format", + "example": false, + "default": false + } + }, + "required": ["url"] + }, + "TestMetaDto": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique test identifier", + "example": "mxqx9v9y0742lap6altwdteqd28t23nq" + } + }, + "required": ["id"] + }, + "MetaScrapeMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL that was scraped", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type used", + "example": "desktop", + "enum": ["desktop", "mobile"] + }, + "format": { + "type": "string", + "description": "Output format of the result", + "example": "json", + "enum": ["markdown", "json"] + }, + "fileOutput": { + "type": "boolean", + "description": "Whether to get response in file format", + "example": false + }, + "blockAds": { + "type": "boolean", + "description": "Whether ads were blocked", + "example": true + }, + "renderJS": { + "type": "boolean", + "description": "Whether JavaScript was rendered", + "example": true + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used, if any" + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": [ + "url", + "device", + "format", + "fileOutput", + "blockAds", + "renderJS", + "test" + ] + }, + "MetaScrapeResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request", + "allOf": [ + { + "$ref": "#/components/schemas/MetaScrapeMetaDto" + } + ] + }, + "data": { + "description": "Scraped data (URL or inline content depending on output)", + "example": "https://example.com/9bulgk075ed9m3vhua5vcrp0.html", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "BaseErrorResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Error message", + "example": "Invalid URL provided" + }, + "details": { + "type": "string", + "description": "Detailed error information", + "example": "The URL must be a valid HTTP or HTTPS URL" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "message"] + }, + "DefaultExtractionFieldDto": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Title/key of the extracted field", + "example": "Product Name" + }, + "value": { + "type": "object", + "description": "Static value to assign to this field", + "example": "Some hardcoded string" + } + }, + "required": ["title", "value"] + }, + "SelectorExtractionFieldDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Field name in the extracted JSON", + "example": "title" + }, + "selector": { + "type": "string", + "description": "Selector or XPath to extract value", + "example": "h1.product-title" + }, + "type": { + "type": "string", + "description": "Type of data to extract", + "example": "text" + }, + "attribute": { + "type": "string", + "description": "If type=attr, specify attribute name", + "example": "href" + }, + "fields": { + "description": "Nested fields", + "type": "array", + "items": { + "$ref": "#/components/schemas/SelectorExtractionFieldDto" + } + } + }, + "required": ["name", "selector", "type"] + }, + "ExtractionSchemaDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name/Label for this extraction schema", + "example": "Product Schema" + }, + "baseSelector": { + "type": "string", + "description": "Base selector for scoping extraction (css/xpath only)", + "example": ".product" + }, + "fields": { + "type": "array", + "description": "List of fields to extract", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DefaultExtractionFieldDto" + }, + { + "$ref": "#/components/schemas/SelectorExtractionFieldDto" + } + ] + } + } + }, + "required": ["name", "fields"] + }, + "WebScrapeDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type to emulate. Defaults to desktop.", + "example": "desktop", + "enum": ["desktop", "mobile"], + "default": "desktop" + }, + "blockAds": { + "type": "boolean", + "description": "Whether to block ads", + "example": true, + "default": true + }, + "renderJS": { + "type": "boolean", + "description": "Whether to render JavaScript", + "example": true, + "default": true + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "format": { + "type": "array", + "description": "Format(s) of the scraped result. Comma-separated or array. Defaults to html.", + "example": "html,markdown", + "default": ["html-llm"], + "items": { + "type": "string", + "enum": [ + "html", + "markdown", + "json", + "markdown-llm", + "html-llm", + "text", + "text-llm" + ] + } + }, + "fileOutput": { + "type": "boolean", + "description": "Whether to get response in file format", + "example": false, + "default": false + }, + "stealth": { + "type": "boolean", + "description": "Enable stealth mode to bypass basic bot detection (removes webdriver signals, patches navigator properties)", + "example": false, + "default": false + }, + "waitTime": { + "type": "number", + "description": "Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks.", + "example": 2.5, + "default": 0 + }, + "extractionMode": { + "type": "string", + "description": "Extraction mode (only used if format=json)", + "example": "default", + "enum": ["default", "cssSchema", "xpathSchema"], + "default": "default" + }, + "extractionSchema": { + "description": "Extraction schema (optional in default mode, required in css/xpath)", + "examples": { + "default": { + "summary": "Default Mode Schema", + "value": { + "name": "Quick Fields", + "fields": [ + { + "title": "Category", + "value": "Electronics" + }, + { + "title": "Country", + "value": "India" + } + ] + } + }, + "cssSchema": { + "summary": "CSS Schema", + "value": { + "name": "Product Schema", + "baseSelector": ".product", + "fields": [ + { + "name": "title", + "selector": "h1.product-title", + "type": "text" + }, + { + "name": "price", + "selector": ".price", + "type": "text" + } + ] + } + }, + "xpathSchema": { + "summary": "XPath Schema", + "value": { + "name": "Article Schema", + "baseSelector": "//div[@class='article']", + "fields": [ + { + "name": "title", + "selector": "//h1/text()", + "type": "text" + } + ] + } + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/ExtractionSchemaDto" + } + ] + } + }, + "required": ["url"] + }, + "WebScrapeMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL that was scraped", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type used", + "example": "desktop", + "enum": ["desktop", "mobile"] + }, + "format": { + "type": "array", + "description": "Output format(s) of the result", + "example": ["html-llm"], + "items": { + "type": "string", + "enum": [ + "html", + "markdown", + "json", + "markdown-llm", + "html-llm", + "text", + "text-llm" + ] + } + }, + "fileOutput": { + "type": "boolean", + "description": "Whether to get response in file format", + "example": false + }, + "blockAds": { + "type": "boolean", + "description": "Whether ads were blocked", + "example": true + }, + "renderJS": { + "type": "boolean", + "description": "Whether JavaScript was rendered", + "example": true + }, + "stealth": { + "type": "boolean", + "description": "Whether stealth mode was enabled", + "example": false + }, + "waitTime": { + "type": "number", + "description": "Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks.", + "example": 2.5, + "default": 0 + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used, if any" + }, + "extractionMode": { + "type": "string", + "description": "Extraction mode (only used if format=json)", + "example": "default" + }, + "extractionSchema": { + "description": "Extraction schema (optional in default mode, required in css/xpath)", + "examples": { + "default": { + "summary": "Default Mode Schema", + "value": { + "name": "Quick Fields", + "fields": [ + { + "title": "Category", + "value": "Electronics" + }, + { + "title": "Country", + "value": "India" + } + ] + } + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/ExtractionSchemaDto" + } + ] + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": [ + "url", + "device", + "format", + "fileOutput", + "blockAds", + "renderJS", + "stealth", + "waitTime", + "extractionMode", + "extractionSchema", + "test" + ] + }, + "WebScrapeResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request", + "allOf": [ + { + "$ref": "#/components/schemas/WebScrapeMetaDto" + } + ] + }, + "data": { + "description": "Scraped data (URL or inline content depending on output)", + "example": "https://example.com/9bulgk075ed9m3vhua5vcrp0.html", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "DnsRecordDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "types": { + "type": "array", + "description": "List of DNS record types to query. If omitted, all supported types will be returned.", + "example": ["A", "MX"], + "items": { + "type": "string", + "enum": [ + "A", + "AAAA", + "CNAME", + "MX", + "CAA", + "NS", + "SOA", + "SRV", + "TXT" + ] + } + } + }, + "required": ["url"] + }, + "DnsMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL that was scraped", + "example": "https://example.com" + }, + "types": { + "type": "string", + "description": "List of DNS record types to query. If omitted, all supported types will be returned.", + "example": ["A", "MX"], + "enum": [ + "A", + "AAAA", + "CNAME", + "MX", + "CAA", + "NS", + "SOA", + "SRV", + "TXT" + ] + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "types", "test"] + }, + "DnsRecordResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request.", + "example": { + "url": "example.com", + "types": ["A", "MX"], + "test": { + "id": "zmkqoxxu075dwn4u61yoqhq2rwo0029m" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/DnsMetaDto" + } + ] + }, + "data": { + "type": "object", + "description": "DNS records grouped by type.", + "example": { + "A": ["172.67.70.213", "104.26.11.88", "104.26.10.88"], + "MX": [ + { + "exchange": "alt3.aspmx.l.google.com", + "priority": 10 + }, + { + "exchange": "aspmx.l.google.com", + "priority": 1 + } + ] + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "ScreenshotDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type to emulate. Defaults to desktop.", + "example": "desktop", + "enum": ["desktop", "mobile"], + "default": "desktop" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "type": { + "type": "string", + "description": "File type of screenshot. Defaults to png.", + "example": "png", + "enum": ["png", "jpeg", "webp"], + "default": "png" + }, + "fullPage": { + "type": "boolean", + "description": "Take full-page screenshot", + "example": true, + "default": false + }, + "blockAds": { + "type": "boolean", + "description": "Block ads on the page", + "example": true, + "default": true + }, + "hideCookie": { + "type": "boolean", + "description": "Hide cookie popups", + "example": true, + "default": true + }, + "skipCaptcha": { + "type": "boolean", + "description": "Try to bypass captcha", + "example": true, + "default": true + }, + "addTimestamp": { + "type": "boolean", + "description": "Add timestamp watermark", + "example": true, + "default": false + }, + "pageHeight": { + "type": "number", + "description": "Height of the page (for partial screenshot)", + "example": 2000, + "minimum": 100, + "maximum": 5000 + }, + "viewportWidth": { + "type": "number", + "description": "Width of the viewport", + "example": 1280, + "minimum": 320, + "maximum": 3840 + }, + "viewportHeight": { + "type": "number", + "description": "Height of the viewport", + "example": 800, + "minimum": 240, + "maximum": 2160 + }, + "theme": { + "type": "string", + "description": "Theme to use for rendering", + "example": "auto", + "enum": ["light", "dark", "auto"], + "default": "auto" + }, + "removeBackground": { + "type": "boolean", + "description": "Remove background from screenshot", + "example": false + }, + "highlightLinks": { + "type": "boolean", + "description": "Highlight links on the page", + "example": false + }, + "delay": { + "type": "number", + "description": "Delay before taking screenshot (in seconds)", + "example": 2, + "minimum": 0, + "maximum": 10 + }, + "disableAnimations": { + "type": "boolean", + "description": "Disable animations on the page", + "example": false + }, + "quality": { + "type": "number", + "description": "Image quality (for JPEG/WEBP)", + "example": 90, + "minimum": 10, + "maximum": 100 + }, + "scaleFactor": { + "type": "number", + "description": "Device scale factor", + "example": 1, + "minimum": 0.1, + "maximum": 5 + }, + "captureBeyondViewport": { + "type": "boolean", + "description": "Capture beyond viewport if possible", + "example": true + } + }, + "required": ["url"] + }, + "ScreenshotMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL that was captured", + "example": "https://example.com" + }, + "type": { + "type": "string", + "description": "File type of screenshot", + "example": "png" + }, + "device": { + "type": "string", + "description": "Device type used", + "example": "desktop" + }, + "fullPage": { + "type": "boolean", + "description": "Whether full-page screenshot was taken", + "example": false + }, + "blockAds": { + "type": "boolean", + "description": "Whether ads were blocked", + "example": false + }, + "hideCookie": { + "type": "boolean", + "description": "Whether cookie popups were hidden", + "example": false + }, + "skipCaptcha": { + "type": "boolean", + "description": "Whether captcha was bypassed", + "example": false + }, + "addTimestamp": { + "type": "boolean", + "description": "Whether timestamp watermark was added", + "example": false + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used, if any" + }, + "pageHeight": { + "type": "number", + "description": "Height of the page", + "example": 2000 + }, + "viewportWidth": { + "type": "number", + "description": "Width of the viewport", + "example": 1280 + }, + "viewportHeight": { + "type": "number", + "description": "Height of the viewport", + "example": 800 + }, + "theme": { + "type": "string", + "description": "Theme used", + "example": "auto" + }, + "removeBackground": { + "type": "boolean", + "description": "Whether background was removed", + "example": false + }, + "highlightLinks": { + "type": "boolean", + "description": "Whether links were highlighted", + "example": false + }, + "delay": { + "type": "number", + "description": "Delay before screenshot", + "example": 2 + }, + "disableAnimations": { + "type": "boolean", + "description": "Whether animations were disabled", + "example": false + }, + "quality": { + "type": "number", + "description": "Image quality (JPEG/WEBP)", + "example": 90 + }, + "scaleFactor": { + "type": "number", + "description": "Device scale factor", + "example": 1 + }, + "captureBeyondViewport": { + "type": "boolean", + "description": "Capture beyond viewport", + "example": true + }, + "test": { + "description": "Test details", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": [ + "url", + "type", + "device", + "fullPage", + "blockAds", + "hideCookie", + "skipCaptcha", + "addTimestamp", + "test" + ] + }, + "ScreenshotResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request", + "allOf": [ + { + "$ref": "#/components/schemas/ScreenshotMetaDto" + } + ] + }, + "data": { + "type": "string", + "description": "Screenshot URL or base64 string", + "example": "https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "SiteStatusDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether to follow redirects when checking site status", + "example": false, + "default": false + } + }, + "required": ["url"] + }, + "SiteStatusMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL checked", + "example": "https://example.com" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether redirects were followed", + "example": true + }, + "redirectedURL": { + "type": "object", + "description": "Final redirected URL (if applicable)", + "example": "https://www.example.com/home" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used (if any)", + "example": "US" + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "followRedirect", "proxyCountry", "test"] + }, + "SiteStatusResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Indicates the current status of the site. It can either be \"Site is up\" or \"Unable to reach the URL.\"", + "example": "Site is up" + }, + "meta": { + "description": "Metadata about the site status check.", + "example": { + "url": "example.com", + "proxyCountry": "US", + "followRedirect": true, + "redirectedURL": "https://www.example.com", + "test": { + "id": "zmkqoxxu075dwn4u61yoqhq2rwo0029m" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/SiteStatusMetaDto" + } + ] + }, + "data": { + "type": "object", + "description": "HTTP status information from the site check.", + "example": { + "statusCode": 200, + "reasonPhrase": "OK" + } + } + }, + "required": [ + "timestamp", + "apiStatus", + "apiCode", + "message", + "meta", + "data" + ] + }, + "RedirectCheckDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + } + }, + "required": ["url"] + }, + "RedirectCheckMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The original URL checked", + "example": "example.com" + }, + "proxyCountry": { + "type": "object", + "description": "Proxy country used (if any)", + "example": "US" + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "proxyCountry", "test"] + }, + "RedirectHopDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The URL at this hop", + "example": "http://example.com/" + }, + "status": { + "type": "number", + "description": "HTTP status code at this hop", + "example": 301 + }, + "headers": { + "description": "Response headers", + "example": [ + { + "name": "location", + "value": "https://example.com/" + }, + { + "name": "date", + "value": "Mon, 29 Aug 2022 07:17:31 GMT" + } + ], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["url", "status", "headers"] + }, + "RedirectCheckResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the redirection check.", + "example": { + "url": "example.com", + "proxyCountry": "United States", + "test": { + "id": "667zexrk0aaiabz2rx95b2cxm0khc2s0" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/RedirectCheckMetaDto" + } + ] + }, + "data": { + "description": "List of redirection hops with status and headers.", + "type": "array", + "items": { + "$ref": "#/components/schemas/RedirectHopDto" + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "BrokenLinkDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether to follow redirects when checking site status", + "example": false, + "default": false + } + }, + "required": ["url"] + }, + "BrokenLinkMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL checked for broken links", + "example": "example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used for this request", + "example": "United States" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether redirection was followed", + "example": true + }, + "redirectedURL": { + "type": "string", + "description": "Final URL after redirection (if any)", + "example": "https://example.com/" + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": [ + "url", + "proxyCountry", + "followRedirect", + "redirectedURL", + "test" + ] + }, + "BrokenLinkSummaryDto": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of links checked", + "example": 5 + }, + "successful": { + "type": "number", + "description": "Number of successful links (2xx status codes)", + "example": 2 + }, + "redirects": { + "type": "number", + "description": "Number of redirect links (3xx status codes)", + "example": 2 + }, + "broken": { + "type": "number", + "description": "Number of broken links (4xx status codes and DNS/network failures)", + "example": 1 + }, + "serverError": { + "type": "number", + "description": "Number of server errors (5xx status codes)", + "example": 0 + } + }, + "required": [ + "total", + "successful", + "redirects", + "broken", + "serverError" + ] + }, + "BrokenLinkResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Human-readable message about the broken link scan result", + "example": "No broken links found." + }, + "meta": { + "description": "Metadata about the broken link request", + "example": { + "url": "example.com", + "proxyCountry": "United States", + "followRedirect": true, + "redirectedURL": "https://example.com/", + "test": { + "id": "wf0b7yrn05br8xtwple7ngj7hhxzvl2e" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/BrokenLinkMetaDto" + } + ] + }, + "summary": { + "description": "Summary of link check results categorized by status", + "example": { + "total": 5, + "successful": 2, + "redirects": 2, + "broken": 1, + "serverError": 0 + }, + "allOf": [ + { + "$ref": "#/components/schemas/BrokenLinkSummaryDto" + } + ] + }, + "data": { + "description": "List of links found on the page and their HTTP status", + "example": [ + { + "link": "https://example.com/", + "status": 200 + }, + { + "link": "https://example.com/articles", + "status": 200 + } + ], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "timestamp", + "apiStatus", + "apiCode", + "message", + "meta", + "summary", + "data" + ] + }, + "MarginDto": { + "type": "object", + "properties": { + "top": { + "type": "number", + "description": "Top margin in mm", + "example": 25.4 + }, + "bottom": { + "type": "number", + "description": "Bottom margin in mm", + "example": 25.4 + }, + "right": { + "type": "number", + "description": "Right margin in mm", + "example": 25.4 + }, + "left": { + "type": "number", + "description": "Left margin in mm", + "example": 25.4 + } + } + }, + "Url2PdfDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type to emulate. Defaults to desktop.", + "example": "desktop", + "enum": ["desktop", "mobile"], + "default": "desktop" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "format": { + "type": "string", + "description": "Paper format", + "example": "a4", + "enum": [ + "letter", + "legal", + "a0", + "a1", + "a2", + "a3", + "a4", + "a5", + "a6" + ], + "default": "a4" + }, + "orientation": { + "type": "string", + "description": "Orientation", + "example": "portrait", + "enum": ["portrait", "landscape"], + "default": "portrait" + }, + "margin": { + "description": "Margins in mm", + "allOf": [ + { + "$ref": "#/components/schemas/MarginDto" + } + ] + }, + "scale": { + "type": "number", + "description": "Rendering scale between 0–2", + "example": 1.5, + "default": 1 + }, + "hideCookie": { + "type": "boolean", + "description": "Hide cookie popups", + "example": false, + "default": false + }, + "skipCaptcha": { + "type": "boolean", + "description": "Try to skip captcha", + "example": false, + "default": false + }, + "addTimestamp": { + "type": "boolean", + "description": "Add timestamp watermark", + "example": false, + "default": false + } + }, + "required": ["url"] + }, + "Url2PdfMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type used", + "example": "desktop" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used, if any" + }, + "format": { + "type": "string", + "description": "Paper format", + "example": "letter" + }, + "orientation": { + "type": "string", + "description": "Orientation", + "example": "landscape" + }, + "margin": { + "description": "Margins in mm", + "allOf": [ + { + "$ref": "#/components/schemas/MarginDto" + } + ] + }, + "scale": { + "type": "number", + "description": "Rendering scale", + "example": 1.5 + }, + "test": { + "description": "Test details", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "device", "format", "orientation", "scale", "test"] + }, + "Url2PdfResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request", + "allOf": [ + { + "$ref": "#/components/schemas/Url2PdfMetaDto" + } + ] + }, + "data": { + "type": "string", + "description": "Generated PDF URL", + "example": "https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "OpenPortDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The URL to be checked", + "example": "https://example.com" + }, + "topPorts": { + "type": "number", + "description": "Scan only the top N ports (optional)", + "example": 100, + "enum": [50, 100, 500, 1000, 5000] + }, + "portRanges": { + "type": "string", + "description": "Custom port ranges to scan, e.g., \"80,443,1000-1010\"", + "example": "80,443,1000-1010" + } + }, + "required": ["url"] + }, + "OpenPortMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The scanned URL", + "example": "https://example.com" + }, + "topPorts": { + "type": "number", + "description": "Top ports scanned (if any)", + "example": 100, + "enum": [50, 100, 500, 1000, 5000] + }, + "portRanges": { + "type": "string", + "description": "Custom port ranges scanned (if any)", + "example": "80,443,1000-1010" + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "test"] + }, + "OpenPortResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request", + "allOf": [ + { + "$ref": "#/components/schemas/OpenPortMetaDto" + } + ] + }, + "data": { + "description": "List of open ports found", + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "TlsScanDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + } + }, + "required": ["url"] + }, + "TlsScanMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The target URL checked for TLS support", + "example": "example.com" + }, + "test": { + "description": "Test metadata object", + "example": { + "id": "40zt4but04y07ccn4pov5fiolzrxbxdg" + }, + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "test"] + }, + "TlsProtocolsDto": { + "type": "object", + "properties": { + "tls10": { + "type": "boolean", + "description": "Whether TLS 1.0 is supported", + "example": false + }, + "tls11": { + "type": "boolean", + "description": "Whether TLS 1.1 is supported", + "example": false + }, + "tls12": { + "type": "boolean", + "description": "Whether TLS 1.2 is supported", + "example": true + }, + "tls13": { + "type": "boolean", + "description": "Whether TLS 1.3 is supported", + "example": true + } + }, + "required": ["tls10", "tls11", "tls12", "tls13"] + }, + "TlsCertificateIssuerDto": { + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "Issuer country", + "example": "US" + }, + "organization": { + "type": "string", + "description": "Issuer organization", + "example": "Cloudflare, Inc." + }, + "commonName": { + "type": "string", + "description": "Issuer common name", + "example": "Cloudflare Inc ECC CA-3" + } + }, + "required": ["country", "organization", "commonName"] + }, + "TlsCertificateDto": { + "type": "object", + "properties": { + "commonName": { + "type": "string", + "description": "Common name (CN) on the certificate", + "example": "sni.cloudflaressl.com" + }, + "subjectAltName": { + "type": "string", + "description": "Subject Alternative Names (SAN)", + "example": "DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com" + }, + "issuer": { + "description": "Issuer details", + "allOf": [ + { + "$ref": "#/components/schemas/TlsCertificateIssuerDto" + } + ] + }, + "expiry": { + "type": "string", + "description": "Certificate expiry date", + "example": "Jun 6 23:59:59 2023 GMT" + } + }, + "required": ["commonName", "subjectAltName", "issuer", "expiry"] + }, + "TlsScanDataDto": { + "type": "object", + "properties": { + "protocols": { + "description": "Protocols supported", + "allOf": [ + { + "$ref": "#/components/schemas/TlsProtocolsDto" + } + ] + }, + "certificate": { + "description": "Certificate details", + "allOf": [ + { + "$ref": "#/components/schemas/TlsCertificateDto" + } + ] + } + }, + "required": ["protocols", "certificate"] + }, + "TlsScanResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the TLS scan request", + "example": { + "url": "example.com", + "test": { + "id": "40zt4but04y07ccn4pov5fiolzrxbxdg" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/TlsScanMetaDto" + } + ] + }, + "data": { + "description": "TLS scan result data", + "example": { + "protocols": { + "tls10": false, + "tls11": false, + "tls12": true, + "tls13": true + }, + "certificate": { + "commonName": "sni.cloudflaressl.com", + "subjectAltName": "DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com", + "issuer": { + "country": "US", + "organization": "Cloudflare, Inc.", + "commonName": "Cloudflare Inc ECC CA-3" + }, + "expiry": "Jun 6 23:59:59 2023 GMT" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/TlsScanDataDto" + } + ] + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "LoadTimeDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether to follow redirects when checking site status", + "example": false, + "default": false + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + } + }, + "required": ["url"] + }, + "LoadTimeMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The tested URL", + "example": "https://example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used for the test", + "example": "us" + }, + "followRedirect": { + "type": "boolean", + "description": "Indicates if redirects were followed during the test", + "example": true + }, + "redirectedURL": { + "type": "string", + "description": "Final URL after redirection (if any)", + "example": "https://example.com/" + }, + "test": { + "description": "Metadata about the test execution", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "redirectedURL", "test"] + }, + "TimingsDto": { + "type": "object", + "properties": { + "dns": { + "type": "number", + "description": "Time spent in DNS lookup (ms)", + "example": 21 + }, + "connect": { + "type": "number", + "description": "Time to establish TCP connection (ms)", + "example": 15 + }, + "tls": { + "type": "number", + "description": "Time to complete TLS handshake (ms)", + "example": 40 + }, + "send": { + "type": "number", + "description": "Time to send request (ms)", + "example": 1 + }, + "wait": { + "type": "number", + "description": "Server processing time (ms)", + "example": 457 + }, + "ttfb": { + "type": "number", + "description": "Time to First Byte - calculated as dns+connect+tls+send+wait (ms)", + "example": 534 + }, + "download": { + "type": "number", + "description": "Time to download response body (ms)", + "example": 4 + }, + "total": { + "type": "number", + "description": "Total load time (ms)", + "example": 538 + }, + "redirectDuration": { + "type": "number", + "description": "Time spent in redirects before reaching final URL (ms)", + "example": 0 + } + }, + "required": [ + "dns", + "connect", + "tls", + "send", + "wait", + "ttfb", + "download", + "total", + "redirectDuration" + ] + }, + "NetworkDto": { + "type": "object", + "properties": { + "protocol": { + "type": "string", + "description": "The actual HTTP protocol used (e.g. h2, h3, http/1.1, http/1.0)", + "example": "h2" + }, + "remoteIp": { + "type": "string", + "description": "Remote IP address of the server", + "example": "1.1.1.1" + }, + "bytesRead": { + "type": "number", + "description": "Total bytes read from the response", + "example": 15400 + } + }, + "required": ["protocol", "bytesRead"] + }, + "ProtocolSupportDto": { + "type": "object", + "properties": { + "http10": { + "type": "boolean", + "description": "Whether HTTP/1.0 is supported", + "example": false + }, + "http11": { + "type": "boolean", + "description": "Whether HTTP/1.1 is supported", + "example": true + }, + "http2": { + "type": "boolean", + "description": "Whether HTTP/2 is supported", + "example": true + }, + "http3": { + "type": "boolean", + "description": "Whether HTTP/3 is supported", + "example": false + }, + "http3SupportedVersion": { + "description": "HTTP/3 supported versions if available", + "example": ["h3-29", "h3"], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["http10", "http11", "http2", "http3"] + }, + "LoadTimeDataDto": { + "type": "object", + "properties": { + "dns": { + "type": "number", + "description": "Time spent in DNS lookup (ms)", + "example": 10 + }, + "connect": { + "type": "number", + "description": "Time to establish TCP connection (ms)", + "example": 12 + }, + "tls": { + "type": "number", + "description": "Time to complete TLS handshake (ms)", + "example": 9 + }, + "send": { + "type": "number", + "description": "Time to send request (ms)", + "example": 19 + }, + "wait": { + "type": "number", + "description": "Time waiting for response (ms)", + "example": 86 + }, + "total": { + "type": "number", + "description": "Total load time (ms)", + "example": 88 + }, + "statusCode": { + "type": "number", + "description": "HTTP status code of the response", + "example": 404 + }, + "reasonPhrase": { + "type": "string", + "description": "HTTP reason phrase", + "example": "Not Found" + }, + "timings": { + "description": "Detailed timing breakdown", + "allOf": [ + { + "$ref": "#/components/schemas/TimingsDto" + } + ] + }, + "network": { + "description": "Network information", + "allOf": [ + { + "$ref": "#/components/schemas/NetworkDto" + } + ] + }, + "headers": { + "type": "object", + "description": "Response headers as key-value pairs", + "example": { + "server": "cloudflare", + "content-type": "text/html; charset=utf-8", + "cache-control": "no-cache" + } + }, + "protocolSupport": { + "description": "HTTP protocol support information", + "allOf": [ + { + "$ref": "#/components/schemas/ProtocolSupportDto" + } + ] + } + }, + "required": [ + "dns", + "connect", + "tls", + "send", + "wait", + "total", + "statusCode", + "reasonPhrase", + "timings", + "network", + "headers", + "protocolSupport" + ] + }, + "LoadTimeResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Overall message about site reachability", + "example": "Site is reachable." + }, + "meta": { + "description": "Metadata about the load time test", + "allOf": [ + { + "$ref": "#/components/schemas/LoadTimeMetaDto" + } + ] + }, + "data": { + "description": "Comprehensive site load time metrics", + "allOf": [ + { + "$ref": "#/components/schemas/LoadTimeDataDto" + } + ] + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "MixedContentDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether to follow redirects when checking site status", + "example": false, + "default": false + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + } + }, + "required": ["url"] + }, + "MixedContentMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The tested URL", + "example": "https://example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Country used for proxy", + "example": "United States" + }, + "followRedirect": { + "type": "boolean", + "description": "Indicates if redirects should be followed", + "example": true + }, + "redirectedURL": { + "type": "string", + "description": "Final URL after redirection (if any)", + "example": "https://example.com/" + }, + "test": { + "description": "Metadata about the test execution", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "test"] + }, + "MixedContentDataDto": { + "type": "object", + "properties": { + "insecure": { + "description": "List of insecure (HTTP) resources found on the page", + "example": [ + "http://example.com/style.css", + "http://example.com/script.js" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "secure": { + "description": "List of secure (HTTPS) resources found on the page", + "example": [ + "https://example.com/", + "https://fonts.googleapis.com/css?family=Open+Sans", + "data:image/svg+xml;base64,PHN2ZyB4bWxucz0i..." + ], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["insecure", "secure"] + }, + "MixedContentResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Indicates whether mixed content found or not. It can either be \"Mixed content(s) found.\" or \"No mixed content found.\"", + "example": "Mixed content(s) found." + }, + "meta": { + "description": "Metadata about the mixed content test", + "allOf": [ + { + "$ref": "#/components/schemas/MixedContentMetaDto" + } + ] + }, + "data": { + "description": "Contains either an array of all resources (when no mixed content) or an object with insecure/secure arrays (when mixed content found)", + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "Simple array of all resources when no mixed content found", + "example": [ + "https://example.com/", + "https://example.com/style.css", + "https://example.com/script.js" + ] + }, + { + "$ref": "#/components/schemas/MixedContentDataDto", + "description": "Object with insecure and secure arrays when mixed content found" + } + ] + } + }, + "required": [ + "timestamp", + "apiStatus", + "apiCode", + "message", + "meta", + "data" + ] + }, + "DnsSecDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + } + }, + "required": ["url"] + }, + "DnsSecMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The tested domain name", + "example": "example.com" + }, + "test": { + "description": "Metadata about the test execution", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "test"] + }, + "DnsSecDataDto": { + "type": "object", + "properties": { + "isEnabled": { + "type": "boolean", + "description": "Indicates if DNSSEC is enabled for the domain", + "example": true + }, + "dnskey": { + "description": "List of DNSKEY records if DNSSEC is enabled", + "example": [ + "DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "rrsig": { + "description": "List of RRSIG records if DNSSEC is enabled", + "example": [ + "RRSIG DNSKEY 13 2 3600 20251124121323 20250924121323 2371 geekflare.com. LUeqKWfw4GcaqSaCbFT7ik6mTgFdWsRdVzn1hHGSwMGZ4HuwlVFB3e1K 9Os+4DnxyYNkfWkBHJcBfFN7e4snHg==" + ], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["isEnabled"] + }, + "DnsSecResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the DNSSEC test", + "allOf": [ + { + "$ref": "#/components/schemas/DnsSecMetaDto" + } + ] + }, + "data": { + "description": "DNSSEC test result data", + "allOf": [ + { + "$ref": "#/components/schemas/DnsSecDataDto" + } + ] + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "MtrDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether to follow redirects when checking site status", + "example": false, + "default": false + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + } + }, + "required": ["url"] + }, + "MtrMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The tested URL or IP address", + "example": "example.com" + }, + "proxyCountry": { + "type": "string", + "description": "Country used for proxy", + "example": "United States" + }, + "followRedirect": { + "type": "boolean", + "description": "Indicates if redirects should be followed", + "example": true + }, + "redirectedURL": { + "type": "string", + "description": "Final URL after redirection (if any)", + "example": "https://example.com/" + }, + "test": { + "description": "Metadata about the test execution", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "redirectedURL", "test"] + }, + "MtrDataDto": { + "type": "object", + "properties": { + "hop": { + "type": "number", + "description": "Hop number in the traceroute path", + "example": 1 + }, + "host": { + "type": "string", + "description": "Host IP or domain name at this hop", + "example": "240.192.18.19" + }, + "asn": { + "type": "string", + "description": "Autonomous System Number (ASN) for the host", + "example": "AS???" + }, + "loss": { + "type": "number", + "description": "Packet loss percentage at this hop", + "example": 0 + }, + "sent": { + "type": "number", + "description": "Number of packets sent to this hop", + "example": 2 + }, + "last": { + "type": "number", + "description": "Last recorded round-trip time (RTT) in milliseconds", + "example": 0.28 + }, + "avg": { + "type": "number", + "description": "Average RTT across packets", + "example": 0.29 + }, + "best": { + "type": "number", + "description": "Best (lowest) RTT observed", + "example": 0.28 + }, + "worst": { + "type": "number", + "description": "Worst (highest) RTT observed", + "example": 0.3 + }, + "stdDev": { + "type": "number", + "description": "Standard deviation of RTT measurements", + "example": 0.01 + } + }, + "required": [ + "hop", + "host", + "asn", + "loss", + "sent", + "last", + "avg", + "best", + "worst", + "stdDev" + ] + }, + "MtrResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the MTR test execution", + "allOf": [ + { + "$ref": "#/components/schemas/MtrMetaDto" + } + ] + }, + "data": { + "description": "Array of hop details observed in the MTR trace route", + "example": [ + { + "hop": 1, + "host": "240.192.18.19", + "asn": "AS???", + "loss": 0, + "sent": 2, + "last": 0.28, + "avg": 0.29, + "best": 0.28, + "worst": 0.3, + "stdDev": 0.01 + }, + { + "hop": 2, + "host": "240.0.60.49", + "asn": "AS???", + "loss": 0, + "sent": 2, + "last": 0.28, + "avg": 0.29, + "best": 0.28, + "worst": 0.29, + "stdDev": 0.01 + } + ], + "type": "array", + "items": { + "$ref": "#/components/schemas/MtrDataDto" + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "PingDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + } + }, + "required": ["url"] + }, + "PingMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The tested URL or IP address", + "example": "example.com" + }, + "test": { + "description": "Metadata about the test execution", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "test"] + }, + "PingDataDto": { + "type": "object", + "properties": { + "requests": { + "type": "number", + "description": "Number of ping requests sent", + "example": 4 + }, + "loss": { + "type": "number", + "description": "Packet loss percentage", + "example": 0 + }, + "latency": { + "type": "number", + "description": "Average latency in milliseconds", + "example": 32.5 + }, + "min": { + "type": "number", + "description": "Minimum round-trip time (RTT) in milliseconds", + "example": 30 + }, + "max": { + "type": "number", + "description": "Maximum round-trip time (RTT) in milliseconds", + "example": 35 + }, + "avg": { + "type": "number", + "description": "Average round-trip time (RTT) in milliseconds", + "example": 32.5 + }, + "stdDev": { + "type": "number", + "description": "Standard deviation of RTT in milliseconds", + "example": 1.5 + }, + "ip": { + "type": "string", + "description": "Resolved IP address of the tested domain", + "example": "142.250.183.206" + } + }, + "required": [ + "requests", + "loss", + "latency", + "min", + "max", + "avg", + "stdDev", + "ip" + ] + }, + "PingResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the Ping test execution", + "allOf": [ + { + "$ref": "#/components/schemas/PingMetaDto" + } + ] + }, + "data": { + "description": "Ping result statistics", + "example": { + "requests": 4, + "loss": 0, + "latency": 32.5, + "min": 30, + "max": 35, + "avg": 32.5, + "stdDev": 1.5, + "ip": "142.250.183.206" + }, + "allOf": [ + { + "$ref": "#/components/schemas/PingDataDto" + } + ] + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "LighthouseDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type to emulate. Defaults to desktop.", + "example": "desktop", + "enum": ["desktop", "mobile"], + "default": "desktop" + }, + "followRedirect": { + "type": "boolean", + "description": "Whether to follow redirects when checking site status", + "example": false, + "default": false + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country code to route the request", + "example": "us" + }, + "parameters": { + "description": "Extra Lighthouse CLI parameters", + "example": ["--only-categories=seo"], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["url"] + }, + "LighthouseMetaDto": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Target URL", + "example": "https://example.com" + }, + "device": { + "type": "string", + "description": "Device type used", + "enum": ["desktop", "mobile"] + }, + "followRedirect": { + "type": "boolean", + "description": "Whether redirects were followed" + }, + "redirectedURL": { + "type": "string", + "description": "Final URL after redirection (if any)", + "example": "https://example.com/" + }, + "proxyCountry": { + "type": "string", + "description": "Proxy country used, if any" + }, + "test": { + "description": "Test details object", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": ["url", "device", "followRedirect", "redirectedURL", "test"] + }, + "LighthouseResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "description": "Metadata about the request", + "allOf": [ + { + "$ref": "#/components/schemas/LighthouseMetaDto" + } + ] + }, + "data": { + "type": "string", + "description": "URL to the Lighthouse report", + "example": "https://example.com/report.html" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "SearchMetaDto": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "Original query", + "example": "best running shoes" + }, + "count": { + "type": "number", + "description": "Number of results returned", + "example": 10 + }, + "source": { + "description": "Search source used", + "example": "web", + "type": "array", + "items": { + "type": "string" + } + }, + "location": { + "type": "string", + "description": "Country used for ranking", + "example": "us" + }, + "time": { + "type": "string", + "description": "Time filter applied", + "example": "d" + }, + "scrape": { + "type": "boolean", + "description": "Whether URL scraping was enabled", + "example": false + }, + "scrapeLimit": { + "type": "number", + "description": "Number of URLs scraped", + "example": 3 + }, + "test": { + "description": "Test metadata", + "allOf": [ + { + "$ref": "#/components/schemas/TestMetaDto" + } + ] + } + }, + "required": [ + "query", + "count", + "source", + "location", + "time", + "scrape", + "scrapeLimit", + "test" + ] + }, + "SearchResultItemDto": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Result title", + "example": "Best Running Shoes of 2025" + }, + "url": { + "type": "string", + "description": "Canonical URL", + "example": "https://example.com/running-shoes" + }, + "snippet": { + "type": "string", + "description": "Clean snippet (ads/HTML removed)", + "example": "We tested over 100 pairs to find the best running shoes..." + }, + "date": { + "type": "string", + "description": "Published date (if available)", + "example": "Dec 18, 2025" + }, + "position": { + "type": "number", + "description": "Rank position", + "example": 1 + }, + "content": { + "type": "object", + "description": "Scraped cleaned HTML content from the result URL", + "example": "Full article cleaned for LLM consumption..." + } + }, + "required": ["title", "url", "snippet", "position"] + }, + "SearchResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "$ref": "#/components/schemas/SearchMetaDto" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchResultItemDto" + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "ImageSearchResultItemDto": { + "type": "object", + "properties": { + "title": { + "type": "string", + "example": "Nike Alphafly 3" + }, + "imageUrl": { + "type": "string", + "example": "https://example.com/img.jpg" + }, + "sourceUrl": { + "type": "string", + "example": "https://example.com/page" + }, + "width": { + "type": "number", + "example": 1024 + }, + "height": { + "type": "number", + "example": 768 + } + }, + "required": ["title", "imageUrl", "sourceUrl", "width", "height"] + }, + "ImageSearchResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "$ref": "#/components/schemas/SearchMetaDto" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSearchResultItemDto" + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "SearchMarkdownResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "$ref": "#/components/schemas/SearchMetaDto" + }, + "data": { + "type": "object", + "example": "1. [Title](https://example.com)\n - snippet" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "SearchHtmlResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "meta": { + "$ref": "#/components/schemas/SearchMetaDto" + }, + "data": { + "type": "object", + "example": "" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] + }, + "SearchRequestDto": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "Search query", + "example": "best running shoes", + "maxLength": 2048 + }, + "limit": { + "type": "number", + "description": "Number of results", + "example": 10, + "default": 10, + "minimum": 1, + "maximum": 100 + }, + "time": { + "type": "string", + "description": "Time filter (h, d, w, m, y or h2, d7, etc.)", + "example": "d", + "default": "any" + }, + "location": { + "type": "string", + "description": "Country code (ISO alpha-2)", + "example": "us", + "default": "us" + }, + "source": { + "type": "string", + "description": "Search source", + "enum": ["web", "news", "images"], + "example": "web", + "default": "web" + }, + "category": { + "type": "string", + "description": "Category filter", + "enum": ["general", "code", "pdf", "research", "linkedin", "wiki"], + "example": "code", + "default": "general" + }, + "includeDomains": { + "description": "Include only these domains", + "example": ["reddit.com", "stackoverflow.com"], + "type": "array", + "items": { + "type": "string" + } + }, + "excludeDomains": { + "description": "Exclude these domains", + "example": ["pinterest.com"], + "type": "array", + "items": { + "type": "string" + } + }, + "format": { + "type": "string", + "description": "Output format", + "enum": ["json", "markdown", "html"], + "default": "json" + }, + "scrape": { + "type": "boolean", + "description": "scrape and extract content from SERP result URLs", + "example": false, + "default": false + }, + "scrapeLimit": { + "type": "number", + "description": "Number of URLs to scrape (requires scrape: true)", + "example": 3, + "default": 3, + "minimum": 1, + "maximum": 10 + } + }, + "required": ["query"] + }, + "HealthResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Metadata about the request" + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "message"] + }, + "ServiceStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "r2", + "description": "Name of the service" + }, + "status": { + "type": "string", + "example": "healthy", + "description": "Health status of the service (e.g., healthy, degraded, down)" + }, + "message": { + "type": "string", + "example": "All systems operational", + "description": "Additional info or error message if any" + } + }, + "required": ["name", "status", "message"] + }, + "ServiceHealthResponseDto": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "Timestamp of the request in milliseconds", + "example": 1777874383873 + }, + "apiStatus": { + "type": "string", + "description": "API status message", + "example": "success", + "enum": ["success", "failure"] + }, + "apiCode": { + "type": "number", + "description": "API status code", + "example": 200 + }, + "message": { + "type": "string", + "description": "Top-level message summarizing the overall health check", + "example": "Service health check completed" + }, + "services": { + "description": "Status of individual internal services", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceStatus" + } + } + }, + "required": ["timestamp", "apiStatus", "apiCode", "message", "services"] + } + } + } +} diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..0f7e625 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.22.0" + } +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..be00b53 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,95 @@ +[project] +name = "geekflare_api" +version = "0.1.0" +description = "Geekflare API" +authors = [ + {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, +] +license = { text = "MIT" } +readme = "README.md" +keywords = ["OpenAPI", "OpenAPI-Generator", "Geekflare API"] +requires-python = ">=3.9" + +dependencies = [ + "urllib3 (>=2.1.0,<3.0.0)", + "python-dateutil (>=2.8.2)", + "pydantic (>=2.11)", + "typing-extensions (>=4.7.1)", +] + +[project.urls] +Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" + +[tool.poetry] +requires-poetry = ">=2.0" + +[tool.poetry.group.dev.dependencies] +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" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "geekflare_api", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "geekflare_api.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9e2d67a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +urllib3 >= 2.1.0, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2.11 +typing-extensions >= 4.7.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1098068 --- /dev/null +++ b/setup.py @@ -0,0 +1,48 @@ +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + 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 = "geekflare-api" +VERSION = "0.1.0" +PYTHON_REQUIRES = ">= 3.10" +REQUIRES = [ + "urllib3 >= 2.1.0, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2.11", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Geekflare API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "Geekflare API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="MIT", + long_description_content_type='text/markdown', + long_description="""\ + Official OpenAPI specification for all Geekflare API endpoints. + """, # noqa: E501 + package_data={"geekflare_api": ["py.typed"]}, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..e98555c --- /dev/null +++ b/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/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_api_tool_api.py b/test/test_api_tool_api.py new file mode 100644 index 0000000..745e2ef --- /dev/null +++ b/test/test_api_tool_api.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.api.api_tool_api import ApiToolApi + + +class TestApiToolApi(unittest.TestCase): + """ApiToolApi unit test stubs""" + + def setUp(self) -> None: + self.api = ApiToolApi() + + def tearDown(self) -> None: + pass + + def test_broken_link(self) -> None: + """Test case for broken_link + + Check if a webpage contains broken links + """ + pass + + def test_dns_record(self) -> None: + """Test case for dns_record + + Retrieve DNS records for a given domain + """ + pass + + def test_dns_sec(self) -> None: + """Test case for dns_sec + + Check if DNSSEC is enabled for a domain + """ + pass + + def test_lighthouse(self) -> None: + """Test case for lighthouse + + Run Lighthouse audit on a website + """ + pass + + def test_load_time(self) -> None: + """Test case for load_time + + Measure the page load time for a given URL + """ + pass + + def test_meta_scrape(self) -> None: + """Test case for meta_scrape + + Scrape a webpage meta with custom options + """ + pass + + def test_mixed_content(self) -> None: + """Test case for mixed_content + + Check for mixed content on a site + """ + pass + + def test_mtr(self) -> None: + """Test case for mtr + + Perform MTR (My Traceroute) network diagnostic test + """ + pass + + def test_open_ports(self) -> None: + """Test case for open_ports + + Scan a website for open ports + """ + pass + + def test_ping(self) -> None: + """Test case for ping + + Perform ICMP Ping test on a given URL or IP + """ + pass + + def test_redirect_check(self) -> None: + """Test case for redirect_check + + Check the redirection chain of a given URL + """ + pass + + def test_screenshot(self) -> None: + """Test case for screenshot + + Capture a full-page screenshot of a website + """ + pass + + def test_search(self) -> None: + """Test case for search + + Search API for AI Agents & LLMs + """ + pass + + def test_site_status(self) -> None: + """Test case for site_status + + Check if a site is up or down + """ + pass + + def test_tls_scan(self) -> None: + """Test case for tls_scan + + Perform TLS scan for a given domain + """ + pass + + def test_url2_pdf(self) -> None: + """Test case for url2_pdf + + Capture a full-page Url2Pdf of a website + """ + pass + + def test_web_scrape(self) -> None: + """Test case for web_scrape + + Scrape a webpage with custom options + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_error_response_dto.py b/test/test_base_error_response_dto.py new file mode 100644 index 0000000..5a857db --- /dev/null +++ b/test/test_base_error_response_dto.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.base_error_response_dto import BaseErrorResponseDto + +class TestBaseErrorResponseDto(unittest.TestCase): + """BaseErrorResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseErrorResponseDto: + """Test BaseErrorResponseDto + 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 `BaseErrorResponseDto` + """ + model = BaseErrorResponseDto() + if include_optional: + return BaseErrorResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Invalid URL provided', + details = 'The URL must be a valid HTTP or HTTPS URL' + ) + else: + return BaseErrorResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Invalid URL provided', + ) + """ + + def testBaseErrorResponseDto(self): + """Test BaseErrorResponseDto""" + # 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/test/test_broken_link_dto.py b/test/test_broken_link_dto.py new file mode 100644 index 0000000..7552f61 --- /dev/null +++ b/test/test_broken_link_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.broken_link_dto import BrokenLinkDto + +class TestBrokenLinkDto(unittest.TestCase): + """BrokenLinkDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrokenLinkDto: + """Test BrokenLinkDto + 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 `BrokenLinkDto` + """ + model = BrokenLinkDto() + if include_optional: + return BrokenLinkDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = False + ) + else: + return BrokenLinkDto( + url = 'https://example.com', + ) + """ + + def testBrokenLinkDto(self): + """Test BrokenLinkDto""" + # 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/test/test_broken_link_meta_dto.py b/test/test_broken_link_meta_dto.py new file mode 100644 index 0000000..d3dc17c --- /dev/null +++ b/test/test_broken_link_meta_dto.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.broken_link_meta_dto import BrokenLinkMetaDto + +class TestBrokenLinkMetaDto(unittest.TestCase): + """BrokenLinkMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrokenLinkMetaDto: + """Test BrokenLinkMetaDto + 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 `BrokenLinkMetaDto` + """ + model = BrokenLinkMetaDto() + if include_optional: + return BrokenLinkMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return BrokenLinkMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testBrokenLinkMetaDto(self): + """Test BrokenLinkMetaDto""" + # 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/test/test_broken_link_response_dto.py b/test/test_broken_link_response_dto.py new file mode 100644 index 0000000..3976516 --- /dev/null +++ b/test/test_broken_link_response_dto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.broken_link_response_dto import BrokenLinkResponseDto + +class TestBrokenLinkResponseDto(unittest.TestCase): + """BrokenLinkResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrokenLinkResponseDto: + """Test BrokenLinkResponseDto + 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 `BrokenLinkResponseDto` + """ + model = BrokenLinkResponseDto() + if include_optional: + return BrokenLinkResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'No broken links found.', + meta = geekflare_api.models.broken_link_meta_dto.BrokenLinkMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + summary = geekflare_api.models.broken_link_summary_dto.BrokenLinkSummaryDto( + total = 5, + successful = 2, + redirects = 2, + broken = 1, + server_error = 0, ), + data = [{link=https://example.com/, status=200}, {link=https://example.com/articles, status=200}] + ) + else: + return BrokenLinkResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'No broken links found.', + meta = geekflare_api.models.broken_link_meta_dto.BrokenLinkMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + summary = geekflare_api.models.broken_link_summary_dto.BrokenLinkSummaryDto( + total = 5, + successful = 2, + redirects = 2, + broken = 1, + server_error = 0, ), + data = [{link=https://example.com/, status=200}, {link=https://example.com/articles, status=200}], + ) + """ + + def testBrokenLinkResponseDto(self): + """Test BrokenLinkResponseDto""" + # 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/test/test_broken_link_summary_dto.py b/test/test_broken_link_summary_dto.py new file mode 100644 index 0000000..6d4a002 --- /dev/null +++ b/test/test_broken_link_summary_dto.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.broken_link_summary_dto import BrokenLinkSummaryDto + +class TestBrokenLinkSummaryDto(unittest.TestCase): + """BrokenLinkSummaryDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrokenLinkSummaryDto: + """Test BrokenLinkSummaryDto + 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 `BrokenLinkSummaryDto` + """ + model = BrokenLinkSummaryDto() + if include_optional: + return BrokenLinkSummaryDto( + total = 5, + successful = 2, + redirects = 2, + broken = 1, + server_error = 0 + ) + else: + return BrokenLinkSummaryDto( + total = 5, + successful = 2, + redirects = 2, + broken = 1, + server_error = 0, + ) + """ + + def testBrokenLinkSummaryDto(self): + """Test BrokenLinkSummaryDto""" + # 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/test/test_default_extraction_field_dto.py b/test/test_default_extraction_field_dto.py new file mode 100644 index 0000000..e174bfd --- /dev/null +++ b/test/test_default_extraction_field_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.default_extraction_field_dto import DefaultExtractionFieldDto + +class TestDefaultExtractionFieldDto(unittest.TestCase): + """DefaultExtractionFieldDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DefaultExtractionFieldDto: + """Test DefaultExtractionFieldDto + 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 `DefaultExtractionFieldDto` + """ + model = DefaultExtractionFieldDto() + if include_optional: + return DefaultExtractionFieldDto( + title = 'Product Name', + value = Some hardcoded string + ) + else: + return DefaultExtractionFieldDto( + title = 'Product Name', + value = Some hardcoded string, + ) + """ + + def testDefaultExtractionFieldDto(self): + """Test DefaultExtractionFieldDto""" + # 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/test/test_dns_meta_dto.py b/test/test_dns_meta_dto.py new file mode 100644 index 0000000..2962401 --- /dev/null +++ b/test/test_dns_meta_dto.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_meta_dto import DnsMetaDto + +class TestDnsMetaDto(unittest.TestCase): + """DnsMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsMetaDto: + """Test DnsMetaDto + 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 `DnsMetaDto` + """ + model = DnsMetaDto() + if include_optional: + return DnsMetaDto( + url = 'https://example.com', + types = '[A, MX]', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return DnsMetaDto( + url = 'https://example.com', + types = '[A, MX]', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testDnsMetaDto(self): + """Test DnsMetaDto""" + # 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/test/test_dns_record_dto.py b/test/test_dns_record_dto.py new file mode 100644 index 0000000..1cc5b29 --- /dev/null +++ b/test/test_dns_record_dto.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_record_dto import DnsRecordDto + +class TestDnsRecordDto(unittest.TestCase): + """DnsRecordDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsRecordDto: + """Test DnsRecordDto + 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 `DnsRecordDto` + """ + model = DnsRecordDto() + if include_optional: + return DnsRecordDto( + url = 'https://example.com', + types = [A, MX] + ) + else: + return DnsRecordDto( + url = 'https://example.com', + ) + """ + + def testDnsRecordDto(self): + """Test DnsRecordDto""" + # 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/test/test_dns_record_response_dto.py b/test/test_dns_record_response_dto.py new file mode 100644 index 0000000..4361fe2 --- /dev/null +++ b/test/test_dns_record_response_dto.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_record_response_dto import DnsRecordResponseDto + +class TestDnsRecordResponseDto(unittest.TestCase): + """DnsRecordResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsRecordResponseDto: + """Test DnsRecordResponseDto + 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 `DnsRecordResponseDto` + """ + model = DnsRecordResponseDto() + if include_optional: + return DnsRecordResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.dns_meta_dto.DnsMetaDto( + url = 'https://example.com', + types = '[A, MX]', + test = null, ), + data = {A=[172.67.70.213, 104.26.11.88, 104.26.10.88], MX=[{exchange=alt3.aspmx.l.google.com, priority=10}, {exchange=aspmx.l.google.com, priority=1}]} + ) + else: + return DnsRecordResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.dns_meta_dto.DnsMetaDto( + url = 'https://example.com', + types = '[A, MX]', + test = null, ), + data = {A=[172.67.70.213, 104.26.11.88, 104.26.10.88], MX=[{exchange=alt3.aspmx.l.google.com, priority=10}, {exchange=aspmx.l.google.com, priority=1}]}, + ) + """ + + def testDnsRecordResponseDto(self): + """Test DnsRecordResponseDto""" + # 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/test/test_dns_sec_data_dto.py b/test/test_dns_sec_data_dto.py new file mode 100644 index 0000000..9a8eba8 --- /dev/null +++ b/test/test_dns_sec_data_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_sec_data_dto import DnsSecDataDto + +class TestDnsSecDataDto(unittest.TestCase): + """DnsSecDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecDataDto: + """Test DnsSecDataDto + 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 `DnsSecDataDto` + """ + model = DnsSecDataDto() + if include_optional: + return DnsSecDataDto( + is_enabled = True, + dnskey = [DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==], + rrsig = [RRSIG DNSKEY 13 2 3600 20251124121323 20250924121323 2371 geekflare.com. LUeqKWfw4GcaqSaCbFT7ik6mTgFdWsRdVzn1hHGSwMGZ4HuwlVFB3e1K 9Os+4DnxyYNkfWkBHJcBfFN7e4snHg==] + ) + else: + return DnsSecDataDto( + is_enabled = True, + ) + """ + + def testDnsSecDataDto(self): + """Test DnsSecDataDto""" + # 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/test/test_dns_sec_dto.py b/test/test_dns_sec_dto.py new file mode 100644 index 0000000..1daf179 --- /dev/null +++ b/test/test_dns_sec_dto.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_sec_dto import DnsSecDto + +class TestDnsSecDto(unittest.TestCase): + """DnsSecDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecDto: + """Test DnsSecDto + 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 `DnsSecDto` + """ + model = DnsSecDto() + if include_optional: + return DnsSecDto( + url = 'https://example.com' + ) + else: + return DnsSecDto( + url = 'https://example.com', + ) + """ + + def testDnsSecDto(self): + """Test DnsSecDto""" + # 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/test/test_dns_sec_meta_dto.py b/test/test_dns_sec_meta_dto.py new file mode 100644 index 0000000..cc5fe09 --- /dev/null +++ b/test/test_dns_sec_meta_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_sec_meta_dto import DnsSecMetaDto + +class TestDnsSecMetaDto(unittest.TestCase): + """DnsSecMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecMetaDto: + """Test DnsSecMetaDto + 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 `DnsSecMetaDto` + """ + model = DnsSecMetaDto() + if include_optional: + return DnsSecMetaDto( + url = 'example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return DnsSecMetaDto( + url = 'example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testDnsSecMetaDto(self): + """Test DnsSecMetaDto""" + # 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/test/test_dns_sec_response_dto.py b/test/test_dns_sec_response_dto.py new file mode 100644 index 0000000..f35cd1c --- /dev/null +++ b/test/test_dns_sec_response_dto.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto + +class TestDnsSecResponseDto(unittest.TestCase): + """DnsSecResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecResponseDto: + """Test DnsSecResponseDto + 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 `DnsSecResponseDto` + """ + model = DnsSecResponseDto() + if include_optional: + return DnsSecResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.dns_sec_meta_dto.DnsSecMetaDto( + url = 'example.com', + test = null, ), + data = geekflare_api.models.dns_sec_data_dto.DnsSecDataDto( + is_enabled = True, + dnskey = [DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==], + rrsig = [RRSIG DNSKEY 13 2 3600 20251124121323 20250924121323 2371 geekflare.com. LUeqKWfw4GcaqSaCbFT7ik6mTgFdWsRdVzn1hHGSwMGZ4HuwlVFB3e1K 9Os+4DnxyYNkfWkBHJcBfFN7e4snHg==], ) + ) + else: + return DnsSecResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.dns_sec_meta_dto.DnsSecMetaDto( + url = 'example.com', + test = null, ), + data = geekflare_api.models.dns_sec_data_dto.DnsSecDataDto( + is_enabled = True, + dnskey = [DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==], + rrsig = [RRSIG DNSKEY 13 2 3600 20251124121323 20250924121323 2371 geekflare.com. LUeqKWfw4GcaqSaCbFT7ik6mTgFdWsRdVzn1hHGSwMGZ4HuwlVFB3e1K 9Os+4DnxyYNkfWkBHJcBfFN7e4snHg==], ), + ) + """ + + def testDnsSecResponseDto(self): + """Test DnsSecResponseDto""" + # 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/test/test_extraction_schema_dto.py b/test/test_extraction_schema_dto.py new file mode 100644 index 0000000..1e002b2 --- /dev/null +++ b/test/test_extraction_schema_dto.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto + +class TestExtractionSchemaDto(unittest.TestCase): + """ExtractionSchemaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExtractionSchemaDto: + """Test ExtractionSchemaDto + 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 `ExtractionSchemaDto` + """ + model = ExtractionSchemaDto() + if include_optional: + return ExtractionSchemaDto( + name = 'Product Schema', + base_selector = '.product', + fields = [ + null + ] + ) + else: + return ExtractionSchemaDto( + name = 'Product Schema', + fields = [ + null + ], + ) + """ + + def testExtractionSchemaDto(self): + """Test ExtractionSchemaDto""" + # 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/test/test_extraction_schema_dto_fields_inner.py b/test/test_extraction_schema_dto_fields_inner.py new file mode 100644 index 0000000..97b6f77 --- /dev/null +++ b/test/test_extraction_schema_dto_fields_inner.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner + +class TestExtractionSchemaDtoFieldsInner(unittest.TestCase): + """ExtractionSchemaDtoFieldsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExtractionSchemaDtoFieldsInner: + """Test ExtractionSchemaDtoFieldsInner + 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 `ExtractionSchemaDtoFieldsInner` + """ + model = ExtractionSchemaDtoFieldsInner() + if include_optional: + return ExtractionSchemaDtoFieldsInner( + title = 'Product Name', + value = Some hardcoded string, + name = 'title', + selector = 'h1.product-title', + type = 'text', + attribute = 'href', + fields = [ + geekflare_api.models.selector_extraction_field_dto.SelectorExtractionFieldDto( + name = 'title', + selector = 'h1.product-title', + type = 'text', + attribute = 'href', ) + ] + ) + else: + return ExtractionSchemaDtoFieldsInner( + title = 'Product Name', + value = Some hardcoded string, + name = 'title', + selector = 'h1.product-title', + type = 'text', + ) + """ + + def testExtractionSchemaDtoFieldsInner(self): + """Test ExtractionSchemaDtoFieldsInner""" + # 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/test/test_health_response_dto.py b/test/test_health_response_dto.py new file mode 100644 index 0000000..18540da --- /dev/null +++ b/test/test_health_response_dto.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.health_response_dto import HealthResponseDto + +class TestHealthResponseDto(unittest.TestCase): + """HealthResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HealthResponseDto: + """Test HealthResponseDto + 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 `HealthResponseDto` + """ + model = HealthResponseDto() + if include_optional: + return HealthResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = '' + ) + else: + return HealthResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = '', + ) + """ + + def testHealthResponseDto(self): + """Test HealthResponseDto""" + # 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/test/test_image_search_response_dto.py b/test/test_image_search_response_dto.py new file mode 100644 index 0000000..4adaaef --- /dev/null +++ b/test/test_image_search_response_dto.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto + +class TestImageSearchResponseDto(unittest.TestCase): + """ImageSearchResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageSearchResponseDto: + """Test ImageSearchResponseDto + 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 `ImageSearchResponseDto` + """ + model = ImageSearchResponseDto() + if include_optional: + return ImageSearchResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = [ + geekflare_api.models.image_search_result_item_dto.ImageSearchResultItemDto( + title = 'Nike Alphafly 3', + image_url = 'https://example.com/img.jpg', + source_url = 'https://example.com/page', + width = 1024, + height = 768, ) + ] + ) + else: + return ImageSearchResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = [ + geekflare_api.models.image_search_result_item_dto.ImageSearchResultItemDto( + title = 'Nike Alphafly 3', + image_url = 'https://example.com/img.jpg', + source_url = 'https://example.com/page', + width = 1024, + height = 768, ) + ], + ) + """ + + def testImageSearchResponseDto(self): + """Test ImageSearchResponseDto""" + # 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/test/test_image_search_result_item_dto.py b/test/test_image_search_result_item_dto.py new file mode 100644 index 0000000..e1d3831 --- /dev/null +++ b/test/test_image_search_result_item_dto.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto + +class TestImageSearchResultItemDto(unittest.TestCase): + """ImageSearchResultItemDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageSearchResultItemDto: + """Test ImageSearchResultItemDto + 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 `ImageSearchResultItemDto` + """ + model = ImageSearchResultItemDto() + if include_optional: + return ImageSearchResultItemDto( + title = 'Nike Alphafly 3', + image_url = 'https://example.com/img.jpg', + source_url = 'https://example.com/page', + width = 1024, + height = 768 + ) + else: + return ImageSearchResultItemDto( + title = 'Nike Alphafly 3', + image_url = 'https://example.com/img.jpg', + source_url = 'https://example.com/page', + width = 1024, + height = 768, + ) + """ + + def testImageSearchResultItemDto(self): + """Test ImageSearchResultItemDto""" + # 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/test/test_lighthouse_dto.py b/test/test_lighthouse_dto.py new file mode 100644 index 0000000..39e2c29 --- /dev/null +++ b/test/test_lighthouse_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.lighthouse_dto import LighthouseDto + +class TestLighthouseDto(unittest.TestCase): + """LighthouseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LighthouseDto: + """Test LighthouseDto + 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 `LighthouseDto` + """ + model = LighthouseDto() + if include_optional: + return LighthouseDto( + url = 'https://example.com', + device = 'desktop', + follow_redirect = False, + proxy_country = 'us', + parameters = [--only-categories=seo] + ) + else: + return LighthouseDto( + url = 'https://example.com', + ) + """ + + def testLighthouseDto(self): + """Test LighthouseDto""" + # 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/test/test_lighthouse_meta_dto.py b/test/test_lighthouse_meta_dto.py new file mode 100644 index 0000000..66aec3a --- /dev/null +++ b/test/test_lighthouse_meta_dto.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.lighthouse_meta_dto import LighthouseMetaDto + +class TestLighthouseMetaDto(unittest.TestCase): + """LighthouseMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LighthouseMetaDto: + """Test LighthouseMetaDto + 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 `LighthouseMetaDto` + """ + model = LighthouseMetaDto() + if include_optional: + return LighthouseMetaDto( + url = 'https://example.com', + device = 'desktop', + follow_redirect = True, + redirected_url = 'https://example.com/', + proxy_country = '', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return LighthouseMetaDto( + url = 'https://example.com', + device = 'desktop', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testLighthouseMetaDto(self): + """Test LighthouseMetaDto""" + # 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/test/test_lighthouse_response_dto.py b/test/test_lighthouse_response_dto.py new file mode 100644 index 0000000..cd268a9 --- /dev/null +++ b/test/test_lighthouse_response_dto.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.lighthouse_response_dto import LighthouseResponseDto + +class TestLighthouseResponseDto(unittest.TestCase): + """LighthouseResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LighthouseResponseDto: + """Test LighthouseResponseDto + 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 `LighthouseResponseDto` + """ + model = LighthouseResponseDto() + if include_optional: + return LighthouseResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.lighthouse_meta_dto.LighthouseMetaDto( + url = 'https://example.com', + device = 'desktop', + follow_redirect = True, + redirected_url = 'https://example.com/', + proxy_country = '', + test = null, ), + data = 'https://example.com/report.html' + ) + else: + return LighthouseResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.lighthouse_meta_dto.LighthouseMetaDto( + url = 'https://example.com', + device = 'desktop', + follow_redirect = True, + redirected_url = 'https://example.com/', + proxy_country = '', + test = null, ), + data = 'https://example.com/report.html', + ) + """ + + def testLighthouseResponseDto(self): + """Test LighthouseResponseDto""" + # 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/test/test_load_time_data_dto.py b/test/test_load_time_data_dto.py new file mode 100644 index 0000000..3be0935 --- /dev/null +++ b/test/test_load_time_data_dto.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.load_time_data_dto import LoadTimeDataDto + +class TestLoadTimeDataDto(unittest.TestCase): + """LoadTimeDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoadTimeDataDto: + """Test LoadTimeDataDto + 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 `LoadTimeDataDto` + """ + model = LoadTimeDataDto() + if include_optional: + return LoadTimeDataDto( + dns = 10, + connect = 12, + tls = 9, + send = 19, + wait = 86, + total = 88, + status_code = 404, + reason_phrase = 'Not Found', + timings = geekflare_api.models.timings_dto.TimingsDto( + dns = 21, + connect = 15, + tls = 40, + send = 1, + wait = 457, + ttfb = 534, + download = 4, + total = 538, + redirect_duration = 0, ), + network = geekflare_api.models.network_dto.NetworkDto( + protocol = 'h2', + remote_ip = '1.1.1.1', + bytes_read = 15400, ), + headers = {server=cloudflare, content-type=text/html; charset=utf-8, cache-control=no-cache}, + protocol_support = geekflare_api.models.protocol_support_dto.ProtocolSupportDto( + http10 = False, + http11 = True, + http2 = True, + http3 = False, + http3_supported_version = [h3-29, h3], ) + ) + else: + return LoadTimeDataDto( + dns = 10, + connect = 12, + tls = 9, + send = 19, + wait = 86, + total = 88, + status_code = 404, + reason_phrase = 'Not Found', + timings = geekflare_api.models.timings_dto.TimingsDto( + dns = 21, + connect = 15, + tls = 40, + send = 1, + wait = 457, + ttfb = 534, + download = 4, + total = 538, + redirect_duration = 0, ), + network = geekflare_api.models.network_dto.NetworkDto( + protocol = 'h2', + remote_ip = '1.1.1.1', + bytes_read = 15400, ), + headers = {server=cloudflare, content-type=text/html; charset=utf-8, cache-control=no-cache}, + protocol_support = geekflare_api.models.protocol_support_dto.ProtocolSupportDto( + http10 = False, + http11 = True, + http2 = True, + http3 = False, + http3_supported_version = [h3-29, h3], ), + ) + """ + + def testLoadTimeDataDto(self): + """Test LoadTimeDataDto""" + # 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/test/test_load_time_dto.py b/test/test_load_time_dto.py new file mode 100644 index 0000000..418c0e9 --- /dev/null +++ b/test/test_load_time_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.load_time_dto import LoadTimeDto + +class TestLoadTimeDto(unittest.TestCase): + """LoadTimeDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoadTimeDto: + """Test LoadTimeDto + 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 `LoadTimeDto` + """ + model = LoadTimeDto() + if include_optional: + return LoadTimeDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = False + ) + else: + return LoadTimeDto( + url = 'https://example.com', + ) + """ + + def testLoadTimeDto(self): + """Test LoadTimeDto""" + # 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/test/test_load_time_meta_dto.py b/test/test_load_time_meta_dto.py new file mode 100644 index 0000000..4ddc64c --- /dev/null +++ b/test/test_load_time_meta_dto.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.load_time_meta_dto import LoadTimeMetaDto + +class TestLoadTimeMetaDto(unittest.TestCase): + """LoadTimeMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoadTimeMetaDto: + """Test LoadTimeMetaDto + 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 `LoadTimeMetaDto` + """ + model = LoadTimeMetaDto() + if include_optional: + return LoadTimeMetaDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return LoadTimeMetaDto( + url = 'https://example.com', + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testLoadTimeMetaDto(self): + """Test LoadTimeMetaDto""" + # 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/test/test_load_time_response_dto.py b/test/test_load_time_response_dto.py new file mode 100644 index 0000000..d3d4489 --- /dev/null +++ b/test/test_load_time_response_dto.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.load_time_response_dto import LoadTimeResponseDto + +class TestLoadTimeResponseDto(unittest.TestCase): + """LoadTimeResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoadTimeResponseDto: + """Test LoadTimeResponseDto + 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 `LoadTimeResponseDto` + """ + model = LoadTimeResponseDto() + if include_optional: + return LoadTimeResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Site is reachable.', + meta = geekflare_api.models.load_time_meta_dto.LoadTimeMetaDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + data = geekflare_api.models.load_time_data_dto.LoadTimeDataDto( + dns = 10, + connect = 12, + tls = 9, + send = 19, + wait = 86, + total = 88, + status_code = 404, + reason_phrase = 'Not Found', + timings = null, + network = null, + headers = {server=cloudflare, content-type=text/html; charset=utf-8, cache-control=no-cache}, + protocol_support = null, ) + ) + else: + return LoadTimeResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.load_time_meta_dto.LoadTimeMetaDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + data = geekflare_api.models.load_time_data_dto.LoadTimeDataDto( + dns = 10, + connect = 12, + tls = 9, + send = 19, + wait = 86, + total = 88, + status_code = 404, + reason_phrase = 'Not Found', + timings = null, + network = null, + headers = {server=cloudflare, content-type=text/html; charset=utf-8, cache-control=no-cache}, + protocol_support = null, ), + ) + """ + + def testLoadTimeResponseDto(self): + """Test LoadTimeResponseDto""" + # 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/test/test_margin_dto.py b/test/test_margin_dto.py new file mode 100644 index 0000000..5f9505a --- /dev/null +++ b/test/test_margin_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.margin_dto import MarginDto + +class TestMarginDto(unittest.TestCase): + """MarginDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MarginDto: + """Test MarginDto + 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 `MarginDto` + """ + model = MarginDto() + if include_optional: + return MarginDto( + top = 25.4, + bottom = 25.4, + right = 25.4, + left = 25.4 + ) + else: + return MarginDto( + ) + """ + + def testMarginDto(self): + """Test MarginDto""" + # 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/test/test_meta_scrape_dto.py b/test/test_meta_scrape_dto.py new file mode 100644 index 0000000..aa62f0f --- /dev/null +++ b/test/test_meta_scrape_dto.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.meta_scrape_dto import MetaScrapeDto + +class TestMetaScrapeDto(unittest.TestCase): + """MetaScrapeDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetaScrapeDto: + """Test MetaScrapeDto + 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 `MetaScrapeDto` + """ + model = MetaScrapeDto() + if include_optional: + return MetaScrapeDto( + url = 'https://example.com', + device = 'desktop', + block_ads = True, + render_js = True, + proxy_country = 'us', + format = 'json', + file_output = False + ) + else: + return MetaScrapeDto( + url = 'https://example.com', + ) + """ + + def testMetaScrapeDto(self): + """Test MetaScrapeDto""" + # 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/test/test_meta_scrape_meta_dto.py b/test/test_meta_scrape_meta_dto.py new file mode 100644 index 0000000..192c6c9 --- /dev/null +++ b/test/test_meta_scrape_meta_dto.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.meta_scrape_meta_dto import MetaScrapeMetaDto + +class TestMetaScrapeMetaDto(unittest.TestCase): + """MetaScrapeMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetaScrapeMetaDto: + """Test MetaScrapeMetaDto + 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 `MetaScrapeMetaDto` + """ + model = MetaScrapeMetaDto() + if include_optional: + return MetaScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = 'json', + file_output = False, + block_ads = True, + render_js = True, + proxy_country = '', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return MetaScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = 'json', + file_output = False, + block_ads = True, + render_js = True, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testMetaScrapeMetaDto(self): + """Test MetaScrapeMetaDto""" + # 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/test/test_meta_scrape_response_dto.py b/test/test_meta_scrape_response_dto.py new file mode 100644 index 0000000..1f74a2b --- /dev/null +++ b/test/test_meta_scrape_response_dto.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.meta_scrape_response_dto import MetaScrapeResponseDto + +class TestMetaScrapeResponseDto(unittest.TestCase): + """MetaScrapeResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetaScrapeResponseDto: + """Test MetaScrapeResponseDto + 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 `MetaScrapeResponseDto` + """ + model = MetaScrapeResponseDto() + if include_optional: + return MetaScrapeResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.meta_scrape_meta_dto.MetaScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = 'json', + file_output = False, + block_ads = True, + render_js = True, + proxy_country = '', + test = null, ), + data = https://example.com/9bulgk075ed9m3vhua5vcrp0.html + ) + else: + return MetaScrapeResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.meta_scrape_meta_dto.MetaScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = 'json', + file_output = False, + block_ads = True, + render_js = True, + proxy_country = '', + test = null, ), + data = https://example.com/9bulgk075ed9m3vhua5vcrp0.html, + ) + """ + + def testMetaScrapeResponseDto(self): + """Test MetaScrapeResponseDto""" + # 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/test/test_meta_scrape_response_dto_data.py b/test/test_meta_scrape_response_dto_data.py new file mode 100644 index 0000000..6069c2e --- /dev/null +++ b/test/test_meta_scrape_response_dto_data.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData + +class TestMetaScrapeResponseDtoData(unittest.TestCase): + """MetaScrapeResponseDtoData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetaScrapeResponseDtoData: + """Test MetaScrapeResponseDtoData + 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 `MetaScrapeResponseDtoData` + """ + model = MetaScrapeResponseDtoData() + if include_optional: + return MetaScrapeResponseDtoData( + ) + else: + return MetaScrapeResponseDtoData( + ) + """ + + def testMetaScrapeResponseDtoData(self): + """Test MetaScrapeResponseDtoData""" + # 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/test/test_mixed_content_data_dto.py b/test/test_mixed_content_data_dto.py new file mode 100644 index 0000000..f2766d8 --- /dev/null +++ b/test/test_mixed_content_data_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mixed_content_data_dto import MixedContentDataDto + +class TestMixedContentDataDto(unittest.TestCase): + """MixedContentDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MixedContentDataDto: + """Test MixedContentDataDto + 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 `MixedContentDataDto` + """ + model = MixedContentDataDto() + if include_optional: + return MixedContentDataDto( + insecure = [http://example.com/style.css, http://example.com/script.js], + secure = [https://example.com/, https://fonts.googleapis.com/css?family=Open+Sans, data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...] + ) + else: + return MixedContentDataDto( + insecure = [http://example.com/style.css, http://example.com/script.js], + secure = [https://example.com/, https://fonts.googleapis.com/css?family=Open+Sans, data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...], + ) + """ + + def testMixedContentDataDto(self): + """Test MixedContentDataDto""" + # 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/test/test_mixed_content_dto.py b/test/test_mixed_content_dto.py new file mode 100644 index 0000000..3f4ecd5 --- /dev/null +++ b/test/test_mixed_content_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mixed_content_dto import MixedContentDto + +class TestMixedContentDto(unittest.TestCase): + """MixedContentDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MixedContentDto: + """Test MixedContentDto + 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 `MixedContentDto` + """ + model = MixedContentDto() + if include_optional: + return MixedContentDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = False + ) + else: + return MixedContentDto( + url = 'https://example.com', + ) + """ + + def testMixedContentDto(self): + """Test MixedContentDto""" + # 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/test/test_mixed_content_meta_dto.py b/test/test_mixed_content_meta_dto.py new file mode 100644 index 0000000..5f16c76 --- /dev/null +++ b/test/test_mixed_content_meta_dto.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mixed_content_meta_dto import MixedContentMetaDto + +class TestMixedContentMetaDto(unittest.TestCase): + """MixedContentMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MixedContentMetaDto: + """Test MixedContentMetaDto + 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 `MixedContentMetaDto` + """ + model = MixedContentMetaDto() + if include_optional: + return MixedContentMetaDto( + url = 'https://example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return MixedContentMetaDto( + url = 'https://example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testMixedContentMetaDto(self): + """Test MixedContentMetaDto""" + # 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/test/test_mixed_content_response_dto.py b/test/test_mixed_content_response_dto.py new file mode 100644 index 0000000..01df260 --- /dev/null +++ b/test/test_mixed_content_response_dto.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mixed_content_response_dto import MixedContentResponseDto + +class TestMixedContentResponseDto(unittest.TestCase): + """MixedContentResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MixedContentResponseDto: + """Test MixedContentResponseDto + 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 `MixedContentResponseDto` + """ + model = MixedContentResponseDto() + if include_optional: + return MixedContentResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Mixed content(s) found.', + meta = geekflare_api.models.mixed_content_meta_dto.MixedContentMetaDto( + url = 'https://example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + data = None + ) + else: + return MixedContentResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Mixed content(s) found.', + meta = geekflare_api.models.mixed_content_meta_dto.MixedContentMetaDto( + url = 'https://example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + data = None, + ) + """ + + def testMixedContentResponseDto(self): + """Test MixedContentResponseDto""" + # 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/test/test_mixed_content_response_dto_data.py b/test/test_mixed_content_response_dto_data.py new file mode 100644 index 0000000..713c578 --- /dev/null +++ b/test/test_mixed_content_response_dto_data.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mixed_content_response_dto_data import MixedContentResponseDtoData + +class TestMixedContentResponseDtoData(unittest.TestCase): + """MixedContentResponseDtoData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MixedContentResponseDtoData: + """Test MixedContentResponseDtoData + 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 `MixedContentResponseDtoData` + """ + model = MixedContentResponseDtoData() + if include_optional: + return MixedContentResponseDtoData( + insecure = [http://example.com/style.css, http://example.com/script.js], + secure = [https://example.com/, https://fonts.googleapis.com/css?family=Open+Sans, data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...] + ) + else: + return MixedContentResponseDtoData( + insecure = [http://example.com/style.css, http://example.com/script.js], + secure = [https://example.com/, https://fonts.googleapis.com/css?family=Open+Sans, data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...], + ) + """ + + def testMixedContentResponseDtoData(self): + """Test MixedContentResponseDtoData""" + # 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/test/test_mtr_data_dto.py b/test/test_mtr_data_dto.py new file mode 100644 index 0000000..95528fa --- /dev/null +++ b/test/test_mtr_data_dto.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mtr_data_dto import MtrDataDto + +class TestMtrDataDto(unittest.TestCase): + """MtrDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MtrDataDto: + """Test MtrDataDto + 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 `MtrDataDto` + """ + model = MtrDataDto() + if include_optional: + return MtrDataDto( + hop = 1, + host = '240.192.18.19', + asn = 'AS???', + loss = 0, + sent = 2, + last = 0.28, + avg = 0.29, + best = 0.28, + worst = 0.3, + std_dev = 0.01 + ) + else: + return MtrDataDto( + hop = 1, + host = '240.192.18.19', + asn = 'AS???', + loss = 0, + sent = 2, + last = 0.28, + avg = 0.29, + best = 0.28, + worst = 0.3, + std_dev = 0.01, + ) + """ + + def testMtrDataDto(self): + """Test MtrDataDto""" + # 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/test/test_mtr_dto.py b/test/test_mtr_dto.py new file mode 100644 index 0000000..3339a24 --- /dev/null +++ b/test/test_mtr_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mtr_dto import MtrDto + +class TestMtrDto(unittest.TestCase): + """MtrDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MtrDto: + """Test MtrDto + 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 `MtrDto` + """ + model = MtrDto() + if include_optional: + return MtrDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = False + ) + else: + return MtrDto( + url = 'https://example.com', + ) + """ + + def testMtrDto(self): + """Test MtrDto""" + # 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/test/test_mtr_meta_dto.py b/test/test_mtr_meta_dto.py new file mode 100644 index 0000000..7b3c24d --- /dev/null +++ b/test/test_mtr_meta_dto.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mtr_meta_dto import MtrMetaDto + +class TestMtrMetaDto(unittest.TestCase): + """MtrMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MtrMetaDto: + """Test MtrMetaDto + 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 `MtrMetaDto` + """ + model = MtrMetaDto() + if include_optional: + return MtrMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return MtrMetaDto( + url = 'example.com', + redirected_url = 'https://example.com/', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testMtrMetaDto(self): + """Test MtrMetaDto""" + # 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/test/test_mtr_response_dto.py b/test/test_mtr_response_dto.py new file mode 100644 index 0000000..b6a75e3 --- /dev/null +++ b/test/test_mtr_response_dto.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.mtr_response_dto import MtrResponseDto + +class TestMtrResponseDto(unittest.TestCase): + """MtrResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MtrResponseDto: + """Test MtrResponseDto + 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 `MtrResponseDto` + """ + model = MtrResponseDto() + if include_optional: + return MtrResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.mtr_meta_dto.MtrMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + data = [{hop=1, host=240.192.18.19, asn=AS???, loss=0, sent=2, last=0.28, avg=0.29, best=0.28, worst=0.3, stdDev=0.01}, {hop=2, host=240.0.60.49, asn=AS???, loss=0, sent=2, last=0.28, avg=0.29, best=0.28, worst=0.29, stdDev=0.01}] + ) + else: + return MtrResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.mtr_meta_dto.MtrMetaDto( + url = 'example.com', + proxy_country = 'United States', + follow_redirect = True, + redirected_url = 'https://example.com/', + test = null, ), + data = [{hop=1, host=240.192.18.19, asn=AS???, loss=0, sent=2, last=0.28, avg=0.29, best=0.28, worst=0.3, stdDev=0.01}, {hop=2, host=240.0.60.49, asn=AS???, loss=0, sent=2, last=0.28, avg=0.29, best=0.28, worst=0.29, stdDev=0.01}], + ) + """ + + def testMtrResponseDto(self): + """Test MtrResponseDto""" + # 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/test/test_network_dto.py b/test/test_network_dto.py new file mode 100644 index 0000000..56eef1a --- /dev/null +++ b/test/test_network_dto.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.network_dto import NetworkDto + +class TestNetworkDto(unittest.TestCase): + """NetworkDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkDto: + """Test NetworkDto + 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 `NetworkDto` + """ + model = NetworkDto() + if include_optional: + return NetworkDto( + protocol = 'h2', + remote_ip = '1.1.1.1', + bytes_read = 15400 + ) + else: + return NetworkDto( + protocol = 'h2', + bytes_read = 15400, + ) + """ + + def testNetworkDto(self): + """Test NetworkDto""" + # 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/test/test_open_port_dto.py b/test/test_open_port_dto.py new file mode 100644 index 0000000..6a73108 --- /dev/null +++ b/test/test_open_port_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.open_port_dto import OpenPortDto + +class TestOpenPortDto(unittest.TestCase): + """OpenPortDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OpenPortDto: + """Test OpenPortDto + 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 `OpenPortDto` + """ + model = OpenPortDto() + if include_optional: + return OpenPortDto( + url = 'https://example.com', + top_ports = 100, + port_ranges = '80,443,1000-1010' + ) + else: + return OpenPortDto( + url = 'https://example.com', + ) + """ + + def testOpenPortDto(self): + """Test OpenPortDto""" + # 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/test/test_open_port_meta_dto.py b/test/test_open_port_meta_dto.py new file mode 100644 index 0000000..b21e36b --- /dev/null +++ b/test/test_open_port_meta_dto.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.open_port_meta_dto import OpenPortMetaDto + +class TestOpenPortMetaDto(unittest.TestCase): + """OpenPortMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OpenPortMetaDto: + """Test OpenPortMetaDto + 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 `OpenPortMetaDto` + """ + model = OpenPortMetaDto() + if include_optional: + return OpenPortMetaDto( + url = 'https://example.com', + top_ports = 100, + port_ranges = '80,443,1000-1010', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return OpenPortMetaDto( + url = 'https://example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testOpenPortMetaDto(self): + """Test OpenPortMetaDto""" + # 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/test/test_open_port_response_dto.py b/test/test_open_port_response_dto.py new file mode 100644 index 0000000..46227a1 --- /dev/null +++ b/test/test_open_port_response_dto.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.open_port_response_dto import OpenPortResponseDto + +class TestOpenPortResponseDto(unittest.TestCase): + """OpenPortResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OpenPortResponseDto: + """Test OpenPortResponseDto + 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 `OpenPortResponseDto` + """ + model = OpenPortResponseDto() + if include_optional: + return OpenPortResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.open_port_meta_dto.OpenPortMetaDto( + url = 'https://example.com', + top_ports = 100, + port_ranges = '80,443,1000-1010', + test = null, ), + data = [ + 1.337 + ] + ) + else: + return OpenPortResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.open_port_meta_dto.OpenPortMetaDto( + url = 'https://example.com', + top_ports = 100, + port_ranges = '80,443,1000-1010', + test = null, ), + data = [ + 1.337 + ], + ) + """ + + def testOpenPortResponseDto(self): + """Test OpenPortResponseDto""" + # 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/test/test_ping_data_dto.py b/test/test_ping_data_dto.py new file mode 100644 index 0000000..326bd51 --- /dev/null +++ b/test/test_ping_data_dto.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.ping_data_dto import PingDataDto + +class TestPingDataDto(unittest.TestCase): + """PingDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PingDataDto: + """Test PingDataDto + 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 `PingDataDto` + """ + model = PingDataDto() + if include_optional: + return PingDataDto( + requests = 4, + loss = 0, + latency = 32.5, + min = 30, + max = 35, + avg = 32.5, + std_dev = 1.5, + ip = '142.250.183.206' + ) + else: + return PingDataDto( + requests = 4, + loss = 0, + latency = 32.5, + min = 30, + max = 35, + avg = 32.5, + std_dev = 1.5, + ip = '142.250.183.206', + ) + """ + + def testPingDataDto(self): + """Test PingDataDto""" + # 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/test/test_ping_dto.py b/test/test_ping_dto.py new file mode 100644 index 0000000..584a5d7 --- /dev/null +++ b/test/test_ping_dto.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.ping_dto import PingDto + +class TestPingDto(unittest.TestCase): + """PingDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PingDto: + """Test PingDto + 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 `PingDto` + """ + model = PingDto() + if include_optional: + return PingDto( + url = 'https://example.com' + ) + else: + return PingDto( + url = 'https://example.com', + ) + """ + + def testPingDto(self): + """Test PingDto""" + # 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/test/test_ping_meta_dto.py b/test/test_ping_meta_dto.py new file mode 100644 index 0000000..e6699a3 --- /dev/null +++ b/test/test_ping_meta_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.ping_meta_dto import PingMetaDto + +class TestPingMetaDto(unittest.TestCase): + """PingMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PingMetaDto: + """Test PingMetaDto + 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 `PingMetaDto` + """ + model = PingMetaDto() + if include_optional: + return PingMetaDto( + url = 'example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return PingMetaDto( + url = 'example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testPingMetaDto(self): + """Test PingMetaDto""" + # 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/test/test_ping_response_dto.py b/test/test_ping_response_dto.py new file mode 100644 index 0000000..87eb4b5 --- /dev/null +++ b/test/test_ping_response_dto.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.ping_response_dto import PingResponseDto + +class TestPingResponseDto(unittest.TestCase): + """PingResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PingResponseDto: + """Test PingResponseDto + 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 `PingResponseDto` + """ + model = PingResponseDto() + if include_optional: + return PingResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.ping_meta_dto.PingMetaDto( + url = 'example.com', + test = null, ), + data = geekflare_api.models.ping_data_dto.PingDataDto( + requests = 4, + loss = 0, + latency = 32.5, + min = 30, + max = 35, + avg = 32.5, + std_dev = 1.5, + ip = '142.250.183.206', ) + ) + else: + return PingResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.ping_meta_dto.PingMetaDto( + url = 'example.com', + test = null, ), + data = geekflare_api.models.ping_data_dto.PingDataDto( + requests = 4, + loss = 0, + latency = 32.5, + min = 30, + max = 35, + avg = 32.5, + std_dev = 1.5, + ip = '142.250.183.206', ), + ) + """ + + def testPingResponseDto(self): + """Test PingResponseDto""" + # 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/test/test_protocol_support_dto.py b/test/test_protocol_support_dto.py new file mode 100644 index 0000000..0cd4f4e --- /dev/null +++ b/test/test_protocol_support_dto.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.protocol_support_dto import ProtocolSupportDto + +class TestProtocolSupportDto(unittest.TestCase): + """ProtocolSupportDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProtocolSupportDto: + """Test ProtocolSupportDto + 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 `ProtocolSupportDto` + """ + model = ProtocolSupportDto() + if include_optional: + return ProtocolSupportDto( + http10 = False, + http11 = True, + http2 = True, + http3 = False, + http3_supported_version = [h3-29, h3] + ) + else: + return ProtocolSupportDto( + http10 = False, + http11 = True, + http2 = True, + http3 = False, + ) + """ + + def testProtocolSupportDto(self): + """Test ProtocolSupportDto""" + # 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/test/test_redirect_check_dto.py b/test/test_redirect_check_dto.py new file mode 100644 index 0000000..e943faa --- /dev/null +++ b/test/test_redirect_check_dto.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.redirect_check_dto import RedirectCheckDto + +class TestRedirectCheckDto(unittest.TestCase): + """RedirectCheckDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RedirectCheckDto: + """Test RedirectCheckDto + 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 `RedirectCheckDto` + """ + model = RedirectCheckDto() + if include_optional: + return RedirectCheckDto( + url = 'https://example.com', + proxy_country = 'us' + ) + else: + return RedirectCheckDto( + url = 'https://example.com', + ) + """ + + def testRedirectCheckDto(self): + """Test RedirectCheckDto""" + # 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/test/test_redirect_check_meta_dto.py b/test/test_redirect_check_meta_dto.py new file mode 100644 index 0000000..f990bf0 --- /dev/null +++ b/test/test_redirect_check_meta_dto.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.redirect_check_meta_dto import RedirectCheckMetaDto + +class TestRedirectCheckMetaDto(unittest.TestCase): + """RedirectCheckMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RedirectCheckMetaDto: + """Test RedirectCheckMetaDto + 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 `RedirectCheckMetaDto` + """ + model = RedirectCheckMetaDto() + if include_optional: + return RedirectCheckMetaDto( + url = 'example.com', + proxy_country = US, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return RedirectCheckMetaDto( + url = 'example.com', + proxy_country = US, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testRedirectCheckMetaDto(self): + """Test RedirectCheckMetaDto""" + # 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/test/test_redirect_check_response_dto.py b/test/test_redirect_check_response_dto.py new file mode 100644 index 0000000..d08858a --- /dev/null +++ b/test/test_redirect_check_response_dto.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto + +class TestRedirectCheckResponseDto(unittest.TestCase): + """RedirectCheckResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RedirectCheckResponseDto: + """Test RedirectCheckResponseDto + 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 `RedirectCheckResponseDto` + """ + model = RedirectCheckResponseDto() + if include_optional: + return RedirectCheckResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.redirect_check_meta_dto.RedirectCheckMetaDto( + url = 'example.com', + proxy_country = US, + test = null, ), + data = [ + geekflare_api.models.redirect_hop_dto.RedirectHopDto( + url = 'http://example.com/', + status = 301, + headers = [{name=location, value=https://example.com/}, {name=date, value=Mon, 29 Aug 2022 07:17:31 GMT}], ) + ] + ) + else: + return RedirectCheckResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.redirect_check_meta_dto.RedirectCheckMetaDto( + url = 'example.com', + proxy_country = US, + test = null, ), + data = [ + geekflare_api.models.redirect_hop_dto.RedirectHopDto( + url = 'http://example.com/', + status = 301, + headers = [{name=location, value=https://example.com/}, {name=date, value=Mon, 29 Aug 2022 07:17:31 GMT}], ) + ], + ) + """ + + def testRedirectCheckResponseDto(self): + """Test RedirectCheckResponseDto""" + # 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/test/test_redirect_hop_dto.py b/test/test_redirect_hop_dto.py new file mode 100644 index 0000000..08a7823 --- /dev/null +++ b/test/test_redirect_hop_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.redirect_hop_dto import RedirectHopDto + +class TestRedirectHopDto(unittest.TestCase): + """RedirectHopDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RedirectHopDto: + """Test RedirectHopDto + 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 `RedirectHopDto` + """ + model = RedirectHopDto() + if include_optional: + return RedirectHopDto( + url = 'http://example.com/', + status = 301, + headers = [{name=location, value=https://example.com/}, {name=date, value=Mon, 29 Aug 2022 07:17:31 GMT}] + ) + else: + return RedirectHopDto( + url = 'http://example.com/', + status = 301, + headers = [{name=location, value=https://example.com/}, {name=date, value=Mon, 29 Aug 2022 07:17:31 GMT}], + ) + """ + + def testRedirectHopDto(self): + """Test RedirectHopDto""" + # 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/test/test_screenshot_dto.py b/test/test_screenshot_dto.py new file mode 100644 index 0000000..8d6f111 --- /dev/null +++ b/test/test_screenshot_dto.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.screenshot_dto import ScreenshotDto + +class TestScreenshotDto(unittest.TestCase): + """ScreenshotDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScreenshotDto: + """Test ScreenshotDto + 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 `ScreenshotDto` + """ + model = ScreenshotDto() + if include_optional: + return ScreenshotDto( + url = 'https://example.com', + device = 'desktop', + proxy_country = 'us', + type = 'png', + full_page = True, + block_ads = True, + hide_cookie = True, + skip_captcha = True, + add_timestamp = True, + page_height = 2000, + viewport_width = 1280, + viewport_height = 800, + theme = 'auto', + remove_background = False, + highlight_links = False, + delay = 2, + disable_animations = False, + quality = 90, + scale_factor = 1, + capture_beyond_viewport = True + ) + else: + return ScreenshotDto( + url = 'https://example.com', + ) + """ + + def testScreenshotDto(self): + """Test ScreenshotDto""" + # 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/test/test_screenshot_meta_dto.py b/test/test_screenshot_meta_dto.py new file mode 100644 index 0000000..1c3c7fa --- /dev/null +++ b/test/test_screenshot_meta_dto.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto + +class TestScreenshotMetaDto(unittest.TestCase): + """ScreenshotMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScreenshotMetaDto: + """Test ScreenshotMetaDto + 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 `ScreenshotMetaDto` + """ + model = ScreenshotMetaDto() + if include_optional: + return ScreenshotMetaDto( + url = 'https://example.com', + type = 'png', + device = 'desktop', + full_page = False, + block_ads = False, + hide_cookie = False, + skip_captcha = False, + add_timestamp = False, + proxy_country = '', + page_height = 2000, + viewport_width = 1280, + viewport_height = 800, + theme = 'auto', + remove_background = False, + highlight_links = False, + delay = 2, + disable_animations = False, + quality = 90, + scale_factor = 1, + capture_beyond_viewport = True, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return ScreenshotMetaDto( + url = 'https://example.com', + type = 'png', + device = 'desktop', + full_page = False, + block_ads = False, + hide_cookie = False, + skip_captcha = False, + add_timestamp = False, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testScreenshotMetaDto(self): + """Test ScreenshotMetaDto""" + # 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/test/test_screenshot_response_dto.py b/test/test_screenshot_response_dto.py new file mode 100644 index 0000000..ac99ffc --- /dev/null +++ b/test/test_screenshot_response_dto.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto + +class TestScreenshotResponseDto(unittest.TestCase): + """ScreenshotResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScreenshotResponseDto: + """Test ScreenshotResponseDto + 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 `ScreenshotResponseDto` + """ + model = ScreenshotResponseDto() + if include_optional: + return ScreenshotResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.screenshot_meta_dto.ScreenshotMetaDto( + url = 'https://example.com', + type = 'png', + device = 'desktop', + full_page = False, + block_ads = False, + hide_cookie = False, + skip_captcha = False, + add_timestamp = False, + proxy_country = '', + page_height = 2000, + viewport_width = 1280, + viewport_height = 800, + theme = 'auto', + remove_background = False, + highlight_links = False, + delay = 2, + disable_animations = False, + quality = 90, + scale_factor = 1, + capture_beyond_viewport = True, + test = null, ), + data = 'https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png' + ) + else: + return ScreenshotResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.screenshot_meta_dto.ScreenshotMetaDto( + url = 'https://example.com', + type = 'png', + device = 'desktop', + full_page = False, + block_ads = False, + hide_cookie = False, + skip_captcha = False, + add_timestamp = False, + proxy_country = '', + page_height = 2000, + viewport_width = 1280, + viewport_height = 800, + theme = 'auto', + remove_background = False, + highlight_links = False, + delay = 2, + disable_animations = False, + quality = 90, + scale_factor = 1, + capture_beyond_viewport = True, + test = null, ), + data = 'https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png', + ) + """ + + def testScreenshotResponseDto(self): + """Test ScreenshotResponseDto""" + # 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/test/test_search200_response.py b/test/test_search200_response.py new file mode 100644 index 0000000..94884f4 --- /dev/null +++ b/test/test_search200_response.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search200_response import Search200Response + +class TestSearch200Response(unittest.TestCase): + """Search200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Search200Response: + """Test Search200Response + 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 `Search200Response` + """ + model = Search200Response() + if include_optional: + return Search200Response( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = + ) + else: + return Search200Response( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = , + ) + """ + + def testSearch200Response(self): + """Test Search200Response""" + # 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/test/test_search_html_response_dto.py b/test/test_search_html_response_dto.py new file mode 100644 index 0000000..2f9a270 --- /dev/null +++ b/test/test_search_html_response_dto.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search_html_response_dto import SearchHtmlResponseDto + +class TestSearchHtmlResponseDto(unittest.TestCase): + """SearchHtmlResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchHtmlResponseDto: + """Test SearchHtmlResponseDto + 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 `SearchHtmlResponseDto` + """ + model = SearchHtmlResponseDto() + if include_optional: + return SearchHtmlResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = + ) + else: + return SearchHtmlResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = , + ) + """ + + def testSearchHtmlResponseDto(self): + """Test SearchHtmlResponseDto""" + # 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/test/test_search_markdown_response_dto.py b/test/test_search_markdown_response_dto.py new file mode 100644 index 0000000..a44515b --- /dev/null +++ b/test/test_search_markdown_response_dto.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search_markdown_response_dto import SearchMarkdownResponseDto + +class TestSearchMarkdownResponseDto(unittest.TestCase): + """SearchMarkdownResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchMarkdownResponseDto: + """Test SearchMarkdownResponseDto + 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 `SearchMarkdownResponseDto` + """ + model = SearchMarkdownResponseDto() + if include_optional: + return SearchMarkdownResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = 1. [Title](https://example.com) + - snippet + ) + else: + return SearchMarkdownResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = 1. [Title](https://example.com) + - snippet, + ) + """ + + def testSearchMarkdownResponseDto(self): + """Test SearchMarkdownResponseDto""" + # 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/test/test_search_meta_dto.py b/test/test_search_meta_dto.py new file mode 100644 index 0000000..466a871 --- /dev/null +++ b/test/test_search_meta_dto.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search_meta_dto import SearchMetaDto + +class TestSearchMetaDto(unittest.TestCase): + """SearchMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchMetaDto: + """Test SearchMetaDto + 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 `SearchMetaDto` + """ + model = SearchMetaDto() + if include_optional: + return SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testSearchMetaDto(self): + """Test SearchMetaDto""" + # 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/test/test_search_request_dto.py b/test/test_search_request_dto.py new file mode 100644 index 0000000..8da3c6e --- /dev/null +++ b/test/test_search_request_dto.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search_request_dto import SearchRequestDto + +class TestSearchRequestDto(unittest.TestCase): + """SearchRequestDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchRequestDto: + """Test SearchRequestDto + 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 `SearchRequestDto` + """ + model = SearchRequestDto() + if include_optional: + return SearchRequestDto( + query = 'best running shoes', + limit = 10, + time = 'any', + location = 'us', + source = 'web', + category = 'general', + include_domains = [reddit.com, stackoverflow.com], + exclude_domains = [pinterest.com], + format = 'json', + scrape = False, + scrape_limit = 3 + ) + else: + return SearchRequestDto( + query = 'best running shoes', + ) + """ + + def testSearchRequestDto(self): + """Test SearchRequestDto""" + # 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/test/test_search_response_dto.py b/test/test_search_response_dto.py new file mode 100644 index 0000000..23f354b --- /dev/null +++ b/test/test_search_response_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search_response_dto import SearchResponseDto + +class TestSearchResponseDto(unittest.TestCase): + """SearchResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchResponseDto: + """Test SearchResponseDto + 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 `SearchResponseDto` + """ + model = SearchResponseDto() + if include_optional: + return SearchResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = [ + geekflare_api.models.search_result_item_dto.SearchResultItemDto( + title = 'Best Running Shoes of 2025', + url = 'https://example.com/running-shoes', + snippet = 'We tested over 100 pairs to find the best running shoes...', + date = 'Dec 18, 2025', + position = 1, + content = Full article cleaned for LLM consumption..., ) + ] + ) + else: + return SearchResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = [ + geekflare_api.models.search_result_item_dto.SearchResultItemDto( + title = 'Best Running Shoes of 2025', + url = 'https://example.com/running-shoes', + snippet = 'We tested over 100 pairs to find the best running shoes...', + date = 'Dec 18, 2025', + position = 1, + content = Full article cleaned for LLM consumption..., ) + ], + ) + """ + + def testSearchResponseDto(self): + """Test SearchResponseDto""" + # 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/test/test_search_result_item_dto.py b/test/test_search_result_item_dto.py new file mode 100644 index 0000000..500f598 --- /dev/null +++ b/test/test_search_result_item_dto.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.search_result_item_dto import SearchResultItemDto + +class TestSearchResultItemDto(unittest.TestCase): + """SearchResultItemDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchResultItemDto: + """Test SearchResultItemDto + 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 `SearchResultItemDto` + """ + model = SearchResultItemDto() + if include_optional: + return SearchResultItemDto( + title = 'Best Running Shoes of 2025', + url = 'https://example.com/running-shoes', + snippet = 'We tested over 100 pairs to find the best running shoes...', + var_date = 'Dec 18, 2025', + position = 1, + content = Full article cleaned for LLM consumption... + ) + else: + return SearchResultItemDto( + title = 'Best Running Shoes of 2025', + url = 'https://example.com/running-shoes', + snippet = 'We tested over 100 pairs to find the best running shoes...', + position = 1, + ) + """ + + def testSearchResultItemDto(self): + """Test SearchResultItemDto""" + # 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/test/test_selector_extraction_field_dto.py b/test/test_selector_extraction_field_dto.py new file mode 100644 index 0000000..673738a --- /dev/null +++ b/test/test_selector_extraction_field_dto.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.selector_extraction_field_dto import SelectorExtractionFieldDto + +class TestSelectorExtractionFieldDto(unittest.TestCase): + """SelectorExtractionFieldDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelectorExtractionFieldDto: + """Test SelectorExtractionFieldDto + 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 `SelectorExtractionFieldDto` + """ + model = SelectorExtractionFieldDto() + if include_optional: + return SelectorExtractionFieldDto( + name = 'title', + selector = 'h1.product-title', + type = 'text', + attribute = 'href', + fields = [ + geekflare_api.models.selector_extraction_field_dto.SelectorExtractionFieldDto( + name = 'title', + selector = 'h1.product-title', + type = 'text', + attribute = 'href', + fields = [ + geekflare_api.models.selector_extraction_field_dto.SelectorExtractionFieldDto( + name = 'title', + selector = 'h1.product-title', + type = 'text', + attribute = 'href', ) + ], ) + ] + ) + else: + return SelectorExtractionFieldDto( + name = 'title', + selector = 'h1.product-title', + type = 'text', + ) + """ + + def testSelectorExtractionFieldDto(self): + """Test SelectorExtractionFieldDto""" + # 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/test/test_service_health_response_dto.py b/test/test_service_health_response_dto.py new file mode 100644 index 0000000..079fb88 --- /dev/null +++ b/test/test_service_health_response_dto.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.service_health_response_dto import ServiceHealthResponseDto + +class TestServiceHealthResponseDto(unittest.TestCase): + """ServiceHealthResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServiceHealthResponseDto: + """Test ServiceHealthResponseDto + 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 `ServiceHealthResponseDto` + """ + model = ServiceHealthResponseDto() + if include_optional: + return ServiceHealthResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Service health check completed', + services = [ + geekflare_api.models.service_status.ServiceStatus( + name = 'r2', + status = 'healthy', + message = 'All systems operational', ) + ] + ) + else: + return ServiceHealthResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Service health check completed', + services = [ + geekflare_api.models.service_status.ServiceStatus( + name = 'r2', + status = 'healthy', + message = 'All systems operational', ) + ], + ) + """ + + def testServiceHealthResponseDto(self): + """Test ServiceHealthResponseDto""" + # 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/test/test_service_status.py b/test/test_service_status.py new file mode 100644 index 0000000..882cd9c --- /dev/null +++ b/test/test_service_status.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.service_status import ServiceStatus + +class TestServiceStatus(unittest.TestCase): + """ServiceStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServiceStatus: + """Test ServiceStatus + 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 `ServiceStatus` + """ + model = ServiceStatus() + if include_optional: + return ServiceStatus( + name = 'r2', + status = 'healthy', + message = 'All systems operational' + ) + else: + return ServiceStatus( + name = 'r2', + status = 'healthy', + message = 'All systems operational', + ) + """ + + def testServiceStatus(self): + """Test ServiceStatus""" + # 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/test/test_site_status_dto.py b/test/test_site_status_dto.py new file mode 100644 index 0000000..40dafad --- /dev/null +++ b/test/test_site_status_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.site_status_dto import SiteStatusDto + +class TestSiteStatusDto(unittest.TestCase): + """SiteStatusDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SiteStatusDto: + """Test SiteStatusDto + 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 `SiteStatusDto` + """ + model = SiteStatusDto() + if include_optional: + return SiteStatusDto( + url = 'https://example.com', + proxy_country = 'us', + follow_redirect = False + ) + else: + return SiteStatusDto( + url = 'https://example.com', + ) + """ + + def testSiteStatusDto(self): + """Test SiteStatusDto""" + # 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/test/test_site_status_meta_dto.py b/test/test_site_status_meta_dto.py new file mode 100644 index 0000000..4148ef9 --- /dev/null +++ b/test/test_site_status_meta_dto.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.site_status_meta_dto import SiteStatusMetaDto + +class TestSiteStatusMetaDto(unittest.TestCase): + """SiteStatusMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SiteStatusMetaDto: + """Test SiteStatusMetaDto + 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 `SiteStatusMetaDto` + """ + model = SiteStatusMetaDto() + if include_optional: + return SiteStatusMetaDto( + url = 'https://example.com', + follow_redirect = True, + redirected_url = https://www.example.com/home, + proxy_country = 'US', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return SiteStatusMetaDto( + url = 'https://example.com', + follow_redirect = True, + proxy_country = 'US', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testSiteStatusMetaDto(self): + """Test SiteStatusMetaDto""" + # 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/test/test_site_status_response_dto.py b/test/test_site_status_response_dto.py new file mode 100644 index 0000000..236e963 --- /dev/null +++ b/test/test_site_status_response_dto.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.site_status_response_dto import SiteStatusResponseDto + +class TestSiteStatusResponseDto(unittest.TestCase): + """SiteStatusResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SiteStatusResponseDto: + """Test SiteStatusResponseDto + 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 `SiteStatusResponseDto` + """ + model = SiteStatusResponseDto() + if include_optional: + return SiteStatusResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Site is up', + meta = geekflare_api.models.site_status_meta_dto.SiteStatusMetaDto( + url = 'https://example.com', + follow_redirect = True, + redirected_url = https://www.example.com/home, + proxy_country = 'US', + test = null, ), + data = {statusCode=200, reasonPhrase=OK} + ) + else: + return SiteStatusResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + message = 'Site is up', + meta = geekflare_api.models.site_status_meta_dto.SiteStatusMetaDto( + url = 'https://example.com', + follow_redirect = True, + redirected_url = https://www.example.com/home, + proxy_country = 'US', + test = null, ), + data = {statusCode=200, reasonPhrase=OK}, + ) + """ + + def testSiteStatusResponseDto(self): + """Test SiteStatusResponseDto""" + # 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/test/test_test_meta_dto.py b/test/test_test_meta_dto.py new file mode 100644 index 0000000..d916e62 --- /dev/null +++ b/test/test_test_meta_dto.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.test_meta_dto import TestMetaDto + +class TestTestMetaDto(unittest.TestCase): + """TestMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestMetaDto: + """Test TestMetaDto + 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 `TestMetaDto` + """ + model = TestMetaDto() + if include_optional: + return TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq' + ) + else: + return TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', + ) + """ + + def testTestMetaDto(self): + """Test TestMetaDto""" + # 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/test/test_timings_dto.py b/test/test_timings_dto.py new file mode 100644 index 0000000..f02c037 --- /dev/null +++ b/test/test_timings_dto.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.timings_dto import TimingsDto + +class TestTimingsDto(unittest.TestCase): + """TimingsDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TimingsDto: + """Test TimingsDto + 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 `TimingsDto` + """ + model = TimingsDto() + if include_optional: + return TimingsDto( + dns = 21, + connect = 15, + tls = 40, + send = 1, + wait = 457, + ttfb = 534, + download = 4, + total = 538, + redirect_duration = 0 + ) + else: + return TimingsDto( + dns = 21, + connect = 15, + tls = 40, + send = 1, + wait = 457, + ttfb = 534, + download = 4, + total = 538, + redirect_duration = 0, + ) + """ + + def testTimingsDto(self): + """Test TimingsDto""" + # 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/test/test_tls_certificate_dto.py b/test/test_tls_certificate_dto.py new file mode 100644 index 0000000..4e1758d --- /dev/null +++ b/test/test_tls_certificate_dto.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_certificate_dto import TlsCertificateDto + +class TestTlsCertificateDto(unittest.TestCase): + """TlsCertificateDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsCertificateDto: + """Test TlsCertificateDto + 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 `TlsCertificateDto` + """ + model = TlsCertificateDto() + if include_optional: + return TlsCertificateDto( + common_name = 'sni.cloudflaressl.com', + subject_alt_name = 'DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com', + issuer = geekflare_api.models.tls_certificate_issuer_dto.TlsCertificateIssuerDto( + country = 'US', + organization = 'Cloudflare, Inc.', + common_name = 'Cloudflare Inc ECC CA-3', ), + expiry = 'Jun 6 23:59:59 2023 GMT' + ) + else: + return TlsCertificateDto( + common_name = 'sni.cloudflaressl.com', + subject_alt_name = 'DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com', + issuer = geekflare_api.models.tls_certificate_issuer_dto.TlsCertificateIssuerDto( + country = 'US', + organization = 'Cloudflare, Inc.', + common_name = 'Cloudflare Inc ECC CA-3', ), + expiry = 'Jun 6 23:59:59 2023 GMT', + ) + """ + + def testTlsCertificateDto(self): + """Test TlsCertificateDto""" + # 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/test/test_tls_certificate_issuer_dto.py b/test/test_tls_certificate_issuer_dto.py new file mode 100644 index 0000000..6b94688 --- /dev/null +++ b/test/test_tls_certificate_issuer_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_certificate_issuer_dto import TlsCertificateIssuerDto + +class TestTlsCertificateIssuerDto(unittest.TestCase): + """TlsCertificateIssuerDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsCertificateIssuerDto: + """Test TlsCertificateIssuerDto + 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 `TlsCertificateIssuerDto` + """ + model = TlsCertificateIssuerDto() + if include_optional: + return TlsCertificateIssuerDto( + country = 'US', + organization = 'Cloudflare, Inc.', + common_name = 'Cloudflare Inc ECC CA-3' + ) + else: + return TlsCertificateIssuerDto( + country = 'US', + organization = 'Cloudflare, Inc.', + common_name = 'Cloudflare Inc ECC CA-3', + ) + """ + + def testTlsCertificateIssuerDto(self): + """Test TlsCertificateIssuerDto""" + # 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/test/test_tls_protocols_dto.py b/test/test_tls_protocols_dto.py new file mode 100644 index 0000000..eece42c --- /dev/null +++ b/test/test_tls_protocols_dto.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_protocols_dto import TlsProtocolsDto + +class TestTlsProtocolsDto(unittest.TestCase): + """TlsProtocolsDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsProtocolsDto: + """Test TlsProtocolsDto + 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 `TlsProtocolsDto` + """ + model = TlsProtocolsDto() + if include_optional: + return TlsProtocolsDto( + tls10 = False, + tls11 = False, + tls12 = True, + tls13 = True + ) + else: + return TlsProtocolsDto( + tls10 = False, + tls11 = False, + tls12 = True, + tls13 = True, + ) + """ + + def testTlsProtocolsDto(self): + """Test TlsProtocolsDto""" + # 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/test/test_tls_scan_data_dto.py b/test/test_tls_scan_data_dto.py new file mode 100644 index 0000000..08a108c --- /dev/null +++ b/test/test_tls_scan_data_dto.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_scan_data_dto import TlsScanDataDto + +class TestTlsScanDataDto(unittest.TestCase): + """TlsScanDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsScanDataDto: + """Test TlsScanDataDto + 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 `TlsScanDataDto` + """ + model = TlsScanDataDto() + if include_optional: + return TlsScanDataDto( + protocols = geekflare_api.models.tls_protocols_dto.TlsProtocolsDto( + tls10 = False, + tls11 = False, + tls12 = True, + tls13 = True, ), + certificate = geekflare_api.models.tls_certificate_dto.TlsCertificateDto( + common_name = 'sni.cloudflaressl.com', + subject_alt_name = 'DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com', + issuer = null, + expiry = 'Jun 6 23:59:59 2023 GMT', ) + ) + else: + return TlsScanDataDto( + protocols = geekflare_api.models.tls_protocols_dto.TlsProtocolsDto( + tls10 = False, + tls11 = False, + tls12 = True, + tls13 = True, ), + certificate = geekflare_api.models.tls_certificate_dto.TlsCertificateDto( + common_name = 'sni.cloudflaressl.com', + subject_alt_name = 'DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com', + issuer = null, + expiry = 'Jun 6 23:59:59 2023 GMT', ), + ) + """ + + def testTlsScanDataDto(self): + """Test TlsScanDataDto""" + # 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/test/test_tls_scan_dto.py b/test/test_tls_scan_dto.py new file mode 100644 index 0000000..84a3d75 --- /dev/null +++ b/test/test_tls_scan_dto.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_scan_dto import TlsScanDto + +class TestTlsScanDto(unittest.TestCase): + """TlsScanDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsScanDto: + """Test TlsScanDto + 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 `TlsScanDto` + """ + model = TlsScanDto() + if include_optional: + return TlsScanDto( + url = 'https://example.com' + ) + else: + return TlsScanDto( + url = 'https://example.com', + ) + """ + + def testTlsScanDto(self): + """Test TlsScanDto""" + # 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/test/test_tls_scan_meta_dto.py b/test/test_tls_scan_meta_dto.py new file mode 100644 index 0000000..ab188c1 --- /dev/null +++ b/test/test_tls_scan_meta_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_scan_meta_dto import TlsScanMetaDto + +class TestTlsScanMetaDto(unittest.TestCase): + """TlsScanMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsScanMetaDto: + """Test TlsScanMetaDto + 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 `TlsScanMetaDto` + """ + model = TlsScanMetaDto() + if include_optional: + return TlsScanMetaDto( + url = 'example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return TlsScanMetaDto( + url = 'example.com', + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testTlsScanMetaDto(self): + """Test TlsScanMetaDto""" + # 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/test/test_tls_scan_response_dto.py b/test/test_tls_scan_response_dto.py new file mode 100644 index 0000000..bc0da4e --- /dev/null +++ b/test/test_tls_scan_response_dto.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.tls_scan_response_dto import TlsScanResponseDto + +class TestTlsScanResponseDto(unittest.TestCase): + """TlsScanResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TlsScanResponseDto: + """Test TlsScanResponseDto + 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 `TlsScanResponseDto` + """ + model = TlsScanResponseDto() + if include_optional: + return TlsScanResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.tls_scan_meta_dto.TlsScanMetaDto( + url = 'example.com', + test = {id=40zt4but04y07ccn4pov5fiolzrxbxdg}, ), + data = geekflare_api.models.tls_scan_data_dto.TlsScanDataDto( + protocols = null, + certificate = null, ) + ) + else: + return TlsScanResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.tls_scan_meta_dto.TlsScanMetaDto( + url = 'example.com', + test = {id=40zt4but04y07ccn4pov5fiolzrxbxdg}, ), + data = geekflare_api.models.tls_scan_data_dto.TlsScanDataDto( + protocols = null, + certificate = null, ), + ) + """ + + def testTlsScanResponseDto(self): + """Test TlsScanResponseDto""" + # 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/test/test_url2_pdf_dto.py b/test/test_url2_pdf_dto.py new file mode 100644 index 0000000..3812d35 --- /dev/null +++ b/test/test_url2_pdf_dto.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.url2_pdf_dto import Url2PdfDto + +class TestUrl2PdfDto(unittest.TestCase): + """Url2PdfDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Url2PdfDto: + """Test Url2PdfDto + 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 `Url2PdfDto` + """ + model = Url2PdfDto() + if include_optional: + return Url2PdfDto( + url = 'https://example.com', + device = 'desktop', + proxy_country = 'us', + format = 'a4', + orientation = 'portrait', + margin = geekflare_api.models.margin_dto.MarginDto( + top = 25.4, + bottom = 25.4, + right = 25.4, + left = 25.4, ), + scale = 1.5, + hide_cookie = False, + skip_captcha = False, + add_timestamp = False + ) + else: + return Url2PdfDto( + url = 'https://example.com', + ) + """ + + def testUrl2PdfDto(self): + """Test Url2PdfDto""" + # 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/test/test_url2_pdf_meta_dto.py b/test/test_url2_pdf_meta_dto.py new file mode 100644 index 0000000..ed99d13 --- /dev/null +++ b/test/test_url2_pdf_meta_dto.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.url2_pdf_meta_dto import Url2PdfMetaDto + +class TestUrl2PdfMetaDto(unittest.TestCase): + """Url2PdfMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Url2PdfMetaDto: + """Test Url2PdfMetaDto + 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 `Url2PdfMetaDto` + """ + model = Url2PdfMetaDto() + if include_optional: + return Url2PdfMetaDto( + url = 'https://example.com', + device = 'desktop', + proxy_country = '', + format = 'letter', + orientation = 'landscape', + margin = geekflare_api.models.margin_dto.MarginDto( + top = 25.4, + bottom = 25.4, + right = 25.4, + left = 25.4, ), + scale = 1.5, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return Url2PdfMetaDto( + url = 'https://example.com', + device = 'desktop', + format = 'letter', + orientation = 'landscape', + scale = 1.5, + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testUrl2PdfMetaDto(self): + """Test Url2PdfMetaDto""" + # 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/test/test_url2_pdf_response_dto.py b/test/test_url2_pdf_response_dto.py new file mode 100644 index 0000000..3ab6ecc --- /dev/null +++ b/test/test_url2_pdf_response_dto.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.url2_pdf_response_dto import Url2PdfResponseDto + +class TestUrl2PdfResponseDto(unittest.TestCase): + """Url2PdfResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Url2PdfResponseDto: + """Test Url2PdfResponseDto + 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 `Url2PdfResponseDto` + """ + model = Url2PdfResponseDto() + if include_optional: + return Url2PdfResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.url2_pdf_meta_dto.Url2PdfMetaDto( + url = 'https://example.com', + device = 'desktop', + proxy_country = '', + format = 'letter', + orientation = 'landscape', + margin = null, + scale = 1.5, + test = null, ), + data = 'https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf' + ) + else: + return Url2PdfResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.url2_pdf_meta_dto.Url2PdfMetaDto( + url = 'https://example.com', + device = 'desktop', + proxy_country = '', + format = 'letter', + orientation = 'landscape', + margin = null, + scale = 1.5, + test = null, ), + data = 'https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf', + ) + """ + + def testUrl2PdfResponseDto(self): + """Test Url2PdfResponseDto""" + # 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/test/test_web_scrape_dto.py b/test/test_web_scrape_dto.py new file mode 100644 index 0000000..77022d8 --- /dev/null +++ b/test/test_web_scrape_dto.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.web_scrape_dto import WebScrapeDto + +class TestWebScrapeDto(unittest.TestCase): + """WebScrapeDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebScrapeDto: + """Test WebScrapeDto + 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 `WebScrapeDto` + """ + model = WebScrapeDto() + if include_optional: + return WebScrapeDto( + url = 'https://example.com', + device = 'desktop', + block_ads = True, + render_js = True, + proxy_country = 'us', + format = html,markdown, + file_output = False, + stealth = False, + wait_time = 2.5, + extraction_mode = 'default', + extraction_schema = geekflare_api.models.extraction_schema_dto.ExtractionSchemaDto( + name = 'Product Schema', + base_selector = '.product', + fields = [ + null + ], ) + ) + else: + return WebScrapeDto( + url = 'https://example.com', + ) + """ + + def testWebScrapeDto(self): + """Test WebScrapeDto""" + # 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/test/test_web_scrape_meta_dto.py b/test/test_web_scrape_meta_dto.py new file mode 100644 index 0000000..707f024 --- /dev/null +++ b/test/test_web_scrape_meta_dto.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto + +class TestWebScrapeMetaDto(unittest.TestCase): + """WebScrapeMetaDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebScrapeMetaDto: + """Test WebScrapeMetaDto + 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 `WebScrapeMetaDto` + """ + model = WebScrapeMetaDto() + if include_optional: + return WebScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = [html-llm], + file_output = False, + block_ads = True, + render_js = True, + stealth = False, + wait_time = 2.5, + proxy_country = '', + extraction_mode = 'default', + extraction_schema = geekflare_api.models.extraction_schema_dto.ExtractionSchemaDto( + name = 'Product Schema', + base_selector = '.product', + fields = [ + null + ], ), + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ) + ) + else: + return WebScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = [html-llm], + file_output = False, + block_ads = True, + render_js = True, + stealth = False, + wait_time = 2.5, + extraction_mode = 'default', + extraction_schema = geekflare_api.models.extraction_schema_dto.ExtractionSchemaDto( + name = 'Product Schema', + base_selector = '.product', + fields = [ + null + ], ), + test = geekflare_api.models.test_meta_dto.TestMetaDto( + id = 'mxqx9v9y0742lap6altwdteqd28t23nq', ), + ) + """ + + def testWebScrapeMetaDto(self): + """Test WebScrapeMetaDto""" + # 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/test/test_web_scrape_response_dto.py b/test/test_web_scrape_response_dto.py new file mode 100644 index 0000000..ed5e189 --- /dev/null +++ b/test/test_web_scrape_response_dto.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto + +class TestWebScrapeResponseDto(unittest.TestCase): + """WebScrapeResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebScrapeResponseDto: + """Test WebScrapeResponseDto + 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 `WebScrapeResponseDto` + """ + model = WebScrapeResponseDto() + if include_optional: + return WebScrapeResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.web_scrape_meta_dto.WebScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = [html-llm], + file_output = False, + block_ads = True, + render_js = True, + stealth = False, + wait_time = 2.5, + proxy_country = '', + extraction_mode = 'default', + extraction_schema = null, + test = null, ), + data = https://example.com/9bulgk075ed9m3vhua5vcrp0.html + ) + else: + return WebScrapeResponseDto( + timestamp = 1777874383873, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.web_scrape_meta_dto.WebScrapeMetaDto( + url = 'https://example.com', + device = 'desktop', + format = [html-llm], + file_output = False, + block_ads = True, + render_js = True, + stealth = False, + wait_time = 2.5, + proxy_country = '', + extraction_mode = 'default', + extraction_schema = null, + test = null, ), + data = https://example.com/9bulgk075ed9m3vhua5vcrp0.html, + ) + """ + + def testWebScrapeResponseDto(self): + """Test WebScrapeResponseDto""" + # 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/tox.ini b/tox.ini new file mode 100644 index 0000000..fa2227c --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=geekflare_api From 6d77e589199c1e7b0deed46b62f0caf6d2c7b9b7 Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Tue, 5 May 2026 15:40:39 +0530 Subject: [PATCH 2/9] Add GeekflareClient class to interact with Geekflare API --- geekflare_api/__init__.py | 1 + geekflare_api/client.py | 90 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 geekflare_api/client.py diff --git a/geekflare_api/__init__.py b/geekflare_api/__init__.py index 6ab2490..c9bb073 100644 --- a/geekflare_api/__init__.py +++ b/geekflare_api/__init__.py @@ -211,4 +211,5 @@ from geekflare_api.models.web_scrape_dto import WebScrapeDto as WebScrapeDto from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto as WebScrapeMetaDto from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto as WebScrapeResponseDto +from geekflare_api.client import GeekflareClient diff --git a/geekflare_api/client.py b/geekflare_api/client.py new file mode 100644 index 0000000..55ea90d --- /dev/null +++ b/geekflare_api/client.py @@ -0,0 +1,90 @@ +import geekflare_api +from geekflare_api.api.api_tool_api import ApiToolApi +from geekflare_api.models import ( + BrokenLinkDto, + DnsRecordDto, + DnsSecDto, + LighthouseDto, + LoadTimeDto, + MetaScrapeDto, + MixedContentDto, + MtrDto, + OpenPortDto, + PingDto, + RedirectCheckDto, + ScreenshotDto, + SearchRequestDto, + SiteStatusDto, + TlsScanDto, + Url2PdfDto, + WebScrapeDto, +) + + +class GeekflareClient: + def __init__(self, api_key: str, base_url: str = "https://api.geekflare.com"): + configuration = geekflare_api.Configuration(host=base_url) + configuration.api_key["x-api-key"] = api_key + configuration.api_key_prefix["x-api-key"] = "" + self._client = geekflare_api.ApiClient(configuration) + self._api = ApiToolApi(self._client) + + def meta_scrape(self, body: MetaScrapeDto): + return self._api.meta_scrape(body) + + def web_scrape(self, body: WebScrapeDto): + return self._api.web_scrape(body) + + def dns_record(self, body: DnsRecordDto): + return self._api.dns_record(body) + + def screenshot(self, body: ScreenshotDto): + return self._api.screenshot(body) + + def site_status(self, body: SiteStatusDto): + return self._api.site_status(body) + + def redirect_check(self, body: RedirectCheckDto): + return self._api.redirect_check(body) + + def broken_link(self, body: BrokenLinkDto): + return self._api.broken_link(body) + + def url2_pdf(self, body: Url2PdfDto): + return self._api.url2_pdf(body) + + def open_ports(self, body: OpenPortDto): + return self._api.open_ports(body) + + def tls_scan(self, body: TlsScanDto): + return self._api.tls_scan(body) + + def load_time(self, body: LoadTimeDto): + return self._api.load_time(body) + + def mixed_content(self, body: MixedContentDto): + return self._api.mixed_content(body) + + def dns_sec(self, body: DnsSecDto): + return self._api.dns_sec(body) + + def mtr(self, body: MtrDto): + return self._api.mtr(body) + + def ping(self, body: PingDto): + return self._api.ping(body) + + def lighthouse(self, body: LighthouseDto): + return self._api.lighthouse(body) + + def search(self, body: SearchRequestDto): + return self._api.search(body) + + def close(self): + self._client.close() + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() \ No newline at end of file From bfe6ea9132d6ea07c322622b019d907612e9fdf3 Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Tue, 5 May 2026 18:02:54 +0530 Subject: [PATCH 3/9] Remove unnecessary API key prefix configuration and update resource cleanup in GeekflareClient --- geekflare_api/client.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/geekflare_api/client.py b/geekflare_api/client.py index 55ea90d..821251b 100644 --- a/geekflare_api/client.py +++ b/geekflare_api/client.py @@ -25,7 +25,6 @@ class GeekflareClient: def __init__(self, api_key: str, base_url: str = "https://api.geekflare.com"): configuration = geekflare_api.Configuration(host=base_url) configuration.api_key["x-api-key"] = api_key - configuration.api_key_prefix["x-api-key"] = "" self._client = geekflare_api.ApiClient(configuration) self._api = ApiToolApi(self._client) @@ -80,11 +79,8 @@ def lighthouse(self, body: LighthouseDto): def search(self, body: SearchRequestDto): return self._api.search(body) - def close(self): - self._client.close() - def __enter__(self): return self def __exit__(self, *args): - self.close() \ No newline at end of file + self._client.rest_client.pool_manager.clear() \ No newline at end of file From 043ea293716a89707c48b9b35b6a143ccdbbeb8f Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Wed, 6 May 2026 11:19:33 +0530 Subject: [PATCH 4/9] Update API method calls in GeekflareClient to use explicit DTO parameter names --- geekflare_api/client.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/geekflare_api/client.py b/geekflare_api/client.py index 821251b..f4d58ba 100644 --- a/geekflare_api/client.py +++ b/geekflare_api/client.py @@ -29,55 +29,55 @@ def __init__(self, api_key: str, base_url: str = "https://api.geekflare.com"): self._api = ApiToolApi(self._client) def meta_scrape(self, body: MetaScrapeDto): - return self._api.meta_scrape(body) + return self._api.meta_scrape(meta_scrape_dto=body) def web_scrape(self, body: WebScrapeDto): - return self._api.web_scrape(body) + return self._api.web_scrape(web_scrape_dto=body) def dns_record(self, body: DnsRecordDto): - return self._api.dns_record(body) + return self._api.dns_record(dns_record_dto=body) def screenshot(self, body: ScreenshotDto): - return self._api.screenshot(body) + return self._api.screenshot(screenshot_dto=body) def site_status(self, body: SiteStatusDto): - return self._api.site_status(body) + return self._api.site_status(site_status_dto=body) def redirect_check(self, body: RedirectCheckDto): - return self._api.redirect_check(body) + return self._api.redirect_check(redirect_check_dto=body) def broken_link(self, body: BrokenLinkDto): - return self._api.broken_link(body) + return self._api.broken_link(broken_link_dto=body) def url2_pdf(self, body: Url2PdfDto): - return self._api.url2_pdf(body) + return self._api.url2_pdf(url2_pdf_dto=body) def open_ports(self, body: OpenPortDto): - return self._api.open_ports(body) + return self._api.open_ports(open_port_dto=body) def tls_scan(self, body: TlsScanDto): - return self._api.tls_scan(body) + return self._api.tls_scan(tls_scan_dto=body) def load_time(self, body: LoadTimeDto): - return self._api.load_time(body) + return self._api.load_time(load_time_dto=body) def mixed_content(self, body: MixedContentDto): - return self._api.mixed_content(body) + return self._api.mixed_content(mixed_content_dto=body) def dns_sec(self, body: DnsSecDto): - return self._api.dns_sec(body) + return self._api.dns_sec(dns_sec_dto=body) def mtr(self, body: MtrDto): - return self._api.mtr(body) + return self._api.mtr(mtr_dto=body) def ping(self, body: PingDto): - return self._api.ping(body) + return self._api.ping(ping_dto=body) def lighthouse(self, body: LighthouseDto): - return self._api.lighthouse(body) + return self._api.lighthouse(lighthouse_dto=body) def search(self, body: SearchRequestDto): - return self._api.search(body) + return self._api.search(search_request_dto=body) def __enter__(self): return self From 6d681869c6892e7e97f7830dfeaee2fc7610d535 Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Wed, 6 May 2026 11:50:16 +0530 Subject: [PATCH 5/9] Refactor API method calls in GeekflareClient to use a unified _call method for improved readability and maintainability --- geekflare_api/client.py | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/geekflare_api/client.py b/geekflare_api/client.py index f4d58ba..41b22ca 100644 --- a/geekflare_api/client.py +++ b/geekflare_api/client.py @@ -1,3 +1,4 @@ +import json import geekflare_api from geekflare_api.api.api_tool_api import ApiToolApi from geekflare_api.models import ( @@ -28,56 +29,60 @@ def __init__(self, api_key: str, base_url: str = "https://api.geekflare.com"): self._client = geekflare_api.ApiClient(configuration) self._api = ApiToolApi(self._client) + def _call(self, method, **kwargs): + response = method(**kwargs) + return json.loads(response.data) + def meta_scrape(self, body: MetaScrapeDto): - return self._api.meta_scrape(meta_scrape_dto=body) + return self._call(self._api.meta_scrape_without_preload_content, meta_scrape_dto=body) def web_scrape(self, body: WebScrapeDto): - return self._api.web_scrape(web_scrape_dto=body) + return self._call(self._api.web_scrape_without_preload_content, web_scrape_dto=body) def dns_record(self, body: DnsRecordDto): - return self._api.dns_record(dns_record_dto=body) + return self._call(self._api.dns_record_without_preload_content, dns_record_dto=body) def screenshot(self, body: ScreenshotDto): - return self._api.screenshot(screenshot_dto=body) + return self._call(self._api.screenshot_without_preload_content, screenshot_dto=body) def site_status(self, body: SiteStatusDto): - return self._api.site_status(site_status_dto=body) + return self._call(self._api.site_status_without_preload_content, site_status_dto=body) def redirect_check(self, body: RedirectCheckDto): - return self._api.redirect_check(redirect_check_dto=body) + return self._call(self._api.redirect_check_without_preload_content, redirect_check_dto=body) def broken_link(self, body: BrokenLinkDto): - return self._api.broken_link(broken_link_dto=body) + return self._call(self._api.broken_link_without_preload_content, broken_link_dto=body) def url2_pdf(self, body: Url2PdfDto): - return self._api.url2_pdf(url2_pdf_dto=body) + return self._call(self._api.url2_pdf_without_preload_content, url2_pdf_dto=body) def open_ports(self, body: OpenPortDto): - return self._api.open_ports(open_port_dto=body) + return self._call(self._api.open_ports_without_preload_content, open_port_dto=body) def tls_scan(self, body: TlsScanDto): - return self._api.tls_scan(tls_scan_dto=body) + return self._call(self._api.tls_scan_without_preload_content, tls_scan_dto=body) def load_time(self, body: LoadTimeDto): - return self._api.load_time(load_time_dto=body) + return self._call(self._api.load_time_without_preload_content, load_time_dto=body) def mixed_content(self, body: MixedContentDto): - return self._api.mixed_content(mixed_content_dto=body) + return self._call(self._api.mixed_content_without_preload_content, mixed_content_dto=body) def dns_sec(self, body: DnsSecDto): - return self._api.dns_sec(dns_sec_dto=body) + return self._call(self._api.dns_sec_without_preload_content, dns_sec_dto=body) def mtr(self, body: MtrDto): - return self._api.mtr(mtr_dto=body) + return self._call(self._api.mtr_without_preload_content, mtr_dto=body) def ping(self, body: PingDto): - return self._api.ping(ping_dto=body) + return self._call(self._api.ping_without_preload_content, ping_dto=body) def lighthouse(self, body: LighthouseDto): - return self._api.lighthouse(lighthouse_dto=body) + return self._call(self._api.lighthouse_without_preload_content, lighthouse_dto=body) def search(self, body: SearchRequestDto): - return self._api.search(search_request_dto=body) + return self._call(self._api.search_without_preload_content, search_request_dto=body) def __enter__(self): return self From e86e880565b7f0ca95c1091b4f0cf5e919cf17e9 Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Wed, 6 May 2026 12:16:31 +0530 Subject: [PATCH 6/9] Refactor pyproject.toml to standardize project metadata and dependencies --- pyproject.toml | 106 +++++++++---------------------------------------- 1 file changed, 18 insertions(+), 88 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index be00b53..971ecd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,95 +1,25 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + [project] -name = "geekflare_api" +name = "geekflare-api" version = "0.1.0" -description = "Geekflare API" -authors = [ - {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, -] -license = { text = "MIT" } +description = "Official Python SDK for Geekflare API" readme = "README.md" -keywords = ["OpenAPI", "OpenAPI-Generator", "Geekflare API"] -requires-python = ">=3.9" - +license = { text = "MIT" } +authors = [{ name = "Geekflare", email = "support@geekflare.com" }] +keywords = ["geekflare", "api", "sdk", "scraping", "screenshot", "dns", "search"] +requires-python = ">=3.8" dependencies = [ - "urllib3 (>=2.1.0,<3.0.0)", - "python-dateutil (>=2.8.2)", - "pydantic (>=2.11)", - "typing-extensions (>=4.7.1)", + "urllib3>=1.25.3", + "python-dateutil>=2.8.2", + "pydantic>=2.0.0", + "typing-extensions>=4.7.1", ] [project.urls] -Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" - -[tool.poetry] -requires-poetry = ">=2.0" - -[tool.poetry.group.dev.dependencies] -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" - - -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[tool.pylint.'MESSAGES CONTROL'] -extension-pkg-whitelist = "pydantic" - -[tool.mypy] -files = [ - "geekflare_api", - #"test", # auto-generated tests - "tests", # hand-written tests -] -# TODO: enable "strict" once all these individual checks are passing -# strict = true - -# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options -warn_unused_configs = true -warn_redundant_casts = true -warn_unused_ignores = true - -## Getting these passing should be easy -strict_equality = true -extra_checks = true - -## Strongly recommend enabling this one as soon as you can -check_untyped_defs = true - -## These shouldn't be too much additional work, but may be tricky to -## get passing if you use a lot of untyped libraries -disallow_subclassing_any = true -disallow_untyped_decorators = true -disallow_any_generics = true - -### These next few are various gradations of forcing use of type annotations -#disallow_untyped_calls = true -#disallow_incomplete_defs = true -#disallow_untyped_defs = true -# -### This one isn't too hard to get passing, but return on investment is lower -#no_implicit_reexport = true -# -### This one can be tricky to get passing if you use a lot of untyped libraries -#warn_return_any = true - -[[tool.mypy.overrides]] -module = [ - "geekflare_api.configuration", -] -warn_unused_ignores = true -strict_equality = true -extra_checks = true -check_untyped_defs = true -disallow_subclassing_any = true -disallow_untyped_decorators = true -disallow_any_generics = true -disallow_untyped_calls = true -disallow_incomplete_defs = true -disallow_untyped_defs = true -no_implicit_reexport = true -warn_return_any = true +Homepage = "https://github.com/geekflare/geekflare-api-python" +Documentation = "https://docs.geekflare.com/api/intro" +Repository = "https://github.com/geekflare/geekflare-api-python" +Issues = "https://github.com/geekflare/geekflare-api-python/issues" \ No newline at end of file From 13e4460046fe1a4dfca56216c191787a6336df79 Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Wed, 6 May 2026 14:18:53 +0530 Subject: [PATCH 7/9] Update README.md to reflect SDK details and installation instructions; add test.py to .gitignore --- .gitignore | 2 + README.md | 248 ++++++++++------------------------------------------- 2 files changed, 47 insertions(+), 203 deletions(-) diff --git a/.gitignore b/.gitignore index 65b06b9..5f36ff5 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,5 @@ target/ # Ipython Notebook .ipynb_checkpoints + +test.py diff --git a/README.md b/README.md index 2c979ac..a4593dc 100644 --- a/README.md +++ b/README.md @@ -1,221 +1,63 @@ # geekflare-api -Official OpenAPI specification for all Geekflare API endpoints. -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: +Official Python SDK for the [Geekflare API](https://geekflare.com/api/). -- API version: 1.0.0 -- Package version: 0.1.0 -- Generator version: 7.23.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +## Installation -## Requirements. - -Python 3.10+ - -## 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 +```bash +pip install geekflare-api ``` -(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 geekflare_api -``` - -### 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) +## Quick Start -Then import the package: ```python -import geekflare_api -``` - -### Tests +from geekflare_api.client import GeekflareClient +from geekflare_api.models import PingDto -Execute `pytest` to run the tests. - -## Getting Started +with GeekflareClient(api_key="your-api-key") as client: + result = client.ping(PingDto(url="https://google.com")) + print(result) +``` -Please follow the [installation procedure](#installation--usage) and then run the following: +## Available Methods + +| Method | Description | +| ----------------------------- | ------------------------------ | +| `client.meta_scrape(body)` | Scrape meta tags from a URL | +| `client.web_scrape(body)` | Scrape web page content | +| `client.dns_record(body)` | Look up DNS records | +| `client.screenshot(body)` | Take a screenshot of a URL | +| `client.site_status(body)` | Check if a site is up or down | +| `client.redirect_check(body)` | Check redirect chain of a URL | +| `client.broken_link(body)` | Find broken links on a page | +| `client.url2_pdf(body)` | Convert a URL to PDF | +| `client.open_ports(body)` | Scan open ports on a host | +| `client.tls_scan(body)` | Scan TLS/SSL configuration | +| `client.load_time(body)` | Test page load time | +| `client.mixed_content(body)` | Check for mixed content issues | +| `client.dns_sec(body)` | Check DNSSEC configuration | +| `client.mtr(body)` | Perform MTR network test | +| `client.ping(body)` | Ping a host | +| `client.lighthouse(body)` | Run Lighthouse audit | +| `client.search(body)` | Perform a web search | + +## Error Handling ```python +from geekflare_api.exceptions import ApiException -import geekflare_api -from geekflare_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.geekflare.com -# See configuration.py for a list of all supported configuration parameters. -configuration = geekflare_api.Configuration( - host = "https://api.geekflare.com" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x-api-key -configuration.api_key['x-api-key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - - -# Enter a context with an instance of the API client -with geekflare_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = geekflare_api.ApiToolApi(api_client) - broken_link_dto = geekflare_api.BrokenLinkDto() # BrokenLinkDto | - - try: - # Check if a webpage contains broken links - api_response = api_instance.broken_link(broken_link_dto) - print("The response of ApiToolApi->broken_link:\n") - pprint(api_response) - except ApiException as e: - print("Exception when calling ApiToolApi->broken_link: %s\n" % e) - +try: + result = client.ping(PingDto(url="https://google.com")) +except ApiException as e: + print(f"API error {e.status}: {e.reason}") ``` -## Documentation for API Endpoints - -All URIs are relative to *https://api.geekflare.com* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ApiToolApi* | [**broken_link**](docs/ApiToolApi.md#broken_link) | **POST** /brokenlink | Check if a webpage contains broken links -*ApiToolApi* | [**dns_record**](docs/ApiToolApi.md#dns_record) | **POST** /dnsrecord | Retrieve DNS records for a given domain -*ApiToolApi* | [**dns_sec**](docs/ApiToolApi.md#dns_sec) | **POST** /dnssec | Check if DNSSEC is enabled for a domain -*ApiToolApi* | [**lighthouse**](docs/ApiToolApi.md#lighthouse) | **POST** /lighthouse | Run Lighthouse audit on a website -*ApiToolApi* | [**load_time**](docs/ApiToolApi.md#load_time) | **POST** /loadtime | Measure the page load time for a given URL -*ApiToolApi* | [**meta_scrape**](docs/ApiToolApi.md#meta_scrape) | **POST** /metascraping | Scrape a webpage meta with custom options -*ApiToolApi* | [**mixed_content**](docs/ApiToolApi.md#mixed_content) | **POST** /mixedcontent | Check for mixed content on a site -*ApiToolApi* | [**mtr**](docs/ApiToolApi.md#mtr) | **POST** /mtr | Perform MTR (My Traceroute) network diagnostic test -*ApiToolApi* | [**open_ports**](docs/ApiToolApi.md#open_ports) | **POST** /openport | Scan a website for open ports -*ApiToolApi* | [**ping**](docs/ApiToolApi.md#ping) | **POST** /ping | Perform ICMP Ping test on a given URL or IP -*ApiToolApi* | [**redirect_check**](docs/ApiToolApi.md#redirect_check) | **POST** /redirectcheck | Check the redirection chain of a given URL -*ApiToolApi* | [**screenshot**](docs/ApiToolApi.md#screenshot) | **POST** /screenshot | Capture a full-page screenshot of a website -*ApiToolApi* | [**search**](docs/ApiToolApi.md#search) | **POST** /search | Search API for AI Agents & LLMs -*ApiToolApi* | [**site_status**](docs/ApiToolApi.md#site_status) | **POST** /up | Check if a site is up or down -*ApiToolApi* | [**tls_scan**](docs/ApiToolApi.md#tls_scan) | **POST** /tlsscan | Perform TLS scan for a given domain -*ApiToolApi* | [**url2_pdf**](docs/ApiToolApi.md#url2_pdf) | **POST** /url2pdf | Capture a full-page Url2Pdf of a website -*ApiToolApi* | [**web_scrape**](docs/ApiToolApi.md#web_scrape) | **POST** /webscraping | Scrape a webpage with custom options - - -## Documentation For Models - - - [BaseErrorResponseDto](docs/BaseErrorResponseDto.md) - - [BrokenLinkDto](docs/BrokenLinkDto.md) - - [BrokenLinkMetaDto](docs/BrokenLinkMetaDto.md) - - [BrokenLinkResponseDto](docs/BrokenLinkResponseDto.md) - - [BrokenLinkSummaryDto](docs/BrokenLinkSummaryDto.md) - - [DefaultExtractionFieldDto](docs/DefaultExtractionFieldDto.md) - - [DnsMetaDto](docs/DnsMetaDto.md) - - [DnsRecordDto](docs/DnsRecordDto.md) - - [DnsRecordResponseDto](docs/DnsRecordResponseDto.md) - - [DnsSecDataDto](docs/DnsSecDataDto.md) - - [DnsSecDto](docs/DnsSecDto.md) - - [DnsSecMetaDto](docs/DnsSecMetaDto.md) - - [DnsSecResponseDto](docs/DnsSecResponseDto.md) - - [ExtractionSchemaDto](docs/ExtractionSchemaDto.md) - - [ExtractionSchemaDtoFieldsInner](docs/ExtractionSchemaDtoFieldsInner.md) - - [HealthResponseDto](docs/HealthResponseDto.md) - - [ImageSearchResponseDto](docs/ImageSearchResponseDto.md) - - [ImageSearchResultItemDto](docs/ImageSearchResultItemDto.md) - - [LighthouseDto](docs/LighthouseDto.md) - - [LighthouseMetaDto](docs/LighthouseMetaDto.md) - - [LighthouseResponseDto](docs/LighthouseResponseDto.md) - - [LoadTimeDataDto](docs/LoadTimeDataDto.md) - - [LoadTimeDto](docs/LoadTimeDto.md) - - [LoadTimeMetaDto](docs/LoadTimeMetaDto.md) - - [LoadTimeResponseDto](docs/LoadTimeResponseDto.md) - - [MarginDto](docs/MarginDto.md) - - [MetaScrapeDto](docs/MetaScrapeDto.md) - - [MetaScrapeMetaDto](docs/MetaScrapeMetaDto.md) - - [MetaScrapeResponseDto](docs/MetaScrapeResponseDto.md) - - [MetaScrapeResponseDtoData](docs/MetaScrapeResponseDtoData.md) - - [MixedContentDataDto](docs/MixedContentDataDto.md) - - [MixedContentDto](docs/MixedContentDto.md) - - [MixedContentMetaDto](docs/MixedContentMetaDto.md) - - [MixedContentResponseDto](docs/MixedContentResponseDto.md) - - [MixedContentResponseDtoData](docs/MixedContentResponseDtoData.md) - - [MtrDataDto](docs/MtrDataDto.md) - - [MtrDto](docs/MtrDto.md) - - [MtrMetaDto](docs/MtrMetaDto.md) - - [MtrResponseDto](docs/MtrResponseDto.md) - - [NetworkDto](docs/NetworkDto.md) - - [OpenPortDto](docs/OpenPortDto.md) - - [OpenPortMetaDto](docs/OpenPortMetaDto.md) - - [OpenPortResponseDto](docs/OpenPortResponseDto.md) - - [PingDataDto](docs/PingDataDto.md) - - [PingDto](docs/PingDto.md) - - [PingMetaDto](docs/PingMetaDto.md) - - [PingResponseDto](docs/PingResponseDto.md) - - [ProtocolSupportDto](docs/ProtocolSupportDto.md) - - [RedirectCheckDto](docs/RedirectCheckDto.md) - - [RedirectCheckMetaDto](docs/RedirectCheckMetaDto.md) - - [RedirectCheckResponseDto](docs/RedirectCheckResponseDto.md) - - [RedirectHopDto](docs/RedirectHopDto.md) - - [ScreenshotDto](docs/ScreenshotDto.md) - - [ScreenshotMetaDto](docs/ScreenshotMetaDto.md) - - [ScreenshotResponseDto](docs/ScreenshotResponseDto.md) - - [Search200Response](docs/Search200Response.md) - - [SearchHtmlResponseDto](docs/SearchHtmlResponseDto.md) - - [SearchMarkdownResponseDto](docs/SearchMarkdownResponseDto.md) - - [SearchMetaDto](docs/SearchMetaDto.md) - - [SearchRequestDto](docs/SearchRequestDto.md) - - [SearchResponseDto](docs/SearchResponseDto.md) - - [SearchResultItemDto](docs/SearchResultItemDto.md) - - [SelectorExtractionFieldDto](docs/SelectorExtractionFieldDto.md) - - [ServiceHealthResponseDto](docs/ServiceHealthResponseDto.md) - - [ServiceStatus](docs/ServiceStatus.md) - - [SiteStatusDto](docs/SiteStatusDto.md) - - [SiteStatusMetaDto](docs/SiteStatusMetaDto.md) - - [SiteStatusResponseDto](docs/SiteStatusResponseDto.md) - - [TestMetaDto](docs/TestMetaDto.md) - - [TimingsDto](docs/TimingsDto.md) - - [TlsCertificateDto](docs/TlsCertificateDto.md) - - [TlsCertificateIssuerDto](docs/TlsCertificateIssuerDto.md) - - [TlsProtocolsDto](docs/TlsProtocolsDto.md) - - [TlsScanDataDto](docs/TlsScanDataDto.md) - - [TlsScanDto](docs/TlsScanDto.md) - - [TlsScanMetaDto](docs/TlsScanMetaDto.md) - - [TlsScanResponseDto](docs/TlsScanResponseDto.md) - - [Url2PdfDto](docs/Url2PdfDto.md) - - [Url2PdfMetaDto](docs/Url2PdfMetaDto.md) - - [Url2PdfResponseDto](docs/Url2PdfResponseDto.md) - - [WebScrapeDto](docs/WebScrapeDto.md) - - [WebScrapeMetaDto](docs/WebScrapeMetaDto.md) - - [WebScrapeResponseDto](docs/WebScrapeResponseDto.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### x-api-key - -- **Type**: API key -- **API key parameter name**: x-api-key -- **Location**: HTTP header - - -## Author - +## Links +- [API Documentation](https://docs.geekflare.com/api/intro) +- [Geekflare API](https://dash.geekflare.com) +- [Report Issues](https://github.com/geekflare/geekflare-api-python/issues) +## License +MIT From 2123f4dee0f8b545626e6960b8bb00a3a4fb062d Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Wed, 6 May 2026 15:26:58 +0530 Subject: [PATCH 8/9] Update README.md to demonstrate web scraping functionality and increment version to 0.1.1 in pyproject.toml --- README.md | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4593dc..af343dc 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ pip install geekflare-api ```python from geekflare_api.client import GeekflareClient -from geekflare_api.models import PingDto +from geekflare_api.models import WebScrapeDto with GeekflareClient(api_key="your-api-key") as client: - result = client.ping(PingDto(url="https://google.com")) + result = client.web_scrape(WebScrapeDto(url="https://google.com")) print(result) ``` @@ -47,7 +47,7 @@ with GeekflareClient(api_key="your-api-key") as client: from geekflare_api.exceptions import ApiException try: - result = client.ping(PingDto(url="https://google.com")) + result = client.web_scrape(WebScrapeDto(url="https://google.com")) except ApiException as e: print(f"API error {e.status}: {e.reason}") ``` diff --git a/pyproject.toml b/pyproject.toml index 971ecd6..f63d84e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "geekflare-api" -version = "0.1.0" +version = "0.1.1" description = "Official Python SDK for Geekflare API" readme = "README.md" license = { text = "MIT" } From c7180d0fba5812dc3fe478f5c7ae9c971bc59437 Mon Sep 17 00:00:00 2001 From: Vaibhav Mishra Date: Wed, 6 May 2026 15:28:37 +0530 Subject: [PATCH 9/9] Update README.md to change example URL in web scraping code to "https://toscrape.com/" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af343dc..3470094 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ from geekflare_api.client import GeekflareClient from geekflare_api.models import WebScrapeDto with GeekflareClient(api_key="your-api-key") as client: - result = client.web_scrape(WebScrapeDto(url="https://google.com")) + result = client.web_scrape(WebScrapeDto(url="https://toscrape.com/")) print(result) ``` @@ -47,7 +47,7 @@ with GeekflareClient(api_key="your-api-key") as client: from geekflare_api.exceptions import ApiException try: - result = client.web_scrape(WebScrapeDto(url="https://google.com")) + result = client.web_scrape(WebScrapeDto(url="https://toscrape.com/")) except ApiException as e: print(f"API error {e.status}: {e.reason}") ```