Class: Legion::Extensions::Llm::Inventory::PublicationStatus
- Inherits:
-
Data
- Object
- Data
- Legion::Extensions::Llm::Inventory::PublicationStatus
- Defined in:
- lib/legion/extensions/llm/inventory/records.rb
Overview
Publication-scope status distinguishing an initializing claim from an authoritative complete catalog. See section 10.7.
Instance Attribute Summary collapse
-
#instance_key ⇒ Object
readonly
Returns the value of attribute instance_key.
-
#last_error ⇒ Object
readonly
Returns the value of attribute last_error.
-
#last_probe_completed_at ⇒ Object
readonly
Returns the value of attribute last_probe_completed_at.
-
#last_probe_outcome ⇒ Object
readonly
Returns the value of attribute last_probe_outcome.
-
#last_probe_started_at ⇒ Object
readonly
Returns the value of attribute last_probe_started_at.
-
#published_sequence ⇒ Object
readonly
Returns the value of attribute published_sequence.
-
#publisher_token_id ⇒ Object
readonly
Returns the value of attribute publisher_token_id.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ PublicationStatus
constructor
A new instance of PublicationStatus.
Constructor Details
#initialize(**kwargs) ⇒ PublicationStatus
Returns a new instance of PublicationStatus.
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 517 def initialize(**kwargs) kwargs = { last_probe_started_at: nil, last_probe_completed_at: nil, last_probe_outcome: nil, last_error: nil }.merge(kwargs) RecordSupport.check_unknown_kwargs!(kwargs: kwargs, members: self.class.members) instance_key = kwargs[:instance_key] published_sequence = kwargs[:published_sequence] last_probe_outcome = kwargs[:last_probe_outcome] raise Errors::ValidationError, 'instance_key must be an InstanceKey' unless instance_key.is_a?(Identity::InstanceKey) raise Errors::ValidationError, 'state must be :initializing or :complete' unless Taxonomies::PUBLICATION_STATES.include?(kwargs[:state]) raise Errors::ValidationError, 'published_sequence must be nil or a nonnegative Integer' unless published_sequence.nil? || RecordSupport.nonnegative_integer?(published_sequence) raise Errors::ValidationError, 'last_probe_outcome must be nil, :success, or :failure' unless last_probe_outcome.nil? || Taxonomies::PROBE_OUTCOMES.include?(last_probe_outcome) super( instance_key: instance_key, state: kwargs[:state], publisher_token_id: kwargs[:publisher_token_id].nil? ? nil : kwargs[:publisher_token_id].dup.freeze, published_sequence: published_sequence, last_probe_started_at: RecordSupport.optional_time(value: kwargs[:last_probe_started_at], field: :last_probe_started_at), last_probe_completed_at: RecordSupport.optional_time(value: kwargs[:last_probe_completed_at], field: :last_probe_completed_at), last_probe_outcome: last_probe_outcome, last_error: RecordSupport.optional_sanitized_reason(value: kwargs[:last_error], field: :last_error) ) end |
Instance Attribute Details
#instance_key ⇒ Object (readonly)
Returns the value of attribute instance_key
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def instance_key @instance_key end |
#last_error ⇒ Object (readonly)
Returns the value of attribute last_error
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def last_error @last_error end |
#last_probe_completed_at ⇒ Object (readonly)
Returns the value of attribute last_probe_completed_at
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def last_probe_completed_at @last_probe_completed_at end |
#last_probe_outcome ⇒ Object (readonly)
Returns the value of attribute last_probe_outcome
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def last_probe_outcome @last_probe_outcome end |
#last_probe_started_at ⇒ Object (readonly)
Returns the value of attribute last_probe_started_at
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def last_probe_started_at @last_probe_started_at end |
#published_sequence ⇒ Object (readonly)
Returns the value of attribute published_sequence
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def published_sequence @published_sequence end |
#publisher_token_id ⇒ Object (readonly)
Returns the value of attribute publisher_token_id
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def publisher_token_id @publisher_token_id end |
#state ⇒ Object (readonly)
Returns the value of attribute state
513 514 515 |
# File 'lib/legion/extensions/llm/inventory/records.rb', line 513 def state @state end |