Class: FdxV660Api::LifecycleEventEntity1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/lifecycle_event_entity1.rb

Overview

Reason and initiator of change event reported in this notification

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(status: SKIP, reason: SKIP, other_reason: SKIP, initiator: SKIP, updated_time: SKIP, additional_properties: nil) ⇒ LifecycleEventEntity1

Returns a new instance of LifecycleEventEntity1.



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 62

def initialize(status: SKIP, reason: SKIP, other_reason: SKIP,
               initiator: SKIP, updated_time: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status unless status == SKIP
  @reason = reason unless reason == SKIP
  @other_reason = other_reason unless other_reason == SKIP
  @initiator = initiator unless initiator == SKIP
  @updated_time = updated_time unless updated_time == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#initiatorPartyType4

The party initiating the revocation or status change

Returns:



29
30
31
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 29

def initiator
  @initiator
end

#other_reasonString

Additional information or description of an OTHER reason

Returns:

  • (String)


25
26
27
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 25

def other_reason
  @other_reason
end

#reasonUpdateReason2

The reason for the revocation or status change, one of BUSINESS_RULE, SECURITY_EVENT, USER_ACTION or OTHER

Returns:



21
22
23
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 21

def reason
  @reason
end

#statusEventStatus2

The status after the event or change requested, one of ACTIVE, SUSPENDED, EXPIRED or REVOKED, depending on entity type

Returns:



16
17
18
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 16

def status
  @status
end

#updated_timeDateTime

When the lifecycle event occurred

Returns:

  • (DateTime)


33
34
35
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 33

def updated_time
  @updated_time
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : SKIP
  reason = hash.key?('reason') ? hash['reason'] : SKIP
  other_reason = hash.key?('otherReason') ? hash['otherReason'] : SKIP
  initiator = hash.key?('initiator') ? hash['initiator'] : SKIP
  updated_time = if hash.key?('updatedTime')
                   (DateTimeHelper.from_rfc3339(hash['updatedTime']) if hash['updatedTime'])
                 else
                   SKIP
                 end

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  LifecycleEventEntity1.new(status: status,
                            reason: reason,
                            other_reason: other_reason,
                            initiator: initiator,
                            updated_time: updated_time,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
42
43
44
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 36

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['reason'] = 'reason'
  @_hash['other_reason'] = 'otherReason'
  @_hash['initiator'] = 'initiator'
  @_hash['updated_time'] = 'updatedTime'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



47
48
49
50
51
52
53
54
55
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 47

def self.optionals
  %w[
    status
    reason
    other_reason
    initiator
    updated_time
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



120
121
122
123
124
125
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 120

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, reason: #{@reason.inspect}, other_reason:"\
  " #{@other_reason.inspect}, initiator: #{@initiator.inspect}, updated_time:"\
  " #{@updated_time.inspect}, additional_properties: #{@additional_properties}>"
end

#to_custom_updated_timeObject



107
108
109
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 107

def to_custom_updated_time
  DateTimeHelper.to_rfc3339(updated_time)
end

#to_sObject

Provides a human-readable string representation of the object.



112
113
114
115
116
117
# File 'lib/fdx_v660_api/models/lifecycle_event_entity1.rb', line 112

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, reason: #{@reason}, other_reason: #{@other_reason},"\
  " initiator: #{@initiator}, updated_time: #{@updated_time}, additional_properties:"\
  " #{@additional_properties}>"
end