Class: Anthropic::Models::Beta::BetaFileMetadata

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_file_metadata.rb,
sig/anthropic/models/beta/beta_file_metadata.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::Files#list

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 ⇒ BetaFileMetadata

Returns a new instance of BetaFileMetadata.

Parameters:

  • id: (String)
  • created_at: (Time)
  • filename: (String)
  • mime_type: (String)
  • size_bytes: (Integer)
  • downloadable: (Boolean)
  • expires_at: (Time, nil)
  • scope: (Anthropic::Beta::BetaFileScope, nil)
  • type: (:file)


40
41
42
43
44
45
46
47
48
49
50
# File 'sig/anthropic/models/beta/beta_file_metadata.rbs', line 40

def initialize: (
  id: String,
  created_at: Time,
  filename: String,
  mime_type: String,
  size_bytes: Integer,
  ?downloadable: bool,
  ?expires_at: Time?,
  ?scope: Anthropic::Beta::BetaFileScope?,
  ?type: :file
) -> void

Instance Attribute Details

#created_at ⇒ Time

RFC 3339 datetime string representing when the file was created.

Parameters:

  • value (Time)

Returns:

  • (Time)


20
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 20

required :created_at, Time

#downloadable ⇒ Boolean?

Whether the file can be downloaded.

Parameters:

Returns:



52
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 52

optional :downloadable, Anthropic::Internal::Type::Boolean

#expires_at ⇒ Time?

RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with expires_in_seconds, this is the upload time plus that value.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


60
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 60

optional :expires_at, Time, nil?: true

#filename ⇒ String

Original filename of the uploaded file.

Parameters:

  • value (String)

Returns:

  • (String)


26
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 26

required :filename, String

#id ⇒ String

Unique object identifier.

The format and length of IDs may change over time.

Parameters:

  • value (String)

Returns:

  • (String)


14
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 14

required :id, String

#mime_type ⇒ String

MIME type of the file.

Parameters:

  • value (String)

Returns:

  • (String)


32
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 32

required :mime_type, String

#scope ⇒ Anthropic::Models::Beta::BetaFileScope?

The scope of this file, indicating the context in which it was created (e.g., a session).

Parameters:

  • value (Anthropic::Beta::BetaFileScope, nil)

Returns:



67
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 67

optional :scope, -> { Anthropic::Beta::BetaFileScope }, nil?: true

#size_bytes ⇒ Integer

Size of the file in bytes.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


38
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 38

required :size_bytes, Integer

#type ⇒ Symbol, :file

Object type.

For files, this is always "file".

Parameters:

  • value (:file)

Returns:

  • (Symbol, :file)


46
# File 'lib/anthropic/models/beta/beta_file_metadata.rb', line 46

required :type, const: :file

Instance Method Details

#to_hash ⇒ { id: String, created_at: Time, filename: String, mime_type: String, size_bytes: Integer, type: :file, downloadable: bool, expires_at: Time?, scope: Anthropic::Beta::BetaFileScope? }

Returns:

  • ({ id: String, created_at: Time, filename: String, mime_type: String, size_bytes: Integer, type: :file, downloadable: bool, expires_at: Time?, scope: Anthropic::Beta::BetaFileScope? })


52
53
54
55
56
57
58
59
60
61
62
# File 'sig/anthropic/models/beta/beta_file_metadata.rbs', line 52

def to_hash: -> {
  id: String,
  created_at: Time,
  filename: String,
  mime_type: String,
  size_bytes: Integer,
  type: :file,
  downloadable: bool,
  expires_at: Time?,
  scope: Anthropic::Beta::BetaFileScope?
}