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.



143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/agent_cli_runtime/values.rb', line 143

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



140
141
142
# File 'lib/agent_cli_runtime/values.rb', line 140

def diagnostic
  @diagnostic
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



140
141
142
# File 'lib/agent_cli_runtime/values.rb', line 140

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



140
141
142
# File 'lib/agent_cli_runtime/values.rb', line 140

def status
  @status
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


157
158
159
# File 'lib/agent_cli_runtime/values.rb', line 157

def configured?
  status == :configured
end