Class: OpenAI::Models::Webhooks::WebhookEndpointWithSecret

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/webhooks/webhook_endpoint_with_secret.rb,
sig/openai/models/webhooks/webhook_endpoint_with_secret.rbs

Overview

See Also:

  • OpenAI::Resources::Webhooks#create

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, 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(id:, created_at:, event_types:, name:, signing_secret:, signing_secret_hint:, url:, updated_at: nil, object: :webhook_endpoint) ⇒ Object

Parameters:

  • id

    The unique ID of the webhook endpoint.

  • created_at

    The Unix timestamp when the endpoint was created.

  • event_types

    The event types that trigger deliveries to this endpoint.

  • name

    The human-readable name of the endpoint.

  • signing_secret

    The endpoint's signing secret. This is returned only when the endpoint is created or the secret is rotated.

  • signing_secret_hint

    A masked hint for the endpoint's signing secret.

  • url

    The HTTPS URL that receives webhook deliveries.

  • updated_at (defaults to: nil)

    The Unix timestamp of the last endpoint configuration or signing-secret change. Initialized at creation; tests and unchanged updates do not advance it.

  • object (defaults to: :webhook_endpoint)

    The object type, which is always webhook_endpoint.



# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 64


Instance Attribute Details

#created_atInteger

The Unix timestamp when the endpoint was created.

Returns:

  • (Integer)


18
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 18

required :created_at, Integer

#event_types::Array[String]

The event types that trigger deliveries to this endpoint.

Returns:

  • (::Array[String])


24
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 24

required :event_types, OpenAI::Internal::Type::ArrayOf[String]

#idString

The unique ID of the webhook endpoint.

Returns:

  • (String)


12
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 12

required :id, String

#nameString

The human-readable name of the endpoint.

Returns:

  • (String)


30
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 30

required :name, String

#object:webhook_endpoint

The object type, which is always webhook_endpoint.

Returns:

  • (:webhook_endpoint)


36
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 36

required :object, const: :webhook_endpoint

#signing_secretString

The endpoint's signing secret. This is returned only when the endpoint is created or the secret is rotated.

Returns:

  • (String)


43
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 43

required :signing_secret, String

#signing_secret_hintString?

A masked hint for the endpoint's signing secret.

Returns:

  • (String, nil)


49
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 49

required :signing_secret_hint, String, nil?: true

#updated_atInteger?

The Unix timestamp of the last endpoint configuration or signing-secret change. Initialized at creation; tests and unchanged updates do not advance it.

Returns:

  • (Integer, nil)


62
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 62

optional :updated_at, Integer

#urlString

The HTTPS URL that receives webhook deliveries.

Returns:

  • (String)


55
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 55

required :url, String

Instance Method Details

#inspectObject



97
98
99
100
101
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 97

def inspect
  converted = self.class.recursively_to_h(self, convert: true)
  converted[:signing_secret] = "[REDACTED]"
  "#<#{self.class}:0x#{object_id.to_s(16)} #{converted}>"
end

#to_hash{

Returns:

  • ({)


83
# File 'sig/openai/models/webhooks/webhook_endpoint_with_secret.rbs', line 83

def to_hash: -> {

#to_sObject

Keep diagnostics safe without changing field access or serialization.



95
# File 'lib/openai/models/webhooks/webhook_endpoint_with_secret.rb', line 95

def to_s = deep_to_h.merge(signing_secret: "[REDACTED]").to_s