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

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/webhooks/webhook_endpoint_with_secret.rb,
lib/openai/helpers/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_cached, coerce_with_error, dump, #dump, inspect, meta_info, new_coerce_state, resolve_type, 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) ⇒ WebhookEndpointWithSecret

Returns a new instance of WebhookEndpointWithSecret.

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.

  • id: (String)
  • created_at: (Integer)
  • event_types: (::Array[String])
  • name: (String)
  • signing_secret: (String)
  • signing_secret_hint: (String, nil)
  • url: (String)
  • updated_at: (Integer) (defaults to: nil)
  • object: (:webhook_endpoint) (defaults to: :webhook_endpoint)


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

Instance Attribute Details

#created_at ⇒ Integer

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]

#id ⇒ String

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

#name ⇒ String

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_secret ⇒ String

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_hint ⇒ String?

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_at ⇒ Integer?

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

#url ⇒ String

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

#inspect ⇒ Object



12
13
14
15
16
# File 'lib/openai/helpers/models/webhooks/webhook_endpoint_with_secret.rb', line 12

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 ⇒ { id: String, created_at: Integer, event_types: ::Array[String], name: String, ?object: :webhook_endpoint, signing_secret: String, signing_secret_hint: String?, url: String, ?updated_at: Integer }

Returns:

  • ({ id: String, created_at: Integer, event_types: ::Array[String], name: String, ?object: :webhook_endpoint, signing_secret: String, signing_secret_hint: String?, url: String, ?updated_at: Integer })


83
84
85
86
87
88
89
90
91
92
93
# File 'sig/openai/models/webhooks/webhook_endpoint_with_secret.rbs', line 83

def to_hash: -> {
  id: String,
  created_at: Integer,
  event_types: ::Array[String],
  name: String,
  ?object: :webhook_endpoint,
  signing_secret: String,
  signing_secret_hint: String?,
  url: String,
  ?updated_at: Integer
}

#to_s ⇒ Object

Keep diagnostics safe without changing field access or serialization.



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

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