Class: OCI::Devops::Models::DiffResponse
- Inherits:
-
Object
- Object
- OCI::Devops::Models::DiffResponse
- Defined in:
- lib/oci/devops/models/diff_response.rb
Overview
Response object for obtaining list of changed files.
Instance Attribute Summary collapse
-
#added_lines_count ⇒ Integer
The number of lines added in whole difference.
-
#are_all_changes_included ⇒ BOOLEAN
Boolean value to indicate if all changes are included in the response.
-
#change_type_count ⇒ Hash<String, Integer>
Count of each type of change in difference.
-
#changes ⇒ Array<OCI::Devops::Models::DiffResponseEntry>
[Required] List of changes in the difference.
-
#commits_ahead_count ⇒ Integer
The number of commits source is ahead of target by.
-
#commits_behind_count ⇒ Integer
The number of commits source is behind target by.
-
#common_commit ⇒ String
The ID of the common commit between source and target.
-
#deleted_lines_count ⇒ Integer
The number of lines deleted in whole difference.
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 = {}) ⇒ DiffResponse
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 = {}) ⇒ DiffResponse
Initializes the object
88 89 90 91 92 93 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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/oci/devops/models/diff_response.rb', line 88 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.are_all_changes_included = attributes[:'areAllChangesIncluded'] unless attributes[:'areAllChangesIncluded'].nil? raise 'You cannot provide both :areAllChangesIncluded and :are_all_changes_included' if attributes.key?(:'areAllChangesIncluded') && attributes.key?(:'are_all_changes_included') self.are_all_changes_included = attributes[:'are_all_changes_included'] unless attributes[:'are_all_changes_included'].nil? self.change_type_count = attributes[:'changeTypeCount'] if attributes[:'changeTypeCount'] raise 'You cannot provide both :changeTypeCount and :change_type_count' if attributes.key?(:'changeTypeCount') && attributes.key?(:'change_type_count') self.change_type_count = attributes[:'change_type_count'] if attributes[:'change_type_count'] self.common_commit = attributes[:'commonCommit'] if attributes[:'commonCommit'] raise 'You cannot provide both :commonCommit and :common_commit' if attributes.key?(:'commonCommit') && attributes.key?(:'common_commit') self.common_commit = attributes[:'common_commit'] if attributes[:'common_commit'] self.commits_ahead_count = attributes[:'commitsAheadCount'] if attributes[:'commitsAheadCount'] raise 'You cannot provide both :commitsAheadCount and :commits_ahead_count' if attributes.key?(:'commitsAheadCount') && attributes.key?(:'commits_ahead_count') self.commits_ahead_count = attributes[:'commits_ahead_count'] if attributes[:'commits_ahead_count'] self.commits_behind_count = attributes[:'commitsBehindCount'] if attributes[:'commitsBehindCount'] raise 'You cannot provide both :commitsBehindCount and :commits_behind_count' if attributes.key?(:'commitsBehindCount') && attributes.key?(:'commits_behind_count') self.commits_behind_count = attributes[:'commits_behind_count'] if attributes[:'commits_behind_count'] self.added_lines_count = attributes[:'addedLinesCount'] if attributes[:'addedLinesCount'] raise 'You cannot provide both :addedLinesCount and :added_lines_count' if attributes.key?(:'addedLinesCount') && attributes.key?(:'added_lines_count') self.added_lines_count = attributes[:'added_lines_count'] if attributes[:'added_lines_count'] self.deleted_lines_count = attributes[:'deletedLinesCount'] if attributes[:'deletedLinesCount'] raise 'You cannot provide both :deletedLinesCount and :deleted_lines_count' if attributes.key?(:'deletedLinesCount') && attributes.key?(:'deleted_lines_count') self.deleted_lines_count = attributes[:'deleted_lines_count'] if attributes[:'deleted_lines_count'] self.changes = attributes[:'changes'] if attributes[:'changes'] end |
Instance Attribute Details
#added_lines_count ⇒ Integer
The number of lines added in whole difference.
32 33 34 |
# File 'lib/oci/devops/models/diff_response.rb', line 32 def added_lines_count @added_lines_count end |
#are_all_changes_included ⇒ BOOLEAN
Boolean value to indicate if all changes are included in the response.
12 13 14 |
# File 'lib/oci/devops/models/diff_response.rb', line 12 def are_all_changes_included @are_all_changes_included end |
#change_type_count ⇒ Hash<String, Integer>
Count of each type of change in difference.
16 17 18 |
# File 'lib/oci/devops/models/diff_response.rb', line 16 def change_type_count @change_type_count end |
#changes ⇒ Array<OCI::Devops::Models::DiffResponseEntry>
[Required] List of changes in the difference.
40 41 42 |
# File 'lib/oci/devops/models/diff_response.rb', line 40 def changes @changes end |
#commits_ahead_count ⇒ Integer
The number of commits source is ahead of target by.
24 25 26 |
# File 'lib/oci/devops/models/diff_response.rb', line 24 def commits_ahead_count @commits_ahead_count end |
#commits_behind_count ⇒ Integer
The number of commits source is behind target by.
28 29 30 |
# File 'lib/oci/devops/models/diff_response.rb', line 28 def commits_behind_count @commits_behind_count end |
#common_commit ⇒ String
The ID of the common commit between source and target.
20 21 22 |
# File 'lib/oci/devops/models/diff_response.rb', line 20 def common_commit @common_commit end |
#deleted_lines_count ⇒ Integer
The number of lines deleted in whole difference.
36 37 38 |
# File 'lib/oci/devops/models/diff_response.rb', line 36 def deleted_lines_count @deleted_lines_count end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/oci/devops/models/diff_response.rb', line 43 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'are_all_changes_included': :'areAllChangesIncluded', 'change_type_count': :'changeTypeCount', 'common_commit': :'commonCommit', 'commits_ahead_count': :'commitsAheadCount', 'commits_behind_count': :'commitsBehindCount', 'added_lines_count': :'addedLinesCount', 'deleted_lines_count': :'deletedLinesCount', 'changes': :'changes' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/oci/devops/models/diff_response.rb', line 59 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'are_all_changes_included': :'BOOLEAN', 'change_type_count': :'Hash<String, Integer>', 'common_commit': :'String', 'commits_ahead_count': :'Integer', 'commits_behind_count': :'Integer', 'added_lines_count': :'Integer', 'deleted_lines_count': :'Integer', 'changes': :'Array<OCI::Devops::Models::DiffResponseEntry>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/oci/devops/models/diff_response.rb', line 146 def ==(other) return true if equal?(other) self.class == other.class && are_all_changes_included == other.are_all_changes_included && change_type_count == other.change_type_count && common_commit == other.common_commit && commits_ahead_count == other.commits_ahead_count && commits_behind_count == other.commits_behind_count && added_lines_count == other.added_lines_count && deleted_lines_count == other.deleted_lines_count && changes == other.changes end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/oci/devops/models/diff_response.rb', line 183 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
163 164 165 |
# File 'lib/oci/devops/models/diff_response.rb', line 163 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
172 173 174 |
# File 'lib/oci/devops/models/diff_response.rb', line 172 def hash [are_all_changes_included, change_type_count, common_commit, commits_ahead_count, commits_behind_count, added_lines_count, deleted_lines_count, changes].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/devops/models/diff_response.rb', line 216 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
210 211 212 |
# File 'lib/oci/devops/models/diff_response.rb', line 210 def to_s to_hash.to_s end |