Class: OCI::Devops::Models::BuildStage

Inherits:
BuildPipelineStage show all
Defined in:
lib/oci/devops/models/build_stage.rb

Overview

Specifies the build stage.

Constant Summary collapse

IMAGE_ENUM =
[
  IMAGE_OL7_X86_64_STANDARD_10 = 'OL7_X86_64_STANDARD_10'.freeze,
  IMAGE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from BuildPipelineStage

OCI::Devops::Models::BuildPipelineStage::BUILD_PIPELINE_STAGE_TYPE_ENUM, OCI::Devops::Models::BuildPipelineStage::LIFECYCLE_STATE_ENUM

Instance Attribute Summary collapse

Attributes inherited from BuildPipelineStage

#build_pipeline_id, #build_pipeline_stage_predecessor_collection, #build_pipeline_stage_type, #compartment_id, #defined_tags, #description, #display_name, #freeform_tags, #id, #lifecycle_details, #lifecycle_state, #project_id, #system_tags, #time_created, #time_updated

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BuildPipelineStage

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ BuildStage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/devops/models/build_stage.rb', line 118

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

  attributes['buildPipelineStageType'] = 'BUILD'

  super(attributes)

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

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

  self.build_spec_file = attributes[:'buildSpecFile'] if attributes[:'buildSpecFile']

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

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

  self.stage_execution_timeout_in_seconds = attributes[:'stageExecutionTimeoutInSeconds'] if attributes[:'stageExecutionTimeoutInSeconds']

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

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

  self.build_source_collection = attributes[:'buildSourceCollection'] if attributes[:'buildSourceCollection']

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

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

  self.primary_build_source = attributes[:'primaryBuildSource'] if attributes[:'primaryBuildSource']

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

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

Instance Attribute Details

#build_source_collectionOCI::Devops::Models::BuildSourceCollection

This attribute is required.



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

def build_source_collection
  @build_source_collection
end

#build_spec_fileString

The path to the build specification file for this environment. The default location of the file if not specified is build_spec.yaml.

Returns:

  • (String)


23
24
25
# File 'lib/oci/devops/models/build_stage.rb', line 23

def build_spec_file
  @build_spec_file
end

#imageString

[Required] Image name for the build environment.

Returns:

  • (String)


19
20
21
# File 'lib/oci/devops/models/build_stage.rb', line 19

def image
  @image
end

#primary_build_sourceString

Name of the build source where the build_spec.yml file is located. If not specified, then the first entry in the build source collection is chosen as primary build source.

Returns:

  • (String)


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

def primary_build_source
  @primary_build_source
end

#stage_execution_timeout_in_secondsInteger

Timeout for the build stage execution. Specify value in seconds.

Returns:

  • (Integer)


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

def stage_execution_timeout_in_seconds
  @stage_execution_timeout_in_seconds
end

Class Method Details

.attribute_mapObject

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



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/devops/models/build_stage.rb', line 38

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'description': :'description',
    'project_id': :'projectId',
    'build_pipeline_id': :'buildPipelineId',
    'compartment_id': :'compartmentId',
    'build_pipeline_stage_type': :'buildPipelineStageType',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'build_pipeline_stage_predecessor_collection': :'buildPipelineStagePredecessorCollection',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags',
    'image': :'image',
    'build_spec_file': :'buildSpecFile',
    'stage_execution_timeout_in_seconds': :'stageExecutionTimeoutInSeconds',
    'build_source_collection': :'buildSourceCollection',
    'primary_build_source': :'primaryBuildSource'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/devops/models/build_stage.rb', line 66

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'description': :'String',
    'project_id': :'String',
    'build_pipeline_id': :'String',
    'compartment_id': :'String',
    'build_pipeline_stage_type': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'build_pipeline_stage_predecessor_collection': :'OCI::Devops::Models::BuildPipelineStagePredecessorCollection',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>',
    'image': :'String',
    'build_spec_file': :'String',
    'stage_execution_timeout_in_seconds': :'Integer',
    'build_source_collection': :'OCI::Devops::Models::BuildSourceCollection',
    'primary_build_source': :'String'
    # 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



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/devops/models/build_stage.rb', line 175

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    description == other.description &&
    project_id == other.project_id &&
    build_pipeline_id == other.build_pipeline_id &&
    compartment_id == other.compartment_id &&
    build_pipeline_stage_type == other.build_pipeline_stage_type &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    build_pipeline_stage_predecessor_collection == other.build_pipeline_stage_predecessor_collection &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags &&
    image == other.image &&
    build_spec_file == other.build_spec_file &&
    stage_execution_timeout_in_seconds == other.stage_execution_timeout_in_seconds &&
    build_source_collection == other.build_source_collection &&
    primary_build_source == other.primary_build_source
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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/devops/models/build_stage.rb', line 224

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


204
205
206
# File 'lib/oci/devops/models/build_stage.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/devops/models/build_stage.rb', line 213

def hash
  [id, display_name, description, project_id, build_pipeline_id, compartment_id, build_pipeline_stage_type, time_created, time_updated, lifecycle_state, lifecycle_details, build_pipeline_stage_predecessor_collection, freeform_tags, defined_tags, system_tags, image, build_spec_file, stage_execution_timeout_in_seconds, build_source_collection, primary_build_source].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/devops/models/build_stage.rb', line 257

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



251
252
253
# File 'lib/oci/devops/models/build_stage.rb', line 251

def to_s
  to_hash.to_s
end