Class: OCI::Devops::Models::DeployStageExecutionProgress

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/devops/models/deploy_stage_execution_progress.rb

Overview

Details about the execution progress of a stage in a deployment. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_ACCEPTED = 'ACCEPTED'.freeze,
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  STATUS_CANCELING = 'CANCELING'.freeze,
  STATUS_CANCELED = 'CANCELED'.freeze,
  STATUS_ROLLBACK_IN_PROGRESS = 'ROLLBACK_IN_PROGRESS'.freeze,
  STATUS_ROLLBACK_SUCCEEDED = 'ROLLBACK_SUCCEEDED'.freeze,
  STATUS_ROLLBACK_FAILED = 'ROLLBACK_FAILED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DeployStageExecutionProgress

Initializes the object

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 130

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 }

  self.deploy_stage_display_name = attributes[:'deployStageDisplayName'] if attributes[:'deployStageDisplayName']

  raise 'You cannot provide both :deployStageDisplayName and :deploy_stage_display_name' if attributes.key?(:'deployStageDisplayName') && attributes.key?(:'deploy_stage_display_name')

  self.deploy_stage_display_name = attributes[:'deploy_stage_display_name'] if attributes[:'deploy_stage_display_name']

  self.deploy_stage_type = attributes[:'deployStageType'] if attributes[:'deployStageType']

  raise 'You cannot provide both :deployStageType and :deploy_stage_type' if attributes.key?(:'deployStageType') && attributes.key?(:'deploy_stage_type')

  self.deploy_stage_type = attributes[:'deploy_stage_type'] if attributes[:'deploy_stage_type']

  self.deploy_stage_id = attributes[:'deployStageId'] if attributes[:'deployStageId']

  raise 'You cannot provide both :deployStageId and :deploy_stage_id' if attributes.key?(:'deployStageId') && attributes.key?(:'deploy_stage_id')

  self.deploy_stage_id = attributes[:'deploy_stage_id'] if attributes[:'deploy_stage_id']

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

  raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')

  self.time_started = attributes[:'time_started'] if attributes[:'time_started']

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

  raise 'You cannot provide both :timeFinished and :time_finished' if attributes.key?(:'timeFinished') && attributes.key?(:'time_finished')

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

  self.status = attributes[:'status'] if attributes[:'status']

  self.deploy_stage_predecessors = attributes[:'deployStagePredecessors'] if attributes[:'deployStagePredecessors']

  raise 'You cannot provide both :deployStagePredecessors and :deploy_stage_predecessors' if attributes.key?(:'deployStagePredecessors') && attributes.key?(:'deploy_stage_predecessors')

  self.deploy_stage_predecessors = attributes[:'deploy_stage_predecessors'] if attributes[:'deploy_stage_predecessors']

  self.deploy_stage_execution_progress_details = attributes[:'deployStageExecutionProgressDetails'] if attributes[:'deployStageExecutionProgressDetails']

  raise 'You cannot provide both :deployStageExecutionProgressDetails and :deploy_stage_execution_progress_details' if attributes.key?(:'deployStageExecutionProgressDetails') && attributes.key?(:'deploy_stage_execution_progress_details')

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

Instance Attribute Details

#deploy_stage_display_nameString

Stage display name. Avoid entering confidential information.

Returns:



27
28
29
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 27

def deploy_stage_display_name
  @deploy_stage_display_name
end

#deploy_stage_execution_progress_detailsArray<OCI::Devops::Models::DeployStageExecutionProgressDetails>

Details about stage execution for all the target environments.

Returns:



54
55
56
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 54

def deploy_stage_execution_progress_details
  @deploy_stage_execution_progress_details
end

#deploy_stage_idString

The OCID of the stage.

Returns:



35
36
37
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 35

def deploy_stage_id
  @deploy_stage_id
end

#deploy_stage_predecessorsOCI::Devops::Models::DeployStagePredecessorCollection

Returns:



50
51
52
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 50

def deploy_stage_predecessors
  @deploy_stage_predecessors
end

#deploy_stage_typeString

Deployment stage type.

Returns:



31
32
33
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 31

def deploy_stage_type
  @deploy_stage_type
end

#statusString

The current state of the stage.

Returns:



47
48
49
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 47

def status
  @status
end

#time_finishedDateTime

Time the stage finished executing. Format defined by [RFC3339](datatracker.ietf.org/doc/html/rfc3339).

Returns:



43
44
45
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 43

def time_finished
  @time_finished
end

#time_startedDateTime

Time the stage started executing. Format defined by [RFC3339](datatracker.ietf.org/doc/html/rfc3339).

Returns:



39
40
41
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 39

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 57

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'deploy_stage_display_name': :'deployStageDisplayName',
    'deploy_stage_type': :'deployStageType',
    'deploy_stage_id': :'deployStageId',
    'time_started': :'timeStarted',
    'time_finished': :'timeFinished',
    'status': :'status',
    'deploy_stage_predecessors': :'deployStagePredecessors',
    'deploy_stage_execution_progress_details': :'deployStageExecutionProgressDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 93

def self.get_subtype(object_hash)
  type = object_hash[:'deployStageType'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::Devops::Models::ComputeInstanceGroupBlueGreenTrafficShiftDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_BLUE_GREEN_TRAFFIC_SHIFT'
  return 'OCI::Devops::Models::ComputeInstanceGroupCanaryDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_CANARY_DEPLOYMENT'
  return 'OCI::Devops::Models::ComputeInstanceGroupDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_ROLLING_DEPLOYMENT'
  return 'OCI::Devops::Models::LoadBalancerTrafficShiftDeployStageExecutionProgress' if type == 'LOAD_BALANCER_TRAFFIC_SHIFT'
  return 'OCI::Devops::Models::WaitDeployStageExecutionProgress' if type == 'WAIT'
  return 'OCI::Devops::Models::ComputeInstanceGroupCanaryTrafficShiftDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_CANARY_TRAFFIC_SHIFT'
  return 'OCI::Devops::Models::RunValidationTestOnComputeInstanceDeployStageExecutionProgress' if type == 'RUN_VALIDATION_TEST_ON_COMPUTE_INSTANCE'
  return 'OCI::Devops::Models::ManualApprovalDeployStageExecutionProgress' if type == 'MANUAL_APPROVAL'
  return 'OCI::Devops::Models::RunPipelineDeployStageExecutionProgress' if type == 'RUN_DEPLOYMENT_PIPELINE'
  return 'OCI::Devops::Models::OkeDeployStageExecutionProgress' if type == 'OKE_DEPLOYMENT'
  return 'OCI::Devops::Models::FunctionDeployStageExecutionProgress' if type == 'DEPLOY_FUNCTION'
  return 'OCI::Devops::Models::InvokeFunctionDeployStageExecutionProgress' if type == 'INVOKE_FUNCTION'
  return 'OCI::Devops::Models::ComputeInstanceGroupCanaryApprovalDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_CANARY_APPROVAL'
  return 'OCI::Devops::Models::ComputeInstanceGroupBlueGreenDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_BLUE_GREEN_DEPLOYMENT'

  # TODO: Log a warning when the subtype is not found.
  'OCI::Devops::Models::DeployStageExecutionProgress'
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'deploy_stage_display_name': :'String',
    'deploy_stage_type': :'String',
    'deploy_stage_id': :'String',
    'time_started': :'DateTime',
    'time_finished': :'DateTime',
    'status': :'String',
    'deploy_stage_predecessors': :'OCI::Devops::Models::DeployStagePredecessorCollection',
    'deploy_stage_execution_progress_details': :'Array<OCI::Devops::Models::DeployStageExecutionProgressDetails>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • the other object to be compared



201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 201

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    deploy_stage_display_name == other.deploy_stage_display_name &&
    deploy_stage_type == other.deploy_stage_type &&
    deploy_stage_id == other.deploy_stage_id &&
    time_started == other.time_started &&
    time_finished == other.time_finished &&
    status == other.status &&
    deploy_stage_predecessors == other.deploy_stage_predecessors &&
    deploy_stage_execution_progress_details == other.deploy_stage_execution_progress_details
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 238

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)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      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) ⇒ Boolean

Parameters:

  • the other object to be compared

Returns:

See Also:

  • `==` method


218
219
220
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 218

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • Hash code



227
228
229
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 227

def hash
  [deploy_stage_display_name, deploy_stage_type, deploy_stage_id, time_started, time_finished, status, deploy_stage_predecessors, deploy_stage_execution_progress_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



271
272
273
274
275
276
277
278
279
280
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 271

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 presentation of the object



265
266
267
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 265

def to_s
  to_hash.to_s
end