diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 64f9ff41..427b8ec4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.8.0" + ".": "2.9.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 74e73bcf..97db86d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 38 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-155e4761d62255841349c0f8a01b0a9c463ea1d1f2d6c4fd8d1a75c8bef6f226.yml -openapi_spec_hash: ab91f77e7c9d992400cbc7fc8a9e76c1 -config_hash: bff282047fafdad771fb7ec685f56944 +configured_endpoints: 40 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-a0dda03bbb600917cfb9add468cc4c8c84351a8dbbf61644dbc353263ca1748f.yml +openapi_spec_hash: c24264f32a46d9317aac5af9d6a396f7 +config_hash: 920678668dd2da6f8966fbf1b8fde4e2 diff --git a/CHANGELOG.md b/CHANGELOG.md index c28ba2a1..39a4a196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 2.9.0 (2026-08-07) + +Full Changelog: [v2.8.0...v2.9.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.8.0...v2.9.0) + +### Features + +* **api:** api update ([ea29f67](https://github.com/context-dot-dev/context-ruby-sdk/commit/ea29f67042bd6fd9b987d7ad4ad9f8993a871653)) +* **api:** api update ([e7c64e4](https://github.com/context-dot-dev/context-ruby-sdk/commit/e7c64e4540db4cc313d70cebe5409739b052e567)) +* **api:** api update ([975de89](https://github.com/context-dot-dev/context-ruby-sdk/commit/975de893c9145f20f541a443730d7d99f575a313)) +* **api:** api update ([a1f13c2](https://github.com/context-dot-dev/context-ruby-sdk/commit/a1f13c2244b0ac81a58c350e6cba79875e0c4bf1)) +* **api:** api update ([e7cfd87](https://github.com/context-dot-dev/context-ruby-sdk/commit/e7cfd87ff2e163f572cc33ee4b6af5be79811d03)) +* **api:** api update ([c827408](https://github.com/context-dot-dev/context-ruby-sdk/commit/c8274088947813e1090d6232190b5333c025696a)) +* **api:** api update ([5c09f03](https://github.com/context-dot-dev/context-ruby-sdk/commit/5c09f03dd90cda2cad388ac2605d6cadebf0e137)) +* **api:** manual updates ([cf2f79f](https://github.com/context-dot-dev/context-ruby-sdk/commit/cf2f79ff77dca3e57069cfac612e7fd333a8d83f)) + ## 2.8.0 (2026-08-05) Full Changelog: [v2.7.0...v2.8.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.7.0...v2.8.0) diff --git a/Gemfile.lock b/Gemfile.lock index 9eaff29b..b2f0af62 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (2.8.0) + context.dev (2.9.0) cgi connection_pool diff --git a/README.md b/README.md index 4ffd7114..9d5a3231 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "context.dev", "~> 2.8.0" +gem "context.dev", "~> 2.9.0" ``` diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 07a2f4d7..6cf448d3 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -58,6 +58,8 @@ require_relative "context_dev/models/ai_extract_products_response" require_relative "context_dev/models/batch_cancel_params" require_relative "context_dev/models/batch_cancel_response" +require_relative "context_dev/models/batch_delete_params" +require_relative "context_dev/models/batch_delete_response" require_relative "context_dev/models/batch_get_results_params" require_relative "context_dev/models/batch_get_results_response" require_relative "context_dev/models/batch_list_params" @@ -108,6 +110,8 @@ require_relative "context_dev/models/page_error_count" require_relative "context_dev/models/parse_handle_params" require_relative "context_dev/models/parse_handle_response" +require_relative "context_dev/models/person_enrich_params" +require_relative "context_dev/models/person_enrich_response" require_relative "context_dev/models/utility_prefetch_params" require_relative "context_dev/models/utility_prefetch_response" require_relative "context_dev/models/web_extract_competitors_params" @@ -140,5 +144,6 @@ require_relative "context_dev/resources/industry" require_relative "context_dev/resources/monitors" require_relative "context_dev/resources/parse" +require_relative "context_dev/resources/people" require_relative "context_dev/resources/utility" require_relative "context_dev/resources/web" diff --git a/lib/context_dev/client.rb b/lib/context_dev/client.rb index 0bbba0d3..081517ab 100644 --- a/lib/context_dev/client.rb +++ b/lib/context_dev/client.rb @@ -43,9 +43,13 @@ class Client < ContextDev::Internal::Transport::BaseClient # @return [ContextDev::Resources::Monitors] attr_reader :monitors + # Scrape many pages or crawl a site asynchronously. # @return [ContextDev::Resources::Batch] attr_reader :batch + # @return [ContextDev::Resources::People] + attr_reader :people + # @api private # # @return [Hash{String=>String}] @@ -115,6 +119,7 @@ def initialize( @utility = ContextDev::Resources::Utility.new(client: self) @monitors = ContextDev::Resources::Monitors.new(client: self) @batch = ContextDev::Resources::Batch.new(client: self) + @people = ContextDev::Resources::People.new(client: self) end end end diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 686501ff..b5162325 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -45,6 +45,8 @@ module ContextDev BatchCancelParams = ContextDev::Models::BatchCancelParams + BatchDeleteParams = ContextDev::Models::BatchDeleteParams + BatchGetResultsParams = ContextDev::Models::BatchGetResultsParams BatchListParams = ContextDev::Models::BatchListParams @@ -99,6 +101,8 @@ module ContextDev ParseHandleParams = ContextDev::Models::ParseHandleParams + PersonEnrichParams = ContextDev::Models::PersonEnrichParams + UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams diff --git a/lib/context_dev/models/batch_delete_params.rb b/lib/context_dev/models/batch_delete_params.rb new file mode 100644 index 00000000..7c80ac3e --- /dev/null +++ b/lib/context_dev/models/batch_delete_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Batch#delete + class BatchDeleteParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute batch_id + # ID of the batch to retrieve or cancel. + # + # @return [String] + required :batch_id, String + + # @!method initialize(batch_id:, request_options: {}) + # @param batch_id [String] ID of the batch to retrieve or cancel. + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/context_dev/models/batch_delete_response.rb b/lib/context_dev/models/batch_delete_response.rb new file mode 100644 index 00000000..2d257c36 --- /dev/null +++ b/lib/context_dev/models/batch_delete_response.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Batch#delete + class BatchDeleteResponse < ContextDev::Internal::Type::BaseModel + # @!attribute id + # ID of the deleted batch. + # + # @return [String, nil] + optional :id, String + + # @!attribute deleted + # Always true on success. + # + # @return [Boolean, nil] + optional :deleted, ContextDev::Internal::Type::Boolean + + # @!attribute key_metadata + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + # + # @return [ContextDev::Models::BatchDeleteResponse::KeyMetadata, nil] + optional :key_metadata, -> { ContextDev::Models::BatchDeleteResponse::KeyMetadata } + + # @!method initialize(id: nil, deleted: nil, key_metadata: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchDeleteResponse} for more details. + # + # @param id [String] ID of the deleted batch. + # + # @param deleted [Boolean] Always true on success. + # + # @param key_metadata [ContextDev::Models::BatchDeleteResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when + + # @see ContextDev::Models::BatchDeleteResponse#key_metadata + class KeyMetadata < ContextDev::Internal::Type::BaseModel + # @!attribute credits_consumed + # The number of credits consumed by this request. + # + # @return [Integer] + required :credits_consumed, Integer + + # @!attribute credits_remaining + # The number of credits remaining for your organization after this request. + # + # @return [Integer] + required :credits_remaining, Integer + + # @!method initialize(credits_consumed:, credits_remaining:) + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + # + # @param credits_consumed [Integer] The number of credits consumed by this request. + # + # @param credits_remaining [Integer] The number of credits remaining for your organization after this request. + end + end + end +end diff --git a/lib/context_dev/models/batch_get_results_response.rb b/lib/context_dev/models/batch_get_results_response.rb index e87ded0b..fffb4d9d 100644 --- a/lib/context_dev/models/batch_get_results_response.rb +++ b/lib/context_dev/models/batch_get_results_response.rb @@ -109,7 +109,17 @@ class Ok < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :meta, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(final_url:, http_status:, metadata:, url:, html: nil, item_id: nil, markdown: nil, meta: nil, status: :ok) + # @!attribute ocr_pages + # PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page + # bills 1 credit on top of the page base credit; absent when no OCR ran. + # + # @return [Integer, nil] + optional :ocr_pages, Integer + + # @!method initialize(final_url:, http_status:, metadata:, url:, html: nil, item_id: nil, markdown: nil, meta: nil, ocr_pages: nil, status: :ok) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchGetResultsResponse::Data::Ok} for more details. + # # A page the batch fetched successfully. # # @param final_url [String] URL the content was read from, after redirects. @@ -128,6 +138,8 @@ class Ok < ContextDev::Internal::Type::BaseModel # # @param meta [Hash{Symbol=>Object}] Caller-supplied metadata echoed from submission. # + # @param ocr_pages [Integer] PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page + # # @param status [Symbol, :ok] The page was scraped. # @see ContextDev::Models::BatchGetResultsResponse::Data::Ok#metadata diff --git a/lib/context_dev/models/batch_list_response.rb b/lib/context_dev/models/batch_list_response.rb index c6b7c572..c4c2dac0 100644 --- a/lib/context_dev/models/batch_list_response.rb +++ b/lib/context_dev/models/batch_list_response.rb @@ -160,12 +160,19 @@ class Data < ContextDev::Internal::Type::BaseModel # @see ContextDev::Models::BatchListResponse::Data#credits class Credits < ContextDev::Internal::Type::BaseModel # @!attribute net - # `reserved` minus `refunded` — what the batch has cost so far. Equal to - # `reserved` until the batch settles. + # `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # Equal to `reserved` until the batch settles. # # @return [Integer] required :net, Integer + # @!attribute ocr_charged + # Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered + # page, on top of `reserved`. Stays 0 until the batch settles. + # + # @return [Integer] + required :ocr_charged, Integer + # @!attribute refunded # Credits returned for pages that did not succeed. Stays 0 until the batch reaches # a final status, then settles in one movement. @@ -180,13 +187,15 @@ class Credits < ContextDev::Internal::Type::BaseModel # @return [Integer] required :reserved, Integer - # @!method initialize(net:, refunded:, reserved:) + # @!method initialize(net:, ocr_charged:, refunded:, reserved:) # Some parameter documentations has been truncated, see # {ContextDev::Models::BatchListResponse::Data::Credits} for more details. # # What this batch has done to your credit balance. # - # @param net [Integer] `reserved` minus `refunded` — what the batch has cost so far. Equal to `reserved + # @param net [Integer] `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # + # @param ocr_charged [Integer] Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered p # # @param refunded [Integer] Credits returned for pages that did not succeed. Stays 0 until the batch reaches # diff --git a/lib/context_dev/models/batch_retrieve_response.rb b/lib/context_dev/models/batch_retrieve_response.rb index 1ad0da1e..846b8e6b 100644 --- a/lib/context_dev/models/batch_retrieve_response.rb +++ b/lib/context_dev/models/batch_retrieve_response.rb @@ -137,12 +137,19 @@ class BatchRetrieveResponse < ContextDev::Internal::Type::BaseModel # @see ContextDev::Models::BatchRetrieveResponse#credits class Credits < ContextDev::Internal::Type::BaseModel # @!attribute net - # `reserved` minus `refunded` — what the batch has cost so far. Equal to - # `reserved` until the batch settles. + # `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # Equal to `reserved` until the batch settles. # # @return [Integer] required :net, Integer + # @!attribute ocr_charged + # Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered + # page, on top of `reserved`. Stays 0 until the batch settles. + # + # @return [Integer] + required :ocr_charged, Integer + # @!attribute refunded # Credits returned for pages that did not succeed. Stays 0 until the batch reaches # a final status, then settles in one movement. @@ -157,13 +164,15 @@ class Credits < ContextDev::Internal::Type::BaseModel # @return [Integer] required :reserved, Integer - # @!method initialize(net:, refunded:, reserved:) + # @!method initialize(net:, ocr_charged:, refunded:, reserved:) # Some parameter documentations has been truncated, see # {ContextDev::Models::BatchRetrieveResponse::Credits} for more details. # # What this batch has done to your credit balance. # - # @param net [Integer] `reserved` minus `refunded` — what the batch has cost so far. Equal to `reserved + # @param net [Integer] `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # + # @param ocr_charged [Integer] Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered p # # @param refunded [Integer] Credits returned for pages that did not succeed. Stays 0 until the batch reaches # diff --git a/lib/context_dev/models/batch_submit_params.rb b/lib/context_dev/models/batch_submit_params.rb index c731f4d8..5e25f252 100644 --- a/lib/context_dev/models/batch_submit_params.rb +++ b/lib/context_dev/models/batch_submit_params.rb @@ -7,49 +7,2375 @@ class BatchSubmitParams < ContextDev::Internal::Type::BaseModel extend ContextDev::Internal::Type::RequestParameters::Converter include ContextDev::Internal::Type::RequestParameters - # @!attribute identifiers - # Known identifiers for the person. At least one identifier is required. + # @!attribute input + # Choose a URL list or a site crawl. # - # @return [ContextDev::Models::BatchSubmitParams::Identifiers] - required :identifiers, -> { ContextDev::BatchSubmitParams::Identifiers } + # @return [ContextDev::Models::BatchSubmitParams::Input::Scrape, ContextDev::Models::BatchSubmitParams::Input::Crawl] + required :input, union: -> { ContextDev::BatchSubmitParams::Input } # @!attribute tags - # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # Tags stored on the batch. Filter the batch list by them later. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] - # @!attribute timeout_ms - # Optional timeout in milliseconds for the request. If the request takes longer - # than this value, it will be aborted with a 408 status code. Maximum allowed - # value is 300000ms (5 minutes). + # @!attribute webhook_url + # URL notified when the batch finishes. # - # @return [Integer, nil] - optional :timeout_ms, Integer, api_name: :timeoutMS + # @return [String, nil] + optional :webhook_url, String, api_name: :webhookUrl - # @!method initialize(identifiers:, tags: nil, timeout_ms: nil, request_options: {}) + # @!attribute idempotency_key + # Any string unique to this submission. Retries with the same key return the + # original batch. + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(input:, tags: nil, webhook_url: nil, idempotency_key: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::BatchSubmitParams} for more details. # - # @param identifiers [ContextDev::Models::BatchSubmitParams::Identifiers] Known identifiers for the person. At least one identifier is required. + # @param input [ContextDev::Models::BatchSubmitParams::Input::Scrape, ContextDev::Models::BatchSubmitParams::Input::Crawl] Choose a URL list or a site crawl. # - # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # @param tags [Array] Tags stored on the batch. Filter the batch list by them later. # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # @param webhook_url [String] URL notified when the batch finishes. + # + # @param idempotency_key [String] Any string unique to this submission. Retries with the same key return the origi # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - class Identifiers < ContextDev::Internal::Type::BaseModel - # @!attribute linkedin_url - # LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/. - # - # @return [String, nil] - optional :linkedin_url, String, api_name: :linkedinUrl - - # @!method initialize(linkedin_url: nil) - # Known identifiers for the person. At least one identifier is required. - # - # @param linkedin_url [String] LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/. + # Choose a URL list or a site crawl. + module Input + extend ContextDev::Internal::Type::Union + + discriminator :mode + + # Scrape up to 25K URLs in one batch. + variant :scrape, -> { ContextDev::BatchSubmitParams::Input::Scrape } + + # Crawl pages starting from a URL or from a domain's sitemap. + variant :crawl, -> { ContextDev::BatchSubmitParams::Input::Crawl } + + class Scrape < ContextDev::Internal::Type::BaseModel + # @!attribute data + # Pages to scrape and their output format. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML] + required :data, union: -> { ContextDev::BatchSubmitParams::Input::Scrape::Data } + + # @!attribute mode + # Scrape the pages in `data.urls`. + # + # @return [Symbol, :scrape] + required :mode, const: :scrape + + # @!method initialize(data:, mode: :scrape) + # Scrape up to 25K URLs in one batch. + # + # @param data [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML] Pages to scrape and their output format. + # + # @param mode [Symbol, :scrape] Scrape the pages in `data.urls`. + + # Pages to scrape and their output format. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape#data + module Data + extend ContextDev::Internal::Type::Union + + discriminator :format + + # Scrape the listed pages as Markdown. + variant :markdown, -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown } + + # Scrape the listed pages as HTML. + variant :html, -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML } + + class Markdown < ContextDev::Internal::Type::BaseModel + # @!attribute format_ + # Return page content as Markdown. + # + # @return [Symbol, :markdown] + required :format_, const: :markdown, api_name: :format + + # @!attribute urls + # Pages to scrape. Maximum 25000. + # + # @return [Array] + required :urls, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL] } + + # @!attribute options + # Options for Markdown output. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options, nil] + optional :options, -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options } + + # @!method initialize(urls:, options: nil, format_: :markdown) + # Scrape the listed pages as Markdown. + # + # @param urls [Array] Pages to scrape. Maximum 25000. + # + # @param options [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options] Options for Markdown output. + # + # @param format_ [Symbol, :markdown] Return page content as Markdown. + + class URL < ContextDev::Internal::Type::BaseModel + # @!attribute url + # Page URL to scrape. + # + # @return [String] + required :url, String + + # @!attribute item_id + # Your ID for this page, returned with its result. The same URL can use different + # IDs. + # + # @return [String, nil] + optional :item_id, String, api_name: :itemId + + # @!attribute meta + # Custom JSON returned unchanged with this page result. + # + # @return [Hash{Symbol=>Object}, nil] + optional :meta, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] + + # @!method initialize(url:, item_id: nil, meta: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::URL} for + # more details. + # + # A page to scrape, with optional data for matching results. + # + # @param url [String] Page URL to scrape. + # + # @param item_id [String] Your ID for this page, returned with its result. The same URL can use different + # + # @param meta [Hash{Symbol=>Object}] Custom JSON returned unchanged with this page result. + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown#options + class Options < ContextDev::Internal::Type::BaseModel + # @!attribute country + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @return [Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country, nil] + optional :country, + enum: -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country } + + # @!attribute exclude_selectors + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + # + # @return [Array, nil] + optional :exclude_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :excludeSelectors, + nil?: true + + # @!attribute include_images + # Include image references in the Markdown. + # + # @return [Boolean, nil] + optional :include_images, ContextDev::Internal::Type::Boolean, api_name: :includeImages + + # @!attribute include_links + # Include links in the Markdown. + # + # @return [Boolean, nil] + optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks + + # @!attribute include_selectors + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + # + # @return [Array, nil] + optional :include_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :includeSelectors, + nil?: true + + # @!attribute max_age_ms + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer, api_name: :maxAgeMs, nil?: true + + # @!attribute pdf + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf, nil] + optional :pdf, -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf } + + # @!attribute settle_animations + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + # + # @return [Boolean, nil] + optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations + + # @!attribute shorten_base64_images + # Shorten inline base64 image data. + # + # @return [Boolean, nil] + optional :shorten_base64_images, + ContextDev::Internal::Type::Boolean, + api_name: :shortenBase64Images + + # @!attribute use_main_content_only + # Return the main content without navigation or footers. + # + # @return [Boolean, nil] + optional :use_main_content_only, + ContextDev::Internal::Type::Boolean, + api_name: :useMainContentOnly + + # @!attribute wait_for_ms + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + # + # @return [Integer, nil] + optional :wait_for_ms, Integer, api_name: :waitForMs + + # @!method initialize(country: nil, exclude_selectors: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, use_main_content_only: nil, wait_for_ms: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options} + # for more details. + # + # Options for Markdown output. + # + # @param country [Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al + # + # @param exclude_selectors [Array, nil] Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # + # @param include_images [Boolean] Include image references in the Markdown. + # + # @param include_links [Boolean] Include links in the Markdown. + # + # @param include_selectors [Array, nil] Keep only the subtrees matching these CSS selectors. Filtered pages are always f + # + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y + # + # @param pdf [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image + # + # @param settle_animations [Boolean] Wait briefly for CSS and transition animations to settle before extraction, on p + # + # @param shorten_base64_images [Boolean] Shorten inline base64 image data. + # + # @param use_main_content_only [Boolean] Return the main content without navigation or footers. + # + # @param wait_for_ms [Integer] How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options#country + module Country + extend ContextDev::Internal::Type::Enum + + AD = :ad + AE = :ae + AF = :af + AG = :ag + AI = :ai + AL = :al + AM = :am + AO = :ao + AR = :ar + AT = :at + AU = :au + AW = :aw + AZ = :az + BA = :ba + BB = :bb + BD = :bd + BE = :be + BF = :bf + BG = :bg + BH = :bh + BI = :bi + BJ = :bj + BM = :bm + BN = :bn + BO = :bo + BQ = :bq + BR = :br + BS = :bs + BW = :bw + BY = :by + BZ = :bz + CA = :ca + CD = :cd + CF = :cf + CG = :cg + CH = :ch + CI = :ci + CL = :cl + CM = :cm + CN = :cn + CO = :co + CR = :cr + CV = :cv + CW = :cw + CY = :cy + CZ = :cz + DE = :de + DJ = :dj + DK = :dk + DM = :dm + DO = :do + DZ = :dz + EC = :ec + EE = :ee + EG = :eg + ES = :es + ET = :et + FI = :fi + FJ = :fj + FR = :fr + GA = :ga + GB = :gb + GD = :gd + GE = :ge + GF = :gf + GG = :gg + GH = :gh + GM = :gm + GN = :gn + GP = :gp + GQ = :gq + GR = :gr + GT = :gt + GU = :gu + GW = :gw + GY = :gy + HK = :hk + HN = :hn + HR = :hr + HT = :ht + HU = :hu + ID = :id + IE = :ie + IL = :il + IM = :im + IN = :in + IQ = :iq + IR = :ir + IS = :is + IT = :it + JE = :je + JM = :jm + JO = :jo + JP = :jp + KE = :ke + KG = :kg + KH = :kh + KN = :kn + KR = :kr + KW = :kw + KY = :ky + KZ = :kz + LA = :la + LB = :lb + LC = :lc + LK = :lk + LR = :lr + LS = :ls + LT = :lt + LU = :lu + LV = :lv + LY = :ly + MA = :ma + MC = :mc + MD = :md + ME = :me + MF = :mf + MG = :mg + MK = :mk + ML = :ml + MM = :mm + MN = :mn + MO = :mo + MQ = :mq + MR = :mr + MT = :mt + MU = :mu + MV = :mv + MW = :mw + MX = :mx + MY = :my + MZ = :mz + NA = :na + NC = :nc + NE = :ne + NG = :ng + NI = :ni + NL = :nl + NO = :no + NP = :np + NZ = :nz + OM = :om + PA = :pa + PE = :pe + PF = :pf + PG = :pg + PH = :ph + PK = :pk + PL = :pl + PR = :pr + PS = :ps + PT = :pt + PY = :py + QA = :qa + RE = :re + RO = :ro + RS = :rs + RU = :ru + RW = :rw + SA = :sa + SC = :sc + SD = :sd + SE = :se + SG = :sg + SI = :si + SK = :sk + SL = :sl + SM = :sm + SN = :sn + SO = :so + SR = :sr + SS = :ss + ST = :st + SV = :sv + SX = :sx + SY = :sy + SZ = :sz + TC = :tc + TD = :td + TG = :tg + TH = :th + TJ = :tj + TL = :tl + TM = :tm + TN = :tn + TR = :tr + TT = :tt + TW = :tw + TZ = :tz + UA = :ua + UG = :ug + US = :us + UY = :uy + UZ = :uz + VC = :vc + VE = :ve + VG = :vg + VI = :vi + VN = :vn + YE = :ye + YT = :yt + ZA = :za + ZM = :zm + ZW = :zw + + # @!method self.values + # @return [Array] + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options#pdf + class Pdf < ContextDev::Internal::Type::BaseModel + # @!attribute end_ + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + # + # @return [Integer, nil] + optional :end_, Integer, api_name: :end + + # @!attribute ocr + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr, nil] + optional :ocr, + union: -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr } + + # @!attribute should_parse + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse, nil] + optional :should_parse, + union: -> { + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse + }, + api_name: :shouldParse + + # @!attribute start + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + # + # @return [Integer, nil] + optional :start, Integer + + # @!method initialize(end_: nil, ocr: nil, should_parse: nil, start: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf} + # for more details. + # + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus + # + # @param ocr [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr] When true, OCR the selected PDF pages that have no usable text layer (scans), re + # + # @param should_parse [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # + # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf#ocr + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf#should_parse + module ShouldParse + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + end + end + end + + class HTML < ContextDev::Internal::Type::BaseModel + # @!attribute format_ + # Return page content as HTML. + # + # @return [Symbol, :html] + required :format_, const: :html, api_name: :format + + # @!attribute urls + # Pages to scrape. Maximum 25000. + # + # @return [Array] + required :urls, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL] } + + # @!attribute options + # Options for HTML output. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options, nil] + optional :options, -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options } + + # @!method initialize(urls:, options: nil, format_: :html) + # Scrape the listed pages as HTML. + # + # @param urls [Array] Pages to scrape. Maximum 25000. + # + # @param options [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options] Options for HTML output. + # + # @param format_ [Symbol, :html] Return page content as HTML. + + class URL < ContextDev::Internal::Type::BaseModel + # @!attribute url + # Page URL to scrape. + # + # @return [String] + required :url, String + + # @!attribute item_id + # Your ID for this page, returned with its result. The same URL can use different + # IDs. + # + # @return [String, nil] + optional :item_id, String, api_name: :itemId + + # @!attribute meta + # Custom JSON returned unchanged with this page result. + # + # @return [Hash{Symbol=>Object}, nil] + optional :meta, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] + + # @!method initialize(url:, item_id: nil, meta: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::URL} for more + # details. + # + # A page to scrape, with optional data for matching results. + # + # @param url [String] Page URL to scrape. + # + # @param item_id [String] Your ID for this page, returned with its result. The same URL can use different + # + # @param meta [Hash{Symbol=>Object}] Custom JSON returned unchanged with this page result. + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML#options + class Options < ContextDev::Internal::Type::BaseModel + # @!attribute country + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @return [Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country, nil] + optional :country, enum: -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country } + + # @!attribute exclude_selectors + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + # + # @return [Array, nil] + optional :exclude_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :excludeSelectors, + nil?: true + + # @!attribute include_selectors + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + # + # @return [Array, nil] + optional :include_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :includeSelectors, + nil?: true + + # @!attribute max_age_ms + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer, api_name: :maxAgeMs, nil?: true + + # @!attribute pdf + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf, nil] + optional :pdf, -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf } + + # @!attribute settle_animations + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + # + # @return [Boolean, nil] + optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations + + # @!attribute use_main_content_only + # Return the main content without navigation or footers. + # + # @return [Boolean, nil] + optional :use_main_content_only, + ContextDev::Internal::Type::Boolean, + api_name: :useMainContentOnly + + # @!attribute wait_for_ms + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + # + # @return [Integer, nil] + optional :wait_for_ms, Integer, api_name: :waitForMs + + # @!method initialize(country: nil, exclude_selectors: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, use_main_content_only: nil, wait_for_ms: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options} for + # more details. + # + # Options for HTML output. + # + # @param country [Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al + # + # @param exclude_selectors [Array, nil] Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # + # @param include_selectors [Array, nil] Keep only the subtrees matching these CSS selectors. Filtered pages are always f + # + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y + # + # @param pdf [ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image + # + # @param settle_animations [Boolean] Wait briefly for CSS and transition animations to settle before extraction, on p + # + # @param use_main_content_only [Boolean] Return the main content without navigation or footers. + # + # @param wait_for_ms [Integer] How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options#country + module Country + extend ContextDev::Internal::Type::Enum + + AD = :ad + AE = :ae + AF = :af + AG = :ag + AI = :ai + AL = :al + AM = :am + AO = :ao + AR = :ar + AT = :at + AU = :au + AW = :aw + AZ = :az + BA = :ba + BB = :bb + BD = :bd + BE = :be + BF = :bf + BG = :bg + BH = :bh + BI = :bi + BJ = :bj + BM = :bm + BN = :bn + BO = :bo + BQ = :bq + BR = :br + BS = :bs + BW = :bw + BY = :by + BZ = :bz + CA = :ca + CD = :cd + CF = :cf + CG = :cg + CH = :ch + CI = :ci + CL = :cl + CM = :cm + CN = :cn + CO = :co + CR = :cr + CV = :cv + CW = :cw + CY = :cy + CZ = :cz + DE = :de + DJ = :dj + DK = :dk + DM = :dm + DO = :do + DZ = :dz + EC = :ec + EE = :ee + EG = :eg + ES = :es + ET = :et + FI = :fi + FJ = :fj + FR = :fr + GA = :ga + GB = :gb + GD = :gd + GE = :ge + GF = :gf + GG = :gg + GH = :gh + GM = :gm + GN = :gn + GP = :gp + GQ = :gq + GR = :gr + GT = :gt + GU = :gu + GW = :gw + GY = :gy + HK = :hk + HN = :hn + HR = :hr + HT = :ht + HU = :hu + ID = :id + IE = :ie + IL = :il + IM = :im + IN = :in + IQ = :iq + IR = :ir + IS = :is + IT = :it + JE = :je + JM = :jm + JO = :jo + JP = :jp + KE = :ke + KG = :kg + KH = :kh + KN = :kn + KR = :kr + KW = :kw + KY = :ky + KZ = :kz + LA = :la + LB = :lb + LC = :lc + LK = :lk + LR = :lr + LS = :ls + LT = :lt + LU = :lu + LV = :lv + LY = :ly + MA = :ma + MC = :mc + MD = :md + ME = :me + MF = :mf + MG = :mg + MK = :mk + ML = :ml + MM = :mm + MN = :mn + MO = :mo + MQ = :mq + MR = :mr + MT = :mt + MU = :mu + MV = :mv + MW = :mw + MX = :mx + MY = :my + MZ = :mz + NA = :na + NC = :nc + NE = :ne + NG = :ng + NI = :ni + NL = :nl + NO = :no + NP = :np + NZ = :nz + OM = :om + PA = :pa + PE = :pe + PF = :pf + PG = :pg + PH = :ph + PK = :pk + PL = :pl + PR = :pr + PS = :ps + PT = :pt + PY = :py + QA = :qa + RE = :re + RO = :ro + RS = :rs + RU = :ru + RW = :rw + SA = :sa + SC = :sc + SD = :sd + SE = :se + SG = :sg + SI = :si + SK = :sk + SL = :sl + SM = :sm + SN = :sn + SO = :so + SR = :sr + SS = :ss + ST = :st + SV = :sv + SX = :sx + SY = :sy + SZ = :sz + TC = :tc + TD = :td + TG = :tg + TH = :th + TJ = :tj + TL = :tl + TM = :tm + TN = :tn + TR = :tr + TT = :tt + TW = :tw + TZ = :tz + UA = :ua + UG = :ug + US = :us + UY = :uy + UZ = :uz + VC = :vc + VE = :ve + VG = :vg + VI = :vi + VN = :vn + YE = :ye + YT = :yt + ZA = :za + ZM = :zm + ZW = :zw + + # @!method self.values + # @return [Array] + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options#pdf + class Pdf < ContextDev::Internal::Type::BaseModel + # @!attribute end_ + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + # + # @return [Integer, nil] + optional :end_, Integer, api_name: :end + + # @!attribute ocr + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr, nil] + optional :ocr, union: -> { ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr } + + # @!attribute should_parse + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse, nil] + optional :should_parse, + union: -> { + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse + }, + api_name: :shouldParse + + # @!attribute start + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + # + # @return [Integer, nil] + optional :start, Integer + + # @!method initialize(end_: nil, ocr: nil, should_parse: nil, start: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf} + # for more details. + # + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus + # + # @param ocr [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr] When true, OCR the selected PDF pages that have no usable text layer (scans), re + # + # @param should_parse [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # + # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf#ocr + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf#should_parse + module ShouldParse + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + end + end + end + + # @!method self.variants + # @return [Array(ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML)] + end + end + + class Crawl < ContextDev::Internal::Type::BaseModel + # @!attribute data + # Crawl source and output format. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML] + required :data, union: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data } + + # @!attribute mode + # Discover and scrape pages from `data.source`. + # + # @return [Symbol, :crawl] + required :mode, const: :crawl + + # @!method initialize(data:, mode: :crawl) + # Crawl pages starting from a URL or from a domain's sitemap. + # + # @param data [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML] Crawl source and output format. + # + # @param mode [Symbol, :crawl] Discover and scrape pages from `data.source`. + + # Crawl source and output format. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl#data + module Data + extend ContextDev::Internal::Type::Union + + discriminator :format + + # Crawl pages and return Markdown. + variant :markdown, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown } + + # Crawl pages and return HTML. + variant :html, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML } + + class Markdown < ContextDev::Internal::Type::BaseModel + # @!attribute format_ + # Return page content as Markdown. + # + # @return [Symbol, :markdown] + required :format_, const: :markdown, api_name: :format + + # @!attribute source + # How to find pages to crawl. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap] + required :source, union: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source } + + # @!attribute options + # Options for Markdown output. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options, nil] + optional :options, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options } + + # @!method initialize(source:, options: nil, format_: :markdown) + # Crawl pages and return Markdown. + # + # @param source [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap] How to find pages to crawl. + # + # @param options [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options] Options for Markdown output. + # + # @param format_ [Symbol, :markdown] Return page content as Markdown. + + # How to find pages to crawl. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown#source + module Source + extend ContextDev::Internal::Type::Union + + discriminator :type + + # Discover pages by following links from one URL. + variant :start_url, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL } + + # Scrape the pages listed in a domain's sitemap. Links on those pages are not followed. + variant :sitemap, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap } + + class StartURL < ContextDev::Internal::Type::BaseModel + # @!attribute type + # Start from one page. + # + # @return [Symbol, :start_url] + required :type, const: :start_url + + # @!attribute url + # Page where crawling begins. A URL without a scheme is read as https://. + # + # @return [String] + required :url, String + + # @!attribute controls + # Limits and filters for page discovery. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls, nil] + optional :controls, + -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls } + + # @!method initialize(url:, controls: nil, type: :start_url) + # Discover pages by following links from one URL. + # + # @param url [String] Page where crawling begins. A URL without a scheme is read as https://. + # + # @param controls [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls] Limits and filters for page discovery. + # + # @param type [Symbol, :start_url] Start from one page. + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL#controls + class Controls < ContextDev::Internal::Type::BaseModel + # @!attribute follow_subdomains + # Follow links to subdomains. + # + # @return [Boolean, nil] + optional :follow_subdomains, + ContextDev::Internal::Type::Boolean, + api_name: :followSubdomains + + # @!attribute max_depth + # Maximum link depth. Source pages are depth 0. No limit when omitted. + # + # @return [Integer, nil] + optional :max_depth, Integer, api_name: :maxDepth + + # @!attribute max_urls + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @return [Integer, nil] + optional :max_urls, Integer, api_name: :maxUrls + + # @!attribute regex + # RE2 pattern for URLs to include. The `start_url` itself is always included. + # + # @return [String, nil] + optional :regex, String + + # @!method initialize(follow_subdomains: nil, max_depth: nil, max_urls: nil, regex: nil) + # Limits and filters for page discovery. + # + # @param follow_subdomains [Boolean] Follow links to subdomains. + # + # @param max_depth [Integer] Maximum link depth. Source pages are depth 0. No limit when omitted. + # + # @param max_urls [Integer] Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @param regex [String] RE2 pattern for URLs to include. The `start_url` itself is always included. + end + end + + class Sitemap < ContextDev::Internal::Type::BaseModel + # @!attribute domain + # Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + # domain. + # + # @return [String] + required :domain, String + + # @!attribute type + # Scrape the URLs in the domain's sitemap. + # + # @return [Symbol, :sitemap] + required :type, const: :sitemap + + # @!attribute controls + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls, nil] + optional :controls, + -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls } + + # @!method initialize(domain:, controls: nil, type: :sitemap) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap} + # for more details. + # + # Scrape the pages listed in a domain's sitemap. Links on those pages are not + # followed. + # + # @param domain [String] Domain whose sitemap lists the pages to scrape. A full URL is reduced to its dom + # + # @param controls [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls] Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those U + # + # @param type [Symbol, :sitemap] Scrape the URLs in the domain's sitemap. + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap#controls + class Controls < ContextDev::Internal::Type::BaseModel + # @!attribute max_urls + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @return [Integer, nil] + optional :max_urls, Integer, api_name: :maxUrls + + # @!attribute regex + # RE2 pattern; only sitemap URLs matching it are scraped. + # + # @return [String, nil] + optional :regex, String + + # @!method initialize(max_urls: nil, regex: nil) + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + # + # @param max_urls [Integer] Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @param regex [String] RE2 pattern; only sitemap URLs matching it are scraped. + end + end + + # @!method self.variants + # @return [Array(ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap)] + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown#options + class Options < ContextDev::Internal::Type::BaseModel + # @!attribute country + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @return [Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country, nil] + optional :country, + enum: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country } + + # @!attribute exclude_selectors + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + # + # @return [Array, nil] + optional :exclude_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :excludeSelectors, + nil?: true + + # @!attribute include_images + # Include image references in the Markdown. + # + # @return [Boolean, nil] + optional :include_images, ContextDev::Internal::Type::Boolean, api_name: :includeImages + + # @!attribute include_links + # Include links in the Markdown. + # + # @return [Boolean, nil] + optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks + + # @!attribute include_selectors + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + # + # @return [Array, nil] + optional :include_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :includeSelectors, + nil?: true + + # @!attribute max_age_ms + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer, api_name: :maxAgeMs, nil?: true + + # @!attribute pdf + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf, nil] + optional :pdf, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf } + + # @!attribute settle_animations + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + # + # @return [Boolean, nil] + optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations + + # @!attribute shorten_base64_images + # Shorten inline base64 image data. + # + # @return [Boolean, nil] + optional :shorten_base64_images, + ContextDev::Internal::Type::Boolean, + api_name: :shortenBase64Images + + # @!attribute use_main_content_only + # Return the main content without navigation or footers. + # + # @return [Boolean, nil] + optional :use_main_content_only, + ContextDev::Internal::Type::Boolean, + api_name: :useMainContentOnly + + # @!attribute wait_for_ms + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + # + # @return [Integer, nil] + optional :wait_for_ms, Integer, api_name: :waitForMs + + # @!method initialize(country: nil, exclude_selectors: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, use_main_content_only: nil, wait_for_ms: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options} + # for more details. + # + # Options for Markdown output. + # + # @param country [Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al + # + # @param exclude_selectors [Array, nil] Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # + # @param include_images [Boolean] Include image references in the Markdown. + # + # @param include_links [Boolean] Include links in the Markdown. + # + # @param include_selectors [Array, nil] Keep only the subtrees matching these CSS selectors. Filtered pages are always f + # + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y + # + # @param pdf [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image + # + # @param settle_animations [Boolean] Wait briefly for CSS and transition animations to settle before extraction, on p + # + # @param shorten_base64_images [Boolean] Shorten inline base64 image data. + # + # @param use_main_content_only [Boolean] Return the main content without navigation or footers. + # + # @param wait_for_ms [Integer] How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options#country + module Country + extend ContextDev::Internal::Type::Enum + + AD = :ad + AE = :ae + AF = :af + AG = :ag + AI = :ai + AL = :al + AM = :am + AO = :ao + AR = :ar + AT = :at + AU = :au + AW = :aw + AZ = :az + BA = :ba + BB = :bb + BD = :bd + BE = :be + BF = :bf + BG = :bg + BH = :bh + BI = :bi + BJ = :bj + BM = :bm + BN = :bn + BO = :bo + BQ = :bq + BR = :br + BS = :bs + BW = :bw + BY = :by + BZ = :bz + CA = :ca + CD = :cd + CF = :cf + CG = :cg + CH = :ch + CI = :ci + CL = :cl + CM = :cm + CN = :cn + CO = :co + CR = :cr + CV = :cv + CW = :cw + CY = :cy + CZ = :cz + DE = :de + DJ = :dj + DK = :dk + DM = :dm + DO = :do + DZ = :dz + EC = :ec + EE = :ee + EG = :eg + ES = :es + ET = :et + FI = :fi + FJ = :fj + FR = :fr + GA = :ga + GB = :gb + GD = :gd + GE = :ge + GF = :gf + GG = :gg + GH = :gh + GM = :gm + GN = :gn + GP = :gp + GQ = :gq + GR = :gr + GT = :gt + GU = :gu + GW = :gw + GY = :gy + HK = :hk + HN = :hn + HR = :hr + HT = :ht + HU = :hu + ID = :id + IE = :ie + IL = :il + IM = :im + IN = :in + IQ = :iq + IR = :ir + IS = :is + IT = :it + JE = :je + JM = :jm + JO = :jo + JP = :jp + KE = :ke + KG = :kg + KH = :kh + KN = :kn + KR = :kr + KW = :kw + KY = :ky + KZ = :kz + LA = :la + LB = :lb + LC = :lc + LK = :lk + LR = :lr + LS = :ls + LT = :lt + LU = :lu + LV = :lv + LY = :ly + MA = :ma + MC = :mc + MD = :md + ME = :me + MF = :mf + MG = :mg + MK = :mk + ML = :ml + MM = :mm + MN = :mn + MO = :mo + MQ = :mq + MR = :mr + MT = :mt + MU = :mu + MV = :mv + MW = :mw + MX = :mx + MY = :my + MZ = :mz + NA = :na + NC = :nc + NE = :ne + NG = :ng + NI = :ni + NL = :nl + NO = :no + NP = :np + NZ = :nz + OM = :om + PA = :pa + PE = :pe + PF = :pf + PG = :pg + PH = :ph + PK = :pk + PL = :pl + PR = :pr + PS = :ps + PT = :pt + PY = :py + QA = :qa + RE = :re + RO = :ro + RS = :rs + RU = :ru + RW = :rw + SA = :sa + SC = :sc + SD = :sd + SE = :se + SG = :sg + SI = :si + SK = :sk + SL = :sl + SM = :sm + SN = :sn + SO = :so + SR = :sr + SS = :ss + ST = :st + SV = :sv + SX = :sx + SY = :sy + SZ = :sz + TC = :tc + TD = :td + TG = :tg + TH = :th + TJ = :tj + TL = :tl + TM = :tm + TN = :tn + TR = :tr + TT = :tt + TW = :tw + TZ = :tz + UA = :ua + UG = :ug + US = :us + UY = :uy + UZ = :uz + VC = :vc + VE = :ve + VG = :vg + VI = :vi + VN = :vn + YE = :ye + YT = :yt + ZA = :za + ZM = :zm + ZW = :zw + + # @!method self.values + # @return [Array] + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options#pdf + class Pdf < ContextDev::Internal::Type::BaseModel + # @!attribute end_ + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + # + # @return [Integer, nil] + optional :end_, Integer, api_name: :end + + # @!attribute ocr + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr, nil] + optional :ocr, + union: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr } + + # @!attribute should_parse + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse, nil] + optional :should_parse, + union: -> { + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse + }, + api_name: :shouldParse + + # @!attribute start + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + # + # @return [Integer, nil] + optional :start, Integer + + # @!method initialize(end_: nil, ocr: nil, should_parse: nil, start: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf} + # for more details. + # + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus + # + # @param ocr [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr] When true, OCR the selected PDF pages that have no usable text layer (scans), re + # + # @param should_parse [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # + # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf#ocr + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf#should_parse + module ShouldParse + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + end + end + end + + class HTML < ContextDev::Internal::Type::BaseModel + # @!attribute format_ + # Return page content as HTML. + # + # @return [Symbol, :html] + required :format_, const: :html, api_name: :format + + # @!attribute source + # How to find pages to crawl. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap] + required :source, union: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source } + + # @!attribute options + # Options for HTML output. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options, nil] + optional :options, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options } + + # @!method initialize(source:, options: nil, format_: :html) + # Crawl pages and return HTML. + # + # @param source [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap] How to find pages to crawl. + # + # @param options [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options] Options for HTML output. + # + # @param format_ [Symbol, :html] Return page content as HTML. + + # How to find pages to crawl. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML#source + module Source + extend ContextDev::Internal::Type::Union + + discriminator :type + + # Discover pages by following links from one URL. + variant :start_url, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL } + + # Scrape the pages listed in a domain's sitemap. Links on those pages are not followed. + variant :sitemap, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap } + + class StartURL < ContextDev::Internal::Type::BaseModel + # @!attribute type + # Start from one page. + # + # @return [Symbol, :start_url] + required :type, const: :start_url + + # @!attribute url + # Page where crawling begins. A URL without a scheme is read as https://. + # + # @return [String] + required :url, String + + # @!attribute controls + # Limits and filters for page discovery. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls, nil] + optional :controls, + -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls } + + # @!method initialize(url:, controls: nil, type: :start_url) + # Discover pages by following links from one URL. + # + # @param url [String] Page where crawling begins. A URL without a scheme is read as https://. + # + # @param controls [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls] Limits and filters for page discovery. + # + # @param type [Symbol, :start_url] Start from one page. + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL#controls + class Controls < ContextDev::Internal::Type::BaseModel + # @!attribute follow_subdomains + # Follow links to subdomains. + # + # @return [Boolean, nil] + optional :follow_subdomains, + ContextDev::Internal::Type::Boolean, + api_name: :followSubdomains + + # @!attribute max_depth + # Maximum link depth. Source pages are depth 0. No limit when omitted. + # + # @return [Integer, nil] + optional :max_depth, Integer, api_name: :maxDepth + + # @!attribute max_urls + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @return [Integer, nil] + optional :max_urls, Integer, api_name: :maxUrls + + # @!attribute regex + # RE2 pattern for URLs to include. The `start_url` itself is always included. + # + # @return [String, nil] + optional :regex, String + + # @!method initialize(follow_subdomains: nil, max_depth: nil, max_urls: nil, regex: nil) + # Limits and filters for page discovery. + # + # @param follow_subdomains [Boolean] Follow links to subdomains. + # + # @param max_depth [Integer] Maximum link depth. Source pages are depth 0. No limit when omitted. + # + # @param max_urls [Integer] Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @param regex [String] RE2 pattern for URLs to include. The `start_url` itself is always included. + end + end + + class Sitemap < ContextDev::Internal::Type::BaseModel + # @!attribute domain + # Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + # domain. + # + # @return [String] + required :domain, String + + # @!attribute type + # Scrape the URLs in the domain's sitemap. + # + # @return [Symbol, :sitemap] + required :type, const: :sitemap + + # @!attribute controls + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls, nil] + optional :controls, + -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls } + + # @!method initialize(domain:, controls: nil, type: :sitemap) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap} + # for more details. + # + # Scrape the pages listed in a domain's sitemap. Links on those pages are not + # followed. + # + # @param domain [String] Domain whose sitemap lists the pages to scrape. A full URL is reduced to its dom + # + # @param controls [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls] Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those U + # + # @param type [Symbol, :sitemap] Scrape the URLs in the domain's sitemap. + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap#controls + class Controls < ContextDev::Internal::Type::BaseModel + # @!attribute max_urls + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @return [Integer, nil] + optional :max_urls, Integer, api_name: :maxUrls + + # @!attribute regex + # RE2 pattern; only sitemap URLs matching it are scraped. + # + # @return [String, nil] + optional :regex, String + + # @!method initialize(max_urls: nil, regex: nil) + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + # + # @param max_urls [Integer] Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + # + # @param regex [String] RE2 pattern; only sitemap URLs matching it are scraped. + end + end + + # @!method self.variants + # @return [Array(ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap)] + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML#options + class Options < ContextDev::Internal::Type::BaseModel + # @!attribute country + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @return [Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country, nil] + optional :country, enum: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country } + + # @!attribute exclude_selectors + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + # + # @return [Array, nil] + optional :exclude_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :excludeSelectors, + nil?: true + + # @!attribute include_selectors + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + # + # @return [Array, nil] + optional :include_selectors, + ContextDev::Internal::Type::ArrayOf[String], + api_name: :includeSelectors, + nil?: true + + # @!attribute max_age_ms + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer, api_name: :maxAgeMs, nil?: true + + # @!attribute pdf + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @return [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf, nil] + optional :pdf, -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf } + + # @!attribute settle_animations + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + # + # @return [Boolean, nil] + optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations + + # @!attribute use_main_content_only + # Return the main content without navigation or footers. + # + # @return [Boolean, nil] + optional :use_main_content_only, + ContextDev::Internal::Type::Boolean, + api_name: :useMainContentOnly + + # @!attribute wait_for_ms + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + # + # @return [Integer, nil] + optional :wait_for_ms, Integer, api_name: :waitForMs + + # @!method initialize(country: nil, exclude_selectors: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, use_main_content_only: nil, wait_for_ms: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options} for + # more details. + # + # Options for HTML output. + # + # @param country [Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al + # + # @param exclude_selectors [Array, nil] Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # + # @param include_selectors [Array, nil] Keep only the subtrees matching these CSS selectors. Filtered pages are always f + # + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y + # + # @param pdf [ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image + # + # @param settle_animations [Boolean] Wait briefly for CSS and transition animations to settle before extraction, on p + # + # @param use_main_content_only [Boolean] Return the main content without navigation or footers. + # + # @param wait_for_ms [Integer] How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options#country + module Country + extend ContextDev::Internal::Type::Enum + + AD = :ad + AE = :ae + AF = :af + AG = :ag + AI = :ai + AL = :al + AM = :am + AO = :ao + AR = :ar + AT = :at + AU = :au + AW = :aw + AZ = :az + BA = :ba + BB = :bb + BD = :bd + BE = :be + BF = :bf + BG = :bg + BH = :bh + BI = :bi + BJ = :bj + BM = :bm + BN = :bn + BO = :bo + BQ = :bq + BR = :br + BS = :bs + BW = :bw + BY = :by + BZ = :bz + CA = :ca + CD = :cd + CF = :cf + CG = :cg + CH = :ch + CI = :ci + CL = :cl + CM = :cm + CN = :cn + CO = :co + CR = :cr + CV = :cv + CW = :cw + CY = :cy + CZ = :cz + DE = :de + DJ = :dj + DK = :dk + DM = :dm + DO = :do + DZ = :dz + EC = :ec + EE = :ee + EG = :eg + ES = :es + ET = :et + FI = :fi + FJ = :fj + FR = :fr + GA = :ga + GB = :gb + GD = :gd + GE = :ge + GF = :gf + GG = :gg + GH = :gh + GM = :gm + GN = :gn + GP = :gp + GQ = :gq + GR = :gr + GT = :gt + GU = :gu + GW = :gw + GY = :gy + HK = :hk + HN = :hn + HR = :hr + HT = :ht + HU = :hu + ID = :id + IE = :ie + IL = :il + IM = :im + IN = :in + IQ = :iq + IR = :ir + IS = :is + IT = :it + JE = :je + JM = :jm + JO = :jo + JP = :jp + KE = :ke + KG = :kg + KH = :kh + KN = :kn + KR = :kr + KW = :kw + KY = :ky + KZ = :kz + LA = :la + LB = :lb + LC = :lc + LK = :lk + LR = :lr + LS = :ls + LT = :lt + LU = :lu + LV = :lv + LY = :ly + MA = :ma + MC = :mc + MD = :md + ME = :me + MF = :mf + MG = :mg + MK = :mk + ML = :ml + MM = :mm + MN = :mn + MO = :mo + MQ = :mq + MR = :mr + MT = :mt + MU = :mu + MV = :mv + MW = :mw + MX = :mx + MY = :my + MZ = :mz + NA = :na + NC = :nc + NE = :ne + NG = :ng + NI = :ni + NL = :nl + NO = :no + NP = :np + NZ = :nz + OM = :om + PA = :pa + PE = :pe + PF = :pf + PG = :pg + PH = :ph + PK = :pk + PL = :pl + PR = :pr + PS = :ps + PT = :pt + PY = :py + QA = :qa + RE = :re + RO = :ro + RS = :rs + RU = :ru + RW = :rw + SA = :sa + SC = :sc + SD = :sd + SE = :se + SG = :sg + SI = :si + SK = :sk + SL = :sl + SM = :sm + SN = :sn + SO = :so + SR = :sr + SS = :ss + ST = :st + SV = :sv + SX = :sx + SY = :sy + SZ = :sz + TC = :tc + TD = :td + TG = :tg + TH = :th + TJ = :tj + TL = :tl + TM = :tm + TN = :tn + TR = :tr + TT = :tt + TW = :tw + TZ = :tz + UA = :ua + UG = :ug + US = :us + UY = :uy + UZ = :uz + VC = :vc + VE = :ve + VG = :vg + VI = :vi + VN = :vn + YE = :ye + YT = :yt + ZA = :za + ZM = :zm + ZW = :zw + + # @!method self.values + # @return [Array] + end + + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options#pdf + class Pdf < ContextDev::Internal::Type::BaseModel + # @!attribute end_ + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + # + # @return [Integer, nil] + optional :end_, Integer, api_name: :end + + # @!attribute ocr + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr, nil] + optional :ocr, union: -> { ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr } + + # @!attribute should_parse + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @return [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse, nil] + optional :should_parse, + union: -> { + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse + }, + api_name: :shouldParse + + # @!attribute start + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + # + # @return [Integer, nil] + optional :start, Integer + + # @!method initialize(end_: nil, ocr: nil, should_parse: nil, start: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf} + # for more details. + # + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + # + # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus + # + # @param ocr [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr] When true, OCR the selected PDF pages that have no usable text layer (scans), re + # + # @param should_parse [Boolean, Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # + # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf#ocr + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + # + # @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf#should_parse + module ShouldParse + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::TRUE } + + variant const: -> { ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + end + end + end + + # @!method self.variants + # @return [Array(ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML)] + end + end + + # @!method self.variants + # @return [Array(ContextDev::Models::BatchSubmitParams::Input::Scrape, ContextDev::Models::BatchSubmitParams::Input::Crawl)] end end end diff --git a/lib/context_dev/models/batch_submit_response.rb b/lib/context_dev/models/batch_submit_response.rb index 717e1887..40dff81a 100644 --- a/lib/context_dev/models/batch_submit_response.rb +++ b/lib/context_dev/models/batch_submit_response.rb @@ -4,584 +4,179 @@ module ContextDev module Models # @see ContextDev::Resources::Batch#submit class BatchSubmitResponse < ContextDev::Internal::Type::BaseModel - # @!attribute code - # HTTP status code. + # @!attribute id + # Batch ID. Poll GET /batch/{batch_id} with it. # - # @return [Integer, ContextDev::Models::BatchSubmitResponse::Code] - required :code, enum: -> { ContextDev::Models::BatchSubmitResponse::Code } + # @return [String] + required :id, String - # @!attribute metadata - # Additional response details. + # @!attribute crawl + # The crawl controls as submitted, so the limits requested can be compared against + # what the crawl reached. # - # @return [ContextDev::Models::BatchSubmitResponse::Metadata] - required :metadata, -> { ContextDev::Models::BatchSubmitResponse::Metadata } + # @return [ContextDev::Models::CrawlControls, nil] + required :crawl, -> { ContextDev::CrawlControls }, nil?: true - # @!attribute person - # Retrieved person profile. + # @!attribute created_at + # When the batch was created. # - # @return [ContextDev::Models::BatchSubmitResponse::Person] - required :person, -> { ContextDev::Models::BatchSubmitResponse::Person } + # @return [String] + required :created_at, String + + # @!attribute credits + # What accepting this batch cost. + # + # @return [ContextDev::Models::BatchSubmitResponse::Credits] + required :credits, -> { ContextDev::Models::BatchSubmitResponse::Credits } + + # @!attribute format_ + # What each page will be returned as. + # + # @return [Symbol, ContextDev::Models::BatchSubmitResponse::Format] + required :format_, enum: -> { ContextDev::Models::BatchSubmitResponse::Format }, api_name: :format + + # @!attribute input + # What submission took in, and what it charged for. + # + # @return [ContextDev::Models::Intake] + required :input, -> { ContextDev::Intake } + + # @!attribute invalid_urls + # Rejected URLs, up to 100. These are not charged. + # + # @return [Array] + required :invalid_urls, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BatchSubmitResponse::InvalidURL] } + + # @!attribute mode + # How pages will be selected. + # + # @return [Symbol, ContextDev::Models::BatchSubmitResponse::Mode] + required :mode, enum: -> { ContextDev::Models::BatchSubmitResponse::Mode } # @!attribute status - # Response status. + # Always `queued`. An accepted batch has not started yet. # # @return [Symbol, ContextDev::Models::BatchSubmitResponse::Status] required :status, enum: -> { ContextDev::Models::BatchSubmitResponse::Status } + # @!attribute tags + # Tags stored on the batch. + # + # @return [Array] + required :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute key_metadata - # Metadata about the API key used for the request. Included in every response - # whenever a valid API key is provided, even when the response status is not 200. + # API key usage for this request. # # @return [ContextDev::Models::BatchSubmitResponse::KeyMetadata, nil] optional :key_metadata, -> { ContextDev::Models::BatchSubmitResponse::KeyMetadata } - # @!method initialize(code:, metadata:, person:, status:, key_metadata: nil) + # @!attribute webhook_secret + # Signing secret for the completion webhook, returned only here and never again. + # Store it now; it is not repeated by GET /batch/{batch_id}. + # + # @return [String, nil] + optional :webhook_secret, String + + # @!method initialize(id:, crawl:, created_at:, credits:, format_:, input:, invalid_urls:, mode:, status:, tags:, key_metadata: nil, webhook_secret: nil) # Some parameter documentations has been truncated, see # {ContextDev::Models::BatchSubmitResponse} for more details. # - # @param code [Integer, ContextDev::Models::BatchSubmitResponse::Code] HTTP status code. + # @param id [String] Batch ID. Poll GET /batch/{batch_id} with it. # - # @param metadata [ContextDev::Models::BatchSubmitResponse::Metadata] Additional response details. + # @param crawl [ContextDev::Models::CrawlControls, nil] The crawl controls as submitted, so the limits requested can be compared against # - # @param person [ContextDev::Models::BatchSubmitResponse::Person] Retrieved person profile. + # @param created_at [String] When the batch was created. # - # @param status [Symbol, ContextDev::Models::BatchSubmitResponse::Status] Response status. + # @param credits [ContextDev::Models::BatchSubmitResponse::Credits] What accepting this batch cost. # - # @param key_metadata [ContextDev::Models::BatchSubmitResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when - - # HTTP status code. + # @param format_ [Symbol, ContextDev::Models::BatchSubmitResponse::Format] What each page will be returned as. # - # @see ContextDev::Models::BatchSubmitResponse#code - module Code - extend ContextDev::Internal::Type::Enum - - CODE_200 = 200 - - # @!method self.values - # @return [Array] - end - - # @see ContextDev::Models::BatchSubmitResponse#metadata - class Metadata < ContextDev::Internal::Type::BaseModel - # @!attribute identifiers - # Identifiers returned for the person. - # - # @return [ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers] - required :identifiers, -> { ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers } - - # @!attribute sources_attempted - # Source categories checked. - # - # @return [Array] - required :sources_attempted, - -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted] }, - api_name: :sourcesAttempted - - # @!attribute sources_succeeded - # Source categories with data. - # - # @return [Array] - required :sources_succeeded, - -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded] }, - api_name: :sourcesSucceeded - - # @!attribute urls_analyzed - # URLs reviewed for this profile. - # - # @return [Array] - required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String], api_name: :urlsAnalyzed + # @param input [ContextDev::Models::Intake] What submission took in, and what it charged for. + # + # @param invalid_urls [Array] Rejected URLs, up to 100. These are not charged. + # + # @param mode [Symbol, ContextDev::Models::BatchSubmitResponse::Mode] How pages will be selected. + # + # @param status [Symbol, ContextDev::Models::BatchSubmitResponse::Status] Always `queued`. An accepted batch has not started yet. + # + # @param tags [Array] Tags stored on the batch. + # + # @param key_metadata [ContextDev::Models::BatchSubmitResponse::KeyMetadata] API key usage for this request. + # + # @param webhook_secret [String] Signing secret for the completion webhook, returned only here and never again. S - # @!attribute personal_website_url - # Personal website URL, when found. + # @see ContextDev::Models::BatchSubmitResponse#credits + class Credits < ContextDev::Internal::Type::BaseModel + # @!attribute reserved + # Credits just debited from your balance. Whatever the batch does not spend is + # refunded when it settles. # - # @return [String, nil] - optional :personal_website_url, String, api_name: :personalWebsiteUrl + # @return [Integer] + required :reserved, Integer - # @!method initialize(identifiers:, sources_attempted:, sources_succeeded:, urls_analyzed:, personal_website_url: nil) - # Additional response details. - # - # @param identifiers [ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers] Identifiers returned for the person. - # - # @param sources_attempted [Array] Source categories checked. - # - # @param sources_succeeded [Array] Source categories with data. + # @!method initialize(reserved:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BatchSubmitResponse::Credits} for more details. # - # @param urls_analyzed [Array] URLs reviewed for this profile. + # What accepting this batch cost. # - # @param personal_website_url [String] Personal website URL, when found. - - # @see ContextDev::Models::BatchSubmitResponse::Metadata#identifiers - class Identifiers < ContextDev::Internal::Type::BaseModel - # @!attribute linkedin_url - # LinkedIn profile URL. - # - # @return [String, nil] - optional :linkedin_url, String, api_name: :linkedinUrl - - # @!method initialize(linkedin_url: nil) - # Identifiers returned for the person. - # - # @param linkedin_url [String] LinkedIn profile URL. - end - - module SourcesAttempted - extend ContextDev::Internal::Type::Enum - - LINKEDIN = :linkedin - CV = :cv - MANUAL = :manual - GITHUB = :github - OTHER = :other - - # @!method self.values - # @return [Array] - end + # @param reserved [Integer] Credits just debited from your balance. Whatever the batch does not spend is ref + end - module SourcesSucceeded - extend ContextDev::Internal::Type::Enum + # What each page will be returned as. + # + # @see ContextDev::Models::BatchSubmitResponse#format_ + module Format + extend ContextDev::Internal::Type::Enum - LINKEDIN = :linkedin - CV = :cv - MANUAL = :manual - GITHUB = :github - OTHER = :other + MARKDOWN = :markdown + HTML = :html - # @!method self.values - # @return [Array] - end + # @!method self.values + # @return [Array] end - # @see ContextDev::Models::BatchSubmitResponse#person - class Person < ContextDev::Internal::Type::BaseModel - # @!attribute education - # Education history. + class InvalidURL < ContextDev::Internal::Type::BaseModel + # @!attribute reason + # Why it was rejected. # - # @return [Array] - required :education, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BatchSubmitResponse::Person::Education] } + # @return [String] + required :reason, String - # @!attribute experience - # Work history. + # @!attribute url + # Rejected URL. # - # @return [Array] - required :experience, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BatchSubmitResponse::Person::Experience] } + # @return [String] + required :url, String - # @!attribute profile - # Core profile details. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Profile] - required :profile, -> { ContextDev::Models::BatchSubmitResponse::Person::Profile } - - # @!attribute skills - # Listed skills. - # - # @return [Array] - required :skills, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BatchSubmitResponse::Person::Skill] } - - # @!method initialize(education:, experience:, profile:, skills:) - # Retrieved person profile. - # - # @param education [Array] Education history. - # - # @param experience [Array] Work history. + # @!method initialize(reason:, url:) + # @param reason [String] Why it was rejected. # - # @param profile [ContextDev::Models::BatchSubmitResponse::Person::Profile] Core profile details. - # - # @param skills [Array] Listed skills. - - class Education < ContextDev::Internal::Type::BaseModel - # @!attribute institution - # School or institution name. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Education::Institution] - required :institution, -> { ContextDev::Models::BatchSubmitResponse::Person::Education::Institution } - - # @!attribute dates - # Education dates. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Education::Dates, nil] - optional :dates, -> { ContextDev::Models::BatchSubmitResponse::Person::Education::Dates } - - # @!attribute description - # Additional education details. - # - # @return [String, nil] - optional :description, String - - # @!attribute field_of_study - # Area of study. - # - # @return [String, nil] - optional :field_of_study, String, api_name: :fieldOfStudy - - # @!attribute qualification - # Degree, certificate, or credential. - # - # @return [String, nil] - optional :qualification, String - - # @!method initialize(institution:, dates: nil, description: nil, field_of_study: nil, qualification: nil) - # @param institution [ContextDev::Models::BatchSubmitResponse::Person::Education::Institution] School or institution name. - # - # @param dates [ContextDev::Models::BatchSubmitResponse::Person::Education::Dates] Education dates. - # - # @param description [String] Additional education details. - # - # @param field_of_study [String] Area of study. - # - # @param qualification [String] Degree, certificate, or credential. - - # @see ContextDev::Models::BatchSubmitResponse::Person::Education#institution - class Institution < ContextDev::Internal::Type::BaseModel - # @!attribute display_ - # Display name. - # - # @return [String] - required :display_, String, api_name: :display - - # @!attribute normalized - # Standardized name, when available. - # - # @return [String, nil] - optional :normalized, String - - # @!method initialize(display_:, normalized: nil) - # School or institution name. - # - # @param display_ [String] Display name. - # - # @param normalized [String] Standardized name, when available. - end - - # @see ContextDev::Models::BatchSubmitResponse::Person::Education#dates - class Dates < ContextDev::Internal::Type::BaseModel - # @!attribute end_date - # End date, when known. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate, nil] - optional :end_date, - -> { ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate }, - api_name: :endDate - - # @!attribute is_current - # Whether the entry is current. - # - # @return [Boolean, nil] - optional :is_current, ContextDev::Internal::Type::Boolean, api_name: :isCurrent - - # @!attribute start_date - # Start date, when known. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate, nil] - optional :start_date, - -> { ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate }, - api_name: :startDate - - # @!method initialize(end_date: nil, is_current: nil, start_date: nil) - # Education dates. - # - # @param end_date [ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate] End date, when known. - # - # @param is_current [Boolean] Whether the entry is current. - # - # @param start_date [ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate] Start date, when known. - - # @see ContextDev::Models::BatchSubmitResponse::Person::Education::Dates#end_date - class EndDate < ContextDev::Internal::Type::BaseModel - # @!attribute year - # Year value. - # - # @return [Integer] - required :year, Integer - - # @!attribute day - # Day value, when known. - # - # @return [Integer, nil] - optional :day, Integer - - # @!attribute month - # Month value, when known. - # - # @return [Integer, nil] - optional :month, Integer - - # @!method initialize(year:, day: nil, month: nil) - # End date, when known. - # - # @param year [Integer] Year value. - # - # @param day [Integer] Day value, when known. - # - # @param month [Integer] Month value, when known. - end - - # @see ContextDev::Models::BatchSubmitResponse::Person::Education::Dates#start_date - class StartDate < ContextDev::Internal::Type::BaseModel - # @!attribute year - # Year value. - # - # @return [Integer] - required :year, Integer - - # @!attribute day - # Day value, when known. - # - # @return [Integer, nil] - optional :day, Integer - - # @!attribute month - # Month value, when known. - # - # @return [Integer, nil] - optional :month, Integer - - # @!method initialize(year:, day: nil, month: nil) - # Start date, when known. - # - # @param year [Integer] Year value. - # - # @param day [Integer] Day value, when known. - # - # @param month [Integer] Month value, when known. - end - end - end - - class Experience < ContextDev::Internal::Type::BaseModel - # @!attribute company - # Company or organization name. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Experience::Company] - required :company, -> { ContextDev::Models::BatchSubmitResponse::Person::Experience::Company } - - # @!attribute title - # Role or job title. - # - # @return [String] - required :title, String - - # @!attribute dates - # Role dates. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates, nil] - optional :dates, -> { ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates } - - # @!attribute description - # Role description. - # - # @return [String, nil] - optional :description, String - - # @!method initialize(company:, title:, dates: nil, description: nil) - # @param company [ContextDev::Models::BatchSubmitResponse::Person::Experience::Company] Company or organization name. - # - # @param title [String] Role or job title. - # - # @param dates [ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates] Role dates. - # - # @param description [String] Role description. - - # @see ContextDev::Models::BatchSubmitResponse::Person::Experience#company - class Company < ContextDev::Internal::Type::BaseModel - # @!attribute display_ - # Display name. - # - # @return [String] - required :display_, String, api_name: :display - - # @!attribute normalized - # Standardized name, when available. - # - # @return [String, nil] - optional :normalized, String - - # @!method initialize(display_:, normalized: nil) - # Company or organization name. - # - # @param display_ [String] Display name. - # - # @param normalized [String] Standardized name, when available. - end - - # @see ContextDev::Models::BatchSubmitResponse::Person::Experience#dates - class Dates < ContextDev::Internal::Type::BaseModel - # @!attribute end_date - # End date, when known. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate, nil] - optional :end_date, - -> { ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate }, - api_name: :endDate - - # @!attribute is_current - # Whether the entry is current. - # - # @return [Boolean, nil] - optional :is_current, ContextDev::Internal::Type::Boolean, api_name: :isCurrent - - # @!attribute start_date - # Start date, when known. - # - # @return [ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate, nil] - optional :start_date, - -> { ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate }, - api_name: :startDate - - # @!method initialize(end_date: nil, is_current: nil, start_date: nil) - # Role dates. - # - # @param end_date [ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate] End date, when known. - # - # @param is_current [Boolean] Whether the entry is current. - # - # @param start_date [ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate] Start date, when known. - - # @see ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates#end_date - class EndDate < ContextDev::Internal::Type::BaseModel - # @!attribute year - # Year value. - # - # @return [Integer] - required :year, Integer - - # @!attribute day - # Day value, when known. - # - # @return [Integer, nil] - optional :day, Integer - - # @!attribute month - # Month value, when known. - # - # @return [Integer, nil] - optional :month, Integer - - # @!method initialize(year:, day: nil, month: nil) - # End date, when known. - # - # @param year [Integer] Year value. - # - # @param day [Integer] Day value, when known. - # - # @param month [Integer] Month value, when known. - end - - # @see ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates#start_date - class StartDate < ContextDev::Internal::Type::BaseModel - # @!attribute year - # Year value. - # - # @return [Integer] - required :year, Integer - - # @!attribute day - # Day value, when known. - # - # @return [Integer, nil] - optional :day, Integer - - # @!attribute month - # Month value, when known. - # - # @return [Integer, nil] - optional :month, Integer - - # @!method initialize(year:, day: nil, month: nil) - # Start date, when known. - # - # @param year [Integer] Year value. - # - # @param day [Integer] Day value, when known. - # - # @param month [Integer] Month value, when known. - end - end - end - - # @see ContextDev::Models::BatchSubmitResponse::Person#profile - class Profile < ContextDev::Internal::Type::BaseModel - # @!attribute full_name - # Person's full name. - # - # @return [String, nil] - optional :full_name, String, api_name: :fullName - - # @!attribute headline - # Short professional headline. - # - # @return [String, nil] - optional :headline, String - - # @!attribute location - # Person's listed location. - # - # @return [String, nil] - optional :location, String - - # @!attribute profile_picture_url - # Profile image URL. - # - # @return [String, nil] - optional :profile_picture_url, String, api_name: :profilePictureUrl - - # @!attribute summary - # Brief profile summary. - # - # @return [String, nil] - optional :summary, String - - # @!method initialize(full_name: nil, headline: nil, location: nil, profile_picture_url: nil, summary: nil) - # Core profile details. - # - # @param full_name [String] Person's full name. - # - # @param headline [String] Short professional headline. - # - # @param location [String] Person's listed location. - # - # @param profile_picture_url [String] Profile image URL. - # - # @param summary [String] Brief profile summary. - end - - class Skill < ContextDev::Internal::Type::BaseModel - # @!attribute name - # Skill name. - # - # @return [String] - required :name, String + # @param url [String] Rejected URL. + end - # @!attribute normalized - # Standardized skill name, when available. - # - # @return [String, nil] - optional :normalized, String + # How pages will be selected. + # + # @see ContextDev::Models::BatchSubmitResponse#mode + module Mode + extend ContextDev::Internal::Type::Enum - # @!attribute proficiency - # Skill proficiency, when available. - # - # @return [String, nil] - optional :proficiency, String + SCRAPE = :scrape + CRAWL = :crawl - # @!method initialize(name:, normalized: nil, proficiency: nil) - # @param name [String] Skill name. - # - # @param normalized [String] Standardized skill name, when available. - # - # @param proficiency [String] Skill proficiency, when available. - end + # @!method self.values + # @return [Array] end - # Response status. + # Always `queued`. An accepted batch has not started yet. # # @see ContextDev::Models::BatchSubmitResponse#status module Status extend ContextDev::Internal::Type::Enum - OK = :ok + QUEUED = :queued # @!method self.values # @return [Array] @@ -602,8 +197,7 @@ class KeyMetadata < ContextDev::Internal::Type::BaseModel required :credits_remaining, Integer # @!method initialize(credits_consumed:, credits_remaining:) - # Metadata about the API key used for the request. Included in every response - # whenever a valid API key is provided, even when the response status is not 200. + # API key usage for this request. # # @param credits_consumed [Integer] The number of credits consumed by this request. # diff --git a/lib/context_dev/models/brand_retrieve_response.rb b/lib/context_dev/models/brand_retrieve_response.rb index 0f967670..af515059 100644 --- a/lib/context_dev/models/brand_retrieve_response.rb +++ b/lib/context_dev/models/brand_retrieve_response.rb @@ -81,6 +81,12 @@ class Brand < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :email, String + # @!attribute employees + # Employee headcount information for the brand (will be null if unknown) + # + # @return [ContextDev::Models::BrandRetrieveResponse::Brand::Employees, nil] + optional :employees, -> { ContextDev::Models::BrandRetrieveResponse::Brand::Employees } + # @!attribute industries # Industry classification information for the brand # @@ -146,7 +152,7 @@ class Brand < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :title, String - # @!method initialize(address: nil, backdrops: nil, colors: nil, description: nil, domain: nil, email: nil, industries: nil, is_nsfw: nil, links: nil, logos: nil, phone: nil, primary_language: nil, slogan: nil, socials: nil, stock: nil, title: nil) + # @!method initialize(address: nil, backdrops: nil, colors: nil, description: nil, domain: nil, email: nil, employees: nil, industries: nil, is_nsfw: nil, links: nil, logos: nil, phone: nil, primary_language: nil, slogan: nil, socials: nil, stock: nil, title: nil) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveResponse::Brand} for more details. # @@ -164,6 +170,8 @@ class Brand < ContextDev::Internal::Type::BaseModel # # @param email [String] Company email address # + # @param employees [ContextDev::Models::BrandRetrieveResponse::Brand::Employees] Employee headcount information for the brand (will be null if unknown) + # # @param industries [ContextDev::Models::BrandRetrieveResponse::Brand::Industries] Industry classification information for the brand # # @param is_nsfw [Boolean] Indicates whether the brand content is not safe for work (NSFW) @@ -342,6 +350,47 @@ class Color < ContextDev::Internal::Type::BaseModel # @param name [String] Name of the color end + # @see ContextDev::Models::BrandRetrieveResponse::Brand#employees + class Employees < ContextDev::Internal::Type::BaseModel + # @!attribute exact + # Exact employee count when a precise headcount is known + # + # @return [Integer, nil] + optional :exact, Integer + + # @!attribute range + # Employee count range for the brand (e.g. '11 to 50') + # + # @return [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range, nil] + optional :range, enum: -> { ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range } + + # @!method initialize(exact: nil, range: nil) + # Employee headcount information for the brand (will be null if unknown) + # + # @param exact [Integer] Exact employee count when a precise headcount is known + # + # @param range [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range] Employee count range for the brand (e.g. '11 to 50') + + # Employee count range for the brand (e.g. '11 to 50') + # + # @see ContextDev::Models::BrandRetrieveResponse::Brand::Employees#range + module Range + extend ContextDev::Internal::Type::Enum + + RANGE_1_TO_10 = :"1 to 10" + RANGE_11_TO_50 = :"11 to 50" + RANGE_51_TO_200 = :"51 to 200" + RANGE_201_TO_500 = :"201 to 500" + RANGE_501_TO_1000 = :"501 to 1000" + RANGE_1001_TO_5000 = :"1001 to 5000" + RANGE_5001_TO_10000 = :"5001 to 10000" + RANGE_10001 = :"10001+" + + # @!method self.values + # @return [Array] + end + end + # @see ContextDev::Models::BrandRetrieveResponse::Brand#industries class Industries < ContextDev::Internal::Type::BaseModel # @!attribute eic diff --git a/lib/context_dev/models/brand_search_response.rb b/lib/context_dev/models/brand_search_response.rb index a08afd84..0d77921a 100644 --- a/lib/context_dev/models/brand_search_response.rb +++ b/lib/context_dev/models/brand_search_response.rb @@ -5,7 +5,8 @@ module Models # @see ContextDev::Resources::Brand#search class BrandSearchResponse < ContextDev::Internal::Type::BaseModel # @!attribute results - # Up to 10 matching brands, most popular first. Empty when nothing matches. + # Up to 10 matching brands, name matches first, then domain matches, most popular + # first within each group. Empty when nothing matches. # # @return [Array] required :results, @@ -22,7 +23,7 @@ class BrandSearchResponse < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandSearchResponse} for more details. # - # @param results [Array] Up to 10 matching brands, most popular first. Empty when nothing matches. + # @param results [Array] Up to 10 matching brands, name matches first, then domain matches, most popular # # @param key_metadata [ContextDev::Models::BrandSearchResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when diff --git a/lib/context_dev/models/crawl_controls.rb b/lib/context_dev/models/crawl_controls.rb index 2354f042..3ff5065b 100644 --- a/lib/context_dev/models/crawl_controls.rb +++ b/lib/context_dev/models/crawl_controls.rb @@ -26,7 +26,7 @@ class CrawlControls < ContextDev::Internal::Type::BaseModel # @!attribute source # Where the crawl started. # - # @return [ContextDev::Models::CrawlControls::Source::UnionMember0, ContextDev::Models::CrawlControls::Source::UnionMember1] + # @return [ContextDev::Models::CrawlControls::Source::StartURL, ContextDev::Models::CrawlControls::Source::Sitemap] required :source, union: -> { ContextDev::CrawlControls::Source } # @!attribute url_pattern @@ -48,7 +48,7 @@ class CrawlControls < ContextDev::Internal::Type::BaseModel # # @param max_pages [Integer] The `maxUrls` submitted with the crawl. A sitemap crawl scrapes only the URLs it # - # @param source [ContextDev::Models::CrawlControls::Source::UnionMember0, ContextDev::Models::CrawlControls::Source::UnionMember1] Where the crawl started. + # @param source [ContextDev::Models::CrawlControls::Source::StartURL, ContextDev::Models::CrawlControls::Source::Sitemap] Where the crawl started. # # @param url_pattern [String, nil] RE2 pattern URLs had to match to be crawled. Null when the crawl set none. @@ -58,15 +58,17 @@ class CrawlControls < ContextDev::Internal::Type::BaseModel module Source extend ContextDev::Internal::Type::Union - variant -> { ContextDev::CrawlControls::Source::UnionMember0 } + # The crawl discovered pages by following links from one URL. + variant -> { ContextDev::CrawlControls::Source::StartURL } - variant -> { ContextDev::CrawlControls::Source::UnionMember1 } + # The crawl scraped the pages listed in the domain's sitemap. + variant -> { ContextDev::CrawlControls::Source::Sitemap } - class UnionMember0 < ContextDev::Internal::Type::BaseModel + class StartURL < ContextDev::Internal::Type::BaseModel # @!attribute type # - # @return [Symbol, ContextDev::Models::CrawlControls::Source::UnionMember0::Type] - required :type, enum: -> { ContextDev::CrawlControls::Source::UnionMember0::Type } + # @return [Symbol, ContextDev::Models::CrawlControls::Source::StartURL::Type] + required :type, enum: -> { ContextDev::CrawlControls::Source::StartURL::Type } # @!attribute url # Page the crawl started from. @@ -75,11 +77,13 @@ class UnionMember0 < ContextDev::Internal::Type::BaseModel required :url, String # @!method initialize(type:, url:) - # @param type [Symbol, ContextDev::Models::CrawlControls::Source::UnionMember0::Type] + # The crawl discovered pages by following links from one URL. + # + # @param type [Symbol, ContextDev::Models::CrawlControls::Source::StartURL::Type] # # @param url [String] Page the crawl started from. - # @see ContextDev::Models::CrawlControls::Source::UnionMember0#type + # @see ContextDev::Models::CrawlControls::Source::StartURL#type module Type extend ContextDev::Internal::Type::Enum @@ -90,7 +94,7 @@ module Type end end - class UnionMember1 < ContextDev::Internal::Type::BaseModel + class Sitemap < ContextDev::Internal::Type::BaseModel # @!attribute domain # Domain whose sitemap supplied the pages. # @@ -99,15 +103,17 @@ class UnionMember1 < ContextDev::Internal::Type::BaseModel # @!attribute type # - # @return [Symbol, ContextDev::Models::CrawlControls::Source::UnionMember1::Type] - required :type, enum: -> { ContextDev::CrawlControls::Source::UnionMember1::Type } + # @return [Symbol, ContextDev::Models::CrawlControls::Source::Sitemap::Type] + required :type, enum: -> { ContextDev::CrawlControls::Source::Sitemap::Type } # @!method initialize(domain:, type:) + # The crawl scraped the pages listed in the domain's sitemap. + # # @param domain [String] Domain whose sitemap supplied the pages. # - # @param type [Symbol, ContextDev::Models::CrawlControls::Source::UnionMember1::Type] + # @param type [Symbol, ContextDev::Models::CrawlControls::Source::Sitemap::Type] - # @see ContextDev::Models::CrawlControls::Source::UnionMember1#type + # @see ContextDev::Models::CrawlControls::Source::Sitemap#type module Type extend ContextDev::Internal::Type::Enum @@ -119,7 +125,7 @@ module Type end # @!method self.variants - # @return [Array(ContextDev::Models::CrawlControls::Source::UnionMember0, ContextDev::Models::CrawlControls::Source::UnionMember1)] + # @return [Array(ContextDev::Models::CrawlControls::Source::StartURL, ContextDev::Models::CrawlControls::Source::Sitemap)] end end end diff --git a/lib/context_dev/models/parse_handle_params.rb b/lib/context_dev/models/parse_handle_params.rb index 1c98b649..564bebcd 100644 --- a/lib/context_dev/models/parse_handle_params.rb +++ b/lib/context_dev/models/parse_handle_params.rb @@ -38,10 +38,11 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel optional :include_links, union: -> { ContextDev::ParseHandleParams::IncludeLinks } # @!attribute ocr - # When true for PDF inputs, detect and OCR images embedded in the selected pages, - # inserting recognized text at each image's position in page reading order while - # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. - # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + # When true for PDF inputs, OCR the selected pages that have no usable text layer + # (scans), replacing each recovered page's text with the OCR result while pages + # with a real text layer keep it. pdf.start/pdf.end limit the inclusive page + # range. Billed at 1 credit per page OCR actually recovered, on top of the base + # request cost. When false, no OCR runs. # # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr, nil] optional :ocr, union: -> { ContextDev::ParseHandleParams::Ocr } @@ -95,7 +96,7 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Preserve hyperlinks in Markdown output # - # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] When true for PDF inputs, detect and OCR images embedded in the selected pages, + # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] When true for PDF inputs, OCR the selected pages that have no usable text layer # # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. # @@ -239,10 +240,11 @@ module IncludeLinks # @!endgroup end - # When true for PDF inputs, detect and OCR images embedded in the selected pages, - # inserting recognized text at each image's position in page reading order while - # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. - # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + # When true for PDF inputs, OCR the selected pages that have no usable text layer + # (scans), replacing each recovered page's text with the OCR result while pages + # with a real text layer keep it. pdf.start/pdf.end limit the inclusive page + # range. Billed at 1 credit per page OCR actually recovered, on top of the base + # request cost. When false, no OCR runs. module Ocr extend ContextDev::Internal::Type::Union diff --git a/lib/context_dev/models/person_enrich_params.rb b/lib/context_dev/models/person_enrich_params.rb new file mode 100644 index 00000000..8136c0ac --- /dev/null +++ b/lib/context_dev/models/person_enrich_params.rb @@ -0,0 +1,176 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::People#enrich + class PersonEnrichParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute company + # + # @return [ContextDev::Models::PersonEnrichParams::Company, nil] + optional :company, -> { ContextDev::PersonEnrichParams::Company } + + # @!attribute education + # + # @return [Array, nil] + optional :education, -> { ContextDev::Internal::Type::ArrayOf[ContextDev::PersonEnrichParams::Education] } + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute location + # + # @return [ContextDev::Models::PersonEnrichParams::Location, nil] + optional :location, -> { ContextDev::PersonEnrichParams::Location } + + # @!attribute name + # + # @return [ContextDev::Models::PersonEnrichParams::Name, nil] + optional :name, -> { ContextDev::PersonEnrichParams::Name } + + # @!attribute social_urls + # + # @return [Array, nil] + optional :social_urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + + # @!attribute timeout_ms + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + # + # @return [Integer, nil] + optional :timeout_ms, Integer, api_name: :timeoutMS + + # @!method initialize(company: nil, education: nil, email: nil, location: nil, name: nil, social_urls: nil, tags: nil, timeout_ms: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::PersonEnrichParams} for more details. + # + # @param company [ContextDev::Models::PersonEnrichParams::Company] + # + # @param education [Array] + # + # @param email [String] + # + # @param location [ContextDev::Models::PersonEnrichParams::Location] + # + # @param name [ContextDev::Models::PersonEnrichParams::Name] + # + # @param social_urls [Array] + # + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + + class Company < ContextDev::Internal::Type::BaseModel + # @!attribute domain + # + # @return [String, nil] + optional :domain, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(domain: nil, name: nil) + # @param domain [String] + # @param name [String] + end + + class Education < ContextDev::Internal::Type::BaseModel + # @!attribute degree + # + # @return [String, nil] + optional :degree, String + + # @!attribute field_of_study + # + # @return [String, nil] + optional :field_of_study, String + + # @!attribute graduation_year + # + # @return [Integer, nil] + optional :graduation_year, Integer + + # @!attribute institution + # + # @return [ContextDev::Models::PersonEnrichParams::Education::Institution, nil] + optional :institution, -> { ContextDev::PersonEnrichParams::Education::Institution } + + # @!method initialize(degree: nil, field_of_study: nil, graduation_year: nil, institution: nil) + # @param degree [String] + # @param field_of_study [String] + # @param graduation_year [Integer] + # @param institution [ContextDev::Models::PersonEnrichParams::Education::Institution] + + # @see ContextDev::Models::PersonEnrichParams::Education#institution + class Institution < ContextDev::Internal::Type::BaseModel + # @!attribute domain + # + # @return [String, nil] + optional :domain, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(domain: nil, name: nil) + # @param domain [String] + # @param name [String] + end + end + + class Location < ContextDev::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # + # @return [String, nil] + optional :country, String + + # @!attribute region + # + # @return [String, nil] + optional :region, String + + # @!method initialize(city: nil, country: nil, region: nil) + # @param city [String] + # @param country [String] + # @param region [String] + end + + class Name < ContextDev::Internal::Type::BaseModel + # @!attribute first + # + # @return [String, nil] + optional :first, String + + # @!attribute last + # + # @return [String, nil] + optional :last, String + + # @!method initialize(first: nil, last: nil) + # @param first [String] + # @param last [String] + end + end + end +end diff --git a/lib/context_dev/models/person_enrich_response.rb b/lib/context_dev/models/person_enrich_response.rb new file mode 100644 index 00000000..5cf03e91 --- /dev/null +++ b/lib/context_dev/models/person_enrich_response.rb @@ -0,0 +1,581 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::People#enrich + class PersonEnrichResponse < ContextDev::Internal::Type::BaseModel + # @!attribute match + # The highest-scoring person candidate. + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate, ContextDev::Models::PersonEnrichResponse::Match::NotFound] + required :match, union: -> { ContextDev::Models::PersonEnrichResponse::Match } + + # @!attribute key_metadata + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + # + # @return [ContextDev::Models::PersonEnrichResponse::KeyMetadata, nil] + optional :key_metadata, -> { ContextDev::Models::PersonEnrichResponse::KeyMetadata } + + # @!method initialize(match:, key_metadata: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::PersonEnrichResponse} for more details. + # + # @param match [ContextDev::Models::PersonEnrichResponse::Match::Candidate, ContextDev::Models::PersonEnrichResponse::Match::NotFound] The highest-scoring person candidate. + # + # @param key_metadata [ContextDev::Models::PersonEnrichResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when + + # The highest-scoring person candidate. + # + # @see ContextDev::Models::PersonEnrichResponse#match + module Match + extend ContextDev::Internal::Type::Union + + discriminator :status + + # The highest-scoring person candidate. + variant :candidate, -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate } + + # No usable person candidate was found. + variant :not_found, -> { ContextDev::Models::PersonEnrichResponse::Match::NotFound } + + class Candidate < ContextDev::Internal::Type::BaseModel + # @!attribute person + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person] + required :person, -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person } + + # @!attribute score + # + # @return [Integer] + required :score, Integer + + # @!attribute status + # + # @return [Symbol, :candidate] + required :status, const: :candidate + + # @!method initialize(person:, score:, status: :candidate) + # The highest-scoring person candidate. + # + # @param person [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person] + # @param score [Integer] + # @param status [Symbol, :candidate] + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate#person + class Person < ContextDev::Internal::Type::BaseModel + # @!attribute education + # + # @return [Array] + required :education, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education] } + + # @!attribute experience + # + # @return [Array] + required :experience, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience] } + + # @!attribute skills + # + # @return [Array] + required :skills, ContextDev::Internal::Type::ArrayOf[String] + + # @!attribute social_urls + # + # @return [Array] + required :social_urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!attribute website_urls + # + # @return [Array] + required :website_urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!attribute avatar_url + # + # @return [String, nil] + optional :avatar_url, String + + # @!attribute bio + # + # @return [String, nil] + optional :bio, String + + # @!attribute current_role + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole, nil] + optional :current_role, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole } + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute location + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location, nil] + optional :location, -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location } + + # @!attribute name + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name, nil] + optional :name, -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name } + + # @!method initialize(education:, experience:, skills:, social_urls:, website_urls:, avatar_url: nil, bio: nil, current_role: nil, email: nil, location: nil, name: nil) + # @param education [Array] + # @param experience [Array] + # @param skills [Array] + # @param social_urls [Array] + # @param website_urls [Array] + # @param avatar_url [String] + # @param bio [String] + # @param current_role [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole] + # @param email [String] + # @param location [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location] + # @param name [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name] + + class Education < ContextDev::Internal::Type::BaseModel + # @!attribute institution + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution] + required :institution, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution } + + # @!attribute degree + # + # @return [String, nil] + optional :degree, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute end_date + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate, nil] + optional :end_date, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate } + + # @!attribute field_of_study + # + # @return [String, nil] + optional :field_of_study, String + + # @!attribute start_date + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate, nil] + optional :start_date, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate } + + # @!method initialize(institution:, degree: nil, description: nil, end_date: nil, field_of_study: nil, start_date: nil) + # @param institution [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution] + # @param degree [String] + # @param description [String] + # @param end_date [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate] + # @param field_of_study [String] + # @param start_date [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate] + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education#institution + class Institution < ContextDev::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute domain + # + # @return [String, nil] + optional :domain, String + + # @!method initialize(name:, domain: nil) + # @param name [String] + # @param domain [String] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education#end_date + class EndDate < ContextDev::Internal::Type::BaseModel + # @!attribute year + # + # @return [Integer] + required :year, Integer + + # @!attribute day + # + # @return [Integer, nil] + optional :day, Integer + + # @!attribute month + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(year:, day: nil, month: nil) + # @param year [Integer] + # @param day [Integer] + # @param month [Integer] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education#start_date + class StartDate < ContextDev::Internal::Type::BaseModel + # @!attribute year + # + # @return [Integer] + required :year, Integer + + # @!attribute day + # + # @return [Integer, nil] + optional :day, Integer + + # @!attribute month + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(year:, day: nil, month: nil) + # @param year [Integer] + # @param day [Integer] + # @param month [Integer] + end + end + + class Experience < ContextDev::Internal::Type::BaseModel + # @!attribute organization + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization] + required :organization, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization } + + # @!attribute title + # + # @return [String] + required :title, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute end_date + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate, nil] + optional :end_date, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate } + + # @!attribute is_current + # + # @return [Boolean, nil] + optional :is_current, ContextDev::Internal::Type::Boolean + + # @!attribute location + # + # @return [String, nil] + optional :location, String + + # @!attribute start_date + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate, nil] + optional :start_date, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate } + + # @!method initialize(organization:, title:, description: nil, end_date: nil, is_current: nil, location: nil, start_date: nil) + # @param organization [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization] + # @param title [String] + # @param description [String] + # @param end_date [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate] + # @param is_current [Boolean] + # @param location [String] + # @param start_date [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate] + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience#organization + class Organization < ContextDev::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute domain + # + # @return [String, nil] + optional :domain, String + + # @!method initialize(name:, domain: nil) + # @param name [String] + # @param domain [String] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience#end_date + class EndDate < ContextDev::Internal::Type::BaseModel + # @!attribute year + # + # @return [Integer] + required :year, Integer + + # @!attribute day + # + # @return [Integer, nil] + optional :day, Integer + + # @!attribute month + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(year:, day: nil, month: nil) + # @param year [Integer] + # @param day [Integer] + # @param month [Integer] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience#start_date + class StartDate < ContextDev::Internal::Type::BaseModel + # @!attribute year + # + # @return [Integer] + required :year, Integer + + # @!attribute day + # + # @return [Integer, nil] + optional :day, Integer + + # @!attribute month + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(year:, day: nil, month: nil) + # @param year [Integer] + # @param day [Integer] + # @param month [Integer] + end + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person#current_role + class CurrentRole < ContextDev::Internal::Type::BaseModel + # @!attribute organization + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization] + required :organization, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization } + + # @!attribute title + # + # @return [String] + required :title, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute end_date + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate, nil] + optional :end_date, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate } + + # @!attribute is_current + # + # @return [Boolean, nil] + optional :is_current, ContextDev::Internal::Type::Boolean + + # @!attribute location + # + # @return [String, nil] + optional :location, String + + # @!attribute start_date + # + # @return [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate, nil] + optional :start_date, + -> { ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate } + + # @!method initialize(organization:, title:, description: nil, end_date: nil, is_current: nil, location: nil, start_date: nil) + # @param organization [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization] + # @param title [String] + # @param description [String] + # @param end_date [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate] + # @param is_current [Boolean] + # @param location [String] + # @param start_date [ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate] + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole#organization + class Organization < ContextDev::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute domain + # + # @return [String, nil] + optional :domain, String + + # @!method initialize(name:, domain: nil) + # @param name [String] + # @param domain [String] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole#end_date + class EndDate < ContextDev::Internal::Type::BaseModel + # @!attribute year + # + # @return [Integer] + required :year, Integer + + # @!attribute day + # + # @return [Integer, nil] + optional :day, Integer + + # @!attribute month + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(year:, day: nil, month: nil) + # @param year [Integer] + # @param day [Integer] + # @param month [Integer] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole#start_date + class StartDate < ContextDev::Internal::Type::BaseModel + # @!attribute year + # + # @return [Integer] + required :year, Integer + + # @!attribute day + # + # @return [Integer, nil] + optional :day, Integer + + # @!attribute month + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(year:, day: nil, month: nil) + # @param year [Integer] + # @param day [Integer] + # @param month [Integer] + end + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person#location + class Location < ContextDev::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # + # @return [String, nil] + optional :country, String + + # @!attribute country_code + # + # @return [String, nil] + optional :country_code, String + + # @!attribute display_ + # + # @return [String, nil] + optional :display_, String, api_name: :display + + # @!attribute region + # + # @return [String, nil] + optional :region, String + + # @!method initialize(city: nil, country: nil, country_code: nil, display_: nil, region: nil) + # @param city [String] + # @param country [String] + # @param country_code [String] + # @param display_ [String] + # @param region [String] + end + + # @see ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person#name + class Name < ContextDev::Internal::Type::BaseModel + # @!attribute first + # + # @return [String, nil] + optional :first, String + + # @!attribute full + # + # @return [String, nil] + optional :full, String + + # @!attribute last + # + # @return [String, nil] + optional :last, String + + # @!method initialize(first: nil, full: nil, last: nil) + # @param first [String] + # @param full [String] + # @param last [String] + end + end + end + + class NotFound < ContextDev::Internal::Type::BaseModel + # @!attribute person + # + # @return [nil] + required :person, NilClass + + # @!attribute score + # + # @return [nil] + required :score, NilClass + + # @!attribute status + # + # @return [Symbol, :not_found] + required :status, const: :not_found + + # @!method initialize(person:, score:, status: :not_found) + # No usable person candidate was found. + # + # @param person [nil] + # @param score [nil] + # @param status [Symbol, :not_found] + end + + # @!method self.variants + # @return [Array(ContextDev::Models::PersonEnrichResponse::Match::Candidate, ContextDev::Models::PersonEnrichResponse::Match::NotFound)] + end + + # @see ContextDev::Models::PersonEnrichResponse#key_metadata + class KeyMetadata < ContextDev::Internal::Type::BaseModel + # @!attribute credits_consumed + # The number of credits consumed by this request. + # + # @return [Integer] + required :credits_consumed, Integer + + # @!attribute credits_remaining + # The number of credits remaining for your organization after this request. + # + # @return [Integer] + required :credits_remaining, Integer + + # @!method initialize(credits_consumed:, credits_remaining:) + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + # + # @param credits_consumed [Integer] The number of credits consumed by this request. + # + # @param credits_remaining [Integer] The number of credits remaining for your organization after this request. + end + end + end +end diff --git a/lib/context_dev/models/web_search_response.rb b/lib/context_dev/models/web_search_response.rb index a69af7a9..f263a333 100644 --- a/lib/context_dev/models/web_search_response.rb +++ b/lib/context_dev/models/web_search_response.rb @@ -109,6 +109,7 @@ module Code SUCCESS = :SUCCESS NOT_REQUESTED = :NOT_REQUESTED TIMEOUT = :TIMEOUT + CONTENT_TOO_LARGE = :CONTENT_TOO_LARGE WEBSITE_ACCESS_ERROR = :WEBSITE_ACCESS_ERROR ERROR = :ERROR diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index c2930462..e83498b8 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -428,9 +428,10 @@ class Pdf < ContextDev::Internal::Type::BaseModel optional :end_, Integer, api_name: :end # @!attribute ocr - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. # # @return [Boolean, nil] optional :ocr, ContextDev::Internal::Type::Boolean @@ -457,7 +458,7 @@ class Pdf < ContextDev::Internal::Type::BaseModel # # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus # - # @param ocr [Boolean] When true, detect and OCR images embedded in the selected PDF pages, inserting r + # @param ocr [Boolean] When true, OCR the selected PDF pages that have no usable text layer (scans), re # # @param should_parse [Boolean] When true, PDF pages are fetched and parsed. When false, PDF pages are skipped e # diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 9c82efde..d9934996 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -459,16 +459,17 @@ class Pdf < ContextDev::Internal::Type::BaseModel optional :end_, Integer, api_name: :end # @!attribute ocr - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. # # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr, nil] optional :ocr, union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr } # @!attribute should_parse # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. # # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse, nil] optional :should_parse, @@ -490,15 +491,16 @@ class Pdf < ContextDev::Internal::Type::BaseModel # # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus # - # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r + # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr] When true, OCR the selected PDF pages that have no usable text layer (scans), re # # @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. # # @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#ocr module Ocr @@ -526,7 +528,7 @@ module Ocr end # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. # # @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#should_parse module ShouldParse diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 4ed1739d..9ca9792a 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -534,16 +534,17 @@ class Pdf < ContextDev::Internal::Type::BaseModel optional :end_, Integer, api_name: :end # @!attribute ocr - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. # # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr, nil] optional :ocr, union: -> { ContextDev::WebWebScrapeMdParams::Pdf::Ocr } # @!attribute should_parse # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. # # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse, nil] optional :should_parse, @@ -565,15 +566,16 @@ class Pdf < ContextDev::Internal::Type::BaseModel # # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus # - # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r + # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr] When true, OCR the selected PDF pages that have no usable text layer (scans), re # # @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. # # @see ContextDev::Models::WebWebScrapeMdParams::Pdf#ocr module Ocr @@ -601,7 +603,7 @@ module Ocr end # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. # # @see ContextDev::Models::WebWebScrapeMdParams::Pdf#should_parse module ShouldParse diff --git a/lib/context_dev/models/web_web_scrape_sitemap_params.rb b/lib/context_dev/models/web_web_scrape_sitemap_params.rb index 84a20a5c..1520d00d 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -28,6 +28,14 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_links, Integer + # @!attribute search + # Optional search phrase. When provided, the crawled sitemap is filtered to the + # pages whose URLs are about that phrase, most relevant first, and the request + # costs 2 credits instead of 1. + # + # @return [String, nil] + optional :search, String + # @!attribute sitemap_url # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled # instead of discovering the domain's sitemaps. @@ -67,7 +75,7 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr, nil] optional :zdr, enum: -> { ContextDev::WebWebScrapeSitemapParams::Zdr } - # @!method initialize(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) + # @!method initialize(domain:, headers: nil, max_links: nil, search: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # @@ -77,6 +85,8 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param search [String] Optional search phrase. When provided, the crawled sitemap is filtered to the pa + # # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are diff --git a/lib/context_dev/models/web_web_scrape_sitemap_response.rb b/lib/context_dev/models/web_web_scrape_sitemap_response.rb index 463cd3a6..d8354c13 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_response.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_response.rb @@ -23,7 +23,8 @@ class WebWebScrapeSitemapResponse < ContextDev::Internal::Type::BaseModel required :success, enum: -> { ContextDev::Models::WebWebScrapeSitemapResponse::Success } # @!attribute urls - # Array of discovered page URLs from the sitemap (max 500) + # Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set + # these are only the matching pages, most relevant first. # # @return [Array] required :urls, ContextDev::Internal::Type::ArrayOf[String] @@ -45,7 +46,7 @@ class WebWebScrapeSitemapResponse < ContextDev::Internal::Type::BaseModel # # @param success [Boolean, ContextDev::Models::WebWebScrapeSitemapResponse::Success] Indicates success # - # @param urls [Array] Array of discovered page URLs from the sitemap (max 500) + # @param urls [Array] Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set th # # @param key_metadata [ContextDev::Models::WebWebScrapeSitemapResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when diff --git a/lib/context_dev/resources/batch.rb b/lib/context_dev/resources/batch.rb index 0bd57454..478128ea 100644 --- a/lib/context_dev/resources/batch.rb +++ b/lib/context_dev/resources/batch.rb @@ -2,6 +2,7 @@ module ContextDev module Resources + # Scrape many pages or crawl a site asynchronously. class Batch # Check progress, and get download links once the batch finishes. # @@ -60,6 +61,27 @@ def list(params = {}) ) end + # Permanently delete a finished batch and its stored results. Active batches must + # settle first. + # + # @overload delete(batch_id, request_options: {}) + # + # @param batch_id [String] ID of the batch to retrieve or cancel. + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::BatchDeleteResponse] + # + # @see ContextDev::Models::BatchDeleteParams + def delete(batch_id, params = {}) + @client.request( + method: :delete, + path: ["batch/%1$s", batch_id], + model: ContextDev::Models::BatchDeleteResponse, + options: params[:request_options] + ) + end + # Stop a batch from starting new pages. In-progress pages finish, and unused # credits are refunded. # @@ -115,15 +137,17 @@ def get_results(batch_id, params = {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::BatchSubmitParams} for more details. # - # Retrieve and normalize a person profile from identifiers. + # Scrape 25K URLs or crawl large websites asynchronously. + # + # @overload submit(input:, tags: nil, webhook_url: nil, idempotency_key: nil, request_options: {}) # - # @overload submit(identifiers:, tags: nil, timeout_ms: nil, request_options: {}) + # @param input [ContextDev::Models::BatchSubmitParams::Input::Scrape, ContextDev::Models::BatchSubmitParams::Input::Crawl] Body param: Choose a URL list or a site crawl. # - # @param identifiers [ContextDev::Models::BatchSubmitParams::Identifiers] Known identifiers for the person. At least one identifier is required. + # @param tags [Array] Body param: Tags stored on the batch. Filter the batch list by them later. # - # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # @param webhook_url [String] Body param: URL notified when the batch finishes. # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # @param idempotency_key [String] Header param: Any string unique to this submission. Retries with the same key re # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -132,10 +156,12 @@ def get_results(batch_id, params = {}) # @see ContextDev::Models::BatchSubmitParams def submit(params) parsed, options = ContextDev::BatchSubmitParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, - path: "people/retrieve", - body: parsed, + path: "batch/submit", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: ContextDev::Models::BatchSubmitResponse, options: options ) diff --git a/lib/context_dev/resources/brand.rb b/lib/context_dev/resources/brand.rb index cd2eceee..51f79094 100644 --- a/lib/context_dev/resources/brand.rb +++ b/lib/context_dev/resources/brand.rb @@ -69,7 +69,8 @@ def retrieve_simplified(params) # {ContextDev::Models::BrandSearchParams} for more details. # # Search brands by name or domain and get back up to 10 lightweight matches - # (domain, name, logo), most popular first: by Tranco rank, then market cap for + # (domain, name, logo). Name matches rank ahead of domain matches; within each + # group the most popular brands come first: by Tranco rank, then market cap for # brands outside the Tranco list, with text relevance breaking ties. Matching is # prefix-based with no typo tolerance, so it is suited to autocomplete. Only # brands already in the Context.dev index are returned — use /brand/retrieve to diff --git a/lib/context_dev/resources/parse.rb b/lib/context_dev/resources/parse.rb index fd80da71..a7dfa4dc 100644 --- a/lib/context_dev/resources/parse.rb +++ b/lib/context_dev/resources/parse.rb @@ -21,7 +21,7 @@ class Parse # # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Query param: Preserve hyperlinks in Markdown output # - # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] Query param: When true for PDF inputs, detect and OCR images embedded in the sel + # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] Query param: When true for PDF inputs, OCR the selected pages that have no usabl # # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5 # diff --git a/lib/context_dev/resources/people.rb b/lib/context_dev/resources/people.rb new file mode 100644 index 00000000..92e15f46 --- /dev/null +++ b/lib/context_dev/resources/people.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module ContextDev + module Resources + class People + # Some parameter documentations has been truncated, see + # {ContextDev::Models::PersonEnrichParams} for more details. + # + # Finds and normalizes the best available person candidate from additive identity + # clues, then assigns an identity match score from 0 to 100. Available on all paid + # plans. Successful requests cost 20 credits. Disposable and free email addresses + # (like gmail.com, yahoo.com) will throw a 422 error. + # + # @overload enrich(company: nil, education: nil, email: nil, location: nil, name: nil, social_urls: nil, tags: nil, timeout_ms: nil, request_options: {}) + # + # @param company [ContextDev::Models::PersonEnrichParams::Company] + # + # @param education [Array] + # + # @param email [String] + # + # @param location [ContextDev::Models::PersonEnrichParams::Location] + # + # @param name [ContextDev::Models::PersonEnrichParams::Name] + # + # @param social_urls [Array] + # + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::PersonEnrichResponse] + # + # @see ContextDev::Models::PersonEnrichParams + def enrich(params = {}) + parsed, options = ContextDev::PersonEnrichParams.dump_request(params) + @client.request( + method: :post, + path: "people/enrich", + body: parsed, + model: ContextDev::Models::PersonEnrichResponse, + options: options + ) + end + + # @api private + # + # @param client [ContextDev::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 0504ffce..00169af5 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -462,6 +462,18 @@ def web_scrape_images(params) # responses from a recognized API key; use error_code to distinguish stable # failure categories. # + # ### YouTube + # + # YouTube URLs return the video or channel itself rather than the surrounding + # player and navigation chrome. A URL addressing a single video (`/watch`, + # `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, + # view count, keywords, full description, and the transcript when the video has + # captions that can be retrieved; videos without captions return everything except + # the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) + # returns its name, handle, subscriber count, video count, and full description. + # When `includeImages=true`, video responses also include the thumbnail and + # channel responses include the avatar. Costs the same as any other scrape. + # # ### Billing & errors # # | HTTP status | Billed? | Meaning | @@ -471,6 +483,7 @@ def web_scrape_images(params) # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | # | 404 | No | Target page returned or fingerprinted as not found | # | 408 | No | Request timed out | + # | 413 | No | Target content exceeds the maximum supported size (20 MB) | # | 415 | No | Unsupported content type | # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | # | 500 | No | Internal error | @@ -545,9 +558,13 @@ def web_scrape_md(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # - # Crawl an entire website's sitemap and return all discovered page URLs. + # Crawl an entire website's sitemap and return all discovered page URLs. Pass + # `search` to have the crawled sitemap filtered down to the pages about a phrase + # (for example `pricing and plans` or `api authentication docs`), most relevant + # first — a searched crawl scans the whole sitemap and costs 2 credits instead + # of 1. # - # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) + # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, search: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) # # @param domain [String] Domain to build a sitemap for # @@ -555,6 +572,8 @@ def web_scrape_md(params) # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param search [String] Optional search phrase. When provided, the crawled sitemap is filtered to the pa + # # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index 14e45183..c0dbdad4 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "2.8.0" + VERSION = "2.9.0" end diff --git a/rbi/context_dev/client.rbi b/rbi/context_dev/client.rbi index cca08589..2fa520e9 100644 --- a/rbi/context_dev/client.rbi +++ b/rbi/context_dev/client.rbi @@ -38,9 +38,13 @@ module ContextDev sig { returns(ContextDev::Resources::Monitors) } attr_reader :monitors + # Scrape many pages or crawl a site asynchronously. sig { returns(ContextDev::Resources::Batch) } attr_reader :batch + sig { returns(ContextDev::Resources::People) } + attr_reader :people + # @api private sig { override.returns(T::Hash[String, String]) } private def auth_headers diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 40b2332a..9181504d 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -7,6 +7,8 @@ module ContextDev BatchCancelParams = ContextDev::Models::BatchCancelParams + BatchDeleteParams = ContextDev::Models::BatchDeleteParams + BatchGetResultsParams = ContextDev::Models::BatchGetResultsParams BatchListParams = ContextDev::Models::BatchListParams @@ -64,6 +66,8 @@ module ContextDev ParseHandleParams = ContextDev::Models::ParseHandleParams + PersonEnrichParams = ContextDev::Models::PersonEnrichParams + UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams diff --git a/rbi/context_dev/models/batch_delete_params.rbi b/rbi/context_dev/models/batch_delete_params.rbi new file mode 100644 index 00000000..3480ac1e --- /dev/null +++ b/rbi/context_dev/models/batch_delete_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module ContextDev + module Models + class BatchDeleteParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(ContextDev::BatchDeleteParams, ContextDev::Internal::AnyHash) + end + + # ID of the batch to retrieve or cancel. + sig { returns(String) } + attr_accessor :batch_id + + sig do + params( + batch_id: String, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the batch to retrieve or cancel. + batch_id:, + request_options: {} + ) + end + + sig do + override.returns( + { batch_id: String, request_options: ContextDev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/context_dev/models/batch_delete_response.rbi b/rbi/context_dev/models/batch_delete_response.rbi new file mode 100644 index 00000000..3ae4fc70 --- /dev/null +++ b/rbi/context_dev/models/batch_delete_response.rbi @@ -0,0 +1,116 @@ +# typed: strong + +module ContextDev + module Models + class BatchDeleteResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::BatchDeleteResponse, + ContextDev::Internal::AnyHash + ) + end + + # ID of the deleted batch. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Always true on success. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :deleted + + sig { params(deleted: T::Boolean).void } + attr_writer :deleted + + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + sig do + returns(T.nilable(ContextDev::Models::BatchDeleteResponse::KeyMetadata)) + end + attr_reader :key_metadata + + sig do + params( + key_metadata: + ContextDev::Models::BatchDeleteResponse::KeyMetadata::OrHash + ).void + end + attr_writer :key_metadata + + sig do + params( + id: String, + deleted: T::Boolean, + key_metadata: + ContextDev::Models::BatchDeleteResponse::KeyMetadata::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the deleted batch. + id: nil, + # Always true on success. + deleted: nil, + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + key_metadata: nil + ) + end + + sig do + override.returns( + { + id: String, + deleted: T::Boolean, + key_metadata: ContextDev::Models::BatchDeleteResponse::KeyMetadata + } + ) + end + def to_hash + end + + class KeyMetadata < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::BatchDeleteResponse::KeyMetadata, + ContextDev::Internal::AnyHash + ) + end + + # The number of credits consumed by this request. + sig { returns(Integer) } + attr_accessor :credits_consumed + + # The number of credits remaining for your organization after this request. + sig { returns(Integer) } + attr_accessor :credits_remaining + + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + sig do + params(credits_consumed: Integer, credits_remaining: Integer).returns( + T.attached_class + ) + end + def self.new( + # The number of credits consumed by this request. + credits_consumed:, + # The number of credits remaining for your organization after this request. + credits_remaining: + ) + end + + sig do + override.returns( + { credits_consumed: Integer, credits_remaining: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/context_dev/models/batch_get_results_response.rbi b/rbi/context_dev/models/batch_get_results_response.rbi index 8bff0cf0..5e22862d 100644 --- a/rbi/context_dev/models/batch_get_results_response.rbi +++ b/rbi/context_dev/models/batch_get_results_response.rbi @@ -190,6 +190,14 @@ module ContextDev sig { params(meta: T::Hash[Symbol, T.anything]).void } attr_writer :meta + # PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page + # bills 1 credit on top of the page base credit; absent when no OCR ran. + sig { returns(T.nilable(Integer)) } + attr_reader :ocr_pages + + sig { params(ocr_pages: Integer).void } + attr_writer :ocr_pages + # A page the batch fetched successfully. sig do params( @@ -202,6 +210,7 @@ module ContextDev item_id: String, markdown: String, meta: T::Hash[Symbol, T.anything], + ocr_pages: Integer, status: Symbol ).returns(T.attached_class) end @@ -222,6 +231,9 @@ module ContextDev markdown: nil, # Caller-supplied metadata echoed from submission. meta: nil, + # PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page + # bills 1 credit on top of the page base credit; absent when no OCR ran. + ocr_pages: nil, # The page was scraped. status: :ok ) @@ -239,7 +251,8 @@ module ContextDev html: String, item_id: String, markdown: String, - meta: T::Hash[Symbol, T.anything] + meta: T::Hash[Symbol, T.anything], + ocr_pages: Integer } ) end diff --git a/rbi/context_dev/models/batch_list_response.rbi b/rbi/context_dev/models/batch_list_response.rbi index 23c402f2..20a5cdd7 100644 --- a/rbi/context_dev/models/batch_list_response.rbi +++ b/rbi/context_dev/models/batch_list_response.rbi @@ -304,11 +304,16 @@ module ContextDev ) end - # `reserved` minus `refunded` — what the batch has cost so far. Equal to - # `reserved` until the batch settles. + # `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # Equal to `reserved` until the batch settles. sig { returns(Integer) } attr_accessor :net + # Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered + # page, on top of `reserved`. Stays 0 until the batch settles. + sig { returns(Integer) } + attr_accessor :ocr_charged + # Credits returned for pages that did not succeed. Stays 0 until the batch reaches # a final status, then settles in one movement. sig { returns(Integer) } @@ -321,14 +326,20 @@ module ContextDev # What this batch has done to your credit balance. sig do - params(net: Integer, refunded: Integer, reserved: Integer).returns( - T.attached_class - ) + params( + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + ).returns(T.attached_class) end def self.new( - # `reserved` minus `refunded` — what the batch has cost so far. Equal to - # `reserved` until the batch settles. + # `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # Equal to `reserved` until the batch settles. net:, + # Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered + # page, on top of `reserved`. Stays 0 until the batch settles. + ocr_charged:, # Credits returned for pages that did not succeed. Stays 0 until the batch reaches # a final status, then settles in one movement. refunded:, @@ -340,7 +351,12 @@ module ContextDev sig do override.returns( - { net: Integer, refunded: Integer, reserved: Integer } + { + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + } ) end def to_hash diff --git a/rbi/context_dev/models/batch_retrieve_response.rbi b/rbi/context_dev/models/batch_retrieve_response.rbi index 1acf02e8..d279ba42 100644 --- a/rbi/context_dev/models/batch_retrieve_response.rbi +++ b/rbi/context_dev/models/batch_retrieve_response.rbi @@ -238,11 +238,16 @@ module ContextDev ) end - # `reserved` minus `refunded` — what the batch has cost so far. Equal to - # `reserved` until the batch settles. + # `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # Equal to `reserved` until the batch settles. sig { returns(Integer) } attr_accessor :net + # Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered + # page, on top of `reserved`. Stays 0 until the batch settles. + sig { returns(Integer) } + attr_accessor :ocr_charged + # Credits returned for pages that did not succeed. Stays 0 until the batch reaches # a final status, then settles in one movement. sig { returns(Integer) } @@ -255,14 +260,20 @@ module ContextDev # What this batch has done to your credit balance. sig do - params(net: Integer, refunded: Integer, reserved: Integer).returns( - T.attached_class - ) + params( + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + ).returns(T.attached_class) end def self.new( - # `reserved` minus `refunded` — what the batch has cost so far. Equal to - # `reserved` until the batch settles. + # `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. + # Equal to `reserved` until the batch settles. net:, + # Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered + # page, on top of `reserved`. Stays 0 until the batch settles. + ocr_charged:, # Credits returned for pages that did not succeed. Stays 0 until the batch reaches # a final status, then settles in one movement. refunded:, @@ -274,7 +285,12 @@ module ContextDev sig do override.returns( - { net: Integer, refunded: Integer, reserved: Integer } + { + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + } ) end def to_hash diff --git a/rbi/context_dev/models/batch_submit_params.rbi b/rbi/context_dev/models/batch_submit_params.rbi index 99573653..89f6dc0b 100644 --- a/rbi/context_dev/models/batch_submit_params.rbi +++ b/rbi/context_dev/models/batch_submit_params.rbi @@ -11,50 +11,62 @@ module ContextDev T.any(ContextDev::BatchSubmitParams, ContextDev::Internal::AnyHash) end - # Known identifiers for the person. At least one identifier is required. - sig { returns(ContextDev::BatchSubmitParams::Identifiers) } - attr_reader :identifiers - + # Choose a URL list or a site crawl. sig do - params( - identifiers: ContextDev::BatchSubmitParams::Identifiers::OrHash - ).void + returns( + T.any( + ContextDev::BatchSubmitParams::Input::Scrape, + ContextDev::BatchSubmitParams::Input::Crawl + ) + ) end - attr_writer :identifiers + attr_accessor :input - # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # Tags stored on the batch. Filter the batch list by them later. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags sig { params(tags: T::Array[String]).void } attr_writer :tags - # Optional timeout in milliseconds for the request. If the request takes longer - # than this value, it will be aborted with a 408 status code. Maximum allowed - # value is 300000ms (5 minutes). - sig { returns(T.nilable(Integer)) } - attr_reader :timeout_ms + # URL notified when the batch finishes. + sig { returns(T.nilable(String)) } + attr_reader :webhook_url - sig { params(timeout_ms: Integer).void } - attr_writer :timeout_ms + sig { params(webhook_url: String).void } + attr_writer :webhook_url + + # Any string unique to this submission. Retries with the same key return the + # original batch. + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key sig do params( - identifiers: ContextDev::BatchSubmitParams::Identifiers::OrHash, + input: + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::OrHash, + ContextDev::BatchSubmitParams::Input::Crawl::OrHash + ), tags: T::Array[String], - timeout_ms: Integer, + webhook_url: String, + idempotency_key: String, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Known identifiers for the person. At least one identifier is required. - identifiers:, - # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # Choose a URL list or a site crawl. + input:, + # Tags stored on the batch. Filter the batch list by them later. tags: nil, - # Optional timeout in milliseconds for the request. If the request takes longer - # than this value, it will be aborted with a 408 status code. Maximum allowed - # value is 300000ms (5 minutes). - timeout_ms: nil, + # URL notified when the batch finishes. + webhook_url: nil, + # Any string unique to this submission. Retries with the same key return the + # original batch. + idempotency_key: nil, request_options: {} ) end @@ -62,9 +74,14 @@ module ContextDev sig do override.returns( { - identifiers: ContextDev::BatchSubmitParams::Identifiers, + input: + T.any( + ContextDev::BatchSubmitParams::Input::Scrape, + ContextDev::BatchSubmitParams::Input::Crawl + ), tags: T::Array[String], - timeout_ms: Integer, + webhook_url: String, + idempotency_key: String, request_options: ContextDev::RequestOptions } ) @@ -72,32 +89,6926 @@ module ContextDev def to_hash end - class Identifiers < ContextDev::Internal::Type::BaseModel - OrHash = + # Choose a URL list or a site crawl. + module Input + extend ContextDev::Internal::Type::Union + + Variants = T.type_alias do T.any( - ContextDev::BatchSubmitParams::Identifiers, - ContextDev::Internal::AnyHash + ContextDev::BatchSubmitParams::Input::Scrape, + ContextDev::BatchSubmitParams::Input::Crawl ) end - # LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/. - sig { returns(T.nilable(String)) } - attr_reader :linkedin_url + class Scrape < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape, + ContextDev::Internal::AnyHash + ) + end - sig { params(linkedin_url: String).void } - attr_writer :linkedin_url + # Pages to scrape and their output format. + sig do + returns( + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML + ) + ) + end + attr_accessor :data - # Known identifiers for the person. At least one identifier is required. - sig { params(linkedin_url: String).returns(T.attached_class) } - def self.new( - # LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/. - linkedin_url: nil - ) + # Scrape the pages in `data.urls`. + sig { returns(Symbol) } + attr_accessor :mode + + # Scrape up to 25K URLs in one batch. + sig do + params( + data: + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::OrHash, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::OrHash + ), + mode: Symbol + ).returns(T.attached_class) + end + def self.new( + # Pages to scrape and their output format. + data:, + # Scrape the pages in `data.urls`. + mode: :scrape + ) + end + + sig do + override.returns( + { + data: + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML + ), + mode: Symbol + } + ) + end + def to_hash + end + + # Pages to scrape and their output format. + module Data + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML + ) + end + + class Markdown < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown, + ContextDev::Internal::AnyHash + ) + end + + # Return page content as Markdown. + sig { returns(Symbol) } + attr_accessor :format_ + + # Pages to scrape. Maximum 25000. + sig do + returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL + ] + ) + end + attr_accessor :urls + + # Options for Markdown output. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options + ) + ) + end + attr_reader :options + + sig do + params( + options: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::OrHash + ).void + end + attr_writer :options + + # Scrape the listed pages as Markdown. + sig do + params( + urls: + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL::OrHash + ], + options: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::OrHash, + format_: Symbol + ).returns(T.attached_class) + end + def self.new( + # Pages to scrape. Maximum 25000. + urls:, + # Options for Markdown output. + options: nil, + # Return page content as Markdown. + format_: :markdown + ) + end + + sig do + override.returns( + { + format_: Symbol, + urls: + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL + ], + options: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options + } + ) + end + def to_hash + end + + class URL < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL, + ContextDev::Internal::AnyHash + ) + end + + # Page URL to scrape. + sig { returns(String) } + attr_accessor :url + + # Your ID for this page, returned with its result. The same URL can use different + # IDs. + sig { returns(T.nilable(String)) } + attr_reader :item_id + + sig { params(item_id: String).void } + attr_writer :item_id + + # Custom JSON returned unchanged with this page result. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :meta + + sig { params(meta: T::Hash[Symbol, T.anything]).void } + attr_writer :meta + + # A page to scrape, with optional data for matching results. + sig do + params( + url: String, + item_id: String, + meta: T::Hash[Symbol, T.anything] + ).returns(T.attached_class) + end + def self.new( + # Page URL to scrape. + url:, + # Your ID for this page, returned with its result. The same URL can use different + # IDs. + item_id: nil, + # Custom JSON returned unchanged with this page result. + meta: nil + ) + end + + sig do + override.returns( + { + url: String, + item_id: String, + meta: T::Hash[Symbol, T.anything] + } + ) + end + def to_hash + end + end + + class Options < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options, + ContextDev::Internal::AnyHash + ) + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::OrSymbol + ) + ) + end + attr_reader :country + + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::OrSymbol + ).void + end + attr_writer :country + + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_selectors + + # Include image references in the Markdown. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_images + + sig { params(include_images: T::Boolean).void } + attr_writer :include_images + + # Include links in the Markdown. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_links + + sig { params(include_links: T::Boolean).void } + attr_writer :include_links + + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_selectors + + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_age_ms + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf + ) + ) + end + attr_reader :pdf + + sig do + params( + pdf: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::OrHash + ).void + end + attr_writer :pdf + + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :settle_animations + + sig { params(settle_animations: T::Boolean).void } + attr_writer :settle_animations + + # Shorten inline base64 image data. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :shorten_base64_images + + sig { params(shorten_base64_images: T::Boolean).void } + attr_writer :shorten_base64_images + + # Return the main content without navigation or footers. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_main_content_only + + sig { params(use_main_content_only: T::Boolean).void } + attr_writer :use_main_content_only + + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + + # Options for Markdown output. + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_images: T::Boolean, + include_links: T::Boolean, + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::OrHash, + settle_animations: T::Boolean, + shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + ).returns(T.attached_class) + end + def self.new( + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + country: nil, + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + exclude_selectors: nil, + # Include image references in the Markdown. + include_images: nil, + # Include links in the Markdown. + include_links: nil, + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + include_selectors: nil, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + max_age_ms: nil, + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + pdf: nil, + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + settle_animations: nil, + # Shorten inline base64 image data. + shorten_base64_images: nil, + # Return the main content without navigation or footers. + use_main_content_only: nil, + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + wait_for_ms: nil + ) + end + + sig do + override.returns( + { + country: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_images: T::Boolean, + include_links: T::Boolean, + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf, + settle_animations: T::Boolean, + shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + } + ) + end + def to_hash + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + module Country + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD = + T.let( + :ad, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AE = + T.let( + :ae, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AF = + T.let( + :af, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AG = + T.let( + :ag, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AI = + T.let( + :ai, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AL = + T.let( + :al, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AM = + T.let( + :am, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AO = + T.let( + :ao, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AR = + T.let( + :ar, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AT = + T.let( + :at, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AU = + T.let( + :au, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AW = + T.let( + :aw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + AZ = + T.let( + :az, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BA = + T.let( + :ba, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BB = + T.let( + :bb, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BD = + T.let( + :bd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BE = + T.let( + :be, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BF = + T.let( + :bf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BG = + T.let( + :bg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BH = + T.let( + :bh, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BI = + T.let( + :bi, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BJ = + T.let( + :bj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BM = + T.let( + :bm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BN = + T.let( + :bn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BO = + T.let( + :bo, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BQ = + T.let( + :bq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BR = + T.let( + :br, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BS = + T.let( + :bs, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BW = + T.let( + :bw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BY = + T.let( + :by, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + BZ = + T.let( + :bz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CA = + T.let( + :ca, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CD = + T.let( + :cd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CF = + T.let( + :cf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CG = + T.let( + :cg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CH = + T.let( + :ch, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CI = + T.let( + :ci, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CL = + T.let( + :cl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CM = + T.let( + :cm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CN = + T.let( + :cn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CO = + T.let( + :co, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CR = + T.let( + :cr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CV = + T.let( + :cv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CW = + T.let( + :cw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CY = + T.let( + :cy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + CZ = + T.let( + :cz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + DE = + T.let( + :de, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + DJ = + T.let( + :dj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + DK = + T.let( + :dk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + DM = + T.let( + :dm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + DO = + T.let( + :do, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + DZ = + T.let( + :dz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + EC = + T.let( + :ec, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + EE = + T.let( + :ee, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + EG = + T.let( + :eg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ES = + T.let( + :es, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ET = + T.let( + :et, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + FI = + T.let( + :fi, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + FJ = + T.let( + :fj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + FR = + T.let( + :fr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GA = + T.let( + :ga, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GB = + T.let( + :gb, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GD = + T.let( + :gd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GE = + T.let( + :ge, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GF = + T.let( + :gf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GG = + T.let( + :gg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GH = + T.let( + :gh, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GM = + T.let( + :gm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GN = + T.let( + :gn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GP = + T.let( + :gp, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GQ = + T.let( + :gq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GR = + T.let( + :gr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GT = + T.let( + :gt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GU = + T.let( + :gu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GW = + T.let( + :gw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + GY = + T.let( + :gy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + HK = + T.let( + :hk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + HN = + T.let( + :hn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + HR = + T.let( + :hr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + HT = + T.let( + :ht, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + HU = + T.let( + :hu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ID = + T.let( + :id, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IE = + T.let( + :ie, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IL = + T.let( + :il, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IM = + T.let( + :im, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IN = + T.let( + :in, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IQ = + T.let( + :iq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IR = + T.let( + :ir, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IS = + T.let( + :is, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + IT = + T.let( + :it, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + JE = + T.let( + :je, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + JM = + T.let( + :jm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + JO = + T.let( + :jo, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + JP = + T.let( + :jp, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KE = + T.let( + :ke, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KG = + T.let( + :kg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KH = + T.let( + :kh, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KN = + T.let( + :kn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KR = + T.let( + :kr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KW = + T.let( + :kw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KY = + T.let( + :ky, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + KZ = + T.let( + :kz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LA = + T.let( + :la, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LB = + T.let( + :lb, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LC = + T.let( + :lc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LK = + T.let( + :lk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LR = + T.let( + :lr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LS = + T.let( + :ls, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LT = + T.let( + :lt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LU = + T.let( + :lu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LV = + T.let( + :lv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + LY = + T.let( + :ly, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MA = + T.let( + :ma, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MC = + T.let( + :mc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MD = + T.let( + :md, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ME = + T.let( + :me, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MF = + T.let( + :mf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MG = + T.let( + :mg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MK = + T.let( + :mk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ML = + T.let( + :ml, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MM = + T.let( + :mm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MN = + T.let( + :mn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MO = + T.let( + :mo, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MQ = + T.let( + :mq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MR = + T.let( + :mr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MT = + T.let( + :mt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MU = + T.let( + :mu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MV = + T.let( + :mv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MW = + T.let( + :mw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MX = + T.let( + :mx, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MY = + T.let( + :my, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + MZ = + T.let( + :mz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NA = + T.let( + :na, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NC = + T.let( + :nc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NE = + T.let( + :ne, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NG = + T.let( + :ng, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NI = + T.let( + :ni, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NL = + T.let( + :nl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NO = + T.let( + :no, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NP = + T.let( + :np, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + NZ = + T.let( + :nz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + OM = + T.let( + :om, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PA = + T.let( + :pa, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PE = + T.let( + :pe, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PF = + T.let( + :pf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PG = + T.let( + :pg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PH = + T.let( + :ph, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PK = + T.let( + :pk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PL = + T.let( + :pl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PR = + T.let( + :pr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PS = + T.let( + :ps, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PT = + T.let( + :pt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + PY = + T.let( + :py, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + QA = + T.let( + :qa, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + RE = + T.let( + :re, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + RO = + T.let( + :ro, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + RS = + T.let( + :rs, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + RU = + T.let( + :ru, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + RW = + T.let( + :rw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SA = + T.let( + :sa, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SC = + T.let( + :sc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SD = + T.let( + :sd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SE = + T.let( + :se, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SG = + T.let( + :sg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SI = + T.let( + :si, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SK = + T.let( + :sk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SL = + T.let( + :sl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SM = + T.let( + :sm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SN = + T.let( + :sn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SO = + T.let( + :so, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SR = + T.let( + :sr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SS = + T.let( + :ss, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ST = + T.let( + :st, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SV = + T.let( + :sv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SX = + T.let( + :sx, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SY = + T.let( + :sy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + SZ = + T.let( + :sz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TC = + T.let( + :tc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TD = + T.let( + :td, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TG = + T.let( + :tg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TH = + T.let( + :th, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TJ = + T.let( + :tj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TL = + T.let( + :tl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TM = + T.let( + :tm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TN = + T.let( + :tn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TR = + T.let( + :tr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TT = + T.let( + :tt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TW = + T.let( + :tw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + TZ = + T.let( + :tz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + UA = + T.let( + :ua, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + UG = + T.let( + :ug, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + US = + T.let( + :us, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + UY = + T.let( + :uy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + UZ = + T.let( + :uz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + VC = + T.let( + :vc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + VE = + T.let( + :ve, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + VG = + T.let( + :vg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + VI = + T.let( + :vi, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + VN = + T.let( + :vn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + YE = + T.let( + :ye, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + YT = + T.let( + :yt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ZA = + T.let( + :za, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ZM = + T.let( + :zm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + ZW = + T.let( + :zw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Country::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Pdf < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf, + ContextDev::Internal::AnyHash + ) + end + + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + sig { returns(T.nilable(Integer)) } + attr_reader :end_ + + sig { params(end_: Integer).void } + attr_writer :end_ + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ) + ) + ) + end + attr_reader :ocr + + sig do + params( + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ) + ).void + end + attr_writer :ocr + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ) + ) + ) + end + attr_reader :should_parse + + sig do + params( + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ) + ).void + end + attr_writer :should_parse + + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + sig { returns(T.nilable(Integer)) } + attr_reader :start + + sig { params(start: Integer).void } + attr_writer :start + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + params( + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + ).returns(T.attached_class) + end + def self.new( + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + end_: nil, + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + ocr: nil, + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + should_parse: nil, + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + start: nil + ) + end + + sig do + override.returns( + { + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + } + ) + end + def to_hash + end + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + module ShouldParse + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + end + end + + class HTML < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML, + ContextDev::Internal::AnyHash + ) + end + + # Return page content as HTML. + sig { returns(Symbol) } + attr_accessor :format_ + + # Pages to scrape. Maximum 25000. + sig do + returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL + ] + ) + end + attr_accessor :urls + + # Options for HTML output. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options + ) + ) + end + attr_reader :options + + sig do + params( + options: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::OrHash + ).void + end + attr_writer :options + + # Scrape the listed pages as HTML. + sig do + params( + urls: + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL::OrHash + ], + options: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::OrHash, + format_: Symbol + ).returns(T.attached_class) + end + def self.new( + # Pages to scrape. Maximum 25000. + urls:, + # Options for HTML output. + options: nil, + # Return page content as HTML. + format_: :html + ) + end + + sig do + override.returns( + { + format_: Symbol, + urls: + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL + ], + options: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options + } + ) + end + def to_hash + end + + class URL < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL, + ContextDev::Internal::AnyHash + ) + end + + # Page URL to scrape. + sig { returns(String) } + attr_accessor :url + + # Your ID for this page, returned with its result. The same URL can use different + # IDs. + sig { returns(T.nilable(String)) } + attr_reader :item_id + + sig { params(item_id: String).void } + attr_writer :item_id + + # Custom JSON returned unchanged with this page result. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :meta + + sig { params(meta: T::Hash[Symbol, T.anything]).void } + attr_writer :meta + + # A page to scrape, with optional data for matching results. + sig do + params( + url: String, + item_id: String, + meta: T::Hash[Symbol, T.anything] + ).returns(T.attached_class) + end + def self.new( + # Page URL to scrape. + url:, + # Your ID for this page, returned with its result. The same URL can use different + # IDs. + item_id: nil, + # Custom JSON returned unchanged with this page result. + meta: nil + ) + end + + sig do + override.returns( + { + url: String, + item_id: String, + meta: T::Hash[Symbol, T.anything] + } + ) + end + def to_hash + end + end + + class Options < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options, + ContextDev::Internal::AnyHash + ) + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::OrSymbol + ) + ) + end + attr_reader :country + + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::OrSymbol + ).void + end + attr_writer :country + + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_selectors + + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_selectors + + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_age_ms + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf + ) + ) + end + attr_reader :pdf + + sig do + params( + pdf: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::OrHash + ).void + end + attr_writer :pdf + + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :settle_animations + + sig { params(settle_animations: T::Boolean).void } + attr_writer :settle_animations + + # Return the main content without navigation or footers. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_main_content_only + + sig { params(use_main_content_only: T::Boolean).void } + attr_writer :use_main_content_only + + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + + # Options for HTML output. + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::OrHash, + settle_animations: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + ).returns(T.attached_class) + end + def self.new( + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + country: nil, + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + exclude_selectors: nil, + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + include_selectors: nil, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + max_age_ms: nil, + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + pdf: nil, + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + settle_animations: nil, + # Return the main content without navigation or footers. + use_main_content_only: nil, + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + wait_for_ms: nil + ) + end + + sig do + override.returns( + { + country: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf, + settle_animations: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + } + ) + end + def to_hash + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + module Country + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD = + T.let( + :ad, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AE = + T.let( + :ae, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AF = + T.let( + :af, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AG = + T.let( + :ag, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AI = + T.let( + :ai, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AL = + T.let( + :al, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AM = + T.let( + :am, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AO = + T.let( + :ao, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AR = + T.let( + :ar, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AT = + T.let( + :at, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AU = + T.let( + :au, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AW = + T.let( + :aw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + AZ = + T.let( + :az, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BA = + T.let( + :ba, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BB = + T.let( + :bb, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BD = + T.let( + :bd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BE = + T.let( + :be, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BF = + T.let( + :bf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BG = + T.let( + :bg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BH = + T.let( + :bh, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BI = + T.let( + :bi, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BJ = + T.let( + :bj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BM = + T.let( + :bm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BN = + T.let( + :bn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BO = + T.let( + :bo, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BQ = + T.let( + :bq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BR = + T.let( + :br, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BS = + T.let( + :bs, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BW = + T.let( + :bw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BY = + T.let( + :by, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + BZ = + T.let( + :bz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CA = + T.let( + :ca, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CD = + T.let( + :cd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CF = + T.let( + :cf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CG = + T.let( + :cg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CH = + T.let( + :ch, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CI = + T.let( + :ci, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CL = + T.let( + :cl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CM = + T.let( + :cm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CN = + T.let( + :cn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CO = + T.let( + :co, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CR = + T.let( + :cr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CV = + T.let( + :cv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CW = + T.let( + :cw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CY = + T.let( + :cy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + CZ = + T.let( + :cz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + DE = + T.let( + :de, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + DJ = + T.let( + :dj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + DK = + T.let( + :dk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + DM = + T.let( + :dm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + DO = + T.let( + :do, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + DZ = + T.let( + :dz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + EC = + T.let( + :ec, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + EE = + T.let( + :ee, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + EG = + T.let( + :eg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ES = + T.let( + :es, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ET = + T.let( + :et, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + FI = + T.let( + :fi, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + FJ = + T.let( + :fj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + FR = + T.let( + :fr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GA = + T.let( + :ga, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GB = + T.let( + :gb, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GD = + T.let( + :gd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GE = + T.let( + :ge, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GF = + T.let( + :gf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GG = + T.let( + :gg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GH = + T.let( + :gh, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GM = + T.let( + :gm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GN = + T.let( + :gn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GP = + T.let( + :gp, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GQ = + T.let( + :gq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GR = + T.let( + :gr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GT = + T.let( + :gt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GU = + T.let( + :gu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GW = + T.let( + :gw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + GY = + T.let( + :gy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + HK = + T.let( + :hk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + HN = + T.let( + :hn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + HR = + T.let( + :hr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + HT = + T.let( + :ht, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + HU = + T.let( + :hu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ID = + T.let( + :id, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IE = + T.let( + :ie, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IL = + T.let( + :il, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IM = + T.let( + :im, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IN = + T.let( + :in, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IQ = + T.let( + :iq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IR = + T.let( + :ir, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IS = + T.let( + :is, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + IT = + T.let( + :it, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + JE = + T.let( + :je, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + JM = + T.let( + :jm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + JO = + T.let( + :jo, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + JP = + T.let( + :jp, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KE = + T.let( + :ke, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KG = + T.let( + :kg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KH = + T.let( + :kh, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KN = + T.let( + :kn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KR = + T.let( + :kr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KW = + T.let( + :kw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KY = + T.let( + :ky, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + KZ = + T.let( + :kz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LA = + T.let( + :la, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LB = + T.let( + :lb, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LC = + T.let( + :lc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LK = + T.let( + :lk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LR = + T.let( + :lr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LS = + T.let( + :ls, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LT = + T.let( + :lt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LU = + T.let( + :lu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LV = + T.let( + :lv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + LY = + T.let( + :ly, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MA = + T.let( + :ma, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MC = + T.let( + :mc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MD = + T.let( + :md, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ME = + T.let( + :me, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MF = + T.let( + :mf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MG = + T.let( + :mg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MK = + T.let( + :mk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ML = + T.let( + :ml, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MM = + T.let( + :mm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MN = + T.let( + :mn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MO = + T.let( + :mo, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MQ = + T.let( + :mq, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MR = + T.let( + :mr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MT = + T.let( + :mt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MU = + T.let( + :mu, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MV = + T.let( + :mv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MW = + T.let( + :mw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MX = + T.let( + :mx, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MY = + T.let( + :my, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + MZ = + T.let( + :mz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NA = + T.let( + :na, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NC = + T.let( + :nc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NE = + T.let( + :ne, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NG = + T.let( + :ng, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NI = + T.let( + :ni, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NL = + T.let( + :nl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NO = + T.let( + :no, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NP = + T.let( + :np, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + NZ = + T.let( + :nz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + OM = + T.let( + :om, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PA = + T.let( + :pa, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PE = + T.let( + :pe, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PF = + T.let( + :pf, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PG = + T.let( + :pg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PH = + T.let( + :ph, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PK = + T.let( + :pk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PL = + T.let( + :pl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PR = + T.let( + :pr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PS = + T.let( + :ps, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PT = + T.let( + :pt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + PY = + T.let( + :py, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + QA = + T.let( + :qa, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + RE = + T.let( + :re, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + RO = + T.let( + :ro, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + RS = + T.let( + :rs, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + RU = + T.let( + :ru, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + RW = + T.let( + :rw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SA = + T.let( + :sa, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SC = + T.let( + :sc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SD = + T.let( + :sd, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SE = + T.let( + :se, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SG = + T.let( + :sg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SI = + T.let( + :si, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SK = + T.let( + :sk, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SL = + T.let( + :sl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SM = + T.let( + :sm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SN = + T.let( + :sn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SO = + T.let( + :so, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SR = + T.let( + :sr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SS = + T.let( + :ss, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ST = + T.let( + :st, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SV = + T.let( + :sv, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SX = + T.let( + :sx, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SY = + T.let( + :sy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + SZ = + T.let( + :sz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TC = + T.let( + :tc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TD = + T.let( + :td, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TG = + T.let( + :tg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TH = + T.let( + :th, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TJ = + T.let( + :tj, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TL = + T.let( + :tl, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TM = + T.let( + :tm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TN = + T.let( + :tn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TR = + T.let( + :tr, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TT = + T.let( + :tt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TW = + T.let( + :tw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + TZ = + T.let( + :tz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + UA = + T.let( + :ua, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + UG = + T.let( + :ug, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + US = + T.let( + :us, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + UY = + T.let( + :uy, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + UZ = + T.let( + :uz, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + VC = + T.let( + :vc, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + VE = + T.let( + :ve, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + VG = + T.let( + :vg, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + VI = + T.let( + :vi, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + VN = + T.let( + :vn, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + YE = + T.let( + :ye, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + YT = + T.let( + :yt, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ZA = + T.let( + :za, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ZM = + T.let( + :zm, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + ZW = + T.let( + :zw, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Country::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Pdf < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf, + ContextDev::Internal::AnyHash + ) + end + + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + sig { returns(T.nilable(Integer)) } + attr_reader :end_ + + sig { params(end_: Integer).void } + attr_writer :end_ + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::OrSymbol + ) + ) + ) + end + attr_reader :ocr + + sig do + params( + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::OrSymbol + ) + ).void + end + attr_writer :ocr + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ) + ) + ) + end + attr_reader :should_parse + + sig do + params( + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ) + ).void + end + attr_writer :should_parse + + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + sig { returns(T.nilable(Integer)) } + attr_reader :start + + sig { params(start: Integer).void } + attr_writer :start + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + params( + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + ).returns(T.attached_class) + end + def self.new( + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + end_: nil, + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + ocr: nil, + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + should_parse: nil, + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + start: nil + ) + end + + sig do + override.returns( + { + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + } + ) + end + def to_hash + end + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + module ShouldParse + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + end + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Scrape::Data::Variants + ] + ) + end + def self.variants + end + end end - sig { override.returns({ linkedin_url: String }) } - def to_hash + class Crawl < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl, + ContextDev::Internal::AnyHash + ) + end + + # Crawl source and output format. + sig do + returns( + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML + ) + ) + end + attr_accessor :data + + # Discover and scrape pages from `data.source`. + sig { returns(Symbol) } + attr_accessor :mode + + # Crawl pages starting from a URL or from a domain's sitemap. + sig do + params( + data: + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::OrHash, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::OrHash + ), + mode: Symbol + ).returns(T.attached_class) + end + def self.new( + # Crawl source and output format. + data:, + # Discover and scrape pages from `data.source`. + mode: :crawl + ) + end + + sig do + override.returns( + { + data: + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML + ), + mode: Symbol + } + ) + end + def to_hash + end + + # Crawl source and output format. + module Data + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML + ) + end + + class Markdown < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown, + ContextDev::Internal::AnyHash + ) + end + + # Return page content as Markdown. + sig { returns(Symbol) } + attr_accessor :format_ + + # How to find pages to crawl. + sig do + returns( + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap + ) + ) + end + attr_accessor :source + + # Options for Markdown output. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options + ) + ) + end + attr_reader :options + + sig do + params( + options: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::OrHash + ).void + end + attr_writer :options + + # Crawl pages and return Markdown. + sig do + params( + source: + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::OrHash, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::OrHash + ), + options: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::OrHash, + format_: Symbol + ).returns(T.attached_class) + end + def self.new( + # How to find pages to crawl. + source:, + # Options for Markdown output. + options: nil, + # Return page content as Markdown. + format_: :markdown + ) + end + + sig do + override.returns( + { + format_: Symbol, + source: + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap + ), + options: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options + } + ) + end + def to_hash + end + + # How to find pages to crawl. + module Source + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap + ) + end + + class StartURL < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL, + ContextDev::Internal::AnyHash + ) + end + + # Start from one page. + sig { returns(Symbol) } + attr_accessor :type + + # Page where crawling begins. A URL without a scheme is read as https://. + sig { returns(String) } + attr_accessor :url + + # Limits and filters for page discovery. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls + ) + ) + end + attr_reader :controls + + sig do + params( + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls::OrHash + ).void + end + attr_writer :controls + + # Discover pages by following links from one URL. + sig do + params( + url: String, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Page where crawling begins. A URL without a scheme is read as https://. + url:, + # Limits and filters for page discovery. + controls: nil, + # Start from one page. + type: :start_url + ) + end + + sig do + override.returns( + { + type: Symbol, + url: String, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls + } + ) + end + def to_hash + end + + class Controls < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls, + ContextDev::Internal::AnyHash + ) + end + + # Follow links to subdomains. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :follow_subdomains + + sig { params(follow_subdomains: T::Boolean).void } + attr_writer :follow_subdomains + + # Maximum link depth. Source pages are depth 0. No limit when omitted. + sig { returns(T.nilable(Integer)) } + attr_reader :max_depth + + sig { params(max_depth: Integer).void } + attr_writer :max_depth + + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + sig { returns(T.nilable(Integer)) } + attr_reader :max_urls + + sig { params(max_urls: Integer).void } + attr_writer :max_urls + + # RE2 pattern for URLs to include. The `start_url` itself is always included. + sig { returns(T.nilable(String)) } + attr_reader :regex + + sig { params(regex: String).void } + attr_writer :regex + + # Limits and filters for page discovery. + sig do + params( + follow_subdomains: T::Boolean, + max_depth: Integer, + max_urls: Integer, + regex: String + ).returns(T.attached_class) + end + def self.new( + # Follow links to subdomains. + follow_subdomains: nil, + # Maximum link depth. Source pages are depth 0. No limit when omitted. + max_depth: nil, + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + max_urls: nil, + # RE2 pattern for URLs to include. The `start_url` itself is always included. + regex: nil + ) + end + + sig do + override.returns( + { + follow_subdomains: T::Boolean, + max_depth: Integer, + max_urls: Integer, + regex: String + } + ) + end + def to_hash + end + end + end + + class Sitemap < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap, + ContextDev::Internal::AnyHash + ) + end + + # Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + # domain. + sig { returns(String) } + attr_accessor :domain + + # Scrape the URLs in the domain's sitemap. + sig { returns(Symbol) } + attr_accessor :type + + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls + ) + ) + end + attr_reader :controls + + sig do + params( + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls::OrHash + ).void + end + attr_writer :controls + + # Scrape the pages listed in a domain's sitemap. Links on those pages are not + # followed. + sig do + params( + domain: String, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + # domain. + domain:, + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + controls: nil, + # Scrape the URLs in the domain's sitemap. + type: :sitemap + ) + end + + sig do + override.returns( + { + domain: String, + type: Symbol, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls + } + ) + end + def to_hash + end + + class Controls < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls, + ContextDev::Internal::AnyHash + ) + end + + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + sig { returns(T.nilable(Integer)) } + attr_reader :max_urls + + sig { params(max_urls: Integer).void } + attr_writer :max_urls + + # RE2 pattern; only sitemap URLs matching it are scraped. + sig { returns(T.nilable(String)) } + attr_reader :regex + + sig { params(regex: String).void } + attr_writer :regex + + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + sig do + params(max_urls: Integer, regex: String).returns( + T.attached_class + ) + end + def self.new( + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + max_urls: nil, + # RE2 pattern; only sitemap URLs matching it are scraped. + regex: nil + ) + end + + sig do + override.returns({ max_urls: Integer, regex: String }) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Variants + ] + ) + end + def self.variants + end + end + + class Options < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options, + ContextDev::Internal::AnyHash + ) + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::OrSymbol + ) + ) + end + attr_reader :country + + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::OrSymbol + ).void + end + attr_writer :country + + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_selectors + + # Include image references in the Markdown. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_images + + sig { params(include_images: T::Boolean).void } + attr_writer :include_images + + # Include links in the Markdown. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_links + + sig { params(include_links: T::Boolean).void } + attr_writer :include_links + + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_selectors + + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_age_ms + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf + ) + ) + end + attr_reader :pdf + + sig do + params( + pdf: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::OrHash + ).void + end + attr_writer :pdf + + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :settle_animations + + sig { params(settle_animations: T::Boolean).void } + attr_writer :settle_animations + + # Shorten inline base64 image data. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :shorten_base64_images + + sig { params(shorten_base64_images: T::Boolean).void } + attr_writer :shorten_base64_images + + # Return the main content without navigation or footers. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_main_content_only + + sig { params(use_main_content_only: T::Boolean).void } + attr_writer :use_main_content_only + + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + + # Options for Markdown output. + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_images: T::Boolean, + include_links: T::Boolean, + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::OrHash, + settle_animations: T::Boolean, + shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + ).returns(T.attached_class) + end + def self.new( + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + country: nil, + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + exclude_selectors: nil, + # Include image references in the Markdown. + include_images: nil, + # Include links in the Markdown. + include_links: nil, + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + include_selectors: nil, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + max_age_ms: nil, + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + pdf: nil, + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + settle_animations: nil, + # Shorten inline base64 image data. + shorten_base64_images: nil, + # Return the main content without navigation or footers. + use_main_content_only: nil, + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + wait_for_ms: nil + ) + end + + sig do + override.returns( + { + country: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_images: T::Boolean, + include_links: T::Boolean, + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf, + settle_animations: T::Boolean, + shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + } + ) + end + def to_hash + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + module Country + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD = + T.let( + :ad, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AE = + T.let( + :ae, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AF = + T.let( + :af, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AG = + T.let( + :ag, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AI = + T.let( + :ai, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AL = + T.let( + :al, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AM = + T.let( + :am, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AO = + T.let( + :ao, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AR = + T.let( + :ar, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AT = + T.let( + :at, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AU = + T.let( + :au, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AW = + T.let( + :aw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + AZ = + T.let( + :az, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BA = + T.let( + :ba, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BB = + T.let( + :bb, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BD = + T.let( + :bd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BE = + T.let( + :be, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BF = + T.let( + :bf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BG = + T.let( + :bg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BH = + T.let( + :bh, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BI = + T.let( + :bi, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BJ = + T.let( + :bj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BM = + T.let( + :bm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BN = + T.let( + :bn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BO = + T.let( + :bo, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BQ = + T.let( + :bq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BR = + T.let( + :br, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BS = + T.let( + :bs, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BW = + T.let( + :bw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BY = + T.let( + :by, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + BZ = + T.let( + :bz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CA = + T.let( + :ca, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CD = + T.let( + :cd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CF = + T.let( + :cf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CG = + T.let( + :cg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CH = + T.let( + :ch, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CI = + T.let( + :ci, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CL = + T.let( + :cl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CM = + T.let( + :cm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CN = + T.let( + :cn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CO = + T.let( + :co, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CR = + T.let( + :cr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CV = + T.let( + :cv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CW = + T.let( + :cw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CY = + T.let( + :cy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + CZ = + T.let( + :cz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + DE = + T.let( + :de, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + DJ = + T.let( + :dj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + DK = + T.let( + :dk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + DM = + T.let( + :dm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + DO = + T.let( + :do, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + DZ = + T.let( + :dz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + EC = + T.let( + :ec, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + EE = + T.let( + :ee, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + EG = + T.let( + :eg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ES = + T.let( + :es, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ET = + T.let( + :et, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + FI = + T.let( + :fi, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + FJ = + T.let( + :fj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + FR = + T.let( + :fr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GA = + T.let( + :ga, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GB = + T.let( + :gb, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GD = + T.let( + :gd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GE = + T.let( + :ge, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GF = + T.let( + :gf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GG = + T.let( + :gg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GH = + T.let( + :gh, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GM = + T.let( + :gm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GN = + T.let( + :gn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GP = + T.let( + :gp, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GQ = + T.let( + :gq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GR = + T.let( + :gr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GT = + T.let( + :gt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GU = + T.let( + :gu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GW = + T.let( + :gw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + GY = + T.let( + :gy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + HK = + T.let( + :hk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + HN = + T.let( + :hn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + HR = + T.let( + :hr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + HT = + T.let( + :ht, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + HU = + T.let( + :hu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ID = + T.let( + :id, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IE = + T.let( + :ie, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IL = + T.let( + :il, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IM = + T.let( + :im, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IN = + T.let( + :in, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IQ = + T.let( + :iq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IR = + T.let( + :ir, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IS = + T.let( + :is, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + IT = + T.let( + :it, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + JE = + T.let( + :je, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + JM = + T.let( + :jm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + JO = + T.let( + :jo, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + JP = + T.let( + :jp, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KE = + T.let( + :ke, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KG = + T.let( + :kg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KH = + T.let( + :kh, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KN = + T.let( + :kn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KR = + T.let( + :kr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KW = + T.let( + :kw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KY = + T.let( + :ky, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + KZ = + T.let( + :kz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LA = + T.let( + :la, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LB = + T.let( + :lb, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LC = + T.let( + :lc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LK = + T.let( + :lk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LR = + T.let( + :lr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LS = + T.let( + :ls, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LT = + T.let( + :lt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LU = + T.let( + :lu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LV = + T.let( + :lv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + LY = + T.let( + :ly, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MA = + T.let( + :ma, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MC = + T.let( + :mc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MD = + T.let( + :md, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ME = + T.let( + :me, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MF = + T.let( + :mf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MG = + T.let( + :mg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MK = + T.let( + :mk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ML = + T.let( + :ml, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MM = + T.let( + :mm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MN = + T.let( + :mn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MO = + T.let( + :mo, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MQ = + T.let( + :mq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MR = + T.let( + :mr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MT = + T.let( + :mt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MU = + T.let( + :mu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MV = + T.let( + :mv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MW = + T.let( + :mw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MX = + T.let( + :mx, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MY = + T.let( + :my, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + MZ = + T.let( + :mz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NA = + T.let( + :na, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NC = + T.let( + :nc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NE = + T.let( + :ne, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NG = + T.let( + :ng, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NI = + T.let( + :ni, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NL = + T.let( + :nl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NO = + T.let( + :no, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NP = + T.let( + :np, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + NZ = + T.let( + :nz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + OM = + T.let( + :om, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PA = + T.let( + :pa, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PE = + T.let( + :pe, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PF = + T.let( + :pf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PG = + T.let( + :pg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PH = + T.let( + :ph, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PK = + T.let( + :pk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PL = + T.let( + :pl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PR = + T.let( + :pr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PS = + T.let( + :ps, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PT = + T.let( + :pt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + PY = + T.let( + :py, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + QA = + T.let( + :qa, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + RE = + T.let( + :re, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + RO = + T.let( + :ro, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + RS = + T.let( + :rs, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + RU = + T.let( + :ru, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + RW = + T.let( + :rw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SA = + T.let( + :sa, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SC = + T.let( + :sc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SD = + T.let( + :sd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SE = + T.let( + :se, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SG = + T.let( + :sg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SI = + T.let( + :si, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SK = + T.let( + :sk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SL = + T.let( + :sl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SM = + T.let( + :sm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SN = + T.let( + :sn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SO = + T.let( + :so, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SR = + T.let( + :sr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SS = + T.let( + :ss, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ST = + T.let( + :st, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SV = + T.let( + :sv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SX = + T.let( + :sx, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SY = + T.let( + :sy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + SZ = + T.let( + :sz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TC = + T.let( + :tc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TD = + T.let( + :td, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TG = + T.let( + :tg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TH = + T.let( + :th, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TJ = + T.let( + :tj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TL = + T.let( + :tl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TM = + T.let( + :tm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TN = + T.let( + :tn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TR = + T.let( + :tr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TT = + T.let( + :tt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TW = + T.let( + :tw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + TZ = + T.let( + :tz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + UA = + T.let( + :ua, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + UG = + T.let( + :ug, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + US = + T.let( + :us, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + UY = + T.let( + :uy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + UZ = + T.let( + :uz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + VC = + T.let( + :vc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + VE = + T.let( + :ve, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + VG = + T.let( + :vg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + VI = + T.let( + :vi, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + VN = + T.let( + :vn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + YE = + T.let( + :ye, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + YT = + T.let( + :yt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ZA = + T.let( + :za, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ZM = + T.let( + :zm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + ZW = + T.let( + :zw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Country::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Pdf < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf, + ContextDev::Internal::AnyHash + ) + end + + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + sig { returns(T.nilable(Integer)) } + attr_reader :end_ + + sig { params(end_: Integer).void } + attr_writer :end_ + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ) + ) + ) + end + attr_reader :ocr + + sig do + params( + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ) + ).void + end + attr_writer :ocr + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ) + ) + ) + end + attr_reader :should_parse + + sig do + params( + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ) + ).void + end + attr_writer :should_parse + + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + sig { returns(T.nilable(Integer)) } + attr_reader :start + + sig { params(start: Integer).void } + attr_writer :start + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + params( + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + ).returns(T.attached_class) + end + def self.new( + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + end_: nil, + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + ocr: nil, + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + should_parse: nil, + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + start: nil + ) + end + + sig do + override.returns( + { + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + } + ) + end + def to_hash + end + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::Ocr::TaggedSymbol + ) + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + module ShouldParse + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + end + end + + class HTML < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML, + ContextDev::Internal::AnyHash + ) + end + + # Return page content as HTML. + sig { returns(Symbol) } + attr_accessor :format_ + + # How to find pages to crawl. + sig do + returns( + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap + ) + ) + end + attr_accessor :source + + # Options for HTML output. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options + ) + ) + end + attr_reader :options + + sig do + params( + options: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::OrHash + ).void + end + attr_writer :options + + # Crawl pages and return HTML. + sig do + params( + source: + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::OrHash, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::OrHash + ), + options: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::OrHash, + format_: Symbol + ).returns(T.attached_class) + end + def self.new( + # How to find pages to crawl. + source:, + # Options for HTML output. + options: nil, + # Return page content as HTML. + format_: :html + ) + end + + sig do + override.returns( + { + format_: Symbol, + source: + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap + ), + options: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options + } + ) + end + def to_hash + end + + # How to find pages to crawl. + module Source + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap + ) + end + + class StartURL < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL, + ContextDev::Internal::AnyHash + ) + end + + # Start from one page. + sig { returns(Symbol) } + attr_accessor :type + + # Page where crawling begins. A URL without a scheme is read as https://. + sig { returns(String) } + attr_accessor :url + + # Limits and filters for page discovery. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls + ) + ) + end + attr_reader :controls + + sig do + params( + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls::OrHash + ).void + end + attr_writer :controls + + # Discover pages by following links from one URL. + sig do + params( + url: String, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Page where crawling begins. A URL without a scheme is read as https://. + url:, + # Limits and filters for page discovery. + controls: nil, + # Start from one page. + type: :start_url + ) + end + + sig do + override.returns( + { + type: Symbol, + url: String, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls + } + ) + end + def to_hash + end + + class Controls < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls, + ContextDev::Internal::AnyHash + ) + end + + # Follow links to subdomains. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :follow_subdomains + + sig { params(follow_subdomains: T::Boolean).void } + attr_writer :follow_subdomains + + # Maximum link depth. Source pages are depth 0. No limit when omitted. + sig { returns(T.nilable(Integer)) } + attr_reader :max_depth + + sig { params(max_depth: Integer).void } + attr_writer :max_depth + + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + sig { returns(T.nilable(Integer)) } + attr_reader :max_urls + + sig { params(max_urls: Integer).void } + attr_writer :max_urls + + # RE2 pattern for URLs to include. The `start_url` itself is always included. + sig { returns(T.nilable(String)) } + attr_reader :regex + + sig { params(regex: String).void } + attr_writer :regex + + # Limits and filters for page discovery. + sig do + params( + follow_subdomains: T::Boolean, + max_depth: Integer, + max_urls: Integer, + regex: String + ).returns(T.attached_class) + end + def self.new( + # Follow links to subdomains. + follow_subdomains: nil, + # Maximum link depth. Source pages are depth 0. No limit when omitted. + max_depth: nil, + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + max_urls: nil, + # RE2 pattern for URLs to include. The `start_url` itself is always included. + regex: nil + ) + end + + sig do + override.returns( + { + follow_subdomains: T::Boolean, + max_depth: Integer, + max_urls: Integer, + regex: String + } + ) + end + def to_hash + end + end + end + + class Sitemap < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap, + ContextDev::Internal::AnyHash + ) + end + + # Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + # domain. + sig { returns(String) } + attr_accessor :domain + + # Scrape the URLs in the domain's sitemap. + sig { returns(Symbol) } + attr_accessor :type + + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls + ) + ) + end + attr_reader :controls + + sig do + params( + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls::OrHash + ).void + end + attr_writer :controls + + # Scrape the pages listed in a domain's sitemap. Links on those pages are not + # followed. + sig do + params( + domain: String, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + # domain. + domain:, + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + controls: nil, + # Scrape the URLs in the domain's sitemap. + type: :sitemap + ) + end + + sig do + override.returns( + { + domain: String, + type: Symbol, + controls: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls + } + ) + end + def to_hash + end + + class Controls < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls, + ContextDev::Internal::AnyHash + ) + end + + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + sig { returns(T.nilable(Integer)) } + attr_reader :max_urls + + sig { params(max_urls: Integer).void } + attr_writer :max_urls + + # RE2 pattern; only sitemap URLs matching it are scraped. + sig { returns(T.nilable(String)) } + attr_reader :regex + + sig { params(regex: String).void } + attr_writer :regex + + # Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + # URLs and never follows links off them, so there is no crawl depth here. + sig do + params(max_urls: Integer, regex: String).returns( + T.attached_class + ) + end + def self.new( + # Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + max_urls: nil, + # RE2 pattern; only sitemap URLs matching it are scraped. + regex: nil + ) + end + + sig do + override.returns({ max_urls: Integer, regex: String }) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Variants + ] + ) + end + def self.variants + end + end + + class Options < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options, + ContextDev::Internal::AnyHash + ) + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::OrSymbol + ) + ) + end + attr_reader :country + + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::OrSymbol + ).void + end + attr_writer :country + + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_selectors + + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_selectors + + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_age_ms + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + returns( + T.nilable( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf + ) + ) + end + attr_reader :pdf + + sig do + params( + pdf: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::OrHash + ).void + end + attr_writer :pdf + + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :settle_animations + + sig { params(settle_animations: T::Boolean).void } + attr_writer :settle_animations + + # Return the main content without navigation or footers. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_main_content_only + + sig { params(use_main_content_only: T::Boolean).void } + attr_writer :use_main_content_only + + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + + # Options for HTML output. + sig do + params( + country: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::OrHash, + settle_animations: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + ).returns(T.attached_class) + end + def self.new( + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + country: nil, + # Remove elements matching these CSS selectors. Applied after `includeSelectors`, + # so an element matching both is removed. + exclude_selectors: nil, + # Keep only the subtrees matching these CSS selectors. Filtered pages are always + # fetched fresh, ignoring `maxAgeMs`. + include_selectors: nil, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + max_age_ms: nil, + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + pdf: nil, + # Wait briefly for CSS and transition animations to settle before extraction, on + # pages that render in a browser. + settle_animations: nil, + # Return the main content without navigation or footers. + use_main_content_only: nil, + # How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + wait_for_ms: nil + ) + end + + sig do + override.returns( + { + country: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::OrSymbol, + exclude_selectors: T.nilable(T::Array[String]), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), + pdf: + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf, + settle_animations: T::Boolean, + use_main_content_only: T::Boolean, + wait_for_ms: Integer + } + ) + end + def to_hash + end + + # Fetch the target page through a residential proxy in this country (ISO 3166-1 + # alpha-2). + module Country + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD = + T.let( + :ad, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AE = + T.let( + :ae, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AF = + T.let( + :af, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AG = + T.let( + :ag, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AI = + T.let( + :ai, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AL = + T.let( + :al, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AM = + T.let( + :am, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AO = + T.let( + :ao, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AR = + T.let( + :ar, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AT = + T.let( + :at, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AU = + T.let( + :au, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AW = + T.let( + :aw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + AZ = + T.let( + :az, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BA = + T.let( + :ba, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BB = + T.let( + :bb, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BD = + T.let( + :bd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BE = + T.let( + :be, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BF = + T.let( + :bf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BG = + T.let( + :bg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BH = + T.let( + :bh, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BI = + T.let( + :bi, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BJ = + T.let( + :bj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BM = + T.let( + :bm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BN = + T.let( + :bn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BO = + T.let( + :bo, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BQ = + T.let( + :bq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BR = + T.let( + :br, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BS = + T.let( + :bs, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BW = + T.let( + :bw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BY = + T.let( + :by, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + BZ = + T.let( + :bz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CA = + T.let( + :ca, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CD = + T.let( + :cd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CF = + T.let( + :cf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CG = + T.let( + :cg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CH = + T.let( + :ch, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CI = + T.let( + :ci, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CL = + T.let( + :cl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CM = + T.let( + :cm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CN = + T.let( + :cn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CO = + T.let( + :co, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CR = + T.let( + :cr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CV = + T.let( + :cv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CW = + T.let( + :cw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CY = + T.let( + :cy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + CZ = + T.let( + :cz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + DE = + T.let( + :de, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + DJ = + T.let( + :dj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + DK = + T.let( + :dk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + DM = + T.let( + :dm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + DO = + T.let( + :do, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + DZ = + T.let( + :dz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + EC = + T.let( + :ec, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + EE = + T.let( + :ee, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + EG = + T.let( + :eg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ES = + T.let( + :es, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ET = + T.let( + :et, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + FI = + T.let( + :fi, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + FJ = + T.let( + :fj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + FR = + T.let( + :fr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GA = + T.let( + :ga, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GB = + T.let( + :gb, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GD = + T.let( + :gd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GE = + T.let( + :ge, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GF = + T.let( + :gf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GG = + T.let( + :gg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GH = + T.let( + :gh, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GM = + T.let( + :gm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GN = + T.let( + :gn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GP = + T.let( + :gp, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GQ = + T.let( + :gq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GR = + T.let( + :gr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GT = + T.let( + :gt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GU = + T.let( + :gu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GW = + T.let( + :gw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + GY = + T.let( + :gy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + HK = + T.let( + :hk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + HN = + T.let( + :hn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + HR = + T.let( + :hr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + HT = + T.let( + :ht, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + HU = + T.let( + :hu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ID = + T.let( + :id, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IE = + T.let( + :ie, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IL = + T.let( + :il, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IM = + T.let( + :im, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IN = + T.let( + :in, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IQ = + T.let( + :iq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IR = + T.let( + :ir, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IS = + T.let( + :is, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + IT = + T.let( + :it, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + JE = + T.let( + :je, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + JM = + T.let( + :jm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + JO = + T.let( + :jo, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + JP = + T.let( + :jp, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KE = + T.let( + :ke, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KG = + T.let( + :kg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KH = + T.let( + :kh, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KN = + T.let( + :kn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KR = + T.let( + :kr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KW = + T.let( + :kw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KY = + T.let( + :ky, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + KZ = + T.let( + :kz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LA = + T.let( + :la, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LB = + T.let( + :lb, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LC = + T.let( + :lc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LK = + T.let( + :lk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LR = + T.let( + :lr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LS = + T.let( + :ls, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LT = + T.let( + :lt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LU = + T.let( + :lu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LV = + T.let( + :lv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + LY = + T.let( + :ly, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MA = + T.let( + :ma, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MC = + T.let( + :mc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MD = + T.let( + :md, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ME = + T.let( + :me, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MF = + T.let( + :mf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MG = + T.let( + :mg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MK = + T.let( + :mk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ML = + T.let( + :ml, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MM = + T.let( + :mm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MN = + T.let( + :mn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MO = + T.let( + :mo, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MQ = + T.let( + :mq, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MR = + T.let( + :mr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MT = + T.let( + :mt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MU = + T.let( + :mu, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MV = + T.let( + :mv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MW = + T.let( + :mw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MX = + T.let( + :mx, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MY = + T.let( + :my, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + MZ = + T.let( + :mz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NA = + T.let( + :na, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NC = + T.let( + :nc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NE = + T.let( + :ne, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NG = + T.let( + :ng, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NI = + T.let( + :ni, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NL = + T.let( + :nl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NO = + T.let( + :no, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NP = + T.let( + :np, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + NZ = + T.let( + :nz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + OM = + T.let( + :om, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PA = + T.let( + :pa, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PE = + T.let( + :pe, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PF = + T.let( + :pf, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PG = + T.let( + :pg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PH = + T.let( + :ph, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PK = + T.let( + :pk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PL = + T.let( + :pl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PR = + T.let( + :pr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PS = + T.let( + :ps, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PT = + T.let( + :pt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + PY = + T.let( + :py, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + QA = + T.let( + :qa, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + RE = + T.let( + :re, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + RO = + T.let( + :ro, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + RS = + T.let( + :rs, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + RU = + T.let( + :ru, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + RW = + T.let( + :rw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SA = + T.let( + :sa, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SC = + T.let( + :sc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SD = + T.let( + :sd, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SE = + T.let( + :se, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SG = + T.let( + :sg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SI = + T.let( + :si, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SK = + T.let( + :sk, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SL = + T.let( + :sl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SM = + T.let( + :sm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SN = + T.let( + :sn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SO = + T.let( + :so, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SR = + T.let( + :sr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SS = + T.let( + :ss, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ST = + T.let( + :st, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SV = + T.let( + :sv, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SX = + T.let( + :sx, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SY = + T.let( + :sy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + SZ = + T.let( + :sz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TC = + T.let( + :tc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TD = + T.let( + :td, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TG = + T.let( + :tg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TH = + T.let( + :th, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TJ = + T.let( + :tj, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TL = + T.let( + :tl, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TM = + T.let( + :tm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TN = + T.let( + :tn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TR = + T.let( + :tr, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TT = + T.let( + :tt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TW = + T.let( + :tw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + TZ = + T.let( + :tz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + UA = + T.let( + :ua, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + UG = + T.let( + :ug, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + US = + T.let( + :us, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + UY = + T.let( + :uy, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + UZ = + T.let( + :uz, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + VC = + T.let( + :vc, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + VE = + T.let( + :ve, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + VG = + T.let( + :vg, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + VI = + T.let( + :vi, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + VN = + T.let( + :vn, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + YE = + T.let( + :ye, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + YT = + T.let( + :yt, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ZA = + T.let( + :za, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ZM = + T.let( + :zm, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + ZW = + T.let( + :zw, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Country::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Pdf < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf, + ContextDev::Internal::AnyHash + ) + end + + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + sig { returns(T.nilable(Integer)) } + attr_reader :end_ + + sig { params(end_: Integer).void } + attr_writer :end_ + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::OrSymbol + ) + ) + ) + end + attr_reader :ocr + + sig do + params( + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::OrSymbol + ) + ).void + end + attr_writer :ocr + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ) + ) + ) + end + attr_reader :should_parse + + sig do + params( + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ) + ).void + end + attr_writer :should_parse + + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + sig { returns(T.nilable(Integer)) } + attr_reader :start + + sig { params(start: Integer).void } + attr_writer :start + + # PDF parsing controls. Use start/end to limit text extraction and embedded-image + # detection/OCR to an inclusive 1-based page range. + sig do + params( + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + ).returns(T.attached_class) + end + def self.new( + # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. + # Must be greater than or equal to start when both are provided. + end_: nil, + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + ocr: nil, + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + should_parse: nil, + # First 1-based PDF page to parse. When omitted, parsing starts at the first page. + start: nil + ) + end + + sig do + override.returns( + { + end_: Integer, + ocr: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::OrSymbol + ), + start: Integer + } + ) + end + def to_hash + end + + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::Ocr::TaggedSymbol + ) + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 PDF_SKIPPED is returned. + module ShouldParse + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ShouldParse::TaggedSymbol + ) + end + end + end + end + + sig do + override.returns( + T::Array[ + ContextDev::BatchSubmitParams::Input::Crawl::Data::Variants + ] + ) + end + def self.variants + end + end + end + + sig do + override.returns( + T::Array[ContextDev::BatchSubmitParams::Input::Variants] + ) + end + def self.variants end end end diff --git a/rbi/context_dev/models/batch_submit_response.rbi b/rbi/context_dev/models/batch_submit_response.rbi index fc97fc66..f8502c65 100644 --- a/rbi/context_dev/models/batch_submit_response.rbi +++ b/rbi/context_dev/models/batch_submit_response.rbi @@ -11,42 +11,69 @@ module ContextDev ) end - # HTTP status code. - sig do - returns(ContextDev::Models::BatchSubmitResponse::Code::TaggedInteger) - end - attr_accessor :code + # Batch ID. Poll GET /batch/{batch_id} with it. + sig { returns(String) } + attr_accessor :id + + # The crawl controls as submitted, so the limits requested can be compared against + # what the crawl reached. + sig { returns(T.nilable(ContextDev::CrawlControls)) } + attr_reader :crawl + + sig { params(crawl: T.nilable(ContextDev::CrawlControls::OrHash)).void } + attr_writer :crawl + + # When the batch was created. + sig { returns(String) } + attr_accessor :created_at - # Additional response details. - sig { returns(ContextDev::Models::BatchSubmitResponse::Metadata) } - attr_reader :metadata + # What accepting this batch cost. + sig { returns(ContextDev::Models::BatchSubmitResponse::Credits) } + attr_reader :credits sig do params( - metadata: ContextDev::Models::BatchSubmitResponse::Metadata::OrHash + credits: ContextDev::Models::BatchSubmitResponse::Credits::OrHash ).void end - attr_writer :metadata + attr_writer :credits + + # What each page will be returned as. + sig do + returns(ContextDev::Models::BatchSubmitResponse::Format::TaggedSymbol) + end + attr_accessor :format_ + + # What submission took in, and what it charged for. + sig { returns(ContextDev::Intake) } + attr_reader :input - # Retrieved person profile. - sig { returns(ContextDev::Models::BatchSubmitResponse::Person) } - attr_reader :person + sig { params(input: ContextDev::Intake::OrHash).void } + attr_writer :input + # Rejected URLs, up to 100. These are not charged. sig do - params( - person: ContextDev::Models::BatchSubmitResponse::Person::OrHash - ).void + returns(T::Array[ContextDev::Models::BatchSubmitResponse::InvalidURL]) + end + attr_accessor :invalid_urls + + # How pages will be selected. + sig do + returns(ContextDev::Models::BatchSubmitResponse::Mode::TaggedSymbol) end - attr_writer :person + attr_accessor :mode - # Response status. + # Always `queued`. An accepted batch has not started yet. sig do returns(ContextDev::Models::BatchSubmitResponse::Status::TaggedSymbol) end attr_accessor :status - # Metadata about the API key used for the request. Included in every response - # whenever a valid API key is provided, even when the response status is not 200. + # Tags stored on the batch. + sig { returns(T::Array[String]) } + attr_accessor :tags + + # API key usage for this request. sig do returns(T.nilable(ContextDev::Models::BatchSubmitResponse::KeyMetadata)) end @@ -60,1205 +87,212 @@ module ContextDev end attr_writer :key_metadata + # Signing secret for the completion webhook, returned only here and never again. + # Store it now; it is not repeated by GET /batch/{batch_id}. + sig { returns(T.nilable(String)) } + attr_reader :webhook_secret + + sig { params(webhook_secret: String).void } + attr_writer :webhook_secret + sig do params( - code: ContextDev::Models::BatchSubmitResponse::Code::OrInteger, - metadata: ContextDev::Models::BatchSubmitResponse::Metadata::OrHash, - person: ContextDev::Models::BatchSubmitResponse::Person::OrHash, + id: String, + crawl: T.nilable(ContextDev::CrawlControls::OrHash), + created_at: String, + credits: ContextDev::Models::BatchSubmitResponse::Credits::OrHash, + format_: ContextDev::Models::BatchSubmitResponse::Format::OrSymbol, + input: ContextDev::Intake::OrHash, + invalid_urls: + T::Array[ + ContextDev::Models::BatchSubmitResponse::InvalidURL::OrHash + ], + mode: ContextDev::Models::BatchSubmitResponse::Mode::OrSymbol, status: ContextDev::Models::BatchSubmitResponse::Status::OrSymbol, + tags: T::Array[String], key_metadata: - ContextDev::Models::BatchSubmitResponse::KeyMetadata::OrHash + ContextDev::Models::BatchSubmitResponse::KeyMetadata::OrHash, + webhook_secret: String ).returns(T.attached_class) end def self.new( - # HTTP status code. - code:, - # Additional response details. - metadata:, - # Retrieved person profile. - person:, - # Response status. + # Batch ID. Poll GET /batch/{batch_id} with it. + id:, + # The crawl controls as submitted, so the limits requested can be compared against + # what the crawl reached. + crawl:, + # When the batch was created. + created_at:, + # What accepting this batch cost. + credits:, + # What each page will be returned as. + format_:, + # What submission took in, and what it charged for. + input:, + # Rejected URLs, up to 100. These are not charged. + invalid_urls:, + # How pages will be selected. + mode:, + # Always `queued`. An accepted batch has not started yet. status:, - # Metadata about the API key used for the request. Included in every response - # whenever a valid API key is provided, even when the response status is not 200. - key_metadata: nil + # Tags stored on the batch. + tags:, + # API key usage for this request. + key_metadata: nil, + # Signing secret for the completion webhook, returned only here and never again. + # Store it now; it is not repeated by GET /batch/{batch_id}. + webhook_secret: nil ) end sig do override.returns( { - code: ContextDev::Models::BatchSubmitResponse::Code::TaggedInteger, - metadata: ContextDev::Models::BatchSubmitResponse::Metadata, - person: ContextDev::Models::BatchSubmitResponse::Person, + id: String, + crawl: T.nilable(ContextDev::CrawlControls), + created_at: String, + credits: ContextDev::Models::BatchSubmitResponse::Credits, + format_: + ContextDev::Models::BatchSubmitResponse::Format::TaggedSymbol, + input: ContextDev::Intake, + invalid_urls: + T::Array[ContextDev::Models::BatchSubmitResponse::InvalidURL], + mode: ContextDev::Models::BatchSubmitResponse::Mode::TaggedSymbol, status: ContextDev::Models::BatchSubmitResponse::Status::TaggedSymbol, - key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata + tags: T::Array[String], + key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata, + webhook_secret: String } ) end def to_hash end - # HTTP status code. - module Code - extend ContextDev::Internal::Type::Enum - - TaggedInteger = - T.type_alias do - T.all(Integer, ContextDev::Models::BatchSubmitResponse::Code) - end - OrInteger = T.type_alias { Integer } - - CODE_200 = - T.let( - 200, - ContextDev::Models::BatchSubmitResponse::Code::TaggedInteger - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::BatchSubmitResponse::Code::TaggedInteger - ] - ) - end - def self.values - end - end - - class Metadata < ContextDev::Internal::Type::BaseModel + class Credits < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - ContextDev::Models::BatchSubmitResponse::Metadata, + ContextDev::Models::BatchSubmitResponse::Credits, ContextDev::Internal::AnyHash ) end - # Identifiers returned for the person. - sig do - returns( - ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers - ) - end - attr_reader :identifiers - - sig do - params( - identifiers: - ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers::OrHash - ).void - end - attr_writer :identifiers - - # Source categories checked. - sig do - returns( - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ] - ) - end - attr_accessor :sources_attempted - - # Source categories with data. - sig do - returns( - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ] - ) - end - attr_accessor :sources_succeeded - - # URLs reviewed for this profile. - sig { returns(T::Array[String]) } - attr_accessor :urls_analyzed - - # Personal website URL, when found. - sig { returns(T.nilable(String)) } - attr_reader :personal_website_url - - sig { params(personal_website_url: String).void } - attr_writer :personal_website_url + # Credits just debited from your balance. Whatever the batch does not spend is + # refunded when it settles. + sig { returns(Integer) } + attr_accessor :reserved - # Additional response details. - sig do - params( - identifiers: - ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers::OrHash, - sources_attempted: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::OrSymbol - ], - sources_succeeded: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::OrSymbol - ], - urls_analyzed: T::Array[String], - personal_website_url: String - ).returns(T.attached_class) - end + # What accepting this batch cost. + sig { params(reserved: Integer).returns(T.attached_class) } def self.new( - # Identifiers returned for the person. - identifiers:, - # Source categories checked. - sources_attempted:, - # Source categories with data. - sources_succeeded:, - # URLs reviewed for this profile. - urls_analyzed:, - # Personal website URL, when found. - personal_website_url: nil + # Credits just debited from your balance. Whatever the batch does not spend is + # refunded when it settles. + reserved: ) end - sig do - override.returns( - { - identifiers: - ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers, - sources_attempted: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ], - sources_succeeded: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ], - urls_analyzed: T::Array[String], - personal_website_url: String - } - ) - end + sig { override.returns({ reserved: Integer }) } def to_hash end + end - class Identifiers < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers, - ContextDev::Internal::AnyHash - ) - end - - # LinkedIn profile URL. - sig { returns(T.nilable(String)) } - attr_reader :linkedin_url - - sig { params(linkedin_url: String).void } - attr_writer :linkedin_url - - # Identifiers returned for the person. - sig { params(linkedin_url: String).returns(T.attached_class) } - def self.new( - # LinkedIn profile URL. - linkedin_url: nil - ) - end + # What each page will be returned as. + module Format + extend ContextDev::Internal::Type::Enum - sig { override.returns({ linkedin_url: String }) } - def to_hash + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::Models::BatchSubmitResponse::Format) end - end - - module SourcesAttempted - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - LINKEDIN = - T.let( - :linkedin, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ) - CV = - T.let( - :cv, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ) - MANUAL = - T.let( - :manual, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ) - GITHUB = - T.let( - :github, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ) - OTHER = - T.let( - :other, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ) + MARKDOWN = + T.let( + :markdown, + ContextDev::Models::BatchSubmitResponse::Format::TaggedSymbol + ) + HTML = + T.let( + :html, + ContextDev::Models::BatchSubmitResponse::Format::TaggedSymbol + ) - sig do - override.returns( - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesAttempted::TaggedSymbol - ] - ) - end - def self.values - end + sig do + override.returns( + T::Array[ + ContextDev::Models::BatchSubmitResponse::Format::TaggedSymbol + ] + ) end - - module SourcesSucceeded - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - LINKEDIN = - T.let( - :linkedin, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ) - CV = - T.let( - :cv, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ) - MANUAL = - T.let( - :manual, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ) - GITHUB = - T.let( - :github, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ) - OTHER = - T.let( - :other, - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::BatchSubmitResponse::Metadata::SourcesSucceeded::TaggedSymbol - ] - ) - end - def self.values - end + def self.values end end - class Person < ContextDev::Internal::Type::BaseModel + class InvalidURL < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - ContextDev::Models::BatchSubmitResponse::Person, + ContextDev::Models::BatchSubmitResponse::InvalidURL, ContextDev::Internal::AnyHash ) end - # Education history. - sig do - returns( - T::Array[ContextDev::Models::BatchSubmitResponse::Person::Education] - ) - end - attr_accessor :education - - # Work history. - sig do - returns( - T::Array[ - ContextDev::Models::BatchSubmitResponse::Person::Experience - ] - ) - end - attr_accessor :experience + # Why it was rejected. + sig { returns(String) } + attr_accessor :reason - # Core profile details. - sig do - returns(ContextDev::Models::BatchSubmitResponse::Person::Profile) - end - attr_reader :profile - - sig do - params( - profile: - ContextDev::Models::BatchSubmitResponse::Person::Profile::OrHash - ).void - end - attr_writer :profile - - # Listed skills. - sig do - returns( - T::Array[ContextDev::Models::BatchSubmitResponse::Person::Skill] - ) - end - attr_accessor :skills + # Rejected URL. + sig { returns(String) } + attr_accessor :url - # Retrieved person profile. - sig do - params( - education: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Person::Education::OrHash - ], - experience: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Person::Experience::OrHash - ], - profile: - ContextDev::Models::BatchSubmitResponse::Person::Profile::OrHash, - skills: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Person::Skill::OrHash - ] - ).returns(T.attached_class) - end + sig { params(reason: String, url: String).returns(T.attached_class) } def self.new( - # Education history. - education:, - # Work history. - experience:, - # Core profile details. - profile:, - # Listed skills. - skills: + # Why it was rejected. + reason:, + # Rejected URL. + url: ) end - sig do - override.returns( - { - education: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Person::Education - ], - experience: - T::Array[ - ContextDev::Models::BatchSubmitResponse::Person::Experience - ], - profile: ContextDev::Models::BatchSubmitResponse::Person::Profile, - skills: - T::Array[ContextDev::Models::BatchSubmitResponse::Person::Skill] - } - ) - end + sig { override.returns({ reason: String, url: String }) } def to_hash end + end - class Education < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Education, - ContextDev::Internal::AnyHash - ) - end - - # School or institution name. - sig do - returns( - ContextDev::Models::BatchSubmitResponse::Person::Education::Institution - ) - end - attr_reader :institution - - sig do - params( - institution: - ContextDev::Models::BatchSubmitResponse::Person::Education::Institution::OrHash - ).void - end - attr_writer :institution - - # Education dates. - sig do - returns( - T.nilable( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates - ) - ) - end - attr_reader :dates + # How pages will be selected. + module Mode + extend ContextDev::Internal::Type::Enum - sig do - params( - dates: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::OrHash - ).void + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::Models::BatchSubmitResponse::Mode) end - attr_writer :dates - - # Additional education details. - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - # Area of study. - sig { returns(T.nilable(String)) } - attr_reader :field_of_study - - sig { params(field_of_study: String).void } - attr_writer :field_of_study - - # Degree, certificate, or credential. - sig { returns(T.nilable(String)) } - attr_reader :qualification - - sig { params(qualification: String).void } - attr_writer :qualification + OrSymbol = T.type_alias { T.any(Symbol, String) } - sig do - params( - institution: - ContextDev::Models::BatchSubmitResponse::Person::Education::Institution::OrHash, - dates: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::OrHash, - description: String, - field_of_study: String, - qualification: String - ).returns(T.attached_class) - end - def self.new( - # School or institution name. - institution:, - # Education dates. - dates: nil, - # Additional education details. - description: nil, - # Area of study. - field_of_study: nil, - # Degree, certificate, or credential. - qualification: nil + SCRAPE = + T.let( + :scrape, + ContextDev::Models::BatchSubmitResponse::Mode::TaggedSymbol ) - end - - sig do - override.returns( - { - institution: - ContextDev::Models::BatchSubmitResponse::Person::Education::Institution, - dates: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates, - description: String, - field_of_study: String, - qualification: String - } - ) - end - def to_hash - end - - class Institution < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Education::Institution, - ContextDev::Internal::AnyHash - ) - end - - # Display name. - sig { returns(String) } - attr_accessor :display_ - - # Standardized name, when available. - sig { returns(T.nilable(String)) } - attr_reader :normalized - - sig { params(normalized: String).void } - attr_writer :normalized - - # School or institution name. - sig do - params(display_: String, normalized: String).returns( - T.attached_class - ) - end - def self.new( - # Display name. - display_:, - # Standardized name, when available. - normalized: nil - ) - end - - sig { override.returns({ display_: String, normalized: String }) } - def to_hash - end - end - - class Dates < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates, - ContextDev::Internal::AnyHash - ) - end - - # End date, when known. - sig do - returns( - T.nilable( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate - ) - ) - end - attr_reader :end_date - - sig do - params( - end_date: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate::OrHash - ).void - end - attr_writer :end_date - - # Whether the entry is current. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :is_current - - sig { params(is_current: T::Boolean).void } - attr_writer :is_current - - # Start date, when known. - sig do - returns( - T.nilable( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - ) - ) - end - attr_reader :start_date - - sig do - params( - start_date: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate::OrHash - ).void - end - attr_writer :start_date - - # Education dates. - sig do - params( - end_date: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate::OrHash, - is_current: T::Boolean, - start_date: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate::OrHash - ).returns(T.attached_class) - end - def self.new( - # End date, when known. - end_date: nil, - # Whether the entry is current. - is_current: nil, - # Start date, when known. - start_date: nil - ) - end - - sig do - override.returns( - { - end_date: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate, - is_current: T::Boolean, - start_date: - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - } - ) - end - def to_hash - end - - class EndDate < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate, - ContextDev::Internal::AnyHash - ) - end - - # Year value. - sig { returns(Integer) } - attr_accessor :year - - # Day value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :day - - sig { params(day: Integer).void } - attr_writer :day - - # Month value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :month - - sig { params(month: Integer).void } - attr_writer :month - - # End date, when known. - sig do - params(year: Integer, day: Integer, month: Integer).returns( - T.attached_class - ) - end - def self.new( - # Year value. - year:, - # Day value, when known. - day: nil, - # Month value, when known. - month: nil - ) - end - - sig do - override.returns( - { year: Integer, day: Integer, month: Integer } - ) - end - def to_hash - end - end - - class StartDate < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate, - ContextDev::Internal::AnyHash - ) - end - - # Year value. - sig { returns(Integer) } - attr_accessor :year - - # Day value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :day - - sig { params(day: Integer).void } - attr_writer :day - - # Month value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :month - - sig { params(month: Integer).void } - attr_writer :month - - # Start date, when known. - sig do - params(year: Integer, day: Integer, month: Integer).returns( - T.attached_class - ) - end - def self.new( - # Year value. - year:, - # Day value, when known. - day: nil, - # Month value, when known. - month: nil - ) - end - - sig do - override.returns( - { year: Integer, day: Integer, month: Integer } - ) - end - def to_hash - end - end - end - end - - class Experience < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Experience, - ContextDev::Internal::AnyHash - ) - end - - # Company or organization name. - sig do - returns( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Company - ) - end - attr_reader :company - - sig do - params( - company: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Company::OrHash - ).void - end - attr_writer :company - - # Role or job title. - sig { returns(String) } - attr_accessor :title - - # Role dates. - sig do - returns( - T.nilable( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates - ) - ) - end - attr_reader :dates - - sig do - params( - dates: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::OrHash - ).void - end - attr_writer :dates - - # Role description. - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig do - params( - company: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Company::OrHash, - title: String, - dates: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::OrHash, - description: String - ).returns(T.attached_class) - end - def self.new( - # Company or organization name. - company:, - # Role or job title. - title:, - # Role dates. - dates: nil, - # Role description. - description: nil + CRAWL = + T.let( + :crawl, + ContextDev::Models::BatchSubmitResponse::Mode::TaggedSymbol ) - end - - sig do - override.returns( - { - company: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Company, - title: String, - dates: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates, - description: String - } - ) - end - def to_hash - end - class Company < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Company, - ContextDev::Internal::AnyHash - ) - end - - # Display name. - sig { returns(String) } - attr_accessor :display_ - - # Standardized name, when available. - sig { returns(T.nilable(String)) } - attr_reader :normalized - - sig { params(normalized: String).void } - attr_writer :normalized - - # Company or organization name. - sig do - params(display_: String, normalized: String).returns( - T.attached_class - ) - end - def self.new( - # Display name. - display_:, - # Standardized name, when available. - normalized: nil - ) - end - - sig { override.returns({ display_: String, normalized: String }) } - def to_hash - end - end - - class Dates < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates, - ContextDev::Internal::AnyHash - ) - end - - # End date, when known. - sig do - returns( - T.nilable( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate - ) - ) - end - attr_reader :end_date - - sig do - params( - end_date: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate::OrHash - ).void - end - attr_writer :end_date - - # Whether the entry is current. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :is_current - - sig { params(is_current: T::Boolean).void } - attr_writer :is_current - - # Start date, when known. - sig do - returns( - T.nilable( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - ) - ) - end - attr_reader :start_date - - sig do - params( - start_date: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate::OrHash - ).void - end - attr_writer :start_date - - # Role dates. - sig do - params( - end_date: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate::OrHash, - is_current: T::Boolean, - start_date: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate::OrHash - ).returns(T.attached_class) - end - def self.new( - # End date, when known. - end_date: nil, - # Whether the entry is current. - is_current: nil, - # Start date, when known. - start_date: nil - ) - end - - sig do - override.returns( - { - end_date: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate, - is_current: T::Boolean, - start_date: - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - } - ) - end - def to_hash - end - - class EndDate < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate, - ContextDev::Internal::AnyHash - ) - end - - # Year value. - sig { returns(Integer) } - attr_accessor :year - - # Day value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :day - - sig { params(day: Integer).void } - attr_writer :day - - # Month value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :month - - sig { params(month: Integer).void } - attr_writer :month - - # End date, when known. - sig do - params(year: Integer, day: Integer, month: Integer).returns( - T.attached_class - ) - end - def self.new( - # Year value. - year:, - # Day value, when known. - day: nil, - # Month value, when known. - month: nil - ) - end - - sig do - override.returns( - { year: Integer, day: Integer, month: Integer } - ) - end - def to_hash - end - end - - class StartDate < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate, - ContextDev::Internal::AnyHash - ) - end - - # Year value. - sig { returns(Integer) } - attr_accessor :year - - # Day value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :day - - sig { params(day: Integer).void } - attr_writer :day - - # Month value, when known. - sig { returns(T.nilable(Integer)) } - attr_reader :month - - sig { params(month: Integer).void } - attr_writer :month - - # Start date, when known. - sig do - params(year: Integer, day: Integer, month: Integer).returns( - T.attached_class - ) - end - def self.new( - # Year value. - year:, - # Day value, when known. - day: nil, - # Month value, when known. - month: nil - ) - end - - sig do - override.returns( - { year: Integer, day: Integer, month: Integer } - ) - end - def to_hash - end - end - end - end - - class Profile < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Profile, - ContextDev::Internal::AnyHash - ) - end - - # Person's full name. - sig { returns(T.nilable(String)) } - attr_reader :full_name - - sig { params(full_name: String).void } - attr_writer :full_name - - # Short professional headline. - sig { returns(T.nilable(String)) } - attr_reader :headline - - sig { params(headline: String).void } - attr_writer :headline - - # Person's listed location. - sig { returns(T.nilable(String)) } - attr_reader :location - - sig { params(location: String).void } - attr_writer :location - - # Profile image URL. - sig { returns(T.nilable(String)) } - attr_reader :profile_picture_url - - sig { params(profile_picture_url: String).void } - attr_writer :profile_picture_url - - # Brief profile summary. - sig { returns(T.nilable(String)) } - attr_reader :summary - - sig { params(summary: String).void } - attr_writer :summary - - # Core profile details. - sig do - params( - full_name: String, - headline: String, - location: String, - profile_picture_url: String, - summary: String - ).returns(T.attached_class) - end - def self.new( - # Person's full name. - full_name: nil, - # Short professional headline. - headline: nil, - # Person's listed location. - location: nil, - # Profile image URL. - profile_picture_url: nil, - # Brief profile summary. - summary: nil + sig do + override.returns( + T::Array[ + ContextDev::Models::BatchSubmitResponse::Mode::TaggedSymbol + ] ) - end - - sig do - override.returns( - { - full_name: String, - headline: String, - location: String, - profile_picture_url: String, - summary: String - } - ) - end - def to_hash - end end - - class Skill < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::BatchSubmitResponse::Person::Skill, - ContextDev::Internal::AnyHash - ) - end - - # Skill name. - sig { returns(String) } - attr_accessor :name - - # Standardized skill name, when available. - sig { returns(T.nilable(String)) } - attr_reader :normalized - - sig { params(normalized: String).void } - attr_writer :normalized - - # Skill proficiency, when available. - sig { returns(T.nilable(String)) } - attr_reader :proficiency - - sig { params(proficiency: String).void } - attr_writer :proficiency - - sig do - params( - name: String, - normalized: String, - proficiency: String - ).returns(T.attached_class) - end - def self.new( - # Skill name. - name:, - # Standardized skill name, when available. - normalized: nil, - # Skill proficiency, when available. - proficiency: nil - ) - end - - sig do - override.returns( - { name: String, normalized: String, proficiency: String } - ) - end - def to_hash - end + def self.values end end - # Response status. + # Always `queued`. An accepted batch has not started yet. module Status extend ContextDev::Internal::Type::Enum @@ -1268,9 +302,9 @@ module ContextDev end OrSymbol = T.type_alias { T.any(Symbol, String) } - OK = + QUEUED = T.let( - :ok, + :queued, ContextDev::Models::BatchSubmitResponse::Status::TaggedSymbol ) @@ -1302,8 +336,7 @@ module ContextDev sig { returns(Integer) } attr_accessor :credits_remaining - # Metadata about the API key used for the request. Included in every response - # whenever a valid API key is provided, even when the response status is not 200. + # API key usage for this request. sig do params(credits_consumed: Integer, credits_remaining: Integer).returns( T.attached_class diff --git a/rbi/context_dev/models/brand_retrieve_response.rbi b/rbi/context_dev/models/brand_retrieve_response.rbi index af130880..306d3b44 100644 --- a/rbi/context_dev/models/brand_retrieve_response.rbi +++ b/rbi/context_dev/models/brand_retrieve_response.rbi @@ -179,6 +179,24 @@ module ContextDev sig { params(email: String).void } attr_writer :email + # Employee headcount information for the brand (will be null if unknown) + sig do + returns( + T.nilable( + ContextDev::Models::BrandRetrieveResponse::Brand::Employees + ) + ) + end + attr_reader :employees + + sig do + params( + employees: + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::OrHash + ).void + end + attr_writer :employees + # Industry classification information for the brand sig do returns( @@ -324,6 +342,8 @@ module ContextDev description: String, domain: String, email: String, + employees: + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::OrHash, industries: ContextDev::Models::BrandRetrieveResponse::Brand::Industries::OrHash, is_nsfw: T::Boolean, @@ -361,6 +381,8 @@ module ContextDev domain: nil, # Company email address email: nil, + # Employee headcount information for the brand (will be null if unknown) + employees: nil, # Industry classification information for the brand industries: nil, # Indicates whether the brand content is not safe for work (NSFW) @@ -401,6 +423,8 @@ module ContextDev description: String, domain: String, email: String, + employees: + ContextDev::Models::BrandRetrieveResponse::Brand::Employees, industries: ContextDev::Models::BrandRetrieveResponse::Brand::Industries, is_nsfw: T::Boolean, @@ -757,6 +781,134 @@ module ContextDev end end + class Employees < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::BrandRetrieveResponse::Brand::Employees, + ContextDev::Internal::AnyHash + ) + end + + # Exact employee count when a precise headcount is known + sig { returns(T.nilable(Integer)) } + attr_reader :exact + + sig { params(exact: Integer).void } + attr_writer :exact + + # Employee count range for the brand (e.g. '11 to 50') + sig do + returns( + T.nilable( + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + ) + end + attr_reader :range + + sig do + params( + range: + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::OrSymbol + ).void + end + attr_writer :range + + # Employee headcount information for the brand (will be null if unknown) + sig do + params( + exact: Integer, + range: + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Exact employee count when a precise headcount is known + exact: nil, + # Employee count range for the brand (e.g. '11 to 50') + range: nil + ) + end + + sig do + override.returns( + { + exact: Integer, + range: + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + } + ) + end + def to_hash + end + + # Employee count range for the brand (e.g. '11 to 50') + module Range + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RANGE_1_TO_10 = + T.let( + :"1 to 10", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_11_TO_50 = + T.let( + :"11 to 50", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_51_TO_200 = + T.let( + :"51 to 200", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_201_TO_500 = + T.let( + :"201 to 500", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_501_TO_1000 = + T.let( + :"501 to 1000", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_1001_TO_5000 = + T.let( + :"1001 to 5000", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_5001_TO_10000 = + T.let( + :"5001 to 10000", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + RANGE_10001 = + T.let( + :"10001+", + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::Range::TaggedSymbol + ] + ) + end + def self.values + end + end + end + class Industries < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/context_dev/models/brand_search_response.rbi b/rbi/context_dev/models/brand_search_response.rbi index fd377643..9f6dd196 100644 --- a/rbi/context_dev/models/brand_search_response.rbi +++ b/rbi/context_dev/models/brand_search_response.rbi @@ -11,7 +11,8 @@ module ContextDev ) end - # Up to 10 matching brands, most popular first. Empty when nothing matches. + # Up to 10 matching brands, name matches first, then domain matches, most popular + # first within each group. Empty when nothing matches. sig { returns(T::Array[ContextDev::Models::BrandSearchResponse::Result]) } attr_accessor :results @@ -39,7 +40,8 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Up to 10 matching brands, most popular first. Empty when nothing matches. + # Up to 10 matching brands, name matches first, then domain matches, most popular + # first within each group. Empty when nothing matches. results:, # Metadata about the API key used for the request. Included in every response # whenever a valid API key is provided, even when the response status is not 200. diff --git a/rbi/context_dev/models/crawl_controls.rbi b/rbi/context_dev/models/crawl_controls.rbi index ccf7fd34..01253878 100644 --- a/rbi/context_dev/models/crawl_controls.rbi +++ b/rbi/context_dev/models/crawl_controls.rbi @@ -39,8 +39,8 @@ module ContextDev max_pages: Integer, source: T.any( - ContextDev::CrawlControls::Source::UnionMember0::OrHash, - ContextDev::CrawlControls::Source::UnionMember1::OrHash + ContextDev::CrawlControls::Source::StartURL::OrHash, + ContextDev::CrawlControls::Source::Sitemap::OrHash ), url_pattern: T.nilable(String) ).returns(T.attached_class) @@ -82,23 +82,23 @@ module ContextDev Variants = T.type_alias do T.any( - ContextDev::CrawlControls::Source::UnionMember0, - ContextDev::CrawlControls::Source::UnionMember1 + ContextDev::CrawlControls::Source::StartURL, + ContextDev::CrawlControls::Source::Sitemap ) end - class UnionMember0 < ContextDev::Internal::Type::BaseModel + class StartURL < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - ContextDev::CrawlControls::Source::UnionMember0, + ContextDev::CrawlControls::Source::StartURL, ContextDev::Internal::AnyHash ) end sig do returns( - ContextDev::CrawlControls::Source::UnionMember0::Type::TaggedSymbol + ContextDev::CrawlControls::Source::StartURL::Type::TaggedSymbol ) end attr_accessor :type @@ -107,10 +107,10 @@ module ContextDev sig { returns(String) } attr_accessor :url + # The crawl discovered pages by following links from one URL. sig do params( - type: - ContextDev::CrawlControls::Source::UnionMember0::Type::OrSymbol, + type: ContextDev::CrawlControls::Source::StartURL::Type::OrSymbol, url: String ).returns(T.attached_class) end @@ -125,7 +125,7 @@ module ContextDev override.returns( { type: - ContextDev::CrawlControls::Source::UnionMember0::Type::TaggedSymbol, + ContextDev::CrawlControls::Source::StartURL::Type::TaggedSymbol, url: String } ) @@ -138,23 +138,20 @@ module ContextDev TaggedSymbol = T.type_alias do - T.all( - Symbol, - ContextDev::CrawlControls::Source::UnionMember0::Type - ) + T.all(Symbol, ContextDev::CrawlControls::Source::StartURL::Type) end OrSymbol = T.type_alias { T.any(Symbol, String) } START_URL = T.let( :start_url, - ContextDev::CrawlControls::Source::UnionMember0::Type::TaggedSymbol + ContextDev::CrawlControls::Source::StartURL::Type::TaggedSymbol ) sig do override.returns( T::Array[ - ContextDev::CrawlControls::Source::UnionMember0::Type::TaggedSymbol + ContextDev::CrawlControls::Source::StartURL::Type::TaggedSymbol ] ) end @@ -163,11 +160,11 @@ module ContextDev end end - class UnionMember1 < ContextDev::Internal::Type::BaseModel + class Sitemap < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - ContextDev::CrawlControls::Source::UnionMember1, + ContextDev::CrawlControls::Source::Sitemap, ContextDev::Internal::AnyHash ) end @@ -178,16 +175,16 @@ module ContextDev sig do returns( - ContextDev::CrawlControls::Source::UnionMember1::Type::TaggedSymbol + ContextDev::CrawlControls::Source::Sitemap::Type::TaggedSymbol ) end attr_accessor :type + # The crawl scraped the pages listed in the domain's sitemap. sig do params( domain: String, - type: - ContextDev::CrawlControls::Source::UnionMember1::Type::OrSymbol + type: ContextDev::CrawlControls::Source::Sitemap::Type::OrSymbol ).returns(T.attached_class) end def self.new( @@ -202,7 +199,7 @@ module ContextDev { domain: String, type: - ContextDev::CrawlControls::Source::UnionMember1::Type::TaggedSymbol + ContextDev::CrawlControls::Source::Sitemap::Type::TaggedSymbol } ) end @@ -214,23 +211,20 @@ module ContextDev TaggedSymbol = T.type_alias do - T.all( - Symbol, - ContextDev::CrawlControls::Source::UnionMember1::Type - ) + T.all(Symbol, ContextDev::CrawlControls::Source::Sitemap::Type) end OrSymbol = T.type_alias { T.any(Symbol, String) } SITEMAP = T.let( :sitemap, - ContextDev::CrawlControls::Source::UnionMember1::Type::TaggedSymbol + ContextDev::CrawlControls::Source::Sitemap::Type::TaggedSymbol ) sig do override.returns( T::Array[ - ContextDev::CrawlControls::Source::UnionMember1::Type::TaggedSymbol + ContextDev::CrawlControls::Source::Sitemap::Type::TaggedSymbol ] ) end diff --git a/rbi/context_dev/models/parse_handle_params.rbi b/rbi/context_dev/models/parse_handle_params.rbi index 4b74f53f..effe0182 100644 --- a/rbi/context_dev/models/parse_handle_params.rbi +++ b/rbi/context_dev/models/parse_handle_params.rbi @@ -83,10 +83,11 @@ module ContextDev end attr_writer :include_links - # When true for PDF inputs, detect and OCR images embedded in the selected pages, - # inserting recognized text at each image's position in page reading order while - # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. - # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + # When true for PDF inputs, OCR the selected pages that have no usable text layer + # (scans), replacing each recovered page's text with the OCR result while pages + # with a real text layer keep it. pdf.start/pdf.end limit the inclusive page + # range. Billed at 1 credit per page OCR actually recovered, on top of the base + # request cost. When false, no OCR runs. sig do returns( T.nilable( @@ -220,10 +221,11 @@ module ContextDev include_images: nil, # Preserve hyperlinks in Markdown output include_links: nil, - # When true for PDF inputs, detect and OCR images embedded in the selected pages, - # inserting recognized text at each image's position in page reading order while - # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. - # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + # When true for PDF inputs, OCR the selected pages that have no usable text layer + # (scans), replacing each recovered page's text with the OCR result while pages + # with a real text layer keep it. pdf.start/pdf.end limit the inclusive page + # range. Billed at 1 credit per page OCR actually recovered, on top of the base + # request cost. When false, no OCR runs. ocr: nil, # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. pdf: nil, @@ -516,10 +518,11 @@ module ContextDev ) end - # When true for PDF inputs, detect and OCR images embedded in the selected pages, - # inserting recognized text at each image's position in page reading order while - # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. - # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + # When true for PDF inputs, OCR the selected pages that have no usable text layer + # (scans), replacing each recovered page's text with the OCR result while pages + # with a real text layer keep it. pdf.start/pdf.end limit the inclusive page + # range. Billed at 1 credit per page OCR actually recovered, on top of the base + # request cost. When false, no OCR runs. module Ocr extend ContextDev::Internal::Type::Union diff --git a/rbi/context_dev/models/person_enrich_params.rbi b/rbi/context_dev/models/person_enrich_params.rbi new file mode 100644 index 00000000..5d391559 --- /dev/null +++ b/rbi/context_dev/models/person_enrich_params.rbi @@ -0,0 +1,332 @@ +# typed: strong + +module ContextDev + module Models + class PersonEnrichParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(ContextDev::PersonEnrichParams, ContextDev::Internal::AnyHash) + end + + sig { returns(T.nilable(ContextDev::PersonEnrichParams::Company)) } + attr_reader :company + + sig do + params(company: ContextDev::PersonEnrichParams::Company::OrHash).void + end + attr_writer :company + + sig do + returns(T.nilable(T::Array[ContextDev::PersonEnrichParams::Education])) + end + attr_reader :education + + sig do + params( + education: T::Array[ContextDev::PersonEnrichParams::Education::OrHash] + ).void + end + attr_writer :education + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig { returns(T.nilable(ContextDev::PersonEnrichParams::Location)) } + attr_reader :location + + sig do + params(location: ContextDev::PersonEnrichParams::Location::OrHash).void + end + attr_writer :location + + sig { returns(T.nilable(ContextDev::PersonEnrichParams::Name)) } + attr_reader :name + + sig { params(name: ContextDev::PersonEnrichParams::Name::OrHash).void } + attr_writer :name + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :social_urls + + sig { params(social_urls: T::Array[String]).void } + attr_writer :social_urls + + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + + sig do + params( + company: ContextDev::PersonEnrichParams::Company::OrHash, + education: + T::Array[ContextDev::PersonEnrichParams::Education::OrHash], + email: String, + location: ContextDev::PersonEnrichParams::Location::OrHash, + name: ContextDev::PersonEnrichParams::Name::OrHash, + social_urls: T::Array[String], + tags: T::Array[String], + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + company: nil, + education: nil, + email: nil, + location: nil, + name: nil, + social_urls: nil, + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + tags: nil, + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + timeout_ms: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + company: ContextDev::PersonEnrichParams::Company, + education: T::Array[ContextDev::PersonEnrichParams::Education], + email: String, + location: ContextDev::PersonEnrichParams::Location, + name: ContextDev::PersonEnrichParams::Name, + social_urls: T::Array[String], + tags: T::Array[String], + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + ) + end + def to_hash + end + + class Company < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::PersonEnrichParams::Company, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(domain: String, name: String).returns(T.attached_class) } + def self.new(domain: nil, name: nil) + end + + sig { override.returns({ domain: String, name: String }) } + def to_hash + end + end + + class Education < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::PersonEnrichParams::Education, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :degree + + sig { params(degree: String).void } + attr_writer :degree + + sig { returns(T.nilable(String)) } + attr_reader :field_of_study + + sig { params(field_of_study: String).void } + attr_writer :field_of_study + + sig { returns(T.nilable(Integer)) } + attr_reader :graduation_year + + sig { params(graduation_year: Integer).void } + attr_writer :graduation_year + + sig do + returns( + T.nilable(ContextDev::PersonEnrichParams::Education::Institution) + ) + end + attr_reader :institution + + sig do + params( + institution: + ContextDev::PersonEnrichParams::Education::Institution::OrHash + ).void + end + attr_writer :institution + + sig do + params( + degree: String, + field_of_study: String, + graduation_year: Integer, + institution: + ContextDev::PersonEnrichParams::Education::Institution::OrHash + ).returns(T.attached_class) + end + def self.new( + degree: nil, + field_of_study: nil, + graduation_year: nil, + institution: nil + ) + end + + sig do + override.returns( + { + degree: String, + field_of_study: String, + graduation_year: Integer, + institution: + ContextDev::PersonEnrichParams::Education::Institution + } + ) + end + def to_hash + end + + class Institution < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::PersonEnrichParams::Education::Institution, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(domain: String, name: String).returns(T.attached_class) } + def self.new(domain: nil, name: nil) + end + + sig { override.returns({ domain: String, name: String }) } + def to_hash + end + end + end + + class Location < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::PersonEnrichParams::Location, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :region + + sig { params(region: String).void } + attr_writer :region + + sig do + params(city: String, country: String, region: String).returns( + T.attached_class + ) + end + def self.new(city: nil, country: nil, region: nil) + end + + sig do + override.returns({ city: String, country: String, region: String }) + end + def to_hash + end + end + + class Name < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::PersonEnrichParams::Name, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :first + + sig { params(first: String).void } + attr_writer :first + + sig { returns(T.nilable(String)) } + attr_reader :last + + sig { params(last: String).void } + attr_writer :last + + sig { params(first: String, last: String).returns(T.attached_class) } + def self.new(first: nil, last: nil) + end + + sig { override.returns({ first: String, last: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/context_dev/models/person_enrich_response.rbi b/rbi/context_dev/models/person_enrich_response.rbi new file mode 100644 index 00000000..0581a48f --- /dev/null +++ b/rbi/context_dev/models/person_enrich_response.rbi @@ -0,0 +1,1208 @@ +# typed: strong + +module ContextDev + module Models + class PersonEnrichResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse, + ContextDev::Internal::AnyHash + ) + end + + # The highest-scoring person candidate. + sig { returns(ContextDev::Models::PersonEnrichResponse::Match::Variants) } + attr_accessor :match + + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + sig do + returns( + T.nilable(ContextDev::Models::PersonEnrichResponse::KeyMetadata) + ) + end + attr_reader :key_metadata + + sig do + params( + key_metadata: + ContextDev::Models::PersonEnrichResponse::KeyMetadata::OrHash + ).void + end + attr_writer :key_metadata + + sig do + params( + match: + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::OrHash, + ContextDev::Models::PersonEnrichResponse::Match::NotFound::OrHash + ), + key_metadata: + ContextDev::Models::PersonEnrichResponse::KeyMetadata::OrHash + ).returns(T.attached_class) + end + def self.new( + # The highest-scoring person candidate. + match:, + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + key_metadata: nil + ) + end + + sig do + override.returns( + { + match: ContextDev::Models::PersonEnrichResponse::Match::Variants, + key_metadata: ContextDev::Models::PersonEnrichResponse::KeyMetadata + } + ) + end + def to_hash + end + + # The highest-scoring person candidate. + module Match + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate, + ContextDev::Models::PersonEnrichResponse::Match::NotFound + ) + end + + class Candidate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person + ) + end + attr_reader :person + + sig do + params( + person: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::OrHash + ).void + end + attr_writer :person + + sig { returns(Integer) } + attr_accessor :score + + sig { returns(Symbol) } + attr_accessor :status + + # The highest-scoring person candidate. + sig do + params( + person: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::OrHash, + score: Integer, + status: Symbol + ).returns(T.attached_class) + end + def self.new(person:, score:, status: :candidate) + end + + sig do + override.returns( + { + person: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person, + score: Integer, + status: Symbol + } + ) + end + def to_hash + end + + class Person < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education + ] + ) + end + attr_accessor :education + + sig do + returns( + T::Array[ + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience + ] + ) + end + attr_accessor :experience + + sig { returns(T::Array[String]) } + attr_accessor :skills + + sig { returns(T::Array[String]) } + attr_accessor :social_urls + + sig { returns(T::Array[String]) } + attr_accessor :website_urls + + sig { returns(T.nilable(String)) } + attr_reader :avatar_url + + sig { params(avatar_url: String).void } + attr_writer :avatar_url + + sig { returns(T.nilable(String)) } + attr_reader :bio + + sig { params(bio: String).void } + attr_writer :bio + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole + ) + ) + end + attr_reader :current_role + + sig do + params( + current_role: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::OrHash + ).void + end + attr_writer :current_role + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location + ) + ) + end + attr_reader :location + + sig do + params( + location: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location::OrHash + ).void + end + attr_writer :location + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + ) + ) + end + attr_reader :name + + sig do + params( + name: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name::OrHash + ).void + end + attr_writer :name + + sig do + params( + education: + T::Array[ + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::OrHash + ], + experience: + T::Array[ + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::OrHash + ], + skills: T::Array[String], + social_urls: T::Array[String], + website_urls: T::Array[String], + avatar_url: String, + bio: String, + current_role: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::OrHash, + email: String, + location: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location::OrHash, + name: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name::OrHash + ).returns(T.attached_class) + end + def self.new( + education:, + experience:, + skills:, + social_urls:, + website_urls:, + avatar_url: nil, + bio: nil, + current_role: nil, + email: nil, + location: nil, + name: nil + ) + end + + sig do + override.returns( + { + education: + T::Array[ + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education + ], + experience: + T::Array[ + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience + ], + skills: T::Array[String], + social_urls: T::Array[String], + website_urls: T::Array[String], + avatar_url: String, + bio: String, + current_role: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole, + email: String, + location: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location, + name: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + } + ) + end + def to_hash + end + + class Education < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution + ) + end + attr_reader :institution + + sig do + params( + institution: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution::OrHash + ).void + end + attr_writer :institution + + sig { returns(T.nilable(String)) } + attr_reader :degree + + sig { params(degree: String).void } + attr_writer :degree + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate + ) + ) + end + attr_reader :end_date + + sig do + params( + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate::OrHash + ).void + end + attr_writer :end_date + + sig { returns(T.nilable(String)) } + attr_reader :field_of_study + + sig { params(field_of_study: String).void } + attr_writer :field_of_study + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + ) + ) + end + attr_reader :start_date + + sig do + params( + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate::OrHash + ).void + end + attr_writer :start_date + + sig do + params( + institution: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution::OrHash, + degree: String, + description: String, + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate::OrHash, + field_of_study: String, + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate::OrHash + ).returns(T.attached_class) + end + def self.new( + institution:, + degree: nil, + description: nil, + end_date: nil, + field_of_study: nil, + start_date: nil + ) + end + + sig do + override.returns( + { + institution: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution, + degree: String, + description: String, + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate, + field_of_study: String, + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + } + ) + end + def to_hash + end + + class Institution < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + sig do + params(name: String, domain: String).returns(T.attached_class) + end + def self.new(name:, domain: nil) + end + + sig { override.returns({ name: String, domain: String }) } + def to_hash + end + end + + class EndDate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :year + + sig { returns(T.nilable(Integer)) } + attr_reader :day + + sig { params(day: Integer).void } + attr_writer :day + + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + sig do + params(year: Integer, day: Integer, month: Integer).returns( + T.attached_class + ) + end + def self.new(year:, day: nil, month: nil) + end + + sig do + override.returns( + { year: Integer, day: Integer, month: Integer } + ) + end + def to_hash + end + end + + class StartDate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :year + + sig { returns(T.nilable(Integer)) } + attr_reader :day + + sig { params(day: Integer).void } + attr_writer :day + + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + sig do + params(year: Integer, day: Integer, month: Integer).returns( + T.attached_class + ) + end + def self.new(year:, day: nil, month: nil) + end + + sig do + override.returns( + { year: Integer, day: Integer, month: Integer } + ) + end + def to_hash + end + end + end + + class Experience < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization + ) + end + attr_reader :organization + + sig do + params( + organization: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization::OrHash + ).void + end + attr_writer :organization + + sig { returns(String) } + attr_accessor :title + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate + ) + ) + end + attr_reader :end_date + + sig do + params( + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate::OrHash + ).void + end + attr_writer :end_date + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_current + + sig { params(is_current: T::Boolean).void } + attr_writer :is_current + + sig { returns(T.nilable(String)) } + attr_reader :location + + sig { params(location: String).void } + attr_writer :location + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + ) + ) + end + attr_reader :start_date + + sig do + params( + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate::OrHash + ).void + end + attr_writer :start_date + + sig do + params( + organization: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization::OrHash, + title: String, + description: String, + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate::OrHash, + is_current: T::Boolean, + location: String, + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate::OrHash + ).returns(T.attached_class) + end + def self.new( + organization:, + title:, + description: nil, + end_date: nil, + is_current: nil, + location: nil, + start_date: nil + ) + end + + sig do + override.returns( + { + organization: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization, + title: String, + description: String, + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate, + is_current: T::Boolean, + location: String, + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + } + ) + end + def to_hash + end + + class Organization < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + sig do + params(name: String, domain: String).returns(T.attached_class) + end + def self.new(name:, domain: nil) + end + + sig { override.returns({ name: String, domain: String }) } + def to_hash + end + end + + class EndDate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :year + + sig { returns(T.nilable(Integer)) } + attr_reader :day + + sig { params(day: Integer).void } + attr_writer :day + + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + sig do + params(year: Integer, day: Integer, month: Integer).returns( + T.attached_class + ) + end + def self.new(year:, day: nil, month: nil) + end + + sig do + override.returns( + { year: Integer, day: Integer, month: Integer } + ) + end + def to_hash + end + end + + class StartDate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :year + + sig { returns(T.nilable(Integer)) } + attr_reader :day + + sig { params(day: Integer).void } + attr_writer :day + + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + sig do + params(year: Integer, day: Integer, month: Integer).returns( + T.attached_class + ) + end + def self.new(year:, day: nil, month: nil) + end + + sig do + override.returns( + { year: Integer, day: Integer, month: Integer } + ) + end + def to_hash + end + end + end + + class CurrentRole < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization + ) + end + attr_reader :organization + + sig do + params( + organization: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization::OrHash + ).void + end + attr_writer :organization + + sig { returns(String) } + attr_accessor :title + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate + ) + ) + end + attr_reader :end_date + + sig do + params( + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate::OrHash + ).void + end + attr_writer :end_date + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_current + + sig { params(is_current: T::Boolean).void } + attr_writer :is_current + + sig { returns(T.nilable(String)) } + attr_reader :location + + sig { params(location: String).void } + attr_writer :location + + sig do + returns( + T.nilable( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + ) + ) + end + attr_reader :start_date + + sig do + params( + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate::OrHash + ).void + end + attr_writer :start_date + + sig do + params( + organization: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization::OrHash, + title: String, + description: String, + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate::OrHash, + is_current: T::Boolean, + location: String, + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate::OrHash + ).returns(T.attached_class) + end + def self.new( + organization:, + title:, + description: nil, + end_date: nil, + is_current: nil, + location: nil, + start_date: nil + ) + end + + sig do + override.returns( + { + organization: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization, + title: String, + description: String, + end_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate, + is_current: T::Boolean, + location: String, + start_date: + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + } + ) + end + def to_hash + end + + class Organization < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + sig do + params(name: String, domain: String).returns(T.attached_class) + end + def self.new(name:, domain: nil) + end + + sig { override.returns({ name: String, domain: String }) } + def to_hash + end + end + + class EndDate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :year + + sig { returns(T.nilable(Integer)) } + attr_reader :day + + sig { params(day: Integer).void } + attr_writer :day + + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + sig do + params(year: Integer, day: Integer, month: Integer).returns( + T.attached_class + ) + end + def self.new(year:, day: nil, month: nil) + end + + sig do + override.returns( + { year: Integer, day: Integer, month: Integer } + ) + end + def to_hash + end + end + + class StartDate < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :year + + sig { returns(T.nilable(Integer)) } + attr_reader :day + + sig { params(day: Integer).void } + attr_writer :day + + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + sig do + params(year: Integer, day: Integer, month: Integer).returns( + T.attached_class + ) + end + def self.new(year:, day: nil, month: nil) + end + + sig do + override.returns( + { year: Integer, day: Integer, month: Integer } + ) + end + def to_hash + end + end + end + + class Location < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :country_code + + sig { params(country_code: String).void } + attr_writer :country_code + + sig { returns(T.nilable(String)) } + attr_reader :display_ + + sig { params(display_: String).void } + attr_writer :display_ + + sig { returns(T.nilable(String)) } + attr_reader :region + + sig { params(region: String).void } + attr_writer :region + + sig do + params( + city: String, + country: String, + country_code: String, + display_: String, + region: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + country: nil, + country_code: nil, + display_: nil, + region: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + country_code: String, + display_: String, + region: String + } + ) + end + def to_hash + end + end + + class Name < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :first + + sig { params(first: String).void } + attr_writer :first + + sig { returns(T.nilable(String)) } + attr_reader :full + + sig { params(full: String).void } + attr_writer :full + + sig { returns(T.nilable(String)) } + attr_reader :last + + sig { params(last: String).void } + attr_writer :last + + sig do + params(first: String, full: String, last: String).returns( + T.attached_class + ) + end + def self.new(first: nil, full: nil, last: nil) + end + + sig do + override.returns({ first: String, full: String, last: String }) + end + def to_hash + end + end + end + end + + class NotFound < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::Match::NotFound, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(NilClass) } + attr_accessor :person + + sig { returns(NilClass) } + attr_accessor :score + + sig { returns(Symbol) } + attr_accessor :status + + # No usable person candidate was found. + sig do + params(person: NilClass, score: NilClass, status: Symbol).returns( + T.attached_class + ) + end + def self.new(person:, score:, status: :not_found) + end + + sig do + override.returns( + { person: NilClass, score: NilClass, status: Symbol } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ContextDev::Models::PersonEnrichResponse::Match::Variants] + ) + end + def self.variants + end + end + + class KeyMetadata < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::PersonEnrichResponse::KeyMetadata, + ContextDev::Internal::AnyHash + ) + end + + # The number of credits consumed by this request. + sig { returns(Integer) } + attr_accessor :credits_consumed + + # The number of credits remaining for your organization after this request. + sig { returns(Integer) } + attr_accessor :credits_remaining + + # Metadata about the API key used for the request. Included in every response + # whenever a valid API key is provided, even when the response status is not 200. + sig do + params(credits_consumed: Integer, credits_remaining: Integer).returns( + T.attached_class + ) + end + def self.new( + # The number of credits consumed by this request. + credits_consumed:, + # The number of credits remaining for your organization after this request. + credits_remaining: + ) + end + + sig do + override.returns( + { credits_consumed: Integer, credits_remaining: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/context_dev/models/web_search_response.rbi b/rbi/context_dev/models/web_search_response.rbi index 1d3b0812..17f1c2ce 100644 --- a/rbi/context_dev/models/web_search_response.rbi +++ b/rbi/context_dev/models/web_search_response.rbi @@ -224,6 +224,11 @@ module ContextDev :TIMEOUT, ContextDev::Models::WebSearchResponse::Result::Markdown::Code::TaggedSymbol ) + CONTENT_TOO_LARGE = + T.let( + :CONTENT_TOO_LARGE, + ContextDev::Models::WebSearchResponse::Result::Markdown::Code::TaggedSymbol + ) WEBSITE_ACCESS_ERROR = T.let( :WEBSITE_ACCESS_ERROR, diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index abfdd35c..59a1ffc9 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -553,9 +553,10 @@ module ContextDev sig { params(end_: Integer).void } attr_writer :end_ - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. sig { returns(T.nilable(T::Boolean)) } attr_reader :ocr @@ -591,9 +592,10 @@ module ContextDev # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. # Must be greater than or equal to start when both are provided. end_: nil, - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. ocr: nil, # When true, PDF pages are fetched and parsed. When false, PDF pages are skipped # entirely (not included in results and not counted as failures). diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index d1a33a2f..e322e905 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -901,9 +901,10 @@ module ContextDev sig { params(end_: Integer).void } attr_writer :end_ - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. sig do returns( T.nilable( @@ -928,7 +929,7 @@ module ContextDev attr_writer :ocr # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. sig do returns( T.nilable( @@ -981,12 +982,13 @@ module ContextDev # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. # Must be greater than or equal to start when both are provided. end_: nil, - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. ocr: nil, # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. should_parse: nil, # First 1-based PDF page to parse. When omitted, parsing starts at the first page. start: nil @@ -1014,9 +1016,10 @@ module ContextDev def to_hash end - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. module Ocr extend ContextDev::Internal::Type::Union @@ -1055,7 +1058,7 @@ module ContextDev end # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. module ShouldParse extend ContextDev::Internal::Type::Union diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index e7e3046a..cca31afc 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -874,9 +874,10 @@ module ContextDev sig { params(end_: Integer).void } attr_writer :end_ - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. sig do returns( T.nilable( @@ -901,7 +902,7 @@ module ContextDev attr_writer :ocr # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. sig do returns( T.nilable( @@ -954,12 +955,13 @@ module ContextDev # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. # Must be greater than or equal to start when both are provided. end_: nil, - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. ocr: nil, # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. should_parse: nil, # First 1-based PDF page to parse. When omitted, parsing starts at the first page. start: nil @@ -987,9 +989,10 @@ module ContextDev def to_hash end - # When true, detect and OCR images embedded in the selected PDF pages, inserting - # recognized text at each image's position in page reading order while preserving - # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # When true, OCR the selected PDF pages that have no usable text layer (scans), + # replacing each recovered page's text with the OCR result while pages with a real + # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. module Ocr extend ContextDev::Internal::Type::Union @@ -1028,7 +1031,7 @@ module ContextDev end # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - # a 400 WEBSITE_ACCESS_ERROR is returned. + # a 400 PDF_SKIPPED is returned. module ShouldParse extend ContextDev::Internal::Type::Union diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi index a4cbec1f..60574383 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -35,6 +35,15 @@ module ContextDev sig { params(max_links: Integer).void } attr_writer :max_links + # Optional search phrase. When provided, the crawled sitemap is filtered to the + # pages whose URLs are about that phrase, most relevant first, and the request + # costs 2 credits instead of 1. + sig { returns(T.nilable(String)) } + attr_reader :search + + sig { params(search: String).void } + attr_writer :search + # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled # instead of discovering the domain's sitemaps. sig { returns(T.nilable(String)) } @@ -88,6 +97,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + search: String, sitemap_url: String, tags: T::Array[String], timeout_ms: Integer, @@ -106,6 +116,10 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional search phrase. When provided, the crawled sitemap is filtered to the + # pages whose URLs are about that phrase, most relevant first, and the request + # costs 2 credits instead of 1. + search: nil, # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled # instead of discovering the domain's sitemaps. sitemap_url: nil, @@ -135,6 +149,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + search: String, sitemap_url: String, tags: T::Array[String], timeout_ms: Integer, diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi index 8c897e05..aa5c4484 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi @@ -34,7 +34,8 @@ module ContextDev end attr_accessor :success - # Array of discovered page URLs from the sitemap (max 500) + # Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set + # these are only the matching pages, most relevant first. sig { returns(T::Array[String]) } attr_accessor :urls @@ -75,7 +76,8 @@ module ContextDev meta:, # Indicates success success:, - # Array of discovered page URLs from the sitemap (max 500) + # Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set + # these are only the matching pages, most relevant first. urls:, # Metadata about the API key used for the request. Included in every response # whenever a valid API key is provided, even when the response status is not 200. diff --git a/rbi/context_dev/resources/batch.rbi b/rbi/context_dev/resources/batch.rbi index 78000f9a..ce31fbdd 100644 --- a/rbi/context_dev/resources/batch.rbi +++ b/rbi/context_dev/resources/batch.rbi @@ -2,6 +2,7 @@ module ContextDev module Resources + # Scrape many pages or crawl a site asynchronously. class Batch # Check progress, and get download links once the batch finishes. sig do @@ -49,6 +50,21 @@ module ContextDev ) end + # Permanently delete a finished batch and its stored results. Active batches must + # settle first. + sig do + params( + batch_id: String, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::BatchDeleteResponse) + end + def delete( + # ID of the batch to retrieve or cancel. + batch_id, + request_options: {} + ) + end + # Stop a batch from starting new pages. In-progress pages finish, and unused # credits are refunded. sig do @@ -86,24 +102,30 @@ module ContextDev ) end - # Retrieve and normalize a person profile from identifiers. + # Scrape 25K URLs or crawl large websites asynchronously. sig do params( - identifiers: ContextDev::BatchSubmitParams::Identifiers::OrHash, + input: + T.any( + ContextDev::BatchSubmitParams::Input::Scrape::OrHash, + ContextDev::BatchSubmitParams::Input::Crawl::OrHash + ), tags: T::Array[String], - timeout_ms: Integer, + webhook_url: String, + idempotency_key: String, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::BatchSubmitResponse) end def submit( - # Known identifiers for the person. At least one identifier is required. - identifiers:, - # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + # Body param: Choose a URL list or a site crawl. + input:, + # Body param: Tags stored on the batch. Filter the batch list by them later. tags: nil, - # Optional timeout in milliseconds for the request. If the request takes longer - # than this value, it will be aborted with a 408 status code. Maximum allowed - # value is 300000ms (5 minutes). - timeout_ms: nil, + # Body param: URL notified when the batch finishes. + webhook_url: nil, + # Header param: Any string unique to this submission. Retries with the same key + # return the original batch. + idempotency_key: nil, request_options: {} ) end diff --git a/rbi/context_dev/resources/brand.rbi b/rbi/context_dev/resources/brand.rbi index e75c5145..9fbb7ee7 100644 --- a/rbi/context_dev/resources/brand.rbi +++ b/rbi/context_dev/resources/brand.rbi @@ -65,7 +65,8 @@ module ContextDev end # Search brands by name or domain and get back up to 10 lightweight matches - # (domain, name, logo), most popular first: by Tranco rank, then market cap for + # (domain, name, logo). Name matches rank ahead of domain matches; within each + # group the most popular brands come first: by Tranco rank, then market cap for # brands outside the Tranco list, with text relevance breaking ties. Matching is # prefix-based with no typo tolerance, so it is suited to autocomplete. Only # brands already in the Context.dev index are returned — use /brand/retrieve to diff --git a/rbi/context_dev/resources/parse.rbi b/rbi/context_dev/resources/parse.rbi index 7a7dac46..265a3907 100644 --- a/rbi/context_dev/resources/parse.rbi +++ b/rbi/context_dev/resources/parse.rbi @@ -49,11 +49,11 @@ module ContextDev include_images: nil, # Query param: Preserve hyperlinks in Markdown output include_links: nil, - # Query param: When true for PDF inputs, detect and OCR images embedded in the - # selected pages, inserting recognized text at each image's position in page - # reading order while preserving the PDF text layer. pdf.start/pdf.end limit the - # inclusive page range. When false, all OCR is disabled, including the automatic - # scanned-PDF fallback. + # Query param: When true for PDF inputs, OCR the selected pages that have no + # usable text layer (scans), replacing each recovered page's text with the OCR + # result while pages with a real text layer keep it. pdf.start/pdf.end limit the + # inclusive page range. Billed at 1 credit per page OCR actually recovered, on top + # of the base request cost. When false, no OCR runs. ocr: nil, # Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end": # 5}. diff --git a/rbi/context_dev/resources/people.rbi b/rbi/context_dev/resources/people.rbi new file mode 100644 index 00000000..c519ff31 --- /dev/null +++ b/rbi/context_dev/resources/people.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module ContextDev + module Resources + class People + # Finds and normalizes the best available person candidate from additive identity + # clues, then assigns an identity match score from 0 to 100. Available on all paid + # plans. Successful requests cost 20 credits. Disposable and free email addresses + # (like gmail.com, yahoo.com) will throw a 422 error. + sig do + params( + company: ContextDev::PersonEnrichParams::Company::OrHash, + education: + T::Array[ContextDev::PersonEnrichParams::Education::OrHash], + email: String, + location: ContextDev::PersonEnrichParams::Location::OrHash, + name: ContextDev::PersonEnrichParams::Name::OrHash, + social_urls: T::Array[String], + tags: T::Array[String], + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::PersonEnrichResponse) + end + def enrich( + company: nil, + education: nil, + email: nil, + location: nil, + name: nil, + social_urls: nil, + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + tags: nil, + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + timeout_ms: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: ContextDev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 5b32418a..28f319b6 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -595,6 +595,18 @@ module ContextDev # responses from a recognized API key; use error_code to distinguish stable # failure categories. # + # ### YouTube + # + # YouTube URLs return the video or channel itself rather than the surrounding + # player and navigation chrome. A URL addressing a single video (`/watch`, + # `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, + # view count, keywords, full description, and the transcript when the video has + # captions that can be retrieved; videos without captions return everything except + # the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) + # returns its name, handle, subscriber count, video count, and full description. + # When `includeImages=true`, video responses also include the thumbnail and + # channel responses include the avatar. Costs the same as any other scrape. + # # ### Billing & errors # # | HTTP status | Billed? | Meaning | @@ -604,6 +616,7 @@ module ContextDev # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | # | 404 | No | Target page returned or fingerprinted as not found | # | 408 | No | Request timed out | + # | 413 | No | Target content exceeds the maximum supported size (20 MB) | # | 415 | No | Unsupported content type | # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | # | 500 | No | Internal error | @@ -727,12 +740,17 @@ module ContextDev ) end - # Crawl an entire website's sitemap and return all discovered page URLs. + # Crawl an entire website's sitemap and return all discovered page URLs. Pass + # `search` to have the crawled sitemap filtered down to the pages about a phrase + # (for example `pricing and plans` or `api authentication docs`), most relevant + # first — a searched crawl scans the whole sitemap and costs 2 credits instead + # of 1. sig do params( domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + search: String, sitemap_url: String, tags: T::Array[String], timeout_ms: Integer, @@ -751,6 +769,10 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional search phrase. When provided, the crawled sitemap is filtered to the + # pages whose URLs are about that phrase, most relevant first, and the request + # costs 2 credits instead of 1. + search: nil, # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled # instead of discovering the domain's sitemaps. sitemap_url: nil, diff --git a/sig/context_dev/client.rbs b/sig/context_dev/client.rbs index bab631ef..16447acb 100644 --- a/sig/context_dev/client.rbs +++ b/sig/context_dev/client.rbs @@ -26,6 +26,8 @@ module ContextDev attr_reader batch: ContextDev::Resources::Batch + attr_reader people: ContextDev::Resources::People + private def auth_headers: -> ::Hash[String, String] def initialize: ( diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 35acb092..d98a1175 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -5,6 +5,8 @@ module ContextDev class BatchCancelParams = ContextDev::Models::BatchCancelParams + class BatchDeleteParams = ContextDev::Models::BatchDeleteParams + class BatchGetResultsParams = ContextDev::Models::BatchGetResultsParams class BatchListParams = ContextDev::Models::BatchListParams @@ -59,6 +61,8 @@ module ContextDev class ParseHandleParams = ContextDev::Models::ParseHandleParams + class PersonEnrichParams = ContextDev::Models::PersonEnrichParams + class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams class WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams diff --git a/sig/context_dev/models/batch_delete_params.rbs b/sig/context_dev/models/batch_delete_params.rbs new file mode 100644 index 00000000..0996106e --- /dev/null +++ b/sig/context_dev/models/batch_delete_params.rbs @@ -0,0 +1,23 @@ +module ContextDev + module Models + type batch_delete_params = + { batch_id: String } & ContextDev::Internal::Type::request_parameters + + class BatchDeleteParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_accessor batch_id: String + + def initialize: ( + batch_id: String, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + batch_id: String, + request_options: ContextDev::RequestOptions + } + end + end +end diff --git a/sig/context_dev/models/batch_delete_response.rbs b/sig/context_dev/models/batch_delete_response.rbs new file mode 100644 index 00000000..b999aff1 --- /dev/null +++ b/sig/context_dev/models/batch_delete_response.rbs @@ -0,0 +1,57 @@ +module ContextDev + module Models + type batch_delete_response = + { + id: String, + deleted: bool, + key_metadata: ContextDev::Models::BatchDeleteResponse::KeyMetadata + } + + class BatchDeleteResponse < ContextDev::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader deleted: bool? + + def deleted=: (bool) -> bool + + attr_reader key_metadata: ContextDev::Models::BatchDeleteResponse::KeyMetadata? + + def key_metadata=: ( + ContextDev::Models::BatchDeleteResponse::KeyMetadata + ) -> ContextDev::Models::BatchDeleteResponse::KeyMetadata + + def initialize: ( + ?id: String, + ?deleted: bool, + ?key_metadata: ContextDev::Models::BatchDeleteResponse::KeyMetadata + ) -> void + + def to_hash: -> { + id: String, + deleted: bool, + key_metadata: ContextDev::Models::BatchDeleteResponse::KeyMetadata + } + + type key_metadata = + { credits_consumed: Integer, credits_remaining: Integer } + + class KeyMetadata < ContextDev::Internal::Type::BaseModel + attr_accessor credits_consumed: Integer + + attr_accessor credits_remaining: Integer + + def initialize: ( + credits_consumed: Integer, + credits_remaining: Integer + ) -> void + + def to_hash: -> { + credits_consumed: Integer, + credits_remaining: Integer + } + end + end + end +end diff --git a/sig/context_dev/models/batch_get_results_response.rbs b/sig/context_dev/models/batch_get_results_response.rbs index 5e51642a..ad76bbbc 100644 --- a/sig/context_dev/models/batch_get_results_response.rbs +++ b/sig/context_dev/models/batch_get_results_response.rbs @@ -58,7 +58,8 @@ module ContextDev html: String, item_id: String, markdown: String, - meta: ::Hash[Symbol, top] + meta: ::Hash[Symbol, top], + ocr_pages: Integer } class Ok < ContextDev::Internal::Type::BaseModel @@ -88,6 +89,10 @@ module ContextDev def meta=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + attr_reader ocr_pages: Integer? + + def ocr_pages=: (Integer) -> Integer + def initialize: ( final_url: String, http_status: Integer?, @@ -97,6 +102,7 @@ module ContextDev ?item_id: String, ?markdown: String, ?meta: ::Hash[Symbol, top], + ?ocr_pages: Integer, ?status: :ok ) -> void @@ -109,7 +115,8 @@ module ContextDev html: String, item_id: String, markdown: String, - meta: ::Hash[Symbol, top] + meta: ::Hash[Symbol, top], + ocr_pages: Integer } type metadata = diff --git a/sig/context_dev/models/batch_list_response.rbs b/sig/context_dev/models/batch_list_response.rbs index 1506ff2f..e02fdec5 100644 --- a/sig/context_dev/models/batch_list_response.rbs +++ b/sig/context_dev/models/batch_list_response.rbs @@ -117,22 +117,36 @@ module ContextDev timing: ContextDev::Models::BatchListResponse::Data::Timing } - type credits = { net: Integer, refunded: Integer, reserved: Integer } + type credits = + { + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + } class Credits < ContextDev::Internal::Type::BaseModel attr_accessor net: Integer + attr_accessor ocr_charged: Integer + attr_accessor refunded: Integer attr_accessor reserved: Integer def initialize: ( net: Integer, + ocr_charged: Integer, refunded: Integer, reserved: Integer ) -> void - def to_hash: -> { net: Integer, refunded: Integer, reserved: Integer } + def to_hash: -> { + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + } end type format_ = :markdown | :html diff --git a/sig/context_dev/models/batch_retrieve_response.rbs b/sig/context_dev/models/batch_retrieve_response.rbs index 6f6f136e..76fc4c41 100644 --- a/sig/context_dev/models/batch_retrieve_response.rbs +++ b/sig/context_dev/models/batch_retrieve_response.rbs @@ -90,22 +90,36 @@ module ContextDev key_metadata: ContextDev::Models::BatchRetrieveResponse::KeyMetadata } - type credits = { net: Integer, refunded: Integer, reserved: Integer } + type credits = + { + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + } class Credits < ContextDev::Internal::Type::BaseModel attr_accessor net: Integer + attr_accessor ocr_charged: Integer + attr_accessor refunded: Integer attr_accessor reserved: Integer def initialize: ( net: Integer, + ocr_charged: Integer, refunded: Integer, reserved: Integer ) -> void - def to_hash: -> { net: Integer, refunded: Integer, reserved: Integer } + def to_hash: -> { + net: Integer, + ocr_charged: Integer, + refunded: Integer, + reserved: Integer + } end type format_ = :markdown | :html diff --git a/sig/context_dev/models/batch_submit_params.rbs b/sig/context_dev/models/batch_submit_params.rbs index f87d9269..ff026c2c 100644 --- a/sig/context_dev/models/batch_submit_params.rbs +++ b/sig/context_dev/models/batch_submit_params.rbs @@ -2,9 +2,10 @@ module ContextDev module Models type batch_submit_params = { - identifiers: ContextDev::BatchSubmitParams::Identifiers, + input: ContextDev::Models::BatchSubmitParams::input, tags: ::Array[String], - timeout_ms: Integer + webhook_url: String, + idempotency_key: String } & ContextDev::Internal::Type::request_parameters @@ -12,40 +13,2780 @@ module ContextDev extend ContextDev::Internal::Type::RequestParameters::Converter include ContextDev::Internal::Type::RequestParameters - attr_accessor identifiers: ContextDev::BatchSubmitParams::Identifiers + attr_accessor input: ContextDev::Models::BatchSubmitParams::input attr_reader tags: ::Array[String]? def tags=: (::Array[String]) -> ::Array[String] - attr_reader timeout_ms: Integer? + attr_reader webhook_url: String? - def timeout_ms=: (Integer) -> Integer + def webhook_url=: (String) -> String + + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String def initialize: ( - identifiers: ContextDev::BatchSubmitParams::Identifiers, + input: ContextDev::Models::BatchSubmitParams::input, ?tags: ::Array[String], - ?timeout_ms: Integer, + ?webhook_url: String, + ?idempotency_key: String, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { - identifiers: ContextDev::BatchSubmitParams::Identifiers, + input: ContextDev::Models::BatchSubmitParams::input, tags: ::Array[String], - timeout_ms: Integer, + webhook_url: String, + idempotency_key: String, request_options: ContextDev::RequestOptions } - type identifiers = { linkedin_url: String } + type input = + ContextDev::BatchSubmitParams::Input::Scrape + | ContextDev::BatchSubmitParams::Input::Crawl + + module Input + extend ContextDev::Internal::Type::Union + + type scrape = + { + data: ContextDev::Models::BatchSubmitParams::Input::Scrape::data, + mode: :scrape + } + + class Scrape < ContextDev::Internal::Type::BaseModel + attr_accessor data: ContextDev::Models::BatchSubmitParams::Input::Scrape::data + + attr_accessor mode: :scrape + + def initialize: ( + data: ContextDev::Models::BatchSubmitParams::Input::Scrape::data, + ?mode: :scrape + ) -> void + + def to_hash: -> { + data: ContextDev::Models::BatchSubmitParams::Input::Scrape::data, + mode: :scrape + } + + type data = + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown + | ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML + + module Data + extend ContextDev::Internal::Type::Union + + type markdown = + { + format_: :markdown, + urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL], + options: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options + } + + class Markdown < ContextDev::Internal::Type::BaseModel + attr_accessor format_: :markdown + + attr_accessor urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL] + + attr_reader options: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options? + + def options=: ( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options + ) -> ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options + + def initialize: ( + urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL], + ?options: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options, + ?format_: :markdown + ) -> void + + def to_hash: -> { + format_: :markdown, + urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::URL], + options: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options + } + + type url = + { url: String, item_id: String, meta: ::Hash[Symbol, top] } + + class URL < ContextDev::Internal::Type::BaseModel + attr_accessor url: String + + attr_reader item_id: String? + + def item_id=: (String) -> String + + attr_reader meta: ::Hash[Symbol, top]? + + def meta=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + url: String, + ?item_id: String, + ?meta: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> { + url: String, + item_id: String, + meta: ::Hash[Symbol, top] + } + end + + type options = + { + country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country, + exclude_selectors: ::Array[String]?, + include_images: bool, + include_links: bool, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf, + settle_animations: bool, + :shorten_base64_images => bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + class Options < ContextDev::Internal::Type::BaseModel + attr_reader country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country? + + def country=: ( + ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country + ) -> ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country + + attr_accessor exclude_selectors: ::Array[String]? + + attr_reader include_images: bool? + + def include_images=: (bool) -> bool + + attr_reader include_links: bool? + + def include_links=: (bool) -> bool + + attr_accessor include_selectors: ::Array[String]? + + attr_accessor max_age_ms: Integer? + + attr_reader pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf? + + def pdf=: ( + ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf + ) -> ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf + + attr_reader settle_animations: bool? + + def settle_animations=: (bool) -> bool + + attr_reader shorten_base64_images: bool? + + def shorten_base64_images=: (bool) -> bool + + attr_reader use_main_content_only: bool? + + def use_main_content_only=: (bool) -> bool + + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + + def initialize: ( + ?country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country, + ?exclude_selectors: ::Array[String]?, + ?include_images: bool, + ?include_links: bool, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, + ?pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf, + ?settle_animations: bool, + ?shorten_base64_images: bool, + ?use_main_content_only: bool, + ?wait_for_ms: Integer + ) -> void + + def to_hash: -> { + country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country, + exclude_selectors: ::Array[String]?, + include_images: bool, + include_links: bool, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf, + settle_animations: bool, + :shorten_base64_images => bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + type country = + :ad + | :ae + | :af + | :ag + | :ai + | :al + | :am + | :ao + | :ar + | :at + | :au + | :aw + | :az + | :ba + | :bb + | :bd + | :be + | :bf + | :bg + | :bh + | :bi + | :bj + | :bm + | :bn + | :bo + | :bq + | :br + | :bs + | :bw + | :by + | :bz + | :ca + | :cd + | :cf + | :cg + | :ch + | :ci + | :cl + | :cm + | :cn + | :co + | :cr + | :cv + | :cw + | :cy + | :cz + | :de + | :dj + | :dk + | :dm + | :do + | :dz + | :ec + | :ee + | :eg + | :es + | :et + | :fi + | :fj + | :fr + | :ga + | :gb + | :gd + | :ge + | :gf + | :gg + | :gh + | :gm + | :gn + | :gp + | :gq + | :gr + | :gt + | :gu + | :gw + | :gy + | :hk + | :hn + | :hr + | :ht + | :hu + | :id + | :ie + | :il + | :im + | :in + | :iq + | :ir + | :is + | :it + | :je + | :jm + | :jo + | :jp + | :ke + | :kg + | :kh + | :kn + | :kr + | :kw + | :ky + | :kz + | :la + | :lb + | :lc + | :lk + | :lr + | :ls + | :lt + | :lu + | :lv + | :ly + | :ma + | :mc + | :md + | :me + | :mf + | :mg + | :mk + | :ml + | :mm + | :mn + | :mo + | :mq + | :mr + | :mt + | :mu + | :mv + | :mw + | :mx + | :my + | :mz + | :na + | :nc + | :ne + | :ng + | :ni + | :nl + | :no + | :np + | :nz + | :om + | :pa + | :pe + | :pf + | :pg + | :ph + | :pk + | :pl + | :pr + | :ps + | :pt + | :py + | :qa + | :re + | :ro + | :rs + | :ru + | :rw + | :sa + | :sc + | :sd + | :se + | :sg + | :si + | :sk + | :sl + | :sm + | :sn + | :so + | :sr + | :ss + | :st + | :sv + | :sx + | :sy + | :sz + | :tc + | :td + | :tg + | :th + | :tj + | :tl + | :tm + | :tn + | :tr + | :tt + | :tw + | :tz + | :ua + | :ug + | :us + | :uy + | :uz + | :vc + | :ve + | :vg + | :vi + | :vn + | :ye + | :yt + | :za + | :zm + | :zw + + module Country + extend ContextDev::Internal::Type::Enum + + AD: :ad + AE: :ae + AF: :af + AG: :ag + AI: :ai + AL: :al + AM: :am + AO: :ao + AR: :ar + AT: :at + AU: :au + AW: :aw + AZ: :az + BA: :ba + BB: :bb + BD: :bd + BE: :be + BF: :bf + BG: :bg + BH: :bh + BI: :bi + BJ: :bj + BM: :bm + BN: :bn + BO: :bo + BQ: :bq + BR: :br + BS: :bs + BW: :bw + BY: :by + BZ: :bz + CA: :ca + CD: :cd + CF: :cf + CG: :cg + CH: :ch + CI: :ci + CL: :cl + CM: :cm + CN: :cn + CO: :co + CR: :cr + CV: :cv + CW: :cw + CY: :cy + CZ: :cz + DE: :de + DJ: :dj + DK: :dk + DM: :dm + DO: :do + DZ: :dz + EC: :ec + EE: :ee + EG: :eg + ES: :es + ET: :et + FI: :fi + FJ: :fj + FR: :fr + GA: :ga + GB: :gb + GD: :gd + GE: :ge + GF: :gf + GG: :gg + GH: :gh + GM: :gm + GN: :gn + GP: :gp + GQ: :gq + GR: :gr + GT: :gt + GU: :gu + GW: :gw + GY: :gy + HK: :hk + HN: :hn + HR: :hr + HT: :ht + HU: :hu + ID: :id + IE: :ie + IL: :il + IM: :im + IN: :in + IQ: :iq + IR: :ir + IS: :is + IT: :it + JE: :je + JM: :jm + JO: :jo + JP: :jp + KE: :ke + KG: :kg + KH: :kh + KN: :kn + KR: :kr + KW: :kw + KY: :ky + KZ: :kz + LA: :la + LB: :lb + LC: :lc + LK: :lk + LR: :lr + LS: :ls + LT: :lt + LU: :lu + LV: :lv + LY: :ly + MA: :ma + MC: :mc + MD: :md + ME: :me + MF: :mf + MG: :mg + MK: :mk + ML: :ml + MM: :mm + MN: :mn + MO: :mo + MQ: :mq + MR: :mr + MT: :mt + MU: :mu + MV: :mv + MW: :mw + MX: :mx + MY: :my + MZ: :mz + NA: :na + NC: :nc + NE: :ne + NG: :ng + NI: :ni + NL: :nl + NO: :no + NP: :np + NZ: :nz + OM: :om + PA: :pa + PE: :pe + PF: :pf + PG: :pg + PH: :ph + PK: :pk + PL: :pl + PR: :pr + PS: :ps + PT: :pt + PY: :py + QA: :qa + RE: :re + RO: :ro + RS: :rs + RU: :ru + RW: :rw + SA: :sa + SC: :sc + SD: :sd + SE: :se + SG: :sg + SI: :si + SK: :sk + SL: :sl + SM: :sm + SN: :sn + SO: :so + SR: :sr + SS: :ss + ST: :st + SV: :sv + SX: :sx + SY: :sy + SZ: :sz + TC: :tc + TD: :td + TG: :tg + TH: :th + TJ: :tj + TL: :tl + TM: :tm + TN: :tn + TR: :tr + TT: :tt + TW: :tw + TZ: :tz + UA: :ua + UG: :ug + US: :us + UY: :uy + UZ: :uz + VC: :vc + VE: :ve + VG: :vg + VI: :vi + VN: :vn + YE: :ye + YT: :yt + ZA: :za + ZM: :zm + ZW: :zw + + def self?.values: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::country] + end + + type pdf = + { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse, + start: Integer + } + + class Pdf < ContextDev::Internal::Type::BaseModel + attr_reader end_: Integer? + + def end_=: (Integer) -> Integer + + attr_reader ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr? + + def ocr=: ( + ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr + ) -> ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr + + attr_reader should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse? + + def should_parse=: ( + ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse + ) -> ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse + + attr_reader start: Integer? + + def start=: (Integer) -> Integer + + def initialize: ( + ?end_: Integer, + ?ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr, + ?should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse, + ?start: Integer + ) -> void + + def to_hash: -> { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse, + start: Integer + } + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::ocr] + + TRUE: :true + FALSE: :false + end + + type should_parse = bool | :true | :false + + module ShouldParse + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::Markdown::Options::Pdf::should_parse] + + TRUE: :true + FALSE: :false + end + end + end + end + + type html = + { + format_: :html, + urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL], + options: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options + } + + class HTML < ContextDev::Internal::Type::BaseModel + attr_accessor format_: :html + + attr_accessor urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL] + + attr_reader options: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options? + + def options=: ( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options + ) -> ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options + + def initialize: ( + urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL], + ?options: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options, + ?format_: :html + ) -> void + + def to_hash: -> { + format_: :html, + urls: ::Array[ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::URL], + options: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options + } + + type url = + { url: String, item_id: String, meta: ::Hash[Symbol, top] } + + class URL < ContextDev::Internal::Type::BaseModel + attr_accessor url: String + + attr_reader item_id: String? + + def item_id=: (String) -> String + + attr_reader meta: ::Hash[Symbol, top]? + + def meta=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + url: String, + ?item_id: String, + ?meta: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> { + url: String, + item_id: String, + meta: ::Hash[Symbol, top] + } + end + + type options = + { + country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country, + exclude_selectors: ::Array[String]?, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf, + settle_animations: bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + class Options < ContextDev::Internal::Type::BaseModel + attr_reader country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country? + + def country=: ( + ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country + ) -> ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country + + attr_accessor exclude_selectors: ::Array[String]? + + attr_accessor include_selectors: ::Array[String]? + + attr_accessor max_age_ms: Integer? + + attr_reader pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf? + + def pdf=: ( + ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf + ) -> ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf + + attr_reader settle_animations: bool? + + def settle_animations=: (bool) -> bool + + attr_reader use_main_content_only: bool? + + def use_main_content_only=: (bool) -> bool + + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + + def initialize: ( + ?country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country, + ?exclude_selectors: ::Array[String]?, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, + ?pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf, + ?settle_animations: bool, + ?use_main_content_only: bool, + ?wait_for_ms: Integer + ) -> void + + def to_hash: -> { + country: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country, + exclude_selectors: ::Array[String]?, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf, + settle_animations: bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + type country = + :ad + | :ae + | :af + | :ag + | :ai + | :al + | :am + | :ao + | :ar + | :at + | :au + | :aw + | :az + | :ba + | :bb + | :bd + | :be + | :bf + | :bg + | :bh + | :bi + | :bj + | :bm + | :bn + | :bo + | :bq + | :br + | :bs + | :bw + | :by + | :bz + | :ca + | :cd + | :cf + | :cg + | :ch + | :ci + | :cl + | :cm + | :cn + | :co + | :cr + | :cv + | :cw + | :cy + | :cz + | :de + | :dj + | :dk + | :dm + | :do + | :dz + | :ec + | :ee + | :eg + | :es + | :et + | :fi + | :fj + | :fr + | :ga + | :gb + | :gd + | :ge + | :gf + | :gg + | :gh + | :gm + | :gn + | :gp + | :gq + | :gr + | :gt + | :gu + | :gw + | :gy + | :hk + | :hn + | :hr + | :ht + | :hu + | :id + | :ie + | :il + | :im + | :in + | :iq + | :ir + | :is + | :it + | :je + | :jm + | :jo + | :jp + | :ke + | :kg + | :kh + | :kn + | :kr + | :kw + | :ky + | :kz + | :la + | :lb + | :lc + | :lk + | :lr + | :ls + | :lt + | :lu + | :lv + | :ly + | :ma + | :mc + | :md + | :me + | :mf + | :mg + | :mk + | :ml + | :mm + | :mn + | :mo + | :mq + | :mr + | :mt + | :mu + | :mv + | :mw + | :mx + | :my + | :mz + | :na + | :nc + | :ne + | :ng + | :ni + | :nl + | :no + | :np + | :nz + | :om + | :pa + | :pe + | :pf + | :pg + | :ph + | :pk + | :pl + | :pr + | :ps + | :pt + | :py + | :qa + | :re + | :ro + | :rs + | :ru + | :rw + | :sa + | :sc + | :sd + | :se + | :sg + | :si + | :sk + | :sl + | :sm + | :sn + | :so + | :sr + | :ss + | :st + | :sv + | :sx + | :sy + | :sz + | :tc + | :td + | :tg + | :th + | :tj + | :tl + | :tm + | :tn + | :tr + | :tt + | :tw + | :tz + | :ua + | :ug + | :us + | :uy + | :uz + | :vc + | :ve + | :vg + | :vi + | :vn + | :ye + | :yt + | :za + | :zm + | :zw + + module Country + extend ContextDev::Internal::Type::Enum + + AD: :ad + AE: :ae + AF: :af + AG: :ag + AI: :ai + AL: :al + AM: :am + AO: :ao + AR: :ar + AT: :at + AU: :au + AW: :aw + AZ: :az + BA: :ba + BB: :bb + BD: :bd + BE: :be + BF: :bf + BG: :bg + BH: :bh + BI: :bi + BJ: :bj + BM: :bm + BN: :bn + BO: :bo + BQ: :bq + BR: :br + BS: :bs + BW: :bw + BY: :by + BZ: :bz + CA: :ca + CD: :cd + CF: :cf + CG: :cg + CH: :ch + CI: :ci + CL: :cl + CM: :cm + CN: :cn + CO: :co + CR: :cr + CV: :cv + CW: :cw + CY: :cy + CZ: :cz + DE: :de + DJ: :dj + DK: :dk + DM: :dm + DO: :do + DZ: :dz + EC: :ec + EE: :ee + EG: :eg + ES: :es + ET: :et + FI: :fi + FJ: :fj + FR: :fr + GA: :ga + GB: :gb + GD: :gd + GE: :ge + GF: :gf + GG: :gg + GH: :gh + GM: :gm + GN: :gn + GP: :gp + GQ: :gq + GR: :gr + GT: :gt + GU: :gu + GW: :gw + GY: :gy + HK: :hk + HN: :hn + HR: :hr + HT: :ht + HU: :hu + ID: :id + IE: :ie + IL: :il + IM: :im + IN: :in + IQ: :iq + IR: :ir + IS: :is + IT: :it + JE: :je + JM: :jm + JO: :jo + JP: :jp + KE: :ke + KG: :kg + KH: :kh + KN: :kn + KR: :kr + KW: :kw + KY: :ky + KZ: :kz + LA: :la + LB: :lb + LC: :lc + LK: :lk + LR: :lr + LS: :ls + LT: :lt + LU: :lu + LV: :lv + LY: :ly + MA: :ma + MC: :mc + MD: :md + ME: :me + MF: :mf + MG: :mg + MK: :mk + ML: :ml + MM: :mm + MN: :mn + MO: :mo + MQ: :mq + MR: :mr + MT: :mt + MU: :mu + MV: :mv + MW: :mw + MX: :mx + MY: :my + MZ: :mz + NA: :na + NC: :nc + NE: :ne + NG: :ng + NI: :ni + NL: :nl + NO: :no + NP: :np + NZ: :nz + OM: :om + PA: :pa + PE: :pe + PF: :pf + PG: :pg + PH: :ph + PK: :pk + PL: :pl + PR: :pr + PS: :ps + PT: :pt + PY: :py + QA: :qa + RE: :re + RO: :ro + RS: :rs + RU: :ru + RW: :rw + SA: :sa + SC: :sc + SD: :sd + SE: :se + SG: :sg + SI: :si + SK: :sk + SL: :sl + SM: :sm + SN: :sn + SO: :so + SR: :sr + SS: :ss + ST: :st + SV: :sv + SX: :sx + SY: :sy + SZ: :sz + TC: :tc + TD: :td + TG: :tg + TH: :th + TJ: :tj + TL: :tl + TM: :tm + TN: :tn + TR: :tr + TT: :tt + TW: :tw + TZ: :tz + UA: :ua + UG: :ug + US: :us + UY: :uy + UZ: :uz + VC: :vc + VE: :ve + VG: :vg + VI: :vi + VN: :vn + YE: :ye + YT: :yt + ZA: :za + ZM: :zm + ZW: :zw + + def self?.values: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::country] + end + + type pdf = + { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse, + start: Integer + } + + class Pdf < ContextDev::Internal::Type::BaseModel + attr_reader end_: Integer? + + def end_=: (Integer) -> Integer + + attr_reader ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr? + + def ocr=: ( + ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr + ) -> ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr + + attr_reader should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse? + + def should_parse=: ( + ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse + ) -> ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse + + attr_reader start: Integer? + + def start=: (Integer) -> Integer + + def initialize: ( + ?end_: Integer, + ?ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr, + ?should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse, + ?start: Integer + ) -> void + + def to_hash: -> { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse, + start: Integer + } + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::ocr] + + TRUE: :true + FALSE: :false + end + + type should_parse = bool | :true | :false + + module ShouldParse + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::HTML::Options::Pdf::should_parse] + + TRUE: :true + FALSE: :false + end + end + end + end + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Scrape::data] + end + end + + type crawl = + { + data: ContextDev::Models::BatchSubmitParams::Input::Crawl::data, + mode: :crawl + } + + class Crawl < ContextDev::Internal::Type::BaseModel + attr_accessor data: ContextDev::Models::BatchSubmitParams::Input::Crawl::data + + attr_accessor mode: :crawl + + def initialize: ( + data: ContextDev::Models::BatchSubmitParams::Input::Crawl::data, + ?mode: :crawl + ) -> void + + def to_hash: -> { + data: ContextDev::Models::BatchSubmitParams::Input::Crawl::data, + mode: :crawl + } + + type data = + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown + | ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML + + module Data + extend ContextDev::Internal::Type::Union + + type markdown = + { + format_: :markdown, + source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::source, + options: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options + } + + class Markdown < ContextDev::Internal::Type::BaseModel + attr_accessor format_: :markdown + + attr_accessor source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::source + + attr_reader options: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options? + + def options=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options + + def initialize: ( + source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::source, + ?options: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options, + ?format_: :markdown + ) -> void + + def to_hash: -> { + format_: :markdown, + source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::source, + options: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options + } + + type source = + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL + | ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap + + module Source + extend ContextDev::Internal::Type::Union + + type start_url = + { + type: :start_url, + url: String, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls + } + + class StartURL < ContextDev::Internal::Type::BaseModel + attr_accessor type: :start_url + + attr_accessor url: String + + attr_reader controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls? + + def controls=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls + + def initialize: ( + url: String, + ?controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls, + ?type: :start_url + ) -> void + + def to_hash: -> { + type: :start_url, + url: String, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::StartURL::Controls + } + + type controls = + { + follow_subdomains: bool, + max_depth: Integer, + max_urls: Integer, + regex: String + } + + class Controls < ContextDev::Internal::Type::BaseModel + attr_reader follow_subdomains: bool? + + def follow_subdomains=: (bool) -> bool + + attr_reader max_depth: Integer? + + def max_depth=: (Integer) -> Integer + + attr_reader max_urls: Integer? + + def max_urls=: (Integer) -> Integer + + attr_reader regex: String? + + def regex=: (String) -> String + + def initialize: ( + ?follow_subdomains: bool, + ?max_depth: Integer, + ?max_urls: Integer, + ?regex: String + ) -> void + + def to_hash: -> { + follow_subdomains: bool, + max_depth: Integer, + max_urls: Integer, + regex: String + } + end + end + + type sitemap = + { + domain: String, + type: :sitemap, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls + } + + class Sitemap < ContextDev::Internal::Type::BaseModel + attr_accessor domain: String + + attr_accessor type: :sitemap + + attr_reader controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls? + + def controls=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls + + def initialize: ( + domain: String, + ?controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls, + ?type: :sitemap + ) -> void + + def to_hash: -> { + domain: String, + type: :sitemap, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Source::Sitemap::Controls + } + + type controls = { max_urls: Integer, regex: String } + + class Controls < ContextDev::Internal::Type::BaseModel + attr_reader max_urls: Integer? + + def max_urls=: (Integer) -> Integer + + attr_reader regex: String? + + def regex=: (String) -> String + + def initialize: (?max_urls: Integer, ?regex: String) -> void + + def to_hash: -> { max_urls: Integer, regex: String } + end + end + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::source] + end + + type options = + { + country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country, + exclude_selectors: ::Array[String]?, + include_images: bool, + include_links: bool, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf, + settle_animations: bool, + :shorten_base64_images => bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + class Options < ContextDev::Internal::Type::BaseModel + attr_reader country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country? + + def country=: ( + ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country + ) -> ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country + + attr_accessor exclude_selectors: ::Array[String]? + + attr_reader include_images: bool? + + def include_images=: (bool) -> bool + + attr_reader include_links: bool? + + def include_links=: (bool) -> bool + + attr_accessor include_selectors: ::Array[String]? + + attr_accessor max_age_ms: Integer? + + attr_reader pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf? + + def pdf=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf + + attr_reader settle_animations: bool? + + def settle_animations=: (bool) -> bool + + attr_reader shorten_base64_images: bool? + + def shorten_base64_images=: (bool) -> bool + + attr_reader use_main_content_only: bool? + + def use_main_content_only=: (bool) -> bool + + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + + def initialize: ( + ?country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country, + ?exclude_selectors: ::Array[String]?, + ?include_images: bool, + ?include_links: bool, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, + ?pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf, + ?settle_animations: bool, + ?shorten_base64_images: bool, + ?use_main_content_only: bool, + ?wait_for_ms: Integer + ) -> void + + def to_hash: -> { + country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country, + exclude_selectors: ::Array[String]?, + include_images: bool, + include_links: bool, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf, + settle_animations: bool, + :shorten_base64_images => bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + type country = + :ad + | :ae + | :af + | :ag + | :ai + | :al + | :am + | :ao + | :ar + | :at + | :au + | :aw + | :az + | :ba + | :bb + | :bd + | :be + | :bf + | :bg + | :bh + | :bi + | :bj + | :bm + | :bn + | :bo + | :bq + | :br + | :bs + | :bw + | :by + | :bz + | :ca + | :cd + | :cf + | :cg + | :ch + | :ci + | :cl + | :cm + | :cn + | :co + | :cr + | :cv + | :cw + | :cy + | :cz + | :de + | :dj + | :dk + | :dm + | :do + | :dz + | :ec + | :ee + | :eg + | :es + | :et + | :fi + | :fj + | :fr + | :ga + | :gb + | :gd + | :ge + | :gf + | :gg + | :gh + | :gm + | :gn + | :gp + | :gq + | :gr + | :gt + | :gu + | :gw + | :gy + | :hk + | :hn + | :hr + | :ht + | :hu + | :id + | :ie + | :il + | :im + | :in + | :iq + | :ir + | :is + | :it + | :je + | :jm + | :jo + | :jp + | :ke + | :kg + | :kh + | :kn + | :kr + | :kw + | :ky + | :kz + | :la + | :lb + | :lc + | :lk + | :lr + | :ls + | :lt + | :lu + | :lv + | :ly + | :ma + | :mc + | :md + | :me + | :mf + | :mg + | :mk + | :ml + | :mm + | :mn + | :mo + | :mq + | :mr + | :mt + | :mu + | :mv + | :mw + | :mx + | :my + | :mz + | :na + | :nc + | :ne + | :ng + | :ni + | :nl + | :no + | :np + | :nz + | :om + | :pa + | :pe + | :pf + | :pg + | :ph + | :pk + | :pl + | :pr + | :ps + | :pt + | :py + | :qa + | :re + | :ro + | :rs + | :ru + | :rw + | :sa + | :sc + | :sd + | :se + | :sg + | :si + | :sk + | :sl + | :sm + | :sn + | :so + | :sr + | :ss + | :st + | :sv + | :sx + | :sy + | :sz + | :tc + | :td + | :tg + | :th + | :tj + | :tl + | :tm + | :tn + | :tr + | :tt + | :tw + | :tz + | :ua + | :ug + | :us + | :uy + | :uz + | :vc + | :ve + | :vg + | :vi + | :vn + | :ye + | :yt + | :za + | :zm + | :zw + + module Country + extend ContextDev::Internal::Type::Enum + + AD: :ad + AE: :ae + AF: :af + AG: :ag + AI: :ai + AL: :al + AM: :am + AO: :ao + AR: :ar + AT: :at + AU: :au + AW: :aw + AZ: :az + BA: :ba + BB: :bb + BD: :bd + BE: :be + BF: :bf + BG: :bg + BH: :bh + BI: :bi + BJ: :bj + BM: :bm + BN: :bn + BO: :bo + BQ: :bq + BR: :br + BS: :bs + BW: :bw + BY: :by + BZ: :bz + CA: :ca + CD: :cd + CF: :cf + CG: :cg + CH: :ch + CI: :ci + CL: :cl + CM: :cm + CN: :cn + CO: :co + CR: :cr + CV: :cv + CW: :cw + CY: :cy + CZ: :cz + DE: :de + DJ: :dj + DK: :dk + DM: :dm + DO: :do + DZ: :dz + EC: :ec + EE: :ee + EG: :eg + ES: :es + ET: :et + FI: :fi + FJ: :fj + FR: :fr + GA: :ga + GB: :gb + GD: :gd + GE: :ge + GF: :gf + GG: :gg + GH: :gh + GM: :gm + GN: :gn + GP: :gp + GQ: :gq + GR: :gr + GT: :gt + GU: :gu + GW: :gw + GY: :gy + HK: :hk + HN: :hn + HR: :hr + HT: :ht + HU: :hu + ID: :id + IE: :ie + IL: :il + IM: :im + IN: :in + IQ: :iq + IR: :ir + IS: :is + IT: :it + JE: :je + JM: :jm + JO: :jo + JP: :jp + KE: :ke + KG: :kg + KH: :kh + KN: :kn + KR: :kr + KW: :kw + KY: :ky + KZ: :kz + LA: :la + LB: :lb + LC: :lc + LK: :lk + LR: :lr + LS: :ls + LT: :lt + LU: :lu + LV: :lv + LY: :ly + MA: :ma + MC: :mc + MD: :md + ME: :me + MF: :mf + MG: :mg + MK: :mk + ML: :ml + MM: :mm + MN: :mn + MO: :mo + MQ: :mq + MR: :mr + MT: :mt + MU: :mu + MV: :mv + MW: :mw + MX: :mx + MY: :my + MZ: :mz + NA: :na + NC: :nc + NE: :ne + NG: :ng + NI: :ni + NL: :nl + NO: :no + NP: :np + NZ: :nz + OM: :om + PA: :pa + PE: :pe + PF: :pf + PG: :pg + PH: :ph + PK: :pk + PL: :pl + PR: :pr + PS: :ps + PT: :pt + PY: :py + QA: :qa + RE: :re + RO: :ro + RS: :rs + RU: :ru + RW: :rw + SA: :sa + SC: :sc + SD: :sd + SE: :se + SG: :sg + SI: :si + SK: :sk + SL: :sl + SM: :sm + SN: :sn + SO: :so + SR: :sr + SS: :ss + ST: :st + SV: :sv + SX: :sx + SY: :sy + SZ: :sz + TC: :tc + TD: :td + TG: :tg + TH: :th + TJ: :tj + TL: :tl + TM: :tm + TN: :tn + TR: :tr + TT: :tt + TW: :tw + TZ: :tz + UA: :ua + UG: :ug + US: :us + UY: :uy + UZ: :uz + VC: :vc + VE: :ve + VG: :vg + VI: :vi + VN: :vn + YE: :ye + YT: :yt + ZA: :za + ZM: :zm + ZW: :zw + + def self?.values: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::country] + end + + type pdf = + { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse, + start: Integer + } + + class Pdf < ContextDev::Internal::Type::BaseModel + attr_reader end_: Integer? + + def end_=: (Integer) -> Integer + + attr_reader ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr? + + def ocr=: ( + ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr + ) -> ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr + + attr_reader should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse? + + def should_parse=: ( + ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse + ) -> ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse + + attr_reader start: Integer? + + def start=: (Integer) -> Integer + + def initialize: ( + ?end_: Integer, + ?ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr, + ?should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse, + ?start: Integer + ) -> void + + def to_hash: -> { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse, + start: Integer + } + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::ocr] + + TRUE: :true + FALSE: :false + end + + type should_parse = bool | :true | :false + + module ShouldParse + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::Markdown::Options::Pdf::should_parse] + + TRUE: :true + FALSE: :false + end + end + end + end + + type html = + { + format_: :html, + source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::source, + options: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options + } + + class HTML < ContextDev::Internal::Type::BaseModel + attr_accessor format_: :html + + attr_accessor source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::source + + attr_reader options: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options? + + def options=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options + + def initialize: ( + source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::source, + ?options: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options, + ?format_: :html + ) -> void + + def to_hash: -> { + format_: :html, + source: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::source, + options: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options + } + + type source = + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL + | ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap + + module Source + extend ContextDev::Internal::Type::Union + + type start_url = + { + type: :start_url, + url: String, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls + } + + class StartURL < ContextDev::Internal::Type::BaseModel + attr_accessor type: :start_url + + attr_accessor url: String + + attr_reader controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls? + + def controls=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls + + def initialize: ( + url: String, + ?controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls, + ?type: :start_url + ) -> void + + def to_hash: -> { + type: :start_url, + url: String, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::StartURL::Controls + } + + type controls = + { + follow_subdomains: bool, + max_depth: Integer, + max_urls: Integer, + regex: String + } + + class Controls < ContextDev::Internal::Type::BaseModel + attr_reader follow_subdomains: bool? + + def follow_subdomains=: (bool) -> bool + + attr_reader max_depth: Integer? + + def max_depth=: (Integer) -> Integer + + attr_reader max_urls: Integer? + + def max_urls=: (Integer) -> Integer + + attr_reader regex: String? + + def regex=: (String) -> String + + def initialize: ( + ?follow_subdomains: bool, + ?max_depth: Integer, + ?max_urls: Integer, + ?regex: String + ) -> void + + def to_hash: -> { + follow_subdomains: bool, + max_depth: Integer, + max_urls: Integer, + regex: String + } + end + end + + type sitemap = + { + domain: String, + type: :sitemap, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls + } + + class Sitemap < ContextDev::Internal::Type::BaseModel + attr_accessor domain: String + + attr_accessor type: :sitemap + + attr_reader controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls? + + def controls=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls + + def initialize: ( + domain: String, + ?controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls, + ?type: :sitemap + ) -> void + + def to_hash: -> { + domain: String, + type: :sitemap, + controls: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Source::Sitemap::Controls + } + + type controls = { max_urls: Integer, regex: String } + + class Controls < ContextDev::Internal::Type::BaseModel + attr_reader max_urls: Integer? + + def max_urls=: (Integer) -> Integer + + attr_reader regex: String? + + def regex=: (String) -> String + + def initialize: (?max_urls: Integer, ?regex: String) -> void + + def to_hash: -> { max_urls: Integer, regex: String } + end + end + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::source] + end + + type options = + { + country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country, + exclude_selectors: ::Array[String]?, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf, + settle_animations: bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + class Options < ContextDev::Internal::Type::BaseModel + attr_reader country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country? + + def country=: ( + ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country + ) -> ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country + + attr_accessor exclude_selectors: ::Array[String]? + + attr_accessor include_selectors: ::Array[String]? + + attr_accessor max_age_ms: Integer? + + attr_reader pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf? + + def pdf=: ( + ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf + ) -> ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf + + attr_reader settle_animations: bool? + + def settle_animations=: (bool) -> bool + + attr_reader use_main_content_only: bool? + + def use_main_content_only=: (bool) -> bool + + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + + def initialize: ( + ?country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country, + ?exclude_selectors: ::Array[String]?, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, + ?pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf, + ?settle_animations: bool, + ?use_main_content_only: bool, + ?wait_for_ms: Integer + ) -> void + + def to_hash: -> { + country: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country, + exclude_selectors: ::Array[String]?, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, + pdf: ContextDev::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf, + settle_animations: bool, + use_main_content_only: bool, + wait_for_ms: Integer + } + + type country = + :ad + | :ae + | :af + | :ag + | :ai + | :al + | :am + | :ao + | :ar + | :at + | :au + | :aw + | :az + | :ba + | :bb + | :bd + | :be + | :bf + | :bg + | :bh + | :bi + | :bj + | :bm + | :bn + | :bo + | :bq + | :br + | :bs + | :bw + | :by + | :bz + | :ca + | :cd + | :cf + | :cg + | :ch + | :ci + | :cl + | :cm + | :cn + | :co + | :cr + | :cv + | :cw + | :cy + | :cz + | :de + | :dj + | :dk + | :dm + | :do + | :dz + | :ec + | :ee + | :eg + | :es + | :et + | :fi + | :fj + | :fr + | :ga + | :gb + | :gd + | :ge + | :gf + | :gg + | :gh + | :gm + | :gn + | :gp + | :gq + | :gr + | :gt + | :gu + | :gw + | :gy + | :hk + | :hn + | :hr + | :ht + | :hu + | :id + | :ie + | :il + | :im + | :in + | :iq + | :ir + | :is + | :it + | :je + | :jm + | :jo + | :jp + | :ke + | :kg + | :kh + | :kn + | :kr + | :kw + | :ky + | :kz + | :la + | :lb + | :lc + | :lk + | :lr + | :ls + | :lt + | :lu + | :lv + | :ly + | :ma + | :mc + | :md + | :me + | :mf + | :mg + | :mk + | :ml + | :mm + | :mn + | :mo + | :mq + | :mr + | :mt + | :mu + | :mv + | :mw + | :mx + | :my + | :mz + | :na + | :nc + | :ne + | :ng + | :ni + | :nl + | :no + | :np + | :nz + | :om + | :pa + | :pe + | :pf + | :pg + | :ph + | :pk + | :pl + | :pr + | :ps + | :pt + | :py + | :qa + | :re + | :ro + | :rs + | :ru + | :rw + | :sa + | :sc + | :sd + | :se + | :sg + | :si + | :sk + | :sl + | :sm + | :sn + | :so + | :sr + | :ss + | :st + | :sv + | :sx + | :sy + | :sz + | :tc + | :td + | :tg + | :th + | :tj + | :tl + | :tm + | :tn + | :tr + | :tt + | :tw + | :tz + | :ua + | :ug + | :us + | :uy + | :uz + | :vc + | :ve + | :vg + | :vi + | :vn + | :ye + | :yt + | :za + | :zm + | :zw + + module Country + extend ContextDev::Internal::Type::Enum + + AD: :ad + AE: :ae + AF: :af + AG: :ag + AI: :ai + AL: :al + AM: :am + AO: :ao + AR: :ar + AT: :at + AU: :au + AW: :aw + AZ: :az + BA: :ba + BB: :bb + BD: :bd + BE: :be + BF: :bf + BG: :bg + BH: :bh + BI: :bi + BJ: :bj + BM: :bm + BN: :bn + BO: :bo + BQ: :bq + BR: :br + BS: :bs + BW: :bw + BY: :by + BZ: :bz + CA: :ca + CD: :cd + CF: :cf + CG: :cg + CH: :ch + CI: :ci + CL: :cl + CM: :cm + CN: :cn + CO: :co + CR: :cr + CV: :cv + CW: :cw + CY: :cy + CZ: :cz + DE: :de + DJ: :dj + DK: :dk + DM: :dm + DO: :do + DZ: :dz + EC: :ec + EE: :ee + EG: :eg + ES: :es + ET: :et + FI: :fi + FJ: :fj + FR: :fr + GA: :ga + GB: :gb + GD: :gd + GE: :ge + GF: :gf + GG: :gg + GH: :gh + GM: :gm + GN: :gn + GP: :gp + GQ: :gq + GR: :gr + GT: :gt + GU: :gu + GW: :gw + GY: :gy + HK: :hk + HN: :hn + HR: :hr + HT: :ht + HU: :hu + ID: :id + IE: :ie + IL: :il + IM: :im + IN: :in + IQ: :iq + IR: :ir + IS: :is + IT: :it + JE: :je + JM: :jm + JO: :jo + JP: :jp + KE: :ke + KG: :kg + KH: :kh + KN: :kn + KR: :kr + KW: :kw + KY: :ky + KZ: :kz + LA: :la + LB: :lb + LC: :lc + LK: :lk + LR: :lr + LS: :ls + LT: :lt + LU: :lu + LV: :lv + LY: :ly + MA: :ma + MC: :mc + MD: :md + ME: :me + MF: :mf + MG: :mg + MK: :mk + ML: :ml + MM: :mm + MN: :mn + MO: :mo + MQ: :mq + MR: :mr + MT: :mt + MU: :mu + MV: :mv + MW: :mw + MX: :mx + MY: :my + MZ: :mz + NA: :na + NC: :nc + NE: :ne + NG: :ng + NI: :ni + NL: :nl + NO: :no + NP: :np + NZ: :nz + OM: :om + PA: :pa + PE: :pe + PF: :pf + PG: :pg + PH: :ph + PK: :pk + PL: :pl + PR: :pr + PS: :ps + PT: :pt + PY: :py + QA: :qa + RE: :re + RO: :ro + RS: :rs + RU: :ru + RW: :rw + SA: :sa + SC: :sc + SD: :sd + SE: :se + SG: :sg + SI: :si + SK: :sk + SL: :sl + SM: :sm + SN: :sn + SO: :so + SR: :sr + SS: :ss + ST: :st + SV: :sv + SX: :sx + SY: :sy + SZ: :sz + TC: :tc + TD: :td + TG: :tg + TH: :th + TJ: :tj + TL: :tl + TM: :tm + TN: :tn + TR: :tr + TT: :tt + TW: :tw + TZ: :tz + UA: :ua + UG: :ug + US: :us + UY: :uy + UZ: :uz + VC: :vc + VE: :ve + VG: :vg + VI: :vi + VN: :vn + YE: :ye + YT: :yt + ZA: :za + ZM: :zm + ZW: :zw + + def self?.values: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::country] + end + + type pdf = + { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse, + start: Integer + } + + class Pdf < ContextDev::Internal::Type::BaseModel + attr_reader end_: Integer? + + def end_=: (Integer) -> Integer + + attr_reader ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr? + + def ocr=: ( + ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr + ) -> ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr + + attr_reader should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse? + + def should_parse=: ( + ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse + ) -> ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse + + attr_reader start: Integer? + + def start=: (Integer) -> Integer + + def initialize: ( + ?end_: Integer, + ?ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr, + ?should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse, + ?start: Integer + ) -> void + + def to_hash: -> { + end_: Integer, + ocr: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr, + should_parse: ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse, + start: Integer + } + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::ocr] + + TRUE: :true + FALSE: :false + end + + type should_parse = bool | :true | :false + + module ShouldParse + extend ContextDev::Internal::Type::Union - class Identifiers < ContextDev::Internal::Type::BaseModel - attr_reader linkedin_url: String? + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::HTML::Options::Pdf::should_parse] - def linkedin_url=: (String) -> String + TRUE: :true + FALSE: :false + end + end + end + end - def initialize: (?linkedin_url: String) -> void + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::Input::Crawl::data] + end + end - def to_hash: -> { linkedin_url: String } + def self?.variants: -> ::Array[ContextDev::Models::BatchSubmitParams::input] end end end diff --git a/sig/context_dev/models/batch_submit_response.rbs b/sig/context_dev/models/batch_submit_response.rbs index 5d71f18a..0ac4fba2 100644 --- a/sig/context_dev/models/batch_submit_response.rbs +++ b/sig/context_dev/models/batch_submit_response.rbs @@ -2,519 +2,131 @@ module ContextDev module Models type batch_submit_response = { - code: ContextDev::Models::BatchSubmitResponse::code, - metadata: ContextDev::Models::BatchSubmitResponse::Metadata, - person: ContextDev::Models::BatchSubmitResponse::Person, + id: String, + crawl: ContextDev::CrawlControls?, + created_at: String, + credits: ContextDev::Models::BatchSubmitResponse::Credits, + format_: ContextDev::Models::BatchSubmitResponse::format_, + input: ContextDev::Intake, + invalid_urls: ::Array[ContextDev::Models::BatchSubmitResponse::InvalidURL], + mode: ContextDev::Models::BatchSubmitResponse::mode, status: ContextDev::Models::BatchSubmitResponse::status, - key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata + tags: ::Array[String], + key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata, + webhook_secret: String } class BatchSubmitResponse < ContextDev::Internal::Type::BaseModel - attr_accessor code: ContextDev::Models::BatchSubmitResponse::code + attr_accessor id: String - attr_accessor metadata: ContextDev::Models::BatchSubmitResponse::Metadata + attr_accessor crawl: ContextDev::CrawlControls? - attr_accessor person: ContextDev::Models::BatchSubmitResponse::Person + attr_accessor created_at: String + + attr_accessor credits: ContextDev::Models::BatchSubmitResponse::Credits + + attr_accessor format_: ContextDev::Models::BatchSubmitResponse::format_ + + attr_accessor input: ContextDev::Intake + + attr_accessor invalid_urls: ::Array[ContextDev::Models::BatchSubmitResponse::InvalidURL] + + attr_accessor mode: ContextDev::Models::BatchSubmitResponse::mode attr_accessor status: ContextDev::Models::BatchSubmitResponse::status + attr_accessor tags: ::Array[String] + attr_reader key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata? def key_metadata=: ( ContextDev::Models::BatchSubmitResponse::KeyMetadata ) -> ContextDev::Models::BatchSubmitResponse::KeyMetadata + attr_reader webhook_secret: String? + + def webhook_secret=: (String) -> String + def initialize: ( - code: ContextDev::Models::BatchSubmitResponse::code, - metadata: ContextDev::Models::BatchSubmitResponse::Metadata, - person: ContextDev::Models::BatchSubmitResponse::Person, + id: String, + crawl: ContextDev::CrawlControls?, + created_at: String, + credits: ContextDev::Models::BatchSubmitResponse::Credits, + format_: ContextDev::Models::BatchSubmitResponse::format_, + input: ContextDev::Intake, + invalid_urls: ::Array[ContextDev::Models::BatchSubmitResponse::InvalidURL], + mode: ContextDev::Models::BatchSubmitResponse::mode, status: ContextDev::Models::BatchSubmitResponse::status, - ?key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata + tags: ::Array[String], + ?key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata, + ?webhook_secret: String ) -> void def to_hash: -> { - code: ContextDev::Models::BatchSubmitResponse::code, - metadata: ContextDev::Models::BatchSubmitResponse::Metadata, - person: ContextDev::Models::BatchSubmitResponse::Person, + id: String, + crawl: ContextDev::CrawlControls?, + created_at: String, + credits: ContextDev::Models::BatchSubmitResponse::Credits, + format_: ContextDev::Models::BatchSubmitResponse::format_, + input: ContextDev::Intake, + invalid_urls: ::Array[ContextDev::Models::BatchSubmitResponse::InvalidURL], + mode: ContextDev::Models::BatchSubmitResponse::mode, status: ContextDev::Models::BatchSubmitResponse::status, - key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata + tags: ::Array[String], + key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata, + webhook_secret: String } - type code = 200 + type credits = { reserved: Integer } - module Code - extend ContextDev::Internal::Type::Enum + class Credits < ContextDev::Internal::Type::BaseModel + attr_accessor reserved: Integer - CODE_200: 200 + def initialize: (reserved: Integer) -> void - def self?.values: -> ::Array[ContextDev::Models::BatchSubmitResponse::code] + def to_hash: -> { reserved: Integer } end - type metadata = - { - identifiers: ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers, - sources_attempted: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_attempted], - sources_succeeded: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_succeeded], - urls_analyzed: ::Array[String], - personal_website_url: String - } - - class Metadata < ContextDev::Internal::Type::BaseModel - attr_accessor identifiers: ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers - - attr_accessor sources_attempted: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_attempted] - - attr_accessor sources_succeeded: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_succeeded] - - attr_accessor urls_analyzed: ::Array[String] - - attr_reader personal_website_url: String? - - def personal_website_url=: (String) -> String - - def initialize: ( - identifiers: ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers, - sources_attempted: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_attempted], - sources_succeeded: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_succeeded], - urls_analyzed: ::Array[String], - ?personal_website_url: String - ) -> void - - def to_hash: -> { - identifiers: ContextDev::Models::BatchSubmitResponse::Metadata::Identifiers, - sources_attempted: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_attempted], - sources_succeeded: ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_succeeded], - urls_analyzed: ::Array[String], - personal_website_url: String - } - - type identifiers = { linkedin_url: String } - - class Identifiers < ContextDev::Internal::Type::BaseModel - attr_reader linkedin_url: String? - - def linkedin_url=: (String) -> String - - def initialize: (?linkedin_url: String) -> void - - def to_hash: -> { linkedin_url: String } - end + type format_ = :markdown | :html - type sources_attempted = :linkedin | :cv | :manual | :github | :other - - module SourcesAttempted - extend ContextDev::Internal::Type::Enum - - LINKEDIN: :linkedin - CV: :cv - MANUAL: :manual - GITHUB: :github - OTHER: :other - - def self?.values: -> ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_attempted] - end - - type sources_succeeded = :linkedin | :cv | :manual | :github | :other - - module SourcesSucceeded - extend ContextDev::Internal::Type::Enum + module Format + extend ContextDev::Internal::Type::Enum - LINKEDIN: :linkedin - CV: :cv - MANUAL: :manual - GITHUB: :github - OTHER: :other + MARKDOWN: :markdown + HTML: :html - def self?.values: -> ::Array[ContextDev::Models::BatchSubmitResponse::Metadata::sources_succeeded] - end + def self?.values: -> ::Array[ContextDev::Models::BatchSubmitResponse::format_] end - type person = - { - education: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Education], - experience: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Experience], - profile: ContextDev::Models::BatchSubmitResponse::Person::Profile, - skills: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Skill] - } - - class Person < ContextDev::Internal::Type::BaseModel - attr_accessor education: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Education] - - attr_accessor experience: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Experience] - - attr_accessor profile: ContextDev::Models::BatchSubmitResponse::Person::Profile - - attr_accessor skills: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Skill] - - def initialize: ( - education: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Education], - experience: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Experience], - profile: ContextDev::Models::BatchSubmitResponse::Person::Profile, - skills: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Skill] - ) -> void - - def to_hash: -> { - education: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Education], - experience: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Experience], - profile: ContextDev::Models::BatchSubmitResponse::Person::Profile, - skills: ::Array[ContextDev::Models::BatchSubmitResponse::Person::Skill] - } - - type education = - { - institution: ContextDev::Models::BatchSubmitResponse::Person::Education::Institution, - dates: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates, - description: String, - field_of_study: String, - qualification: String - } - - class Education < ContextDev::Internal::Type::BaseModel - attr_accessor institution: ContextDev::Models::BatchSubmitResponse::Person::Education::Institution - - attr_reader dates: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates? - - def dates=: ( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates - ) -> ContextDev::Models::BatchSubmitResponse::Person::Education::Dates - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader field_of_study: String? - - def field_of_study=: (String) -> String - - attr_reader qualification: String? - - def qualification=: (String) -> String - - def initialize: ( - institution: ContextDev::Models::BatchSubmitResponse::Person::Education::Institution, - ?dates: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates, - ?description: String, - ?field_of_study: String, - ?qualification: String - ) -> void - - def to_hash: -> { - institution: ContextDev::Models::BatchSubmitResponse::Person::Education::Institution, - dates: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates, - description: String, - field_of_study: String, - qualification: String - } - - type institution = { display_: String, normalized: String } - - class Institution < ContextDev::Internal::Type::BaseModel - attr_accessor display_: String - - attr_reader normalized: String? - - def normalized=: (String) -> String - - def initialize: (display_: String, ?normalized: String) -> void - - def to_hash: -> { display_: String, normalized: String } - end - - type dates = - { - end_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate, - is_current: bool, - start_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - } - - class Dates < ContextDev::Internal::Type::BaseModel - attr_reader end_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate? - - def end_date=: ( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate - ) -> ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate - - attr_reader is_current: bool? - - def is_current=: (bool) -> bool - - attr_reader start_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate? - - def start_date=: ( - ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - ) -> ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - - def initialize: ( - ?end_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate, - ?is_current: bool, - ?start_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - ) -> void - - def to_hash: -> { - end_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::EndDate, - is_current: bool, - start_date: ContextDev::Models::BatchSubmitResponse::Person::Education::Dates::StartDate - } + type invalid_url = { reason: String, url: String } - type end_date = { year: Integer, day: Integer, month: Integer } + class InvalidURL < ContextDev::Internal::Type::BaseModel + attr_accessor reason: String - class EndDate < ContextDev::Internal::Type::BaseModel - attr_accessor year: Integer + attr_accessor url: String - attr_reader day: Integer? + def initialize: (reason: String, url: String) -> void - def day=: (Integer) -> Integer - - attr_reader month: Integer? - - def month=: (Integer) -> Integer - - def initialize: ( - year: Integer, - ?day: Integer, - ?month: Integer - ) -> void - - def to_hash: -> { year: Integer, day: Integer, month: Integer } - end - - type start_date = { year: Integer, day: Integer, month: Integer } - - class StartDate < ContextDev::Internal::Type::BaseModel - attr_accessor year: Integer - - attr_reader day: Integer? - - def day=: (Integer) -> Integer - - attr_reader month: Integer? - - def month=: (Integer) -> Integer - - def initialize: ( - year: Integer, - ?day: Integer, - ?month: Integer - ) -> void - - def to_hash: -> { year: Integer, day: Integer, month: Integer } - end - end - end - - type experience = - { - company: ContextDev::Models::BatchSubmitResponse::Person::Experience::Company, - title: String, - dates: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates, - description: String - } - - class Experience < ContextDev::Internal::Type::BaseModel - attr_accessor company: ContextDev::Models::BatchSubmitResponse::Person::Experience::Company - - attr_accessor title: String - - attr_reader dates: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates? - - def dates=: ( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates - ) -> ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates - - attr_reader description: String? - - def description=: (String) -> String - - def initialize: ( - company: ContextDev::Models::BatchSubmitResponse::Person::Experience::Company, - title: String, - ?dates: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates, - ?description: String - ) -> void - - def to_hash: -> { - company: ContextDev::Models::BatchSubmitResponse::Person::Experience::Company, - title: String, - dates: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates, - description: String - } - - type company = { display_: String, normalized: String } - - class Company < ContextDev::Internal::Type::BaseModel - attr_accessor display_: String - - attr_reader normalized: String? - - def normalized=: (String) -> String - - def initialize: (display_: String, ?normalized: String) -> void - - def to_hash: -> { display_: String, normalized: String } - end - - type dates = - { - end_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate, - is_current: bool, - start_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - } - - class Dates < ContextDev::Internal::Type::BaseModel - attr_reader end_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate? - - def end_date=: ( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate - ) -> ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate - - attr_reader is_current: bool? - - def is_current=: (bool) -> bool - - attr_reader start_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate? - - def start_date=: ( - ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - ) -> ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - - def initialize: ( - ?end_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate, - ?is_current: bool, - ?start_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - ) -> void - - def to_hash: -> { - end_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::EndDate, - is_current: bool, - start_date: ContextDev::Models::BatchSubmitResponse::Person::Experience::Dates::StartDate - } - - type end_date = { year: Integer, day: Integer, month: Integer } - - class EndDate < ContextDev::Internal::Type::BaseModel - attr_accessor year: Integer - - attr_reader day: Integer? - - def day=: (Integer) -> Integer - - attr_reader month: Integer? - - def month=: (Integer) -> Integer - - def initialize: ( - year: Integer, - ?day: Integer, - ?month: Integer - ) -> void - - def to_hash: -> { year: Integer, day: Integer, month: Integer } - end - - type start_date = { year: Integer, day: Integer, month: Integer } - - class StartDate < ContextDev::Internal::Type::BaseModel - attr_accessor year: Integer - - attr_reader day: Integer? - - def day=: (Integer) -> Integer - - attr_reader month: Integer? - - def month=: (Integer) -> Integer - - def initialize: ( - year: Integer, - ?day: Integer, - ?month: Integer - ) -> void - - def to_hash: -> { year: Integer, day: Integer, month: Integer } - end - end - end - - type profile = - { - full_name: String, - headline: String, - location: String, - profile_picture_url: String, - summary: String - } - - class Profile < ContextDev::Internal::Type::BaseModel - attr_reader full_name: String? - - def full_name=: (String) -> String - - attr_reader headline: String? - - def headline=: (String) -> String - - attr_reader location: String? - - def location=: (String) -> String - - attr_reader profile_picture_url: String? - - def profile_picture_url=: (String) -> String - - attr_reader summary: String? - - def summary=: (String) -> String - - def initialize: ( - ?full_name: String, - ?headline: String, - ?location: String, - ?profile_picture_url: String, - ?summary: String - ) -> void - - def to_hash: -> { - full_name: String, - headline: String, - location: String, - profile_picture_url: String, - summary: String - } - end - - type skill = { name: String, normalized: String, proficiency: String } - - class Skill < ContextDev::Internal::Type::BaseModel - attr_accessor name: String - - attr_reader normalized: String? - - def normalized=: (String) -> String + def to_hash: -> { reason: String, url: String } + end - attr_reader proficiency: String? + type mode = :scrape | :crawl - def proficiency=: (String) -> String + module Mode + extend ContextDev::Internal::Type::Enum - def initialize: ( - name: String, - ?normalized: String, - ?proficiency: String - ) -> void + SCRAPE: :scrape + CRAWL: :crawl - def to_hash: -> { - name: String, - normalized: String, - proficiency: String - } - end + def self?.values: -> ::Array[ContextDev::Models::BatchSubmitResponse::mode] end - type status = :ok + type status = :queued module Status extend ContextDev::Internal::Type::Enum - OK: :ok + QUEUED: :queued def self?.values: -> ::Array[ContextDev::Models::BatchSubmitResponse::status] end diff --git a/sig/context_dev/models/brand_retrieve_response.rbs b/sig/context_dev/models/brand_retrieve_response.rbs index 014b09bb..29e033d3 100644 --- a/sig/context_dev/models/brand_retrieve_response.rbs +++ b/sig/context_dev/models/brand_retrieve_response.rbs @@ -51,6 +51,7 @@ module ContextDev description: String, domain: String, email: String, + employees: ContextDev::Models::BrandRetrieveResponse::Brand::Employees, industries: ContextDev::Models::BrandRetrieveResponse::Brand::Industries, is_nsfw: bool, links: ContextDev::Models::BrandRetrieveResponse::Brand::Links, @@ -94,6 +95,12 @@ module ContextDev def email=: (String) -> String + attr_reader employees: ContextDev::Models::BrandRetrieveResponse::Brand::Employees? + + def employees=: ( + ContextDev::Models::BrandRetrieveResponse::Brand::Employees + ) -> ContextDev::Models::BrandRetrieveResponse::Brand::Employees + attr_reader industries: ContextDev::Models::BrandRetrieveResponse::Brand::Industries? def industries=: ( @@ -149,6 +156,7 @@ module ContextDev ?description: String, ?domain: String, ?email: String, + ?employees: ContextDev::Models::BrandRetrieveResponse::Brand::Employees, ?industries: ContextDev::Models::BrandRetrieveResponse::Brand::Industries, ?is_nsfw: bool, ?links: ContextDev::Models::BrandRetrieveResponse::Brand::Links, @@ -168,6 +176,7 @@ module ContextDev description: String, domain: String, email: String, + employees: ContextDev::Models::BrandRetrieveResponse::Brand::Employees, industries: ContextDev::Models::BrandRetrieveResponse::Brand::Industries, is_nsfw: bool, links: ContextDev::Models::BrandRetrieveResponse::Brand::Links, @@ -339,6 +348,59 @@ module ContextDev def to_hash: -> { hex: String, name: String } end + type employees = + { + exact: Integer, + range: ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range + } + + class Employees < ContextDev::Internal::Type::BaseModel + attr_reader exact: Integer? + + def exact=: (Integer) -> Integer + + attr_reader range: ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range? + + def range=: ( + ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range + ) -> ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range + + def initialize: ( + ?exact: Integer, + ?range: ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range + ) -> void + + def to_hash: -> { + exact: Integer, + range: ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range + } + + type range = + :"1 to 10" + | :"11 to 50" + | :"51 to 200" + | :"201 to 500" + | :"501 to 1000" + | :"1001 to 5000" + | :"5001 to 10000" + | :"10001+" + + module Range + extend ContextDev::Internal::Type::Enum + + RANGE_1_TO_10: :"1 to 10" + RANGE_11_TO_50: :"11 to 50" + RANGE_51_TO_200: :"51 to 200" + RANGE_201_TO_500: :"201 to 500" + RANGE_501_TO_1000: :"501 to 1000" + RANGE_1001_TO_5000: :"1001 to 5000" + RANGE_5001_TO_10000: :"5001 to 10000" + RANGE_10001: :"10001+" + + def self?.values: -> ::Array[ContextDev::Models::BrandRetrieveResponse::Brand::Employees::range] + end + end + type industries = { eic: ::Array[ContextDev::Models::BrandRetrieveResponse::Brand::Industries::Eic] diff --git a/sig/context_dev/models/crawl_controls.rbs b/sig/context_dev/models/crawl_controls.rbs index 943a274b..ed5d76e1 100644 --- a/sig/context_dev/models/crawl_controls.rbs +++ b/sig/context_dev/models/crawl_controls.rbs @@ -37,30 +37,30 @@ module ContextDev } type source = - ContextDev::CrawlControls::Source::UnionMember0 - | ContextDev::CrawlControls::Source::UnionMember1 + ContextDev::CrawlControls::Source::StartURL + | ContextDev::CrawlControls::Source::Sitemap module Source extend ContextDev::Internal::Type::Union - type union_member0 = + type start_url = { - type: ContextDev::Models::CrawlControls::Source::UnionMember0::type_, + type: ContextDev::Models::CrawlControls::Source::StartURL::type_, url: String } - class UnionMember0 < ContextDev::Internal::Type::BaseModel - attr_accessor type: ContextDev::Models::CrawlControls::Source::UnionMember0::type_ + class StartURL < ContextDev::Internal::Type::BaseModel + attr_accessor type: ContextDev::Models::CrawlControls::Source::StartURL::type_ attr_accessor url: String def initialize: ( - type: ContextDev::Models::CrawlControls::Source::UnionMember0::type_, + type: ContextDev::Models::CrawlControls::Source::StartURL::type_, url: String ) -> void def to_hash: -> { - type: ContextDev::Models::CrawlControls::Source::UnionMember0::type_, + type: ContextDev::Models::CrawlControls::Source::StartURL::type_, url: String } @@ -71,29 +71,29 @@ module ContextDev START_URL: :start_url - def self?.values: -> ::Array[ContextDev::Models::CrawlControls::Source::UnionMember0::type_] + def self?.values: -> ::Array[ContextDev::Models::CrawlControls::Source::StartURL::type_] end end - type union_member1 = + type sitemap = { domain: String, - type: ContextDev::Models::CrawlControls::Source::UnionMember1::type_ + type: ContextDev::Models::CrawlControls::Source::Sitemap::type_ } - class UnionMember1 < ContextDev::Internal::Type::BaseModel + class Sitemap < ContextDev::Internal::Type::BaseModel attr_accessor domain: String - attr_accessor type: ContextDev::Models::CrawlControls::Source::UnionMember1::type_ + attr_accessor type: ContextDev::Models::CrawlControls::Source::Sitemap::type_ def initialize: ( domain: String, - type: ContextDev::Models::CrawlControls::Source::UnionMember1::type_ + type: ContextDev::Models::CrawlControls::Source::Sitemap::type_ ) -> void def to_hash: -> { domain: String, - type: ContextDev::Models::CrawlControls::Source::UnionMember1::type_ + type: ContextDev::Models::CrawlControls::Source::Sitemap::type_ } type type_ = :sitemap @@ -103,7 +103,7 @@ module ContextDev SITEMAP: :sitemap - def self?.values: -> ::Array[ContextDev::Models::CrawlControls::Source::UnionMember1::type_] + def self?.values: -> ::Array[ContextDev::Models::CrawlControls::Source::Sitemap::type_] end end diff --git a/sig/context_dev/models/person_enrich_params.rbs b/sig/context_dev/models/person_enrich_params.rbs new file mode 100644 index 00000000..0f874b33 --- /dev/null +++ b/sig/context_dev/models/person_enrich_params.rbs @@ -0,0 +1,199 @@ +module ContextDev + module Models + type person_enrich_params = + { + company: ContextDev::PersonEnrichParams::Company, + education: ::Array[ContextDev::PersonEnrichParams::Education], + email: String, + location: ContextDev::PersonEnrichParams::Location, + name: ContextDev::PersonEnrichParams::Name, + social_urls: ::Array[String], + tags: ::Array[String], + timeout_ms: Integer + } + & ContextDev::Internal::Type::request_parameters + + class PersonEnrichParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_reader company: ContextDev::PersonEnrichParams::Company? + + def company=: ( + ContextDev::PersonEnrichParams::Company + ) -> ContextDev::PersonEnrichParams::Company + + attr_reader education: ::Array[ContextDev::PersonEnrichParams::Education]? + + def education=: ( + ::Array[ContextDev::PersonEnrichParams::Education] + ) -> ::Array[ContextDev::PersonEnrichParams::Education] + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader location: ContextDev::PersonEnrichParams::Location? + + def location=: ( + ContextDev::PersonEnrichParams::Location + ) -> ContextDev::PersonEnrichParams::Location + + attr_reader name: ContextDev::PersonEnrichParams::Name? + + def name=: ( + ContextDev::PersonEnrichParams::Name + ) -> ContextDev::PersonEnrichParams::Name + + attr_reader social_urls: ::Array[String]? + + def social_urls=: (::Array[String]) -> ::Array[String] + + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + + def initialize: ( + ?company: ContextDev::PersonEnrichParams::Company, + ?education: ::Array[ContextDev::PersonEnrichParams::Education], + ?email: String, + ?location: ContextDev::PersonEnrichParams::Location, + ?name: ContextDev::PersonEnrichParams::Name, + ?social_urls: ::Array[String], + ?tags: ::Array[String], + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + company: ContextDev::PersonEnrichParams::Company, + education: ::Array[ContextDev::PersonEnrichParams::Education], + email: String, + location: ContextDev::PersonEnrichParams::Location, + name: ContextDev::PersonEnrichParams::Name, + social_urls: ::Array[String], + tags: ::Array[String], + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + + type company = { domain: String, name: String } + + class Company < ContextDev::Internal::Type::BaseModel + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?domain: String, ?name: String) -> void + + def to_hash: -> { domain: String, name: String } + end + + type education = + { + degree: String, + field_of_study: String, + graduation_year: Integer, + institution: ContextDev::PersonEnrichParams::Education::Institution + } + + class Education < ContextDev::Internal::Type::BaseModel + attr_reader degree: String? + + def degree=: (String) -> String + + attr_reader field_of_study: String? + + def field_of_study=: (String) -> String + + attr_reader graduation_year: Integer? + + def graduation_year=: (Integer) -> Integer + + attr_reader institution: ContextDev::PersonEnrichParams::Education::Institution? + + def institution=: ( + ContextDev::PersonEnrichParams::Education::Institution + ) -> ContextDev::PersonEnrichParams::Education::Institution + + def initialize: ( + ?degree: String, + ?field_of_study: String, + ?graduation_year: Integer, + ?institution: ContextDev::PersonEnrichParams::Education::Institution + ) -> void + + def to_hash: -> { + degree: String, + field_of_study: String, + graduation_year: Integer, + institution: ContextDev::PersonEnrichParams::Education::Institution + } + + type institution = { domain: String, name: String } + + class Institution < ContextDev::Internal::Type::BaseModel + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?domain: String, ?name: String) -> void + + def to_hash: -> { domain: String, name: String } + end + end + + type location = { city: String, country: String, region: String } + + class Location < ContextDev::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader region: String? + + def region=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?region: String + ) -> void + + def to_hash: -> { city: String, country: String, region: String } + end + + type name_ = { first: String, last: String } + + class Name < ContextDev::Internal::Type::BaseModel + attr_reader first: String? + + def first=: (String) -> String + + attr_reader last: String? + + def last=: (String) -> String + + def initialize: (?first: String, ?last: String) -> void + + def to_hash: -> { first: String, last: String } + end + end + end +end diff --git a/sig/context_dev/models/person_enrich_response.rbs b/sig/context_dev/models/person_enrich_response.rbs new file mode 100644 index 00000000..7b257db9 --- /dev/null +++ b/sig/context_dev/models/person_enrich_response.rbs @@ -0,0 +1,607 @@ +module ContextDev + module Models + type person_enrich_response = + { + match: ContextDev::Models::PersonEnrichResponse::match, + key_metadata: ContextDev::Models::PersonEnrichResponse::KeyMetadata + } + + class PersonEnrichResponse < ContextDev::Internal::Type::BaseModel + attr_accessor match: ContextDev::Models::PersonEnrichResponse::match + + attr_reader key_metadata: ContextDev::Models::PersonEnrichResponse::KeyMetadata? + + def key_metadata=: ( + ContextDev::Models::PersonEnrichResponse::KeyMetadata + ) -> ContextDev::Models::PersonEnrichResponse::KeyMetadata + + def initialize: ( + match: ContextDev::Models::PersonEnrichResponse::match, + ?key_metadata: ContextDev::Models::PersonEnrichResponse::KeyMetadata + ) -> void + + def to_hash: -> { + match: ContextDev::Models::PersonEnrichResponse::match, + key_metadata: ContextDev::Models::PersonEnrichResponse::KeyMetadata + } + + type match = + ContextDev::Models::PersonEnrichResponse::Match::Candidate + | ContextDev::Models::PersonEnrichResponse::Match::NotFound + + module Match + extend ContextDev::Internal::Type::Union + + type candidate = + { + person: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person, + score: Integer, + status: :candidate + } + + class Candidate < ContextDev::Internal::Type::BaseModel + attr_accessor person: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person + + attr_accessor score: Integer + + attr_accessor status: :candidate + + def initialize: ( + person: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person, + score: Integer, + ?status: :candidate + ) -> void + + def to_hash: -> { + person: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person, + score: Integer, + status: :candidate + } + + type person = + { + education: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education], + experience: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience], + skills: ::Array[String], + social_urls: ::Array[String], + website_urls: ::Array[String], + avatar_url: String, + bio: String, + current_role: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole, + email: String, + location: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location, + name: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + } + + class Person < ContextDev::Internal::Type::BaseModel + attr_accessor education: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education] + + attr_accessor experience: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience] + + attr_accessor skills: ::Array[String] + + attr_accessor social_urls: ::Array[String] + + attr_accessor website_urls: ::Array[String] + + attr_reader avatar_url: String? + + def avatar_url=: (String) -> String + + attr_reader bio: String? + + def bio=: (String) -> String + + attr_reader current_role: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole? + + def current_role=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader location: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location? + + def location=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location + + attr_reader name: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name? + + def name=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + + def initialize: ( + education: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education], + experience: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience], + skills: ::Array[String], + social_urls: ::Array[String], + website_urls: ::Array[String], + ?avatar_url: String, + ?bio: String, + ?current_role: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole, + ?email: String, + ?location: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location, + ?name: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + ) -> void + + def to_hash: -> { + education: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education], + experience: ::Array[ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience], + skills: ::Array[String], + social_urls: ::Array[String], + website_urls: ::Array[String], + avatar_url: String, + bio: String, + current_role: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole, + email: String, + location: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Location, + name: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Name + } + + type education = + { + institution: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution, + degree: String, + description: String, + end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate, + field_of_study: String, + start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + } + + class Education < ContextDev::Internal::Type::BaseModel + attr_accessor institution: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution + + attr_reader degree: String? + + def degree=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate? + + def end_date=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate + + attr_reader field_of_study: String? + + def field_of_study=: (String) -> String + + attr_reader start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate? + + def start_date=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + + def initialize: ( + institution: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution, + ?degree: String, + ?description: String, + ?end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate, + ?field_of_study: String, + ?start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + ) -> void + + def to_hash: -> { + institution: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::Institution, + degree: String, + description: String, + end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::EndDate, + field_of_study: String, + start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Education::StartDate + } + + type institution = { name: String, domain: String } + + class Institution < ContextDev::Internal::Type::BaseModel + attr_accessor name: String + + attr_reader domain: String? + + def domain=: (String) -> String + + def initialize: (name: String, ?domain: String) -> void + + def to_hash: -> { name: String, domain: String } + end + + type end_date = { year: Integer, day: Integer, month: Integer } + + class EndDate < ContextDev::Internal::Type::BaseModel + attr_accessor year: Integer + + attr_reader day: Integer? + + def day=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + year: Integer, + ?day: Integer, + ?month: Integer + ) -> void + + def to_hash: -> { year: Integer, day: Integer, month: Integer } + end + + type start_date = { year: Integer, day: Integer, month: Integer } + + class StartDate < ContextDev::Internal::Type::BaseModel + attr_accessor year: Integer + + attr_reader day: Integer? + + def day=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + year: Integer, + ?day: Integer, + ?month: Integer + ) -> void + + def to_hash: -> { year: Integer, day: Integer, month: Integer } + end + end + + type experience = + { + organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization, + title: String, + description: String, + end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate, + is_current: bool, + location: String, + start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + } + + class Experience < ContextDev::Internal::Type::BaseModel + attr_accessor organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization + + attr_accessor title: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate? + + def end_date=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate + + attr_reader is_current: bool? + + def is_current=: (bool) -> bool + + attr_reader location: String? + + def location=: (String) -> String + + attr_reader start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate? + + def start_date=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + + def initialize: ( + organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization, + title: String, + ?description: String, + ?end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate, + ?is_current: bool, + ?location: String, + ?start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + ) -> void + + def to_hash: -> { + organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::Organization, + title: String, + description: String, + end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::EndDate, + is_current: bool, + location: String, + start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::Experience::StartDate + } + + type organization = { name: String, domain: String } + + class Organization < ContextDev::Internal::Type::BaseModel + attr_accessor name: String + + attr_reader domain: String? + + def domain=: (String) -> String + + def initialize: (name: String, ?domain: String) -> void + + def to_hash: -> { name: String, domain: String } + end + + type end_date = { year: Integer, day: Integer, month: Integer } + + class EndDate < ContextDev::Internal::Type::BaseModel + attr_accessor year: Integer + + attr_reader day: Integer? + + def day=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + year: Integer, + ?day: Integer, + ?month: Integer + ) -> void + + def to_hash: -> { year: Integer, day: Integer, month: Integer } + end + + type start_date = { year: Integer, day: Integer, month: Integer } + + class StartDate < ContextDev::Internal::Type::BaseModel + attr_accessor year: Integer + + attr_reader day: Integer? + + def day=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + year: Integer, + ?day: Integer, + ?month: Integer + ) -> void + + def to_hash: -> { year: Integer, day: Integer, month: Integer } + end + end + + type current_role = + { + organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization, + title: String, + description: String, + end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate, + is_current: bool, + location: String, + start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + } + + class CurrentRole < ContextDev::Internal::Type::BaseModel + attr_accessor organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization + + attr_accessor title: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate? + + def end_date=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate + + attr_reader is_current: bool? + + def is_current=: (bool) -> bool + + attr_reader location: String? + + def location=: (String) -> String + + attr_reader start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate? + + def start_date=: ( + ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + ) -> ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + + def initialize: ( + organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization, + title: String, + ?description: String, + ?end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate, + ?is_current: bool, + ?location: String, + ?start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + ) -> void + + def to_hash: -> { + organization: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::Organization, + title: String, + description: String, + end_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::EndDate, + is_current: bool, + location: String, + start_date: ContextDev::Models::PersonEnrichResponse::Match::Candidate::Person::CurrentRole::StartDate + } + + type organization = { name: String, domain: String } + + class Organization < ContextDev::Internal::Type::BaseModel + attr_accessor name: String + + attr_reader domain: String? + + def domain=: (String) -> String + + def initialize: (name: String, ?domain: String) -> void + + def to_hash: -> { name: String, domain: String } + end + + type end_date = { year: Integer, day: Integer, month: Integer } + + class EndDate < ContextDev::Internal::Type::BaseModel + attr_accessor year: Integer + + attr_reader day: Integer? + + def day=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + year: Integer, + ?day: Integer, + ?month: Integer + ) -> void + + def to_hash: -> { year: Integer, day: Integer, month: Integer } + end + + type start_date = { year: Integer, day: Integer, month: Integer } + + class StartDate < ContextDev::Internal::Type::BaseModel + attr_accessor year: Integer + + attr_reader day: Integer? + + def day=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + year: Integer, + ?day: Integer, + ?month: Integer + ) -> void + + def to_hash: -> { year: Integer, day: Integer, month: Integer } + end + end + + type location = + { + city: String, + country: String, + country_code: String, + display_: String, + region: String + } + + class Location < ContextDev::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader country_code: String? + + def country_code=: (String) -> String + + attr_reader display_: String? + + def display_=: (String) -> String + + attr_reader region: String? + + def region=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?country_code: String, + ?display_: String, + ?region: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + country_code: String, + display_: String, + region: String + } + end + + type name_ = { first: String, full: String, last: String } + + class Name < ContextDev::Internal::Type::BaseModel + attr_reader first: String? + + def first=: (String) -> String + + attr_reader full: String? + + def full=: (String) -> String + + attr_reader last: String? + + def last=: (String) -> String + + def initialize: ( + ?first: String, + ?full: String, + ?last: String + ) -> void + + def to_hash: -> { first: String, full: String, last: String } + end + end + end + + type not_found = { person: nil, score: nil, status: :not_found } + + class NotFound < ContextDev::Internal::Type::BaseModel + attr_accessor person: nil + + attr_accessor score: nil + + attr_accessor status: :not_found + + def initialize: (person: nil, score: nil, ?status: :not_found) -> void + + def to_hash: -> { person: nil, score: nil, status: :not_found } + end + + def self?.variants: -> ::Array[ContextDev::Models::PersonEnrichResponse::match] + end + + type key_metadata = + { credits_consumed: Integer, credits_remaining: Integer } + + class KeyMetadata < ContextDev::Internal::Type::BaseModel + attr_accessor credits_consumed: Integer + + attr_accessor credits_remaining: Integer + + def initialize: ( + credits_consumed: Integer, + credits_remaining: Integer + ) -> void + + def to_hash: -> { + credits_consumed: Integer, + credits_remaining: Integer + } + end + end + end +end diff --git a/sig/context_dev/models/web_search_response.rbs b/sig/context_dev/models/web_search_response.rbs index f2f5d958..4ad20474 100644 --- a/sig/context_dev/models/web_search_response.rbs +++ b/sig/context_dev/models/web_search_response.rbs @@ -91,6 +91,7 @@ module ContextDev :SUCCESS | :NOT_REQUESTED | :TIMEOUT + | :CONTENT_TOO_LARGE | :WEBSITE_ACCESS_ERROR | :ERROR @@ -100,6 +101,7 @@ module ContextDev SUCCESS: :SUCCESS NOT_REQUESTED: :NOT_REQUESTED TIMEOUT: :TIMEOUT + CONTENT_TOO_LARGE: :CONTENT_TOO_LARGE WEBSITE_ACCESS_ERROR: :WEBSITE_ACCESS_ERROR ERROR: :ERROR diff --git a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs index aae1007c..b8b3d414 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -5,6 +5,7 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + search: String, sitemap_url: String, tags: ::Array[String], timeout_ms: Integer, @@ -27,6 +28,10 @@ module ContextDev def max_links=: (Integer) -> Integer + attr_reader search: String? + + def search=: (String) -> String + attr_reader sitemap_url: String? def sitemap_url=: (String) -> String @@ -53,6 +58,7 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?search: String, ?sitemap_url: String, ?tags: ::Array[String], ?timeout_ms: Integer, @@ -65,6 +71,7 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + search: String, sitemap_url: String, tags: ::Array[String], timeout_ms: Integer, diff --git a/sig/context_dev/resources/batch.rbs b/sig/context_dev/resources/batch.rbs index be091b9c..4b4d1ae2 100644 --- a/sig/context_dev/resources/batch.rbs +++ b/sig/context_dev/resources/batch.rbs @@ -16,6 +16,11 @@ module ContextDev ?request_options: ContextDev::request_opts ) -> ContextDev::Models::BatchListResponse + def delete: ( + String batch_id, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::BatchDeleteResponse + def cancel: ( String batch_id, ?request_options: ContextDev::request_opts @@ -29,9 +34,10 @@ module ContextDev ) -> ContextDev::Models::BatchGetResultsResponse def submit: ( - identifiers: ContextDev::BatchSubmitParams::Identifiers, + input: ContextDev::Models::BatchSubmitParams::input, ?tags: ::Array[String], - ?timeout_ms: Integer, + ?webhook_url: String, + ?idempotency_key: String, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::BatchSubmitResponse diff --git a/sig/context_dev/resources/people.rbs b/sig/context_dev/resources/people.rbs new file mode 100644 index 00000000..a157b63d --- /dev/null +++ b/sig/context_dev/resources/people.rbs @@ -0,0 +1,19 @@ +module ContextDev + module Resources + class People + def enrich: ( + ?company: ContextDev::PersonEnrichParams::Company, + ?education: ::Array[ContextDev::PersonEnrichParams::Education], + ?email: String, + ?location: ContextDev::PersonEnrichParams::Location, + ?name: ContextDev::PersonEnrichParams::Name, + ?social_urls: ::Array[String], + ?tags: ::Array[String], + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::PersonEnrichResponse + + def initialize: (client: ContextDev::Client) -> void + end + end +end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 1b16a230..256162ed 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -162,6 +162,7 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?search: String, ?sitemap_url: String, ?tags: ::Array[String], ?timeout_ms: Integer, diff --git a/test/context_dev/resources/batch_test.rb b/test/context_dev/resources/batch_test.rb index dbdead45..6f6cdb7d 100644 --- a/test/context_dev/resources/batch_test.rb +++ b/test/context_dev/resources/batch_test.rb @@ -52,6 +52,24 @@ def test_list end end + def test_delete + skip("Mock server tests are disabled") + + response = @context_dev.batch.delete("batch_9f2c8a") + + assert_pattern do + response => ContextDev::Models::BatchDeleteResponse + end + + assert_pattern do + response => { + id: String | nil, + deleted: ContextDev::Internal::Type::Boolean | nil, + key_metadata: ContextDev::Models::BatchDeleteResponse::KeyMetadata | nil + } + end + end + def test_cancel skip("Mock server tests are disabled") @@ -101,7 +119,16 @@ def test_get_results def test_submit_required_params skip("Mock server tests are disabled") - response = @context_dev.batch.submit(identifiers: {}) + response = + @context_dev.batch.submit( + input: { + data: { + format: :markdown, + urls: [{url: "https://example.com/products/anvil"}, {url: "https://example.com/products/hammer"}] + }, + mode: :scrape + } + ) assert_pattern do response => ContextDev::Models::BatchSubmitResponse @@ -109,11 +136,18 @@ def test_submit_required_params assert_pattern do response => { - code: ContextDev::Models::BatchSubmitResponse::Code, - metadata: ContextDev::Models::BatchSubmitResponse::Metadata, - person: ContextDev::Models::BatchSubmitResponse::Person, + id: String, + crawl: ContextDev::CrawlControls | nil, + created_at: String, + credits: ContextDev::Models::BatchSubmitResponse::Credits, + format_: ContextDev::Models::BatchSubmitResponse::Format, + input: ContextDev::Intake, + invalid_urls: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BatchSubmitResponse::InvalidURL]), + mode: ContextDev::Models::BatchSubmitResponse::Mode, status: ContextDev::Models::BatchSubmitResponse::Status, - key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata | nil + tags: ^(ContextDev::Internal::Type::ArrayOf[String]), + key_metadata: ContextDev::Models::BatchSubmitResponse::KeyMetadata | nil, + webhook_secret: String | nil } end end diff --git a/test/context_dev/resources/people_test.rb b/test/context_dev/resources/people_test.rb new file mode 100644 index 00000000..e629d0bd --- /dev/null +++ b/test/context_dev/resources/people_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class ContextDev::Test::Resources::PeopleTest < ContextDev::Test::ResourceTest + def test_enrich + skip("Mock server tests are disabled") + + response = @context_dev.people.enrich + + assert_pattern do + response => ContextDev::Models::PersonEnrichResponse + end + + assert_pattern do + response => { + match: ContextDev::Models::PersonEnrichResponse::Match, + key_metadata: ContextDev::Models::PersonEnrichResponse::KeyMetadata | nil + } + end + end +end