Class: ContextDev::Models::WebScreenshotResponse

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

Overview

See Also:

  • ContextDev::Resources::Web#screenshot

Defined Under Namespace

Modules: ScreenshotType Classes: CacheMetadata, KeyMetadata

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(credits_consumed:, credits_remaining:) ⇒ Object

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.

Parameters:

  • credits_consumed (Integer)

    The number of credits consumed by this request.

  • credits_remaining (Integer)

    The number of credits remaining for your organization after this request.



# File 'lib/context_dev/models/web_screenshot_response.rb', line 67

Instance Attribute Details

#cache_metadataContextDev::Models::WebScreenshotResponse::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.



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

required :cache_metadata, -> { ContextDev::Models::WebScreenshotResponse::CacheMetadata }

#codeInteger?

HTTP status code

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :code, Integer

#domainString?

The normalized domain that was processed

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :domain, String

#heightInteger?

Height in pixels of the returned screenshot image

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


31
# File 'lib/context_dev/models/web_screenshot_response.rb', line 31

optional :height, Integer

#key_metadataContextDev::Models::WebScreenshotResponse::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.



38
# File 'lib/context_dev/models/web_screenshot_response.rb', line 38

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

#screenshotString?

Public image URL for standard requests, or an in-memory data URL when ZDR is enabled.

Parameters:

  • (String)

Returns:

  • (String, nil)


45
# File 'lib/context_dev/models/web_screenshot_response.rb', line 45

optional :screenshot, String

#screenshot_typeSymbol, ...

Type of screenshot that was captured



51
52
53
# File 'lib/context_dev/models/web_screenshot_response.rb', line 51

optional :screenshot_type,
enum: -> { ContextDev::Models::WebScreenshotResponse::ScreenshotType },
api_name: :screenshotType

#statusString?

Status of the response, e.g., 'ok'

Parameters:

  • (String)

Returns:

  • (String, nil)


59
# File 'lib/context_dev/models/web_screenshot_response.rb', line 59

optional :status, String

#widthInteger?

Width in pixels of the returned screenshot image

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


65
# File 'lib/context_dev/models/web_screenshot_response.rb', line 65

optional :width, Integer

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/web_screenshot_response.rb', line 127

Instance Method Details

#to_hash{

Returns:

  • ({)


67
# File 'sig/context_dev/models/web_screenshot_response.rbs', line 67

def to_hash: -> {