Class: LaunchDarkly::Impl::DataSystem::ProtocolV2::DeleteObject Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/data_system/protocolv2.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

DeleteObject specifies the deletion of a particular object.

Since:

  • 5.5.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version:, kind:, key:) ⇒ DeleteObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DeleteObject.

Parameters:

Since:

  • 5.5.0



48
49
50
51
52
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 48

def initialize(version:, kind:, key:)
  @version = version
  @kind = kind
  @key = key
end

Instance Attribute Details

#key ⇒ Symbol (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The key.

Returns:

  • (Symbol) —

    The key

Since:

  • 5.5.0



41
42
43
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 41

def key
  @key
end

#kind ⇒ String (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The object kind (LaunchDarkly::Interfaces::DataSystem::ObjectKind).

Returns:

Since:

  • 5.5.0



38
39
40
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 38

def kind
  @kind
end

#version ⇒ Integer (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The version.

Returns:

  • (Integer) —

    The version

Since:

  • 5.5.0



35
36
37
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 35

def version
  @version
end

Class Method Details

.from_h(data) ⇒ DeleteObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deserializes a DeleteObject from a JSON-compatible hash.

Parameters:

  • data (Hash) —

    The hash representation

Returns:

Raises:

  • (ArgumentError) —

    if required fields are missing

Since:

  • 5.5.0



83
84
85
86
87
88
89
90
91
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 83

def self.from_h(data)
  version = data[:version]
  kind = data[:kind]
  key = data[:key]

  raise ArgumentError, "Missing required fields in DeleteObject" if version.nil? || kind.nil? || key.nil?

  new(version: version, kind: kind, key: key.to_sym)
end

Instance Method Details

#name ⇒ Symbol

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the event name.

Returns:

  • (Symbol)

Since:

  • 5.5.0



59
60
61
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 59

def name
  LaunchDarkly::Interfaces::DataSystem::EventName::DELETE_OBJECT
end

#to_h ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Serializes the DeleteObject to a JSON-compatible hash.

Returns:

  • (Hash)

Since:

  • 5.5.0



68
69
70
71
72
73
74
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 68

def to_h
  {
    version: @version,
    kind: @kind,
    key: @key,
  }
end