Class: OCI::Devops::Models::BuildPipelineStageRunProgress

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

Overview

The details about the run progress of a stage in a build run. 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_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BuildPipelineStageRunProgress

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 111

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.stage_display_name = attributes[:'stageDisplayName'] if attributes[:'stageDisplayName']

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

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

  self.build_pipeline_stage_type = attributes[:'buildPipelineStageType'] if attributes[:'buildPipelineStageType']

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

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

  self.build_pipeline_stage_id = attributes[:'buildPipelineStageId'] if attributes[:'buildPipelineStageId']

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

  self.build_pipeline_stage_id = attributes[:'build_pipeline_stage_id'] if attributes[:'build_pipeline_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.build_pipeline_stage_predecessors = attributes[:'buildPipelineStagePredecessors'] if attributes[:'buildPipelineStagePredecessors']

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

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

Instance Attribute Details

#build_pipeline_stage_idString

The stage OCID.

Returns:

  • (String)


33
34
35
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 33

def build_pipeline_stage_id
  @build_pipeline_stage_id
end

#build_pipeline_stage_predecessorsOCI::Devops::Models::BuildPipelineStagePredecessorCollection



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

def build_pipeline_stage_predecessors
  @build_pipeline_stage_predecessors
end

#build_pipeline_stage_typeString

Stage types.

Returns:

  • (String)


29
30
31
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 29

def build_pipeline_stage_type
  @build_pipeline_stage_type
end

#stage_display_nameString

Build Run display name, which can be renamed and is not necessarily unique. Avoid entering confidential information.

Returns:

  • (String)


25
26
27
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 25

def stage_display_name
  @stage_display_name
end

#statusString

The current status of the stage.

Returns:

  • (String)


45
46
47
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 45

def status
  @status
end

#time_finishedDateTime

The time the stage finished executing. Format defined by RFC3339.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 41

def time_finished
  @time_finished
end

#time_startedDateTime

The time the stage started executing. Format defined by RFC3339.

Returns:

  • (DateTime)


37
38
39
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 37

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

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



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 51

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'stage_display_name': :'stageDisplayName',
    'build_pipeline_stage_type': :'buildPipelineStageType',
    'build_pipeline_stage_id': :'buildPipelineStageId',
    'time_started': :'timeStarted',
    'time_finished': :'timeFinished',
    'status': :'status',
    'build_pipeline_stage_predecessors': :'buildPipelineStagePredecessors'
    # 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.



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 85

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

  return 'OCI::Devops::Models::DeliverArtifactStageRunProgress' if type == 'DELIVER_ARTIFACT'
  return 'OCI::Devops::Models::WaitStageRunProgress' if type == 'WAIT'
  return 'OCI::Devops::Models::TriggerDeploymentPipelineStageRunProgress' if type == 'TRIGGER_DEPLOYMENT_PIPELINE'
  return 'OCI::Devops::Models::BuildStageRunProgress' if type == 'BUILD'

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

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 66

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'stage_display_name': :'String',
    'build_pipeline_stage_type': :'String',
    'build_pipeline_stage_id': :'String',
    'time_started': :'DateTime',
    'time_finished': :'DateTime',
    'status': :'String',
    'build_pipeline_stage_predecessors': :'OCI::Devops::Models::BuildPipelineStagePredecessorCollection'
    # 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



176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 176

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

  self.class == other.class &&
    stage_display_name == other.stage_display_name &&
    build_pipeline_stage_type == other.build_pipeline_stage_type &&
    build_pipeline_stage_id == other.build_pipeline_stage_id &&
    time_started == other.time_started &&
    time_finished == other.time_finished &&
    status == other.status &&
    build_pipeline_stage_predecessors == other.build_pipeline_stage_predecessors
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



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 212

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


192
193
194
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 192

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



201
202
203
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 201

def hash
  [stage_display_name, build_pipeline_stage_type, build_pipeline_stage_id, time_started, time_finished, status, build_pipeline_stage_predecessors].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



245
246
247
248
249
250
251
252
253
254
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 245

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



239
240
241
# File 'lib/oci/devops/models/build_pipeline_stage_run_progress.rb', line 239

def to_s
  to_hash.to_s
end