Class: SafetyKit::Models::ContentCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/safety_kit/models/content_create_params.rb,
sig/safety_kit/models/content_create_params.rbs

Overview

See Also:

  • SafetyKit::Resources::Content#create

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::SafetyKit

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(entity_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see SafetyKit::Models::ContentCreateParams for more details.

Parameters:

  • entity_id (String)

    Your stable identifier for the entity this content belongs to, such as a user, l

  • content_id (String) (defaults to: nil)

    Your identifier for this piece of content — the same content_id you send on /v1/

  • images (Array<String>) (defaults to: nil)

    Images to classify, each as base64-encoded image bytes, raw or as a data URI. At

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

    Additional product context for this content. At most 8KB when serialized.

  • text (String) (defaults to: nil)

    User-authored text to classify. At most 20000 characters.

  • request_options (SafetyKit::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/safety_kit/models/content_create_params.rb', line 46

Instance Attribute Details

#content_idString?

Your identifier for this piece of content — the same content_id you send on /v1/events. When provided, the event this call records deduplicates against the same upload posted through the events API, so sending both never double-counts the content.

Parameters:

  • (String)

Returns:

  • (String, nil)


24
# File 'lib/safety_kit/models/content_create_params.rb', line 24

optional :content_id, String

#entity_idString

Your stable identifier for the entity this content belongs to, such as a user, listing, or message thread.

Parameters:

  • value (String)

Returns:

  • (String)


15
# File 'lib/safety_kit/models/content_create_params.rb', line 15

required :entity_id, String

#imagesArray<String>?

Images to classify, each as base64-encoded image bytes, raw or as a data URI. At most 4 images. The full request body must stay under 6MB, which allows roughly 4.4MB of raw image bytes after base64 inflation.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


32
# File 'lib/safety_kit/models/content_create_params.rb', line 32

optional :images, SafetyKit::Internal::Type::ArrayOf[String]

#metadataHash{Symbol=>Object, nil}?

Additional product context for this content. At most 8KB when serialized.

Parameters:

  • (::Hash[Symbol, top?])

Returns:

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


38
# File 'lib/safety_kit/models/content_create_params.rb', line 38

optional :metadata, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]

#textString?

User-authored text to classify. At most 20000 characters.

Parameters:

  • (String)

Returns:

  • (String, nil)


44
# File 'lib/safety_kit/models/content_create_params.rb', line 44

optional :text, String

Instance Method Details

#to_hash{

Returns:

  • ({)


44
# File 'sig/safety_kit/models/content_create_params.rbs', line 44

def to_hash: -> {