Class: AgentCliRuntime::AuthConfiguration

Inherits:
Data
  • Object
show all
Defined in:
lib/agent_cli_runtime/values.rb

Constant Summary collapse

STATUSES =
%i[configured missing not_checked].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, source: nil, diagnostic: nil) ⇒ AuthConfiguration

Returns a new instance of AuthConfiguration.



114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/agent_cli_runtime/values.rb', line 114

def initialize(status:, source: nil, diagnostic: nil)
  normalized_status = status.to_sym
  unless STATUSES.include?(normalized_status)
    raise ArgumentError,
          "unknown auth configuration status #{status.inspect}; valid: #{STATUSES.inspect}"
  end

  super(
    status: normalized_status,
    source: source.nil? ? nil : Immutable.string(source),
    diagnostic: diagnostic.nil? ? nil : Immutable.string(diagnostic)
  )
end

Instance Attribute Details

#diagnosticObject (readonly)

Returns the value of attribute diagnostic

Returns:

  • (Object)

    the current value of diagnostic



111
112
113
# File 'lib/agent_cli_runtime/values.rb', line 111

def diagnostic
  @diagnostic
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



111
112
113
# File 'lib/agent_cli_runtime/values.rb', line 111

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



111
112
113
# File 'lib/agent_cli_runtime/values.rb', line 111

def status
  @status
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


128
129
130
# File 'lib/agent_cli_runtime/values.rb', line 128

def configured?
  status == :configured
end