Class: ModerationAPI::Models::WebhookCreateParams

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

Overview

See Also:

  • ModerationAPI::Resources::Webhooks#create

Defined Under Namespace

Modules: EventType

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::ModerationAPI

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

#initializeObject



24
# File 'sig/moderation_api/models/webhook_create_params.rbs', line 24

def initialize: (

Instance Attribute Details

#descriptionString?

The webhook's description

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


37
# File 'lib/moderation_api/models/webhook_create_params.rb', line 37

optional :description, String, nil?: true

#event_typesArray<Symbol, ModerationAPI::Models::WebhookCreateParams::EventType>

Event types this webhook subscribes to. One webhook URL receives all events you list here.

Parameters:

  • value (::Array[ModerationAPI::Models::WebhookCreateParams::event_type])

Returns:



15
16
17
18
19
# File 'lib/moderation_api/models/webhook_create_params.rb', line 15

required :event_types,
-> {
  ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::WebhookCreateParams::EventType]
},
api_name: :eventTypes

#nameString

The webhook's name, used to identify it in the dashboard

Parameters:

  • value (String)

Returns:

  • (String)


25
# File 'lib/moderation_api/models/webhook_create_params.rb', line 25

required :name, String

#urlString

The webhook's URL. We'll call this URL when an event occurs.

Parameters:

  • value (String)

Returns:

  • (String)


31
# File 'lib/moderation_api/models/webhook_create_params.rb', line 31

required :url, String

Instance Method Details

#to_hash{

Returns:

  • ({)


32
# File 'sig/moderation_api/models/webhook_create_params.rbs', line 32

def to_hash: -> {