github.com/khulnasoft/codebase@v0.0.0-20231214144635-a707781cbb24/go-bitbucket/model_report_annotation.go (about) 1 /* 2 * Bitbucket API 3 * 4 * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework. 5 * 6 * API version: 2.0 7 * Contact: support@bitbucket.org 8 */ 9 10 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 12 package bitbucket 13 14 import ( 15 "encoding/json" 16 "time" 17 ) 18 19 // ReportAnnotation struct for ReportAnnotation 20 type ReportAnnotation struct { 21 Object 22 // ID of the annotation provided by the annotation creator. It can be used to identify the annotation as an alternative to it's generated uuid. It is not used by Bitbucket, but only by the annotation creator for updating or deleting this specific annotation. Needs to be unique. 23 ExternalId *string `json:"external_id,omitempty"` 24 // The UUID that can be used to identify the annotation. 25 Uuid *string `json:"uuid,omitempty"` 26 // The type of the report. 27 AnnotationType *string `json:"annotation_type,omitempty"` 28 // The path of the file on which this annotation should be placed. This is the path of the file relative to the git repository. If no path is provided, then it will appear in the overview modal on all pull requests where the tip of the branch is the given commit, regardless of which files were modified. 29 Path *string `json:"path,omitempty"` 30 // The line number that the annotation should belong to. If no line number is provided, then it will default to 0 and in a pull request it will appear at the top of the file specified by the path field. 31 Line *int32 `json:"line,omitempty"` 32 // The message to display to users. 33 Summary *string `json:"summary,omitempty"` 34 // The details to show to users when clicking on the annotation. 35 Details *string `json:"details,omitempty"` 36 // The state of the report. May be set to PENDING and later updated. 37 Result *string `json:"result,omitempty"` 38 // The severity of the annotation. 39 Severity *string `json:"severity,omitempty"` 40 // A URL linking to the annotation in an external tool. 41 Link *string `json:"link,omitempty"` 42 // The timestamp when the report was created. 43 CreatedOn *time.Time `json:"created_on,omitempty"` 44 // The timestamp when the report was updated. 45 UpdatedOn *time.Time `json:"updated_on,omitempty"` 46 } 47 48 // NewReportAnnotation instantiates a new ReportAnnotation object 49 // This constructor will assign default values to properties that have it defined, 50 // and makes sure properties required by API are set, but the set of arguments 51 // will change when the set of required properties is changed 52 func NewReportAnnotation() *ReportAnnotation { 53 this := ReportAnnotation{} 54 return &this 55 } 56 57 // NewReportAnnotationWithDefaults instantiates a new ReportAnnotation object 58 // This constructor will only assign default values to properties that have it defined, 59 // but it doesn't guarantee that properties required by API are set 60 func NewReportAnnotationWithDefaults() *ReportAnnotation { 61 this := ReportAnnotation{} 62 return &this 63 } 64 65 // GetExternalId returns the ExternalId field value if set, zero value otherwise. 66 func (o *ReportAnnotation) GetExternalId() string { 67 if o == nil || o.ExternalId == nil { 68 var ret string 69 return ret 70 } 71 return *o.ExternalId 72 } 73 74 // GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise 75 // and a boolean to check if the value has been set. 76 func (o *ReportAnnotation) GetExternalIdOk() (*string, bool) { 77 if o == nil || o.ExternalId == nil { 78 return nil, false 79 } 80 return o.ExternalId, true 81 } 82 83 // HasExternalId returns a boolean if a field has been set. 84 func (o *ReportAnnotation) HasExternalId() bool { 85 if o != nil && o.ExternalId != nil { 86 return true 87 } 88 89 return false 90 } 91 92 // SetExternalId gets a reference to the given string and assigns it to the ExternalId field. 93 func (o *ReportAnnotation) SetExternalId(v string) { 94 o.ExternalId = &v 95 } 96 97 // GetUuid returns the Uuid field value if set, zero value otherwise. 98 func (o *ReportAnnotation) GetUuid() string { 99 if o == nil || o.Uuid == nil { 100 var ret string 101 return ret 102 } 103 return *o.Uuid 104 } 105 106 // GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise 107 // and a boolean to check if the value has been set. 108 func (o *ReportAnnotation) GetUuidOk() (*string, bool) { 109 if o == nil || o.Uuid == nil { 110 return nil, false 111 } 112 return o.Uuid, true 113 } 114 115 // HasUuid returns a boolean if a field has been set. 116 func (o *ReportAnnotation) HasUuid() bool { 117 if o != nil && o.Uuid != nil { 118 return true 119 } 120 121 return false 122 } 123 124 // SetUuid gets a reference to the given string and assigns it to the Uuid field. 125 func (o *ReportAnnotation) SetUuid(v string) { 126 o.Uuid = &v 127 } 128 129 // GetAnnotationType returns the AnnotationType field value if set, zero value otherwise. 130 func (o *ReportAnnotation) GetAnnotationType() string { 131 if o == nil || o.AnnotationType == nil { 132 var ret string 133 return ret 134 } 135 return *o.AnnotationType 136 } 137 138 // GetAnnotationTypeOk returns a tuple with the AnnotationType field value if set, nil otherwise 139 // and a boolean to check if the value has been set. 140 func (o *ReportAnnotation) GetAnnotationTypeOk() (*string, bool) { 141 if o == nil || o.AnnotationType == nil { 142 return nil, false 143 } 144 return o.AnnotationType, true 145 } 146 147 // HasAnnotationType returns a boolean if a field has been set. 148 func (o *ReportAnnotation) HasAnnotationType() bool { 149 if o != nil && o.AnnotationType != nil { 150 return true 151 } 152 153 return false 154 } 155 156 // SetAnnotationType gets a reference to the given string and assigns it to the AnnotationType field. 157 func (o *ReportAnnotation) SetAnnotationType(v string) { 158 o.AnnotationType = &v 159 } 160 161 // GetPath returns the Path field value if set, zero value otherwise. 162 func (o *ReportAnnotation) GetPath() string { 163 if o == nil || o.Path == nil { 164 var ret string 165 return ret 166 } 167 return *o.Path 168 } 169 170 // GetPathOk returns a tuple with the Path field value if set, nil otherwise 171 // and a boolean to check if the value has been set. 172 func (o *ReportAnnotation) GetPathOk() (*string, bool) { 173 if o == nil || o.Path == nil { 174 return nil, false 175 } 176 return o.Path, true 177 } 178 179 // HasPath returns a boolean if a field has been set. 180 func (o *ReportAnnotation) HasPath() bool { 181 if o != nil && o.Path != nil { 182 return true 183 } 184 185 return false 186 } 187 188 // SetPath gets a reference to the given string and assigns it to the Path field. 189 func (o *ReportAnnotation) SetPath(v string) { 190 o.Path = &v 191 } 192 193 // GetLine returns the Line field value if set, zero value otherwise. 194 func (o *ReportAnnotation) GetLine() int32 { 195 if o == nil || o.Line == nil { 196 var ret int32 197 return ret 198 } 199 return *o.Line 200 } 201 202 // GetLineOk returns a tuple with the Line field value if set, nil otherwise 203 // and a boolean to check if the value has been set. 204 func (o *ReportAnnotation) GetLineOk() (*int32, bool) { 205 if o == nil || o.Line == nil { 206 return nil, false 207 } 208 return o.Line, true 209 } 210 211 // HasLine returns a boolean if a field has been set. 212 func (o *ReportAnnotation) HasLine() bool { 213 if o != nil && o.Line != nil { 214 return true 215 } 216 217 return false 218 } 219 220 // SetLine gets a reference to the given int32 and assigns it to the Line field. 221 func (o *ReportAnnotation) SetLine(v int32) { 222 o.Line = &v 223 } 224 225 // GetSummary returns the Summary field value if set, zero value otherwise. 226 func (o *ReportAnnotation) GetSummary() string { 227 if o == nil || o.Summary == nil { 228 var ret string 229 return ret 230 } 231 return *o.Summary 232 } 233 234 // GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise 235 // and a boolean to check if the value has been set. 236 func (o *ReportAnnotation) GetSummaryOk() (*string, bool) { 237 if o == nil || o.Summary == nil { 238 return nil, false 239 } 240 return o.Summary, true 241 } 242 243 // HasSummary returns a boolean if a field has been set. 244 func (o *ReportAnnotation) HasSummary() bool { 245 if o != nil && o.Summary != nil { 246 return true 247 } 248 249 return false 250 } 251 252 // SetSummary gets a reference to the given string and assigns it to the Summary field. 253 func (o *ReportAnnotation) SetSummary(v string) { 254 o.Summary = &v 255 } 256 257 // GetDetails returns the Details field value if set, zero value otherwise. 258 func (o *ReportAnnotation) GetDetails() string { 259 if o == nil || o.Details == nil { 260 var ret string 261 return ret 262 } 263 return *o.Details 264 } 265 266 // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise 267 // and a boolean to check if the value has been set. 268 func (o *ReportAnnotation) GetDetailsOk() (*string, bool) { 269 if o == nil || o.Details == nil { 270 return nil, false 271 } 272 return o.Details, true 273 } 274 275 // HasDetails returns a boolean if a field has been set. 276 func (o *ReportAnnotation) HasDetails() bool { 277 if o != nil && o.Details != nil { 278 return true 279 } 280 281 return false 282 } 283 284 // SetDetails gets a reference to the given string and assigns it to the Details field. 285 func (o *ReportAnnotation) SetDetails(v string) { 286 o.Details = &v 287 } 288 289 // GetResult returns the Result field value if set, zero value otherwise. 290 func (o *ReportAnnotation) GetResult() string { 291 if o == nil || o.Result == nil { 292 var ret string 293 return ret 294 } 295 return *o.Result 296 } 297 298 // GetResultOk returns a tuple with the Result field value if set, nil otherwise 299 // and a boolean to check if the value has been set. 300 func (o *ReportAnnotation) GetResultOk() (*string, bool) { 301 if o == nil || o.Result == nil { 302 return nil, false 303 } 304 return o.Result, true 305 } 306 307 // HasResult returns a boolean if a field has been set. 308 func (o *ReportAnnotation) HasResult() bool { 309 if o != nil && o.Result != nil { 310 return true 311 } 312 313 return false 314 } 315 316 // SetResult gets a reference to the given string and assigns it to the Result field. 317 func (o *ReportAnnotation) SetResult(v string) { 318 o.Result = &v 319 } 320 321 // GetSeverity returns the Severity field value if set, zero value otherwise. 322 func (o *ReportAnnotation) GetSeverity() string { 323 if o == nil || o.Severity == nil { 324 var ret string 325 return ret 326 } 327 return *o.Severity 328 } 329 330 // GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise 331 // and a boolean to check if the value has been set. 332 func (o *ReportAnnotation) GetSeverityOk() (*string, bool) { 333 if o == nil || o.Severity == nil { 334 return nil, false 335 } 336 return o.Severity, true 337 } 338 339 // HasSeverity returns a boolean if a field has been set. 340 func (o *ReportAnnotation) HasSeverity() bool { 341 if o != nil && o.Severity != nil { 342 return true 343 } 344 345 return false 346 } 347 348 // SetSeverity gets a reference to the given string and assigns it to the Severity field. 349 func (o *ReportAnnotation) SetSeverity(v string) { 350 o.Severity = &v 351 } 352 353 // GetLink returns the Link field value if set, zero value otherwise. 354 func (o *ReportAnnotation) GetLink() string { 355 if o == nil || o.Link == nil { 356 var ret string 357 return ret 358 } 359 return *o.Link 360 } 361 362 // GetLinkOk returns a tuple with the Link field value if set, nil otherwise 363 // and a boolean to check if the value has been set. 364 func (o *ReportAnnotation) GetLinkOk() (*string, bool) { 365 if o == nil || o.Link == nil { 366 return nil, false 367 } 368 return o.Link, true 369 } 370 371 // HasLink returns a boolean if a field has been set. 372 func (o *ReportAnnotation) HasLink() bool { 373 if o != nil && o.Link != nil { 374 return true 375 } 376 377 return false 378 } 379 380 // SetLink gets a reference to the given string and assigns it to the Link field. 381 func (o *ReportAnnotation) SetLink(v string) { 382 o.Link = &v 383 } 384 385 // GetCreatedOn returns the CreatedOn field value if set, zero value otherwise. 386 func (o *ReportAnnotation) GetCreatedOn() time.Time { 387 if o == nil || o.CreatedOn == nil { 388 var ret time.Time 389 return ret 390 } 391 return *o.CreatedOn 392 } 393 394 // GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise 395 // and a boolean to check if the value has been set. 396 func (o *ReportAnnotation) GetCreatedOnOk() (*time.Time, bool) { 397 if o == nil || o.CreatedOn == nil { 398 return nil, false 399 } 400 return o.CreatedOn, true 401 } 402 403 // HasCreatedOn returns a boolean if a field has been set. 404 func (o *ReportAnnotation) HasCreatedOn() bool { 405 if o != nil && o.CreatedOn != nil { 406 return true 407 } 408 409 return false 410 } 411 412 // SetCreatedOn gets a reference to the given time.Time and assigns it to the CreatedOn field. 413 func (o *ReportAnnotation) SetCreatedOn(v time.Time) { 414 o.CreatedOn = &v 415 } 416 417 // GetUpdatedOn returns the UpdatedOn field value if set, zero value otherwise. 418 func (o *ReportAnnotation) GetUpdatedOn() time.Time { 419 if o == nil || o.UpdatedOn == nil { 420 var ret time.Time 421 return ret 422 } 423 return *o.UpdatedOn 424 } 425 426 // GetUpdatedOnOk returns a tuple with the UpdatedOn field value if set, nil otherwise 427 // and a boolean to check if the value has been set. 428 func (o *ReportAnnotation) GetUpdatedOnOk() (*time.Time, bool) { 429 if o == nil || o.UpdatedOn == nil { 430 return nil, false 431 } 432 return o.UpdatedOn, true 433 } 434 435 // HasUpdatedOn returns a boolean if a field has been set. 436 func (o *ReportAnnotation) HasUpdatedOn() bool { 437 if o != nil && o.UpdatedOn != nil { 438 return true 439 } 440 441 return false 442 } 443 444 // SetUpdatedOn gets a reference to the given time.Time and assigns it to the UpdatedOn field. 445 func (o *ReportAnnotation) SetUpdatedOn(v time.Time) { 446 o.UpdatedOn = &v 447 } 448 449 func (o ReportAnnotation) MarshalJSON() ([]byte, error) { 450 toSerialize := map[string]interface{}{} 451 serializedObject, errObject := json.Marshal(o.Object) 452 if errObject != nil { 453 return []byte{}, errObject 454 } 455 errObject = json.Unmarshal([]byte(serializedObject), &toSerialize) 456 if errObject != nil { 457 return []byte{}, errObject 458 } 459 if o.ExternalId != nil { 460 toSerialize["external_id"] = o.ExternalId 461 } 462 if o.Uuid != nil { 463 toSerialize["uuid"] = o.Uuid 464 } 465 if o.AnnotationType != nil { 466 toSerialize["annotation_type"] = o.AnnotationType 467 } 468 if o.Path != nil { 469 toSerialize["path"] = o.Path 470 } 471 if o.Line != nil { 472 toSerialize["line"] = o.Line 473 } 474 if o.Summary != nil { 475 toSerialize["summary"] = o.Summary 476 } 477 if o.Details != nil { 478 toSerialize["details"] = o.Details 479 } 480 if o.Result != nil { 481 toSerialize["result"] = o.Result 482 } 483 if o.Severity != nil { 484 toSerialize["severity"] = o.Severity 485 } 486 if o.Link != nil { 487 toSerialize["link"] = o.Link 488 } 489 if o.CreatedOn != nil { 490 toSerialize["created_on"] = o.CreatedOn 491 } 492 if o.UpdatedOn != nil { 493 toSerialize["updated_on"] = o.UpdatedOn 494 } 495 return json.Marshal(toSerialize) 496 } 497 498 type NullableReportAnnotation struct { 499 value *ReportAnnotation 500 isSet bool 501 } 502 503 func (v NullableReportAnnotation) Get() *ReportAnnotation { 504 return v.value 505 } 506 507 func (v *NullableReportAnnotation) Set(val *ReportAnnotation) { 508 v.value = val 509 v.isSet = true 510 } 511 512 func (v NullableReportAnnotation) IsSet() bool { 513 return v.isSet 514 } 515 516 func (v *NullableReportAnnotation) Unset() { 517 v.value = nil 518 v.isSet = false 519 } 520 521 func NewNullableReportAnnotation(val *ReportAnnotation) *NullableReportAnnotation { 522 return &NullableReportAnnotation{value: val, isSet: true} 523 } 524 525 func (v NullableReportAnnotation) MarshalJSON() ([]byte, error) { 526 return json.Marshal(v.value) 527 } 528 529 func (v *NullableReportAnnotation) UnmarshalJSON(src []byte) error { 530 v.isSet = true 531 return json.Unmarshal(src, &v.value) 532 }