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:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
180
181
182
183
184
185
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 136

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:

  • (String)


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

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.



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

def deploy_stage_execution_progress_details
  @deploy_stage_execution_progress_details
end

#deploy_stage_idString

The OCID of the stage.

Returns:

  • (String)


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

def deploy_stage_id
  @deploy_stage_id
end

#deploy_stage_predecessorsOCI::Devops::Models::DeployStagePredecessorCollection



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

def deploy_stage_predecessors
  @deploy_stage_predecessors
end

#deploy_stage_typeString

Deployment stage type.

Returns:

  • (String)


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

def deploy_stage_type
  @deploy_stage_type
end

#statusString

The current state of the stage.

Returns:

  • (String)


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

def status
  @status
end

#time_finishedDateTime

Time the stage finished executing. Format defined by RFC3339.

Returns:

  • (DateTime)


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

def time_finished
  @time_finished
end

#time_startedDateTime

Time the stage started executing. Format defined by RFC3339.

Returns:

  • (DateTime)


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

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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::OkeBlueGreenDeployStageExecutionProgress' if type == 'OKE_BLUE_GREEN_DEPLOYMENT'
  return 'OCI::Devops::Models::ComputeInstanceGroupDeployStageExecutionProgress' if type == 'COMPUTE_INSTANCE_GROUP_ROLLING_DEPLOYMENT'
  return 'OCI::Devops::Models::ShellDeployStageExecutionProgress' if type == 'SHELL'
  return 'OCI::Devops::Models::OkeCanaryDeployStageExecutionProgress' if type == 'OKE_CANARY_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::OkeCanaryApprovalDeployStageExecutionProgress' if type == 'OKE_CANARY_APPROVAL'
  return 'OCI::Devops::Models::ManualApprovalDeployStageExecutionProgress' if type == 'MANUAL_APPROVAL'
  return 'OCI::Devops::Models::OkeDeployStageExecutionProgress' if type == 'OKE_DEPLOYMENT'
  return 'OCI::Devops::Models::FunctionDeployStageExecutionProgress' if type == 'DEPLOY_FUNCTION'
  return 'OCI::Devops::Models::OkeBlueGreenTrafficShiftDeployStageExecutionProgress' if type == 'OKE_BLUE_GREEN_TRAFFIC_SHIFT'
  return 'OCI::Devops::Models::OkeHelmChartDeploymentStageExecutionProgress' if type == 'OKE_HELM_CHART_DEPLOYMENT'
  return 'OCI::Devops::Models::InvokeFunctionDeployStageExecutionProgress' if type == 'INVOKE_FUNCTION'
  return 'OCI::Devops::Models::OkeCanaryTrafficShiftDeployStageExecutionProgress' if type == 'OKE_CANARY_TRAFFIC_SHIFT'
  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.



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

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:

  • other (Object)

    the other object to be compared



207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 207

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:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 244

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:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


224
225
226
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 224

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



233
234
235
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 233

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:

  • (Hash)

    Returns the object in the form of hash



277
278
279
280
281
282
283
284
285
286
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 277

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



271
272
273
# File 'lib/oci/devops/models/deploy_stage_execution_progress.rb', line 271

def to_s
  to_hash.to_s
end