Skip to content

Commit

Permalink
ground work
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHuynh committed Dec 12, 2024
1 parent a2b0d91 commit a2042f3
Show file tree
Hide file tree
Showing 40 changed files with 3,689 additions and 15 deletions.
214 changes: 214 additions & 0 deletions api/types/test-report/code_coverage_file.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
package test_report

// CodeCoverageFile is the API types representation of a code coverage file for a pipeline.
//
// swagger:model CodeCoverageFile
type CodeCoverageFile struct {
ID *int64 `json:"id,omitempty"`
CodeCoverageRun *CodeCoverageRun `json:"code_coverage_run,omitempty"`
CodeCoverageGroup *CodeCoverageGroup `json:"code_coverage_group,omitempty"`
CodeCoverageStats *CodeCoverageStats `json:"code_coverage_stats,omitempty"`
DirectoryName *string `json:"directory_name,omitempty"`
FileName *string `json:"file_name,omitempty"`
MissedLines *int `json:"missed_lines,omitempty"`
PartialLines *int `json:"partial_lines,omitempty"`
FilePath *string `json:"file_path,omitempty"`
}

// GetID returns the ID field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetID() int64 {
if c == nil || c.ID == nil {
return 0
}
return *c.ID
}

// SetID sets the ID field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetID(v int64) {
if c == nil {
return
}
c.ID = &v
}

// GetCodeCoverageRun returns the CodeCoverageRun field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetCodeCoverageRun() *CodeCoverageRun {
if c == nil || c.CodeCoverageRun == nil {
return new(CodeCoverageRun)
}
return c.CodeCoverageRun
}

// SetCodeCoverageRun sets the CodeCoverageRun field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetCodeCoverageRun(v *CodeCoverageRun) {
if c == nil {
return
}
c.CodeCoverageRun = v
}

// GetCodeCoverageGroup returns the CodeCoverageGroup field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetCodeCoverageGroup() *CodeCoverageGroup {
if c == nil || c.CodeCoverageGroup == nil {
return new(CodeCoverageGroup)
}
return c.CodeCoverageGroup
}

// SetCodeCoverageGroup sets the CodeCoverageGroup field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetCodeCoverageGroup(v *CodeCoverageGroup) {
if c == nil {
return
}
c.CodeCoverageGroup = v
}

// GetCodeCoverageStats returns the CodeCoverageStats field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetCodeCoverageStats() *CodeCoverageStats {
if c == nil || c.CodeCoverageStats == nil {
return new(CodeCoverageStats)
}
return c.CodeCoverageStats
}

// SetCodeCoverageStats sets the CodeCoverageStats field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetCodeCoverageStats(v *CodeCoverageStats) {
if c == nil {
return
}
c.CodeCoverageStats = v
}

// GetDirectoryName returns the DirectoryName field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetDirectoryName() string {
if c == nil || c.DirectoryName == nil {
return ""
}
return *c.DirectoryName
}

// SetDirectoryName sets the DirectoryName field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetDirectoryName(v string) {
if c == nil {
return
}
c.DirectoryName = &v
}

// GetFileName returns the FileName field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetFileName() string {
if c == nil || c.FileName == nil {
return ""
}
return *c.FileName
}

// SetFileName sets the FileName field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetFileName(v string) {
if c == nil {
return
}
c.FileName = &v
}

// GetMissedLines returns the MissedLines field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetMissedLines() int {
if c == nil || c.MissedLines == nil {
return 0
}
return *c.MissedLines
}

// SetMissedLines sets the MissedLines field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetMissedLines(v int) {
if c == nil {
return
}
c.MissedLines = &v
}

// GetPartialLines returns the PartialLines field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetPartialLines() int {
if c == nil || c.PartialLines == nil {
return 0
}
return *c.PartialLines
}

// SetPartialLines sets the PartialLines field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetPartialLines(v int) {
if c == nil {
return
}
c.PartialLines = &v
}

// GetFilePath returns the FilePath field.
//
// When the provided CodeCoverageFile type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageFile) GetFilePath() string {
if c == nil || c.FilePath == nil {
return ""
}
return *c.FilePath
}

// SetFilePath sets the FilePath field.
//
// When the provided CodeCoverageFile type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageFile) SetFilePath(v string) {
if c == nil {
return
}
c.FilePath = &v
}
99 changes: 99 additions & 0 deletions api/types/test-report/code_coverage_group.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package test_report

// CodeCoverageGroup is the API types representation of a group of code coverage.
//
// swagger:model CodeCoverageGroup
type CodeCoverageGroup struct {
ID *int64 `json:"id,omitempty"`
CodeCoverageRun *CodeCoverageRun `json:"code_coverage_run,omitempty"`
Name *string `json:"name,omitempty"`
CodeCoverageStats *CodeCoverageStats `json:"code_coverage_stats,omitempty"`
}

// GetID returns the ID field.
//
// When the provided CodeCoverageGroup type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageGroup) GetID() int64 {
if c == nil || c.ID == nil {
return 0
}
return *c.ID
}

// SetID sets the ID field.
//
// When the provided CodeCoverageGroup type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageGroup) SetID(v int64) {
if c == nil {
return
}
c.ID = &v
}

// GetCodeCoverageRun returns the CodeCoverageRun field.
//
// When the provided CodeCoverageGroup type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageGroup) GetCodeCoverageRun() *CodeCoverageRun {
if c == nil || c.CodeCoverageRun == nil {
return new(CodeCoverageRun)
}
return c.CodeCoverageRun
}

// SetCodeCoverageRun sets the CodeCoverageRun field.
//
// When the provided CodeCoverageGroup type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageGroup) SetCodeCoverageRun(v *CodeCoverageRun) {
if c == nil {
return
}
c.CodeCoverageRun = v
}

// GetName returns the Name field.
//
// When the provided CodeCoverageGroup type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageGroup) GetName() string {
if c == nil || c.Name == nil {
return ""
}
return *c.Name
}

// SetName sets the Name field.
//
// When the provided CodeCoverageGroup type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageGroup) SetName(v string) {
if c == nil {
return
}
c.Name = &v
}

// GetCodeCoverageStats returns the CodeCoverageStats field.
//
// When the provided CodeCoverageGroup type is nil, or the field within
// the type is nil, it returns a new CodeCoverageStats instance.
func (c *CodeCoverageGroup) GetCodeCoverageStats() *CodeCoverageStats {
if c == nil || c.CodeCoverageStats == nil {
return new(CodeCoverageStats)
}
return c.CodeCoverageStats
}

// SetCodeCoverageStats sets the CodeCoverageStats field.
//
// When the provided CodeCoverageGroup type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageGroup) SetCodeCoverageStats(v *CodeCoverageStats) {
if c == nil {
return
}
c.CodeCoverageStats = v
}
57 changes: 57 additions & 0 deletions api/types/test-report/code_coverage_run.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package test_report

// CodeCoverageRun is the API types representation of a code coverage run for a pipeline.
//
// swagger:model CodeCoverageRun
type CodeCoverageRun struct {
ID *int64 `json:"id,omitempty"`
TestRunPublicID *string `json:"test_run_public_id,omitempty"`
}

// GetID returns the ID field.
//
// When the provided CodeCoverageRun type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageRun) GetID() int64 {
if c == nil || c.ID == nil {
return 0
}
return *c.ID
}

// GetTestRunPublicID returns the TestRunPublicID field.
//
// When the provided CodeCoverageRun type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (c *CodeCoverageRun) GetTestRunPublicID() string {
if c == nil || c.TestRunPublicID == nil {
return ""
}
return *c.TestRunPublicID
}

// SetID sets the ID field.
//
// When the provided CodeCoverageRun type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageRun) SetID(v int64) {
// return if CodeCoverageRun type is nil
if c == nil {
return
}

c.ID = &v
}

// SetTestRunPublicID sets the TestRunPublicID field.
//
// When the provided CodeCoverageRun type is nil, it
// will set nothing and immediately return.
func (c *CodeCoverageRun) SetTestRunPublicID(v string) {
// return if CodeCoverageRun type is nil
if c == nil {
return
}

c.TestRunPublicID = &v
}
Loading

0 comments on commit a2042f3

Please sign in to comment.