Class: OCI::Adm::Models::VerifyStage

Inherits:
RemediationRunStage show all
Defined in:
lib/oci/adm/models/verify_stage.rb

Overview

A verify stage will run a build pipeline in a branch.

Constant Summary

Constants inherited from RemediationRunStage

RemediationRunStage::NEXT_STAGE_TYPE_ENUM, RemediationRunStage::PREVIOUS_STAGE_TYPE_ENUM, RemediationRunStage::STATUS_ENUM, RemediationRunStage::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from RemediationRunStage

#next_stage_type, #previous_stage_type, #remediation_run_id, #status, #summary, #time_created, #time_finished, #time_started, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RemediationRunStage

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ VerifyStage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/adm/models/verify_stage.rb', line 73

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

  attributes['type'] = 'VERIFY'

  super(attributes)

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

  self.pull_request_properties = attributes[:'pullRequestProperties'] if attributes[:'pullRequestProperties']

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

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

  self.pipeline_properties = attributes[:'pipelineProperties'] if attributes[:'pipelineProperties']

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

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

Instance Attribute Details

#pipeline_propertiesOCI::Adm::Models::PipelineProperties



17
18
19
# File 'lib/oci/adm/models/verify_stage.rb', line 17

def pipeline_properties
  @pipeline_properties
end

#pull_request_propertiesOCI::Adm::Models::PullRequestProperties



14
15
16
# File 'lib/oci/adm/models/verify_stage.rb', line 14

def pull_request_properties
  @pull_request_properties
end

Class Method Details

.attribute_mapObject

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



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/oci/adm/models/verify_stage.rb', line 20

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'status',
    'time_created': :'timeCreated',
    'time_started': :'timeStarted',
    'time_finished': :'timeFinished',
    'type': :'type',
    'summary': :'summary',
    'remediation_run_id': :'remediationRunId',
    'previous_stage_type': :'previousStageType',
    'next_stage_type': :'nextStageType',
    'pull_request_properties': :'pullRequestProperties',
    'pipeline_properties': :'pipelineProperties'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/adm/models/verify_stage.rb', line 39

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'String',
    'time_created': :'DateTime',
    'time_started': :'DateTime',
    'time_finished': :'DateTime',
    'type': :'String',
    'summary': :'String',
    'remediation_run_id': :'String',
    'previous_stage_type': :'String',
    'next_stage_type': :'String',
    'pull_request_properties': :'OCI::Adm::Models::PullRequestProperties',
    'pipeline_properties': :'OCI::Adm::Models::PipelineProperties'
    # 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



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/oci/adm/models/verify_stage.rb', line 103

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

  self.class == other.class &&
    status == other.status &&
    time_created == other.time_created &&
    time_started == other.time_started &&
    time_finished == other.time_finished &&
    type == other.type &&
    summary == other.summary &&
    remediation_run_id == other.remediation_run_id &&
    previous_stage_type == other.previous_stage_type &&
    next_stage_type == other.next_stage_type &&
    pull_request_properties == other.pull_request_properties &&
    pipeline_properties == other.pipeline_properties
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



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/oci/adm/models/verify_stage.rb', line 143

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


123
124
125
# File 'lib/oci/adm/models/verify_stage.rb', line 123

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



132
133
134
# File 'lib/oci/adm/models/verify_stage.rb', line 132

def hash
  [status, time_created, time_started, time_finished, type, summary, remediation_run_id, previous_stage_type, next_stage_type, pull_request_properties, pipeline_properties].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/adm/models/verify_stage.rb', line 176

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



170
171
172
# File 'lib/oci/adm/models/verify_stage.rb', line 170

def to_s
  to_hash.to_s
end