Class: OCI::Devops::Models::BuildRunSnapshot
- Inherits:
-
Object
- Object
- OCI::Devops::Models::BuildRunSnapshot
- Defined in:
- lib/oci/devops/models/build_run_snapshot.rb
Overview
Snapshot of a build run. Contains information including pipelineId, commitId.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_ACCEPTED = 'ACCEPTED'.freeze, LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze, LIFECYCLE_STATE_CANCELING = 'CANCELING'.freeze, LIFECYCLE_STATE_CANCELED = 'CANCELED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#build_pipeline_id ⇒ String
[Required] The OCID of the build pipeline where the build was triggered.
-
#build_run_id ⇒ String
[Required] The OCID of the build run.
-
#commit_id ⇒ String
[Required] The commit id which the build was triggered from.
-
#display_name ⇒ String
The display name of the build run.
-
#lifecycle_details ⇒ String
[Required] A message describing the current state in more detail.
-
#lifecycle_state ⇒ String
[Required] The current status of the build run.
-
#time_created ⇒ DateTime
The time the build run was created.
-
#time_updated ⇒ DateTime
The time the build run was updated.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ BuildRunSnapshot
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ BuildRunSnapshot
Initializes the object
100 101 102 103 104 105 106 107 108 109 110 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 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 100 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.build_pipeline_id = attributes[:'buildPipelineId'] if attributes[:'buildPipelineId'] raise 'You cannot provide both :buildPipelineId and :build_pipeline_id' if attributes.key?(:'buildPipelineId') && attributes.key?(:'build_pipeline_id') self.build_pipeline_id = attributes[:'build_pipeline_id'] if attributes[:'build_pipeline_id'] self.display_name = attributes[:'displayName'] if attributes[:'displayName'] raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] if attributes[:'display_name'] self.commit_id = attributes[:'commitId'] if attributes[:'commitId'] raise 'You cannot provide both :commitId and :commit_id' if attributes.key?(:'commitId') && attributes.key?(:'commit_id') self.commit_id = attributes[:'commit_id'] if attributes[:'commit_id'] self.build_run_id = attributes[:'buildRunId'] if attributes[:'buildRunId'] raise 'You cannot provide both :buildRunId and :build_run_id' if attributes.key?(:'buildRunId') && attributes.key?(:'build_run_id') self.build_run_id = attributes[:'build_run_id'] if attributes[:'build_run_id'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails'] raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details') self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated'] raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated') self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated'] end |
Instance Attribute Details
#build_pipeline_id ⇒ String
[Required] The OCID of the build pipeline where the build was triggered.
24 25 26 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 24 def build_pipeline_id @build_pipeline_id end |
#build_run_id ⇒ String
[Required] The OCID of the build run.
36 37 38 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 36 def build_run_id @build_run_id end |
#commit_id ⇒ String
[Required] The commit id which the build was triggered from.
32 33 34 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 32 def commit_id @commit_id end |
#display_name ⇒ String
The display name of the build run.
28 29 30 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 28 def display_name @display_name end |
#lifecycle_details ⇒ String
[Required] A message describing the current state in more detail.
44 45 46 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 44 def lifecycle_details @lifecycle_details end |
#lifecycle_state ⇒ String
[Required] The current status of the build run.
40 41 42 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 40 def lifecycle_state @lifecycle_state end |
#time_created ⇒ DateTime
The time the build run was created. Format defined by RFC3339.
48 49 50 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 48 def time_created @time_created end |
#time_updated ⇒ DateTime
The time the build run was updated. Format defined by RFC3339.
52 53 54 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 52 def time_updated @time_updated end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 55 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'build_pipeline_id': :'buildPipelineId', 'display_name': :'displayName', 'commit_id': :'commitId', 'build_run_id': :'buildRunId', 'lifecycle_state': :'lifecycleState', 'lifecycle_details': :'lifecycleDetails', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 71 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'build_pipeline_id': :'String', 'display_name': :'String', 'commit_id': :'String', 'build_run_id': :'String', 'lifecycle_state': :'String', 'lifecycle_details': :'String', 'time_created': :'DateTime', 'time_updated': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 175 def ==(other) return true if equal?(other) self.class == other.class && build_pipeline_id == other.build_pipeline_id && display_name == other.display_name && commit_id == other.commit_id && build_run_id == other.build_run_id && lifecycle_state == other.lifecycle_state && lifecycle_details == other.lifecycle_details && time_created == other.time_created && time_updated == other.time_updated end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
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_run_snapshot.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
192 193 194 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 192 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
201 202 203 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 201 def hash [build_pipeline_id, display_name, commit_id, build_run_id, lifecycle_state, lifecycle_details, time_created, time_updated].hash end |
#to_hash ⇒ 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_run_snapshot.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_s ⇒ String
Returns the string representation of the object
239 240 241 |
# File 'lib/oci/devops/models/build_run_snapshot.rb', line 239 def to_s to_hash.to_s end |