Skip to content

Commit

Permalink
feat: secret scanning validity checks, secret scanning non provider p…
Browse files Browse the repository at this point in the history
…atterns (#85)

* New updates to generated code

* New updates to generated code

---------

Co-authored-by: Octokit Bot <[email protected]>
  • Loading branch information
octokitbot and Octokit Bot authored Jul 15, 2024
1 parent a74a3a2 commit a379f57
Show file tree
Hide file tree
Showing 11 changed files with 595 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pkg/github/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "5FA7CA9E52F4DC9FEF52F03756DB724E8A3E6712D6F3156FD93137B201C01715FB8D8C896DA613E7E92B801B6BFDDFC7A5A21DED96C69169D683BFE02CD20F45",
"descriptionHash": "28892E7C7251AFE384B0BAF35F819C673A641FDA8EF33344D143E8081DBF2FE16C643E7DE09D2722ADEF7664B15C22F0315ACE2A63E7A80AA54D8F1B6DDA5D78",
"descriptionLocation": "../../../../../schemas/api.github.com.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.14.0",
Expand Down
30 changes: 30 additions & 0 deletions pkg/github/models/code_security_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type CodeSecurityConfiguration struct {
secret_scanning *CodeSecurityConfiguration_secret_scanning
// The enablement status of secret scanning push protection
secret_scanning_push_protection *CodeSecurityConfiguration_secret_scanning_push_protection
// The enablement status of secret scanning validity checks
secret_scanning_validity_checks *CodeSecurityConfiguration_secret_scanning_validity_checks
// The type of the code security configuration.
target_type *CodeSecurityConfiguration_target_type
// The updated_at property
Expand Down Expand Up @@ -228,6 +230,16 @@ func (m *CodeSecurityConfiguration) GetFieldDeserializers()(map[string]func(i878
}
return nil
}
res["secret_scanning_validity_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_secret_scanning_validity_checks)
if err != nil {
return err
}
if val != nil {
m.SetSecretScanningValidityChecks(val.(*CodeSecurityConfiguration_secret_scanning_validity_checks))
}
return nil
}
res["target_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_target_type)
if err != nil {
Expand Down Expand Up @@ -290,6 +302,11 @@ func (m *CodeSecurityConfiguration) GetSecretScanning()(*CodeSecurityConfigurati
func (m *CodeSecurityConfiguration) GetSecretScanningPushProtection()(*CodeSecurityConfiguration_secret_scanning_push_protection) {
return m.secret_scanning_push_protection
}
// GetSecretScanningValidityChecks gets the secret_scanning_validity_checks property value. The enablement status of secret scanning validity checks
// returns a *CodeSecurityConfiguration_secret_scanning_validity_checks when successful
func (m *CodeSecurityConfiguration) GetSecretScanningValidityChecks()(*CodeSecurityConfiguration_secret_scanning_validity_checks) {
return m.secret_scanning_validity_checks
}
// GetTargetType gets the target_type property value. The type of the code security configuration.
// returns a *CodeSecurityConfiguration_target_type when successful
func (m *CodeSecurityConfiguration) GetTargetType()(*CodeSecurityConfiguration_target_type) {
Expand Down Expand Up @@ -393,6 +410,13 @@ func (m *CodeSecurityConfiguration) Serialize(writer i878a80d2330e89d26896388a3f
return err
}
}
if m.GetSecretScanningValidityChecks() != nil {
cast := (*m.GetSecretScanningValidityChecks()).String()
err := writer.WriteStringValue("secret_scanning_validity_checks", &cast)
if err != nil {
return err
}
}
if m.GetTargetType() != nil {
cast := (*m.GetTargetType()).String()
err := writer.WriteStringValue("target_type", &cast)
Expand Down Expand Up @@ -476,6 +500,10 @@ func (m *CodeSecurityConfiguration) SetSecretScanning(value *CodeSecurityConfigu
func (m *CodeSecurityConfiguration) SetSecretScanningPushProtection(value *CodeSecurityConfiguration_secret_scanning_push_protection)() {
m.secret_scanning_push_protection = value
}
// SetSecretScanningValidityChecks sets the secret_scanning_validity_checks property value. The enablement status of secret scanning validity checks
func (m *CodeSecurityConfiguration) SetSecretScanningValidityChecks(value *CodeSecurityConfiguration_secret_scanning_validity_checks)() {
m.secret_scanning_validity_checks = value
}
// SetTargetType sets the target_type property value. The type of the code security configuration.
func (m *CodeSecurityConfiguration) SetTargetType(value *CodeSecurityConfiguration_target_type)() {
m.target_type = value
Expand Down Expand Up @@ -504,6 +532,7 @@ type CodeSecurityConfigurationable interface {
GetPrivateVulnerabilityReporting()(*CodeSecurityConfiguration_private_vulnerability_reporting)
GetSecretScanning()(*CodeSecurityConfiguration_secret_scanning)
GetSecretScanningPushProtection()(*CodeSecurityConfiguration_secret_scanning_push_protection)
GetSecretScanningValidityChecks()(*CodeSecurityConfiguration_secret_scanning_validity_checks)
GetTargetType()(*CodeSecurityConfiguration_target_type)
GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetUrl()(*string)
Expand All @@ -520,6 +549,7 @@ type CodeSecurityConfigurationable interface {
SetPrivateVulnerabilityReporting(value *CodeSecurityConfiguration_private_vulnerability_reporting)()
SetSecretScanning(value *CodeSecurityConfiguration_secret_scanning)()
SetSecretScanningPushProtection(value *CodeSecurityConfiguration_secret_scanning_push_protection)()
SetSecretScanningValidityChecks(value *CodeSecurityConfiguration_secret_scanning_validity_checks)()
SetTargetType(value *CodeSecurityConfiguration_target_type)()
SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetUrl(value *string)()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package models
import (
"errors"
)
// The enablement status of secret scanning validity checks
type CodeSecurityConfiguration_secret_scanning_validity_checks int

const (
ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS CodeSecurityConfiguration_secret_scanning_validity_checks = iota
DISABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS
NOT_SET_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS
)

func (i CodeSecurityConfiguration_secret_scanning_validity_checks) String() string {
return []string{"enabled", "disabled", "not_set"}[i]
}
func ParseCodeSecurityConfiguration_secret_scanning_validity_checks(v string) (any, error) {
result := ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS
switch v {
case "enabled":
result = ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS
case "disabled":
result = DISABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS
case "not_set":
result = NOT_SET_CODESECURITYCONFIGURATION_SECRET_SCANNING_VALIDITY_CHECKS
default:
return 0, errors.New("Unknown CodeSecurityConfiguration_secret_scanning_validity_checks value: " + v)
}
return &result, nil
}
func SerializeCodeSecurityConfiguration_secret_scanning_validity_checks(values []CodeSecurityConfiguration_secret_scanning_validity_checks) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i CodeSecurityConfiguration_secret_scanning_validity_checks) isMultiValue() bool {
return false
}
Loading

0 comments on commit a379f57

Please sign in to comment.