Class: ContextDev::Models::BatchGetResultsResponse::Data::Ok

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/context_dev/models/batch_get_results_response.rb,
sig/context_dev/models/batch_get_results_response.rbs

Defined Under Namespace

Classes: CacheMetadata, Metadata

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(cache_metadata:, final_url:, http_status:, metadata:, url:, html: nil, item_id: nil, markdown: nil, meta: nil, ocr_pages: nil, status: :ok) ⇒ Object

Some parameter documentations has been truncated, see ContextDev::Models::BatchGetResultsResponse::Data::Ok for more details.

A page the batch fetched successfully.

Parameters:

  • cache_metadata (ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata)

    Cache outcome for this response. Composite responses are hits only when every ca

  • final_url (String)

    URL the content was read from, after redirects.

  • http_status (Integer, nil)

    HTTP status of the final response, when known.

  • metadata (ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata)

    Metadata extracted from the scraped page HTML.

  • url (String)

    URL as submitted, or as discovered by the crawl.

  • html (String) (defaults to: nil)

    Page HTML. Present on html batches, and on markdown batches submitted with `opti

  • item_id (String) (defaults to: nil)

    Caller-supplied identifier echoed from submission.

  • markdown (String) (defaults to: nil)

    Page content as Markdown. Present on markdown batches.

  • meta (Hash{Symbol=>Object}) (defaults to: nil)

    Caller-supplied metadata echoed from submission.

  • ocr_pages (Integer) (defaults to: nil)

    PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page

  • status (Symbol, :ok) (defaults to: :ok)

    The page was scraped.



# File 'lib/context_dev/models/batch_get_results_response.rb', line 128

Instance Attribute Details

#cache_metadataContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata

Cache outcome for this response. Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.



64
# File 'lib/context_dev/models/batch_get_results_response.rb', line 64

required :cache_metadata, -> { ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata }

#final_urlString

URL the content was read from, after redirects.

Parameters:

  • value (String)

Returns:

  • (String)


70
# File 'lib/context_dev/models/batch_get_results_response.rb', line 70

required :final_url, String

#htmlString?

Page HTML. Present on html batches, and on markdown batches submitted with options.includeHTML.

Parameters:

  • (String)

Returns:

  • (String, nil)


101
# File 'lib/context_dev/models/batch_get_results_response.rb', line 101

optional :html, String

#http_statusInteger?

HTTP status of the final response, when known.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


76
# File 'lib/context_dev/models/batch_get_results_response.rb', line 76

required :http_status, Integer, nil?: true

#item_idString?

Caller-supplied identifier echoed from submission.

Parameters:

  • (String)

Returns:

  • (String, nil)


107
# File 'lib/context_dev/models/batch_get_results_response.rb', line 107

optional :item_id, String, api_name: :itemId

#markdownString?

Page content as Markdown. Present on markdown batches.

Parameters:

  • (String)

Returns:

  • (String, nil)


113
# File 'lib/context_dev/models/batch_get_results_response.rb', line 113

optional :markdown, String

#metaHash{Symbol=>Object}?

Caller-supplied metadata echoed from submission.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


119
# File 'lib/context_dev/models/batch_get_results_response.rb', line 119

optional :meta, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]

#metadataContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata

Metadata extracted from the scraped page HTML.



82
# File 'lib/context_dev/models/batch_get_results_response.rb', line 82

required :metadata, -> { ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata }

#ocr_pagesInteger?

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.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


126
# File 'lib/context_dev/models/batch_get_results_response.rb', line 126

optional :ocr_pages, Integer

#statusSymbol, :ok

The page was scraped.

Parameters:

  • value (:ok)

Returns:

  • (Symbol, :ok)


88
# File 'lib/context_dev/models/batch_get_results_response.rb', line 88

required :status, const: :ok

#urlString

URL as submitted, or as discovered by the crawl.

Parameters:

  • value (String)

Returns:

  • (String)


94
# File 'lib/context_dev/models/batch_get_results_response.rb', line 94

required :url, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/batch_get_results_response.rb', line 196

Instance Method Details

#to_hash{

Returns:

  • ({)


113
# File 'sig/context_dev/models/batch_get_results_response.rbs', line 113

def to_hash: -> {