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: Metadata

Instance Attribute 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(final_url:, http_status:, metadata:, url:, html: nil, item_id: nil, markdown: nil, meta: nil, status: :ok) ⇒ Object

A page the batch fetched successfully.

Parameters:

  • 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)

    Raw page HTML. Present on html batches.

  • 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.

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

    The page was scraped.



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

Instance Attribute Details

#final_urlString

URL the content was read from, after redirects.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :final_url, String

#htmlString?

Raw page HTML. Present on html batches.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :html, String

#http_statusInteger?

HTTP status of the final response, when known.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

required :http_status, Integer, nil?: true

#item_idString?

Caller-supplied identifier echoed from submission.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :item_id, String, api_name: :itemId

#markdownString?

Page content as Markdown. Present on markdown batches.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :markdown, String

#metaHash{Symbol=>Object}?

Caller-supplied metadata echoed from submission.

Parameters:

  • (::Hash[Symbol, top])

Returns:

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


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

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

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

Metadata extracted from the scraped page HTML.



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

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

#statusSymbol, :ok

The page was scraped.

Parameters:

  • value (:ok)

Returns:

  • (Symbol, :ok)


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

required :status, const: :ok

#urlString

URL as submitted, or as discovered by the crawl.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :url, String

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {