Class: OCI::Devops::Models::PullRequestSummary
- Inherits:
-
Object
- Object
- OCI::Devops::Models::PullRequestSummary
- Defined in:
- lib/oci/devops/models/pull_request_summary.rb
Overview
Summary of the Pull Request.
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
[Required] Compartment Identifier.
-
#created_by ⇒ OCI::Devops::Models::PrincipalDetails
This attribute is required.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
[Required] Defined tags for this resource.
-
#description ⇒ String
Details of the pull request.
-
#destination_branch ⇒ String
[Required] The destination branch against which the changes are to be reviewed.
-
#display_name ⇒ String
[Required] Pull Request title, can be renamed.
-
#freeform_tags ⇒ Hash<String, String>
[Required] Simple key-value pair that is applied without any predefined name, type or scope.
-
#id ⇒ String
[Required] Unique identifier that is immutable on creation.
-
#lifecycle_details ⇒ String
[Required] The status of the Pull Request.
-
#lifecycle_state ⇒ String
[Required] The current state of the Pull Request.
-
#merge_base_commit_id_at_termination ⇒ String
The merge base commit ID when the Pull Request status was last changed to merged or closed.
-
#repository_id ⇒ String
[Required] DevOps Repository Identifier.
-
#source_branch ⇒ String
[Required] The review branch which contains the changes to be reviewed.
-
#source_commit_id_at_termination ⇒ String
The source branch commit ID when the Pull Request status was last changed to merged or closed.
-
#source_repository_id ⇒ String
The OCID of the forked repository that will act as the source of the changes to be included in the pull request against the parent repository.
-
#system_tags ⇒ Hash<String, Hash<String, Object>>
[Required] Usage of system tag keys.
-
#time_created ⇒ DateTime
[Required] The time the the Pull Request was created.
-
#time_updated ⇒ DateTime
The time the Pull Request was updated.
-
#total_comments ⇒ Integer
[Required] The total number of comments on the pull request.
-
#total_reviewers ⇒ Integer
[Required] The total number of reviewers on the pull request.
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 = {}) ⇒ PullRequestSummary
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 = {}) ⇒ PullRequestSummary
Initializes the object
173 174 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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 173 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.id = attributes[:'id'] if attributes[:'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.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.description = attributes[:'description'] if attributes[:'description'] self.repository_id = attributes[:'repositoryId'] if attributes[:'repositoryId'] raise 'You cannot provide both :repositoryId and :repository_id' if attributes.key?(:'repositoryId') && attributes.key?(:'repository_id') self.repository_id = attributes[:'repository_id'] if attributes[:'repository_id'] self.source_repository_id = attributes[:'sourceRepositoryId'] if attributes[:'sourceRepositoryId'] raise 'You cannot provide both :sourceRepositoryId and :source_repository_id' if attributes.key?(:'sourceRepositoryId') && attributes.key?(:'source_repository_id') self.source_repository_id = attributes[:'source_repository_id'] if attributes[:'source_repository_id'] self.source_branch = attributes[:'sourceBranch'] if attributes[:'sourceBranch'] raise 'You cannot provide both :sourceBranch and :source_branch' if attributes.key?(:'sourceBranch') && attributes.key?(:'source_branch') self.source_branch = attributes[:'source_branch'] if attributes[:'source_branch'] self.destination_branch = attributes[:'destinationBranch'] if attributes[:'destinationBranch'] raise 'You cannot provide both :destinationBranch and :destination_branch' if attributes.key?(:'destinationBranch') && attributes.key?(:'destination_branch') self.destination_branch = attributes[:'destination_branch'] if attributes[:'destination_branch'] self.source_commit_id_at_termination = attributes[:'sourceCommitIdAtTermination'] if attributes[:'sourceCommitIdAtTermination'] raise 'You cannot provide both :sourceCommitIdAtTermination and :source_commit_id_at_termination' if attributes.key?(:'sourceCommitIdAtTermination') && attributes.key?(:'source_commit_id_at_termination') self.source_commit_id_at_termination = attributes[:'source_commit_id_at_termination'] if attributes[:'source_commit_id_at_termination'] self.merge_base_commit_id_at_termination = attributes[:'mergeBaseCommitIdAtTermination'] if attributes[:'mergeBaseCommitIdAtTermination'] raise 'You cannot provide both :mergeBaseCommitIdAtTermination and :merge_base_commit_id_at_termination' if attributes.key?(:'mergeBaseCommitIdAtTermination') && attributes.key?(:'merge_base_commit_id_at_termination') self.merge_base_commit_id_at_termination = attributes[:'merge_base_commit_id_at_termination'] if attributes[:'merge_base_commit_id_at_termination'] 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'] 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.total_comments = attributes[:'totalComments'] if attributes[:'totalComments'] raise 'You cannot provide both :totalComments and :total_comments' if attributes.key?(:'totalComments') && attributes.key?(:'total_comments') self.total_comments = attributes[:'total_comments'] if attributes[:'total_comments'] self.total_reviewers = attributes[:'totalReviewers'] if attributes[:'totalReviewers'] raise 'You cannot provide both :totalReviewers and :total_reviewers' if attributes.key?(:'totalReviewers') && attributes.key?(:'total_reviewers') self.total_reviewers = attributes[:'total_reviewers'] if attributes[:'total_reviewers'] self.created_by = attributes[:'createdBy'] if attributes[:'createdBy'] raise 'You cannot provide both :createdBy and :created_by' if attributes.key?(:'createdBy') && attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] if attributes[:'created_by'] self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self. = attributes[:'systemTags'] if attributes[:'systemTags'] raise 'You cannot provide both :systemTags and :system_tags' if attributes.key?(:'systemTags') && attributes.key?(:'system_tags') self. = attributes[:'system_tags'] if attributes[:'system_tags'] end |
Instance Attribute Details
#compartment_id ⇒ String
[Required] Compartment Identifier
21 22 23 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 21 def compartment_id @compartment_id end |
#created_by ⇒ OCI::Devops::Models::PrincipalDetails
This attribute is required.
77 78 79 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 77 def created_by @created_by end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
[Required] Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}
85 86 87 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 85 def @defined_tags end |
#description ⇒ String
Details of the pull request. Avoid entering confidential information.
25 26 27 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 25 def description @description end |
#destination_branch ⇒ String
[Required] The destination branch against which the changes are to be reviewed.
41 42 43 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 41 def destination_branch @destination_branch end |
#display_name ⇒ String
[Required] Pull Request title, can be renamed
17 18 19 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 17 def display_name @display_name end |
#freeform_tags ⇒ Hash<String, String>
[Required] 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\"}
81 82 83 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 81 def @freeform_tags end |
#id ⇒ String
[Required] Unique identifier that is immutable on creation
13 14 15 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 13 def id @id end |
#lifecycle_details ⇒ String
[Required] The status of the Pull Request.
65 66 67 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 65 def lifecycle_details @lifecycle_details end |
#lifecycle_state ⇒ String
[Required] The current state of the Pull Request.
61 62 63 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 61 def lifecycle_state @lifecycle_state end |
#merge_base_commit_id_at_termination ⇒ String
The merge base commit ID when the Pull Request status was last changed to merged or closed
49 50 51 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 49 def merge_base_commit_id_at_termination @merge_base_commit_id_at_termination end |
#repository_id ⇒ String
[Required] DevOps Repository Identifier
29 30 31 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 29 def repository_id @repository_id end |
#source_branch ⇒ String
[Required] The review branch which contains the changes to be reviewed.
37 38 39 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 37 def source_branch @source_branch end |
#source_commit_id_at_termination ⇒ String
The source branch commit ID when the Pull Request status was last changed to merged or closed
45 46 47 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 45 def source_commit_id_at_termination @source_commit_id_at_termination end |
#source_repository_id ⇒ String
The OCID of the forked repository that will act as the source of the changes to be included in the pull request against the parent repository.
33 34 35 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 33 def source_repository_id @source_repository_id end |
#system_tags ⇒ Hash<String, Hash<String, Object>>
[Required] Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}
89 90 91 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 89 def @system_tags end |
#time_created ⇒ DateTime
[Required] The time the the Pull Request was created. An RFC3339 formatted datetime string
53 54 55 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 53 def time_created @time_created end |
#time_updated ⇒ DateTime
The time the Pull Request was updated. An RFC3339 formatted datetime string
57 58 59 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 57 def time_updated @time_updated end |
#total_comments ⇒ Integer
[Required] The total number of comments on the pull request.
69 70 71 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 69 def total_comments @total_comments end |
#total_reviewers ⇒ Integer
[Required] The total number of reviewers on the pull request.
73 74 75 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 73 def total_reviewers @total_reviewers end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 92 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'display_name': :'displayName', 'compartment_id': :'compartmentId', 'description': :'description', 'repository_id': :'repositoryId', 'source_repository_id': :'sourceRepositoryId', 'source_branch': :'sourceBranch', 'destination_branch': :'destinationBranch', 'source_commit_id_at_termination': :'sourceCommitIdAtTermination', 'merge_base_commit_id_at_termination': :'mergeBaseCommitIdAtTermination', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated', 'lifecycle_state': :'lifecycleState', 'lifecycle_details': :'lifecycleDetails', 'total_comments': :'totalComments', 'total_reviewers': :'totalReviewers', 'created_by': :'createdBy', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'system_tags': :'systemTags' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 120 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'display_name': :'String', 'compartment_id': :'String', 'description': :'String', 'repository_id': :'String', 'source_repository_id': :'String', 'source_branch': :'String', 'destination_branch': :'String', 'source_commit_id_at_termination': :'String', 'merge_base_commit_id_at_termination': :'String', 'time_created': :'DateTime', 'time_updated': :'DateTime', 'lifecycle_state': :'String', 'lifecycle_details': :'String', 'total_comments': :'Integer', 'total_reviewers': :'Integer', 'created_by': :'OCI::Devops::Models::PrincipalDetails', '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.
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 299 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && display_name == other.display_name && compartment_id == other.compartment_id && description == other.description && repository_id == other.repository_id && source_repository_id == other.source_repository_id && source_branch == other.source_branch && destination_branch == other.destination_branch && source_commit_id_at_termination == other.source_commit_id_at_termination && merge_base_commit_id_at_termination == other.merge_base_commit_id_at_termination && time_created == other.time_created && time_updated == other.time_updated && lifecycle_state == other.lifecycle_state && lifecycle_details == other.lifecycle_details && total_comments == other.total_comments && total_reviewers == other.total_reviewers && created_by == other.created_by && == other. && == other. && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 348 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
328 329 330 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 328 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
337 338 339 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 337 def hash [id, display_name, compartment_id, description, repository_id, source_repository_id, source_branch, destination_branch, source_commit_id_at_termination, merge_base_commit_id_at_termination, time_created, time_updated, lifecycle_state, lifecycle_details, total_comments, total_reviewers, created_by, , , ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
381 382 383 384 385 386 387 388 389 390 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 381 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
375 376 377 |
# File 'lib/oci/devops/models/pull_request_summary.rb', line 375 def to_s to_hash.to_s end |