Class: OCI::Devops::Models::RepositoryCommitSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/devops/models/repository_commit_summary.rb

Overview

Commit summary with commit information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RepositoryCommitSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :commit_id (String)

    The value to assign to the #commit_id property

  • :commit_message (String)

    The value to assign to the #commit_message property

  • :author_name (String)

    The value to assign to the #author_name property

  • :author_email (String)

    The value to assign to the #author_email property

  • :committer_name (String)

    The value to assign to the #committer_name property

  • :committer_email (String)

    The value to assign to the #committer_email property

  • :parent_commit_ids (Array<String>)

    The value to assign to the #parent_commit_ids property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :tree_id (String)

    The value to assign to the #tree_id property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property

  • :system_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #system_tags property



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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 117

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.commit_message = attributes[:'commitMessage'] if attributes[:'commitMessage']

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

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

  self.author_name = attributes[:'authorName'] if attributes[:'authorName']

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

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

  self.author_email = attributes[:'authorEmail'] if attributes[:'authorEmail']

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

  self.author_email = 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']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

Instance Attribute Details

#author_emailString

[Required] Email of the author of the repository.

Returns:

  • (String)


25
26
27
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 25

def author_email
  @author_email
end

#author_nameString

[Required] Name of the author of the repository.

Returns:

  • (String)


21
22
23
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 21

def author_name
  @author_name
end

#commit_idString

[Required] Commit hash pointed to by reference name.

Returns:

  • (String)


13
14
15
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 13

def commit_id
  @commit_id
end

#commit_messageString

[Required] The commit message.

Returns:

  • (String)


17
18
19
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 17

def commit_message
  @commit_message
end

#committer_emailString

[Required] Email of who creates the commit.

Returns:

  • (String)


33
34
35
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 33

def committer_email
  @committer_email
end

#committer_nameString

[Required] Name of who creates the commit.

Returns:

  • (String)


29
30
31
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 29

def committer_name
  @committer_name
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


53
54
55
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 53

def defined_tags
  @defined_tags
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


49
50
51
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 49

def freeform_tags
  @freeform_tags
end

#parent_commit_idsArray<String>

[Required] An array of parent commit IDs of created commit.

Returns:

  • (Array<String>)


37
38
39
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 37

def parent_commit_ids
  @parent_commit_ids
end

#system_tagsHash<String, Hash<String, Object>>

Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


57
58
59
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 57

def system_tags
  @system_tags
end

#time_createdDateTime

[Required] The time to create the commit.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 41

def time_created
  @time_created
end

#tree_idString

[Required] Tree information for the specified commit.

Returns:

  • (String)


45
46
47
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 45

def tree_id
  @tree_id
end

Class Method Details

.attribute_mapObject

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



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 60

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',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 80

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',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>'
    # 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



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 203

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

  self.class == other.class &&
    commit_id == other.commit_id &&
    commit_message == other.commit_message &&
    author_name == other.author_name &&
    author_email == other.author_email &&
    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 &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags
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



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 244

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


224
225
226
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 224

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



233
234
235
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 233

def hash
  [commit_id, commit_message, author_name, author_email, committer_name, committer_email, parent_commit_ids, time_created, tree_id, freeform_tags, defined_tags, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



277
278
279
280
281
282
283
284
285
286
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 277

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



271
272
273
# File 'lib/oci/devops/models/repository_commit_summary.rb', line 271

def to_s
  to_hash.to_s
end