Class: OCI::LoadBalancer::Models::WorkRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/load_balancer/models/work_request.rb

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[LIFECYCLE_STATE_ACCEPTED = 'ACCEPTED',
LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS',
LIFECYCLE_STATE_FAILED = 'FAILED',
LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED',
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WorkRequest

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



66
67
68
69
70
71
72
73
74
75
76
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
# File 'lib/oci/load_balancer/models/work_request.rb', line 66

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes[:'errorDetails']
    self.error_details = attributes[:'errorDetails']
  end

  if attributes[:'id']
    self.id = attributes[:'id']
  end

  if attributes[:'lifecycleState']
    self.lifecycle_state = attributes[:'lifecycleState']
  end

  if attributes[:'loadBalancerId']
    self.load_balancer_id = attributes[:'loadBalancerId']
  end

  if attributes[:'message']
    self.message = attributes[:'message']
  end

  if attributes[:'timeAccepted']
    self.time_accepted = attributes[:'timeAccepted']
  end

  if attributes[:'timeFinished']
    self.time_finished = attributes[:'timeFinished']
  end

  if attributes[:'type']
    self.type = attributes[:'type']
  end

end

Instance Attribute Details

#error_detailsArray<OCI::LoadBalancer::Models::WorkRequestError>



15
16
17
# File 'lib/oci/load_balancer/models/work_request.rb', line 15

def error_details
  @error_details
end

#idString

Returns:

  • (String)


19
20
21
# File 'lib/oci/load_balancer/models/work_request.rb', line 19

def id
  @id
end

#lifecycle_stateString

The current state of the work request.

Returns:

  • (String)


24
25
26
# File 'lib/oci/load_balancer/models/work_request.rb', line 24

def lifecycle_state
  @lifecycle_state
end

#load_balancer_idString

The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request is associated.

Returns:

  • (String)


30
31
32
# File 'lib/oci/load_balancer/models/work_request.rb', line 30

def load_balancer_id
  @load_balancer_id
end

#messageString

A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure. Possible data elements include:

  • workflow name

  • event ID

  • work request ID

  • load balancer ID

  • workflow completion message

Returns:

  • (String)


42
43
44
# File 'lib/oci/load_balancer/models/work_request.rb', line 42

def message
  @message
end

#time_acceptedDateTime

The date and time the work request was created, in the format defined by RFC3339.

Example: ‘2016-08-25T21:10:29.600Z`

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/load_balancer/models/work_request.rb', line 49

def time_accepted
  @time_accepted
end

#time_finishedDateTime

The date and time the work request was completed, in the format defined by RFC3339.

Example: ‘2016-08-25T21:10:29.600Z`

Returns:

  • (DateTime)


56
57
58
# File 'lib/oci/load_balancer/models/work_request.rb', line 56

def time_finished
  @time_finished
end

#typeString

The type of action the work request represents.

Returns:

  • (String)


61
62
63
# File 'lib/oci/load_balancer/models/work_request.rb', line 61

def type
  @type
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/oci/load_balancer/models/work_request.rb', line 118

def ==(other_object)
  return true if self.equal?(other_object)
  self.class == other_object.class &&
      error_details == other_object.error_details &&
      id == other_object.id &&
      lifecycle_state == other_object.lifecycle_state &&
      load_balancer_id == other_object.load_balancer_id &&
      message == other_object.message &&
      time_accepted == other_object.time_accepted &&
      time_finished == other_object.time_finished &&
      type == other_object.type
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/load_balancer/models/work_request.rb', line 146

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other_object) ⇒ Boolean

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


133
134
135
# File 'lib/oci/load_balancer/models/work_request.rb', line 133

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



139
140
141
# File 'lib/oci/load_balancer/models/work_request.rb', line 139

def hash
  [error_details, id, lifecycle_state, load_balancer_id, message, time_accepted, time_finished, type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



171
172
173
174
175
176
177
178
179
# File 'lib/oci/load_balancer/models/work_request.rb', line 171

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



165
166
167
# File 'lib/oci/load_balancer/models/work_request.rb', line 165

def to_s
  to_hash.to_s
end