|
| 1 | +package dto |
| 2 | + |
| 3 | +const ( |
| 4 | + EntityKindApi string = "api" |
| 5 | + EntityKindComponent string = "component" |
| 6 | + EntityKindEnvironment string = "environment" |
| 7 | + EntityKindEnvironmentblueprint string = "environmentblueprint" |
| 8 | + EntityKindGroup string = "group" |
| 9 | + EntityKindResource string = "resource" |
| 10 | + EntityKindUser string = "user" |
| 11 | + EntityKindWorkflow string = "workflow" |
| 12 | +) |
| 13 | + |
| 14 | +const ( |
| 15 | + ScorecardDetailsWeightageStrategyCUSTOM string = "CUSTOM" |
| 16 | + ScorecardDetailsWeightageStrategyEQUALWEIGHTS string = "EQUAL_WEIGHTS" |
| 17 | +) |
| 18 | + |
| 19 | +type GetEntityParams struct { |
| 20 | + BranchName string `form:"branch_name,omitempty" json:"branch_name,omitempty"` |
| 21 | + ConnectorRef string `form:"connector_ref,omitempty" json:"connector_ref,omitempty"` |
| 22 | + RepoName string `form:"repo_name,omitempty" json:"repo_name,omitempty"` |
| 23 | + LoadFromFallbackBranch bool `form:"load_from_fallback_branch,omitempty" json:"load_from_fallback_branch,omitempty"` |
| 24 | + OrgIdentifier string `form:"orgIdentifier,omitempty" json:"orgIdentifier,omitempty"` |
| 25 | + ProjectIdentifier string `form:"projectIdentifier,omitempty" json:"projectIdentifier,omitempty"` |
| 26 | + HarnessAccount string `json:"Harness-Account,omitempty"` |
| 27 | +} |
| 28 | + |
| 29 | +type EntityResponse struct { |
| 30 | + Description string `json:"description,omitempty"` |
| 31 | + EntityRef string `json:"entity_ref"` |
| 32 | + EntityValidityDetails struct { |
| 33 | + ErrorMessages []string `json:"error_messages,omitempty"` |
| 34 | + IsValid bool `json:"is_valid,omitempty"` |
| 35 | + } `json:"entity_validity_details,omitempty"` |
| 36 | + GitDetails struct { |
| 37 | + BaseBranch string `json:"base_branch,omitempty"` |
| 38 | + BranchName string `json:"branch_name,omitempty"` |
| 39 | + CommitId string `json:"commit_id,omitempty"` |
| 40 | + CommitMessage string `json:"commit_message,omitempty"` |
| 41 | + ConnectorRef string `json:"connector_ref,omitempty"` |
| 42 | + FilePath string `json:"file_path,omitempty"` |
| 43 | + FileUrl string `json:"file_url,omitempty"` |
| 44 | + IsHarnessCodeRepo bool `json:"is_harness_code_repo,omitempty"` |
| 45 | + ObjectId string `json:"object_id,omitempty"` |
| 46 | + RepoName string `json:"repo_name,omitempty"` |
| 47 | + RepoUrl string `json:"repo_url,omitempty"` |
| 48 | + StoreType string `json:"store_type,omitempty"` |
| 49 | + } `json:"git_details,omitempty"` |
| 50 | + Groups []struct { |
| 51 | + GroupDescription string `json:"group_description,omitempty"` |
| 52 | + GroupIcon string `json:"group_icon,omitempty"` |
| 53 | + GroupIdentifier string `json:"group_identifier,omitempty"` |
| 54 | + GroupName string `json:"group_name,omitempty"` |
| 55 | + OrgIdentifier string `json:"org_identifier,omitempty"` |
| 56 | + OrgName string `json:"org_name,omitempty"` |
| 57 | + ProjectIdentifier string `json:"project_identifier,omitempty"` |
| 58 | + ProjectName string `json:"project_name,omitempty"` |
| 59 | + Scope string `json:"scope,omitempty"` |
| 60 | + } `json:"groups,omitempty"` |
| 61 | + Identifier string `json:"identifier"` |
| 62 | + Kind string `json:"kind"` |
| 63 | + Lifecycle string `json:"lifecycle,omitempty"` |
| 64 | + Metadata map[string]any `json:"metadata,omitempty"` |
| 65 | + Name string `json:"name,omitempty"` |
| 66 | + OrgIdentifier string `json:"orgIdentifier,omitempty"` |
| 67 | + OrgName string `json:"org_name,omitempty"` |
| 68 | + Owner string `json:"owner,omitempty"` |
| 69 | + ProjectIdentifier string `json:"projectIdentifier,omitempty"` |
| 70 | + ProjectName string `json:"project_name,omitempty"` |
| 71 | + ReferenceType string `json:"referenceType"` |
| 72 | + Scope string `json:"scope"` |
| 73 | + Scorecards struct { |
| 74 | + Average float32 `json:"average,omitempty"` |
| 75 | + Scores []struct { |
| 76 | + PassedChecks float32 `json:"passed_checks,omitempty"` |
| 77 | + Score float32 `json:"score,omitempty"` |
| 78 | + Scorecard string `json:"scorecard,omitempty"` |
| 79 | + TotalChecks float32 `json:"total_checks,omitempty"` |
| 80 | + } `json:"scores,omitempty"` |
| 81 | + } `json:"scorecards,omitempty"` |
| 82 | + Starred bool `json:"starred,omitempty"` |
| 83 | + Status []struct { |
| 84 | + Level string `json:"level,omitempty"` |
| 85 | + Message string `json:"message,omitempty"` |
| 86 | + Type string `json:"type,omitempty"` |
| 87 | + } `json:"status,omitempty"` |
| 88 | + Tags []string `json:"tags,omitempty"` |
| 89 | + Type string `json:"type,omitempty"` |
| 90 | + Yaml string `json:"yaml"` |
| 91 | +} |
| 92 | + |
| 93 | +type GetEntitiesParams struct { |
| 94 | + Page int32 `form:"page,omitempty" json:"page,omitempty"` |
| 95 | + Limit int32 `form:"limit,omitempty" json:"limit,omitempty"` |
| 96 | + Sort string `form:"sort,omitempty" json:"sort,omitempty"` |
| 97 | + SearchTerm string `form:"search_term,omitempty" json:"search_term,omitempty"` |
| 98 | + Scopes string `form:"scopes,omitempty" json:"scopes,omitempty"` |
| 99 | + EntityRefs string `form:"entity_refs,omitempty" json:"entity_refs,omitempty"` |
| 100 | + OwnedByMe bool `form:"owned_by_me,omitempty" json:"owned_by_me,omitempty"` |
| 101 | + Favorites bool `form:"favorites,omitempty" json:"favorites,omitempty"` |
| 102 | + Kind string `form:"kind,omitempty" json:"kind,omitempty"` |
| 103 | + Type string `form:"type,omitempty" json:"type,omitempty"` |
| 104 | + Owner string `form:"owner,omitempty" json:"owner,omitempty"` |
| 105 | + Lifecycle string `form:"lifecycle,omitempty" json:"lifecycle,omitempty"` |
| 106 | + Tags string `form:"tags,omitempty" json:"tags,omitempty"` |
| 107 | + HarnessAccount string `json:"Harness-Account,omitempty"` |
| 108 | +} |
| 109 | + |
| 110 | +type GetScorecardsParams struct { |
| 111 | + HarnessAccount string `json:"Harness-Account,omitempty"` |
| 112 | +} |
| 113 | + |
| 114 | +type ScorecardDetailsResponse struct { |
| 115 | + Checks []ScorecardChecksDetails `json:"checks"` |
| 116 | + Scorecard ScorecardDetails `json:"scorecard"` |
| 117 | +} |
| 118 | + |
| 119 | +type ScorecardDetails struct { |
| 120 | + ChecksMissing []string `json:"checks_missing,omitempty"` |
| 121 | + Components int `json:"components,omitempty"` |
| 122 | + Description string `json:"description,omitempty"` |
| 123 | + Filter struct { |
| 124 | + Kind string `json:"kind"` |
| 125 | + Lifecycle []string `json:"lifecycle,omitempty"` |
| 126 | + Owners []string `json:"owners,omitempty"` |
| 127 | + Scopes []string `json:"scopes,omitempty"` |
| 128 | + Tags []string `json:"tags,omitempty"` |
| 129 | + Type string `json:"type,omitempty"` |
| 130 | + } `json:"filter"` |
| 131 | + Identifier string `json:"identifier"` |
| 132 | + Name string `json:"name"` |
| 133 | + OnDemand bool `json:"on_demand,omitempty"` |
| 134 | + Percentage float64 `json:"percentage,omitempty"` |
| 135 | + Published bool `json:"published"` |
| 136 | + WeightageStrategy string `json:"weightage_strategy,omitempty"` |
| 137 | +} |
| 138 | + |
| 139 | +type ScorecardChecksDetails struct { |
| 140 | + Custom bool `json:"custom"` |
| 141 | + Description string `json:"description,omitempty"` |
| 142 | + Identifier string `json:"identifier"` |
| 143 | + Name string `json:"name"` |
| 144 | + Weightage float64 `json:"weightage,omitempty"` |
| 145 | +} |
| 146 | + |
| 147 | +type ScorecardResponse struct { |
| 148 | + Scorecard Scorecard `json:"scorecard,omitempty"` |
| 149 | +} |
| 150 | + |
| 151 | +type Scorecard struct { |
| 152 | + Checks []Check `json:"checks"` |
| 153 | + ChecksMissing []string `json:"checks_missing,omitempty"` |
| 154 | + Components int `json:"components,omitempty"` |
| 155 | + Description string `json:"description,omitempty"` |
| 156 | + Identifier string `json:"identifier"` |
| 157 | + Name string `json:"name"` |
| 158 | + Percentage float64 `json:"percentage,omitempty"` |
| 159 | + Published bool `json:"published,omitempty"` |
| 160 | +} |
| 161 | + |
| 162 | +type Check struct { |
| 163 | + Custom bool `json:"custom"` |
| 164 | + Description string `json:"description,omitempty"` |
| 165 | + Expression string `json:"expression,omitempty"` |
| 166 | + Identifier string `json:"identifier"` |
| 167 | + Name string `json:"name"` |
| 168 | + Tags []string `json:"tags,omitempty"` |
| 169 | +} |
| 170 | + |
| 171 | +type GetAllScorecardSummaryParams struct { |
| 172 | + EntityIdentifier string `form:"entity_identifier" json:"entity_identifier"` |
| 173 | + HarnessAccount string `json:"Harness-Account,omitempty"` |
| 174 | +} |
| 175 | + |
| 176 | +type ScorecardSummaryResponse struct { |
| 177 | + ScorecardsSummary []ScorecardSummaryInfo `json:"scorecards_summary"` |
| 178 | +} |
| 179 | + |
| 180 | +type ScorecardSummaryInfo struct { |
| 181 | + ChecksStatuses []CheckStatus `json:"checks_statuses"` |
| 182 | + Description string `json:"description"` |
| 183 | + RecalibrateInfo ScorecardRecalibrateInfo `json:"recalibrate_info,omitempty"` |
| 184 | + Score int `json:"score"` |
| 185 | + ScorecardIdentifier string `json:"scorecard_identifier"` |
| 186 | + ScorecardName string `json:"scorecard_name"` |
| 187 | + Timestamp int64 `json:"timestamp"` |
| 188 | +} |
| 189 | + |
| 190 | +type CheckStatus struct { |
| 191 | + Custom bool `json:"custom,omitempty"` |
| 192 | + Identifier string `json:"identifier,omitempty"` |
| 193 | + Name string `json:"name"` |
| 194 | + Reason string `json:"reason,omitempty"` |
| 195 | + Status string `json:"status"` |
| 196 | + Weight int `json:"weight"` |
| 197 | +} |
| 198 | + |
| 199 | +type ScorecardRecalibrateInfo struct { |
| 200 | + StartTime int64 `json:"start_time,omitempty"` |
| 201 | + StartedBy IDPUser `json:"started_by,omitempty"` |
| 202 | +} |
| 203 | + |
| 204 | +type IDPUser struct { |
| 205 | + Email string `json:"email,omitempty"` |
| 206 | + Name string `json:"name,omitempty"` |
| 207 | + Uuid string `json:"uuid,omitempty"` |
| 208 | +} |
| 209 | + |
| 210 | +type ScorecardScoreResponse struct { |
| 211 | + OverallScore int `json:"overall_score"` |
| 212 | + ScorecardScores []ScorecardScore `json:"scorecard_scores"` |
| 213 | +} |
| 214 | + |
| 215 | +type ScorecardScore struct { |
| 216 | + Description string `json:"description"` |
| 217 | + Score int `json:"score"` |
| 218 | + ScorecardName string `json:"scorecard_name"` |
| 219 | +} |
0 commit comments