Class: Cadenya::Types::CancelObjectiveRequest

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(workspace_id: nil, objective_id: nil, reason: nil) ⇒ CancelObjectiveRequest

Returns a new instance of CancelObjectiveRequest.



1048
1049
1050
1051
1052
# File 'lib/cadenya/types.rb', line 1048

def initialize(workspace_id: nil, objective_id: nil, reason: nil)
  @workspace_id = workspace_id
  @objective_id = objective_id
  @reason = reason
end

Instance Attribute Details

#objective_idObject (readonly)

Returns the value of attribute objective_id.



1046
1047
1048
# File 'lib/cadenya/types.rb', line 1046

def objective_id
  @objective_id
end

#reasonObject (readonly)

Returns the value of attribute reason.



1046
1047
1048
# File 'lib/cadenya/types.rb', line 1046

def reason
  @reason
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1046
1047
1048
# File 'lib/cadenya/types.rb', line 1046

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1054
1055
1056
1057
1058
1059
1060
# File 'lib/cadenya/types.rb', line 1054

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    objective_id: data["objectiveId"],
    reason: data["reason"],
  )
end

Instance Method Details

#to_hObject



1062
1063
1064
1065
1066
1067
1068
# File 'lib/cadenya/types.rb', line 1062

def to_h
  {
    workspace_id: Util.plain(@workspace_id),
    objective_id: Util.plain(@objective_id),
    reason: Util.plain(@reason),
  }.reject { |_k, v| v.nil? }
end