Class: ContextDev::Models::WebWebScrapeHTMLResponse

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

Overview

See Also:

  • ContextDev::Resources::Web#web_scrape_html

Defined Under Namespace

Modules: Success, Type Classes: ActionsApplied, KeyMetadata, 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(html:, metadata:, success:, type:, url:, actions_applied: nil, actions_html_stale: nil, key_metadata: nil) ⇒ Object

Some parameter documentations has been truncated, see ContextDev::Models::WebWebScrapeHTMLResponse for more details.

Parameters:



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

Instance Attribute Details

#actions_appliedArray<ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied>?

One verified outcome per requested browser action, in request order.



46
47
48
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 46

optional :actions_applied,
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied] },
api_name: :actionsApplied

#actions_html_staleBoolean?

True when an action was applied but the returned content could not be refreshed afterward.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


55
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 55

optional :actions_html_stale, ContextDev::Internal::Type::Boolean, api_name: :actionsHtmlStale

#htmlString

The scraped content of the page. For normal pages this is the raw HTML. When the page is a sitemap or feed served behind an XSL stylesheet (which browsers render into HTML), this is the underlying XML instead — see the type field.

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 13

required :html, String

#key_metadataContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata?

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.



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

optional :key_metadata, -> { ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata }

#metadataContextDev::Models::WebWebScrapeHTMLResponse::Metadata

Metadata extracted from the scraped page HTML.



19
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 19

required :metadata, -> { ContextDev::Models::WebWebScrapeHTMLResponse::Metadata }

#successBoolean, ContextDev::Models::WebWebScrapeHTMLResponse::Success

Indicates success

Parameters:

  • value (ContextDev::Models::WebWebScrapeHTMLResponse::success)

Returns:



25
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 25

required :success, enum: -> { ContextDev::Models::WebWebScrapeHTMLResponse::Success }

#typeSymbol, ContextDev::Models::WebWebScrapeHTMLResponse::Type

Detected content type of the returned html field. Sitemaps and feeds are surfaced as xml; ordinary pages are html. Excel workbooks are surfaced as xlsx/xls with the extracted sheets as HTML tables; PowerPoint presentations are surfaced as pptx/ppt with the extracted slides as HTML.

Parameters:

  • value (ContextDev::Models::WebWebScrapeHTMLResponse::type_)

Returns:



34
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 34

required :type, enum: -> { ContextDev::Models::WebWebScrapeHTMLResponse::Type }

#urlString

The URL that was scraped

Parameters:

  • value (String)

Returns:

  • (String)


40
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 40

required :url, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 339

Instance Method Details

#to_hash{

Returns:

  • ({)


53
# File 'sig/context_dev/models/web_web_scrape_html_response.rbs', line 53

def to_hash: -> {