Class: SafetyKit::Models::ContentCreateResponse

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

Overview

See Also:

  • SafetyKit::Resources::Content#create

Defined Under Namespace

Modules: Label

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(content_id:, labels:, user_id:, version:) ⇒ Object

Synchronous classification result for the submitted content.

Parameters:



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

Instance Attribute Details

#content_idString

SafetyKit identifier for the classified content.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/safety_kit/models/content_create_response.rb', line 11

required :content_id, String

#labelsArray<SafetyKit::Models::ContentCreateResponse::Label::UnionMember0, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1>

Per-label results for the submitted content.

Parameters:

  • value (::Array[SafetyKit::Models::ContentCreateResponse::label])

Returns:



17
18
# File 'lib/safety_kit/models/content_create_response.rb', line 17

required :labels,
-> { SafetyKit::Internal::Type::ArrayOf[union: SafetyKit::Models::ContentCreateResponse::Label] }

#user_idString

The user_id from the request.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :user_id, String

#versionString

The API version that served this request.

Parameters:

  • value (String)

Returns:

  • (String)


30
# File 'lib/safety_kit/models/content_create_response.rb', line 30

required :version, String

Instance Method Details

#to_hash{

Returns:

  • ({)


27
# File 'sig/safety_kit/models/content_create_response.rbs', line 27

def to_hash: -> {