Class: Cadenya::Types::CreateAgentRequest

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, metadata: nil, spec: nil, default_variation: nil) ⇒ CreateAgentRequest

Returns a new instance of CreateAgentRequest.



1529
1530
1531
1532
1533
1534
# File 'lib/cadenya/types.rb', line 1529

def initialize(workspace_id: nil, metadata: nil, spec: nil, default_variation: nil)
  @workspace_id = workspace_id
  @metadata = 
  @spec = spec
  @default_variation = default_variation
end

Instance Attribute Details

#default_variationObject (readonly)

Returns the value of attribute default_variation.



1527
1528
1529
# File 'lib/cadenya/types.rb', line 1527

def default_variation
  @default_variation
end

#metadataObject (readonly)

Returns the value of attribute metadata.



1527
1528
1529
# File 'lib/cadenya/types.rb', line 1527

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1527
1528
1529
# File 'lib/cadenya/types.rb', line 1527

def spec
  @spec
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1527
1528
1529
# File 'lib/cadenya/types.rb', line 1527

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1536
1537
1538
1539
1540
1541
1542
1543
# File 'lib/cadenya/types.rb', line 1536

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    metadata: data["metadata"].nil? ? nil : Types::CreateResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::AgentSpec.from_json(data["spec"]),
    default_variation: data["defaultVariation"].nil? ? nil : Types::CreateAgentVariationRequest.from_json(data["defaultVariation"]),
  )
end

Instance Method Details

#to_hObject



1545
1546
1547
1548
1549
1550
1551
1552
# File 'lib/cadenya/types.rb', line 1545

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