Class: Cadenya::Types::ObjectiveEventWebhookDataData

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent: nil, agent_variation: nil, objective: nil, objective_event: nil) ⇒ ObjectiveEventWebhookDataData

Returns a new instance of ObjectiveEventWebhookDataData.



7676
7677
7678
7679
7680
7681
# File 'lib/cadenya/types.rb', line 7676

def initialize(agent: nil, agent_variation: nil, objective: nil, objective_event: nil)
  @agent = agent
  @agent_variation = agent_variation
  @objective = objective
  @objective_event = objective_event
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



7674
7675
7676
# File 'lib/cadenya/types.rb', line 7674

def agent
  @agent
end

#agent_variationObject (readonly)

Returns the value of attribute agent_variation.



7674
7675
7676
# File 'lib/cadenya/types.rb', line 7674

def agent_variation
  @agent_variation
end

#objectiveObject (readonly)

Returns the value of attribute objective.



7674
7675
7676
# File 'lib/cadenya/types.rb', line 7674

def objective
  @objective
end

#objective_eventObject (readonly)

Returns the value of attribute objective_event.



7674
7675
7676
# File 'lib/cadenya/types.rb', line 7674

def objective_event
  @objective_event
end

Class Method Details

.from_json(data) ⇒ Object



7683
7684
7685
7686
7687
7688
7689
7690
# File 'lib/cadenya/types.rb', line 7683

def self.from_json(data)
  new(
    agent: data["agent"].nil? ? nil : Types::ResourceMetadata.from_json(data["agent"]),
    agent_variation: data["agentVariation"].nil? ? nil : Types::ResourceMetadata.from_json(data["agentVariation"]),
    objective: data["objective"].nil? ? nil : Types::OperationMetadata.from_json(data["objective"]),
    objective_event: data["objectiveEvent"].nil? ? nil : Types::ObjectiveEvent.from_json(data["objectiveEvent"]),
  )
end

Instance Method Details

#to_hObject



7692
7693
7694
7695
7696
7697
7698
7699
# File 'lib/cadenya/types.rb', line 7692

def to_h
  {
    agent: Util.plain(@agent),
    agent_variation: Util.plain(@agent_variation),
    objective: Util.plain(@objective),
    objective_event: Util.plain(@objective_event),
  }.reject { |_k, v| v.nil? }
end