Class: OCI::Devops::Models::RepositoryCommit
- Inherits:
-
Object
- Object
- OCI::Devops::Models::RepositoryCommit
- Defined in:
- lib/oci/devops/models/repository_commit.rb
Overview
Commit object with commit information.
Instance Attribute Summary collapse
-
#author_email ⇒ String
Email of the author of the repository.
-
#author_name ⇒ String
Name of the author of the repository.
-
#commit_id ⇒ String
[Required] Commit hash pointed to by reference name.
-
#commit_message ⇒ String
[Required] The commit message.
-
#committer_email ⇒ String
Email of who creates the commit.
-
#committer_name ⇒ String
Name of who creates the commit.
-
#parent_commit_ids ⇒ Array<String>
An array of parent commit IDs of created commit.
-
#time_created ⇒ DateTime
The time at which commit was created.
-
#tree_id ⇒ String
Tree information for the specified commit.
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 = {}) ⇒ RepositoryCommit
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 = {}) ⇒ RepositoryCommit
Initializes the object
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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/oci/devops/models/repository_commit.rb', line 95 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.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. = attributes[:'commitMessage'] if attributes[:'commitMessage'] raise 'You cannot provide both :commitMessage and :commit_message' if attributes.key?(:'commitMessage') && attributes.key?(:'commit_message') self. = attributes[:'commit_message'] if attributes[:'commit_message'] self. = attributes[:'authorName'] if attributes[:'authorName'] raise 'You cannot provide both :authorName and :author_name' if attributes.key?(:'authorName') && attributes.key?(:'author_name') self. = attributes[:'author_name'] if attributes[:'author_name'] self. = attributes[:'authorEmail'] if attributes[:'authorEmail'] raise 'You cannot provide both :authorEmail and :author_email' if attributes.key?(:'authorEmail') && attributes.key?(:'author_email') self. = attributes[:'author_email'] if attributes[:'author_email'] self.committer_name = attributes[:'committerName'] if attributes[:'committerName'] raise 'You cannot provide both :committerName and :committer_name' if attributes.key?(:'committerName') && attributes.key?(:'committer_name') self.committer_name = attributes[:'committer_name'] if attributes[:'committer_name'] self.committer_email = attributes[:'committerEmail'] if attributes[:'committerEmail'] raise 'You cannot provide both :committerEmail and :committer_email' if attributes.key?(:'committerEmail') && attributes.key?(:'committer_email') self.committer_email = attributes[:'committer_email'] if attributes[:'committer_email'] self.parent_commit_ids = attributes[:'parentCommitIds'] if attributes[:'parentCommitIds'] raise 'You cannot provide both :parentCommitIds and :parent_commit_ids' if attributes.key?(:'parentCommitIds') && attributes.key?(:'parent_commit_ids') self.parent_commit_ids = attributes[:'parent_commit_ids'] if attributes[:'parent_commit_ids'] 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.tree_id = attributes[:'treeId'] if attributes[:'treeId'] raise 'You cannot provide both :treeId and :tree_id' if attributes.key?(:'treeId') && attributes.key?(:'tree_id') self.tree_id = attributes[:'tree_id'] if attributes[:'tree_id'] end |
Instance Attribute Details
#author_email ⇒ String
Email of the author of the repository.
24 25 26 |
# File 'lib/oci/devops/models/repository_commit.rb', line 24 def end |
#author_name ⇒ String
Name of the author of the repository.
20 21 22 |
# File 'lib/oci/devops/models/repository_commit.rb', line 20 def end |
#commit_id ⇒ String
[Required] Commit hash pointed to by reference name.
12 13 14 |
# File 'lib/oci/devops/models/repository_commit.rb', line 12 def commit_id @commit_id end |
#commit_message ⇒ String
[Required] The commit message.
16 17 18 |
# File 'lib/oci/devops/models/repository_commit.rb', line 16 def end |
#committer_email ⇒ String
Email of who creates the commit.
32 33 34 |
# File 'lib/oci/devops/models/repository_commit.rb', line 32 def committer_email @committer_email end |
#committer_name ⇒ String
Name of who creates the commit.
28 29 30 |
# File 'lib/oci/devops/models/repository_commit.rb', line 28 def committer_name @committer_name end |
#parent_commit_ids ⇒ Array<String>
An array of parent commit IDs of created commit.
36 37 38 |
# File 'lib/oci/devops/models/repository_commit.rb', line 36 def parent_commit_ids @parent_commit_ids end |
#time_created ⇒ DateTime
The time at which commit was created.
40 41 42 |
# File 'lib/oci/devops/models/repository_commit.rb', line 40 def time_created @time_created end |
#tree_id ⇒ String
Tree information for the specified commit.
44 45 46 |
# File 'lib/oci/devops/models/repository_commit.rb', line 44 def tree_id @tree_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/oci/devops/models/repository_commit.rb', line 47 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'commit_id': :'commitId', 'commit_message': :'commitMessage', 'author_name': :'authorName', 'author_email': :'authorEmail', 'committer_name': :'committerName', 'committer_email': :'committerEmail', 'parent_commit_ids': :'parentCommitIds', 'time_created': :'timeCreated', 'tree_id': :'treeId' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/oci/devops/models/repository_commit.rb', line 64 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'commit_id': :'String', 'commit_message': :'String', 'author_name': :'String', 'author_email': :'String', 'committer_name': :'String', 'committer_email': :'String', 'parent_commit_ids': :'Array<String>', 'time_created': :'DateTime', 'tree_id': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/oci/devops/models/repository_commit.rb', line 163 def ==(other) return true if equal?(other) self.class == other.class && commit_id == other.commit_id && == other. && == other. && == other. && committer_name == other.committer_name && committer_email == other.committer_email && parent_commit_ids == other.parent_commit_ids && time_created == other.time_created && tree_id == other.tree_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/oci/devops/models/repository_commit.rb', line 201 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
181 182 183 |
# File 'lib/oci/devops/models/repository_commit.rb', line 181 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
190 191 192 |
# File 'lib/oci/devops/models/repository_commit.rb', line 190 def hash [commit_id, , , , committer_name, committer_email, parent_commit_ids, time_created, tree_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
234 235 236 237 238 239 240 241 242 243 |
# File 'lib/oci/devops/models/repository_commit.rb', line 234 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
228 229 230 |
# File 'lib/oci/devops/models/repository_commit.rb', line 228 def to_s to_hash.to_s end |