Skip to content

Commit

Permalink
New updates to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Octokit Bot committed Jul 12, 2024
1 parent 73bd524 commit 8905485
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 1 deletion.
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": "7CD6E42D131894DD1A312DF6188203EAA34E6FFB60B1FEA1DE947CB8E144E99318A7E528EB4540E371657D463E753C793B3A7AB9F8B7673F9A9F1F010D32BB7A",
"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
}
29 changes: 29 additions & 0 deletions pkg/github/models/security_and_analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type SecurityAndAnalysis struct {
dependabot_security_updates SecurityAndAnalysis_dependabot_security_updatesable
// The secret_scanning property
secret_scanning SecurityAndAnalysis_secret_scanningable
// The secret_scanning_non_provider_patterns property
secret_scanning_non_provider_patterns SecurityAndAnalysis_secret_scanning_non_provider_patternsable
// The secret_scanning_push_protection property
secret_scanning_push_protection SecurityAndAnalysis_secret_scanning_push_protectionable
}
Expand Down Expand Up @@ -77,6 +79,16 @@ func (m *SecurityAndAnalysis) GetFieldDeserializers()(map[string]func(i878a80d23
}
return nil
}
res["secret_scanning_non_provider_patterns"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateSecurityAndAnalysis_secret_scanning_non_provider_patternsFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetSecretScanningNonProviderPatterns(val.(SecurityAndAnalysis_secret_scanning_non_provider_patternsable))
}
return nil
}
res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue)
if err != nil {
Expand All @@ -94,6 +106,11 @@ func (m *SecurityAndAnalysis) GetFieldDeserializers()(map[string]func(i878a80d23
func (m *SecurityAndAnalysis) GetSecretScanning()(SecurityAndAnalysis_secret_scanningable) {
return m.secret_scanning
}
// GetSecretScanningNonProviderPatterns gets the secret_scanning_non_provider_patterns property value. The secret_scanning_non_provider_patterns property
// returns a SecurityAndAnalysis_secret_scanning_non_provider_patternsable when successful
func (m *SecurityAndAnalysis) GetSecretScanningNonProviderPatterns()(SecurityAndAnalysis_secret_scanning_non_provider_patternsable) {
return m.secret_scanning_non_provider_patterns
}
// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. The secret_scanning_push_protection property
// returns a SecurityAndAnalysis_secret_scanning_push_protectionable when successful
func (m *SecurityAndAnalysis) GetSecretScanningPushProtection()(SecurityAndAnalysis_secret_scanning_push_protectionable) {
Expand All @@ -119,6 +136,12 @@ func (m *SecurityAndAnalysis) Serialize(writer i878a80d2330e89d26896388a3f487eef
return err
}
}
{
err := writer.WriteObjectValue("secret_scanning_non_provider_patterns", m.GetSecretScanningNonProviderPatterns())
if err != nil {
return err
}
}
{
err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection())
if err != nil {
Expand Down Expand Up @@ -149,6 +172,10 @@ func (m *SecurityAndAnalysis) SetDependabotSecurityUpdates(value SecurityAndAnal
func (m *SecurityAndAnalysis) SetSecretScanning(value SecurityAndAnalysis_secret_scanningable)() {
m.secret_scanning = value
}
// SetSecretScanningNonProviderPatterns sets the secret_scanning_non_provider_patterns property value. The secret_scanning_non_provider_patterns property
func (m *SecurityAndAnalysis) SetSecretScanningNonProviderPatterns(value SecurityAndAnalysis_secret_scanning_non_provider_patternsable)() {
m.secret_scanning_non_provider_patterns = value
}
// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. The secret_scanning_push_protection property
func (m *SecurityAndAnalysis) SetSecretScanningPushProtection(value SecurityAndAnalysis_secret_scanning_push_protectionable)() {
m.secret_scanning_push_protection = value
Expand All @@ -159,9 +186,11 @@ type SecurityAndAnalysisable interface {
GetAdvancedSecurity()(SecurityAndAnalysis_advanced_securityable)
GetDependabotSecurityUpdates()(SecurityAndAnalysis_dependabot_security_updatesable)
GetSecretScanning()(SecurityAndAnalysis_secret_scanningable)
GetSecretScanningNonProviderPatterns()(SecurityAndAnalysis_secret_scanning_non_provider_patternsable)
GetSecretScanningPushProtection()(SecurityAndAnalysis_secret_scanning_push_protectionable)
SetAdvancedSecurity(value SecurityAndAnalysis_advanced_securityable)()
SetDependabotSecurityUpdates(value SecurityAndAnalysis_dependabot_security_updatesable)()
SetSecretScanning(value SecurityAndAnalysis_secret_scanningable)()
SetSecretScanningNonProviderPatterns(value SecurityAndAnalysis_secret_scanning_non_provider_patternsable)()
SetSecretScanningPushProtection(value SecurityAndAnalysis_secret_scanning_push_protectionable)()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package models

import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

type SecurityAndAnalysis_secret_scanning_non_provider_patterns struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// The status property
status *SecurityAndAnalysis_secret_scanning_non_provider_patterns_status
}
// NewSecurityAndAnalysis_secret_scanning_non_provider_patterns instantiates a new SecurityAndAnalysis_secret_scanning_non_provider_patterns and sets the default values.
func NewSecurityAndAnalysis_secret_scanning_non_provider_patterns()(*SecurityAndAnalysis_secret_scanning_non_provider_patterns) {
m := &SecurityAndAnalysis_secret_scanning_non_provider_patterns{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateSecurityAndAnalysis_secret_scanning_non_provider_patternsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateSecurityAndAnalysis_secret_scanning_non_provider_patternsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewSecurityAndAnalysis_secret_scanning_non_provider_patterns(), nil
}
// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
// returns a map[string]any when successful
func (m *SecurityAndAnalysis_secret_scanning_non_provider_patterns) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *SecurityAndAnalysis_secret_scanning_non_provider_patterns) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseSecurityAndAnalysis_secret_scanning_non_provider_patterns_status)
if err != nil {
return err
}
if val != nil {
m.SetStatus(val.(*SecurityAndAnalysis_secret_scanning_non_provider_patterns_status))
}
return nil
}
return res
}
// GetStatus gets the status property value. The status property
// returns a *SecurityAndAnalysis_secret_scanning_non_provider_patterns_status when successful
func (m *SecurityAndAnalysis_secret_scanning_non_provider_patterns) GetStatus()(*SecurityAndAnalysis_secret_scanning_non_provider_patterns_status) {
return m.status
}
// Serialize serializes information the current object
func (m *SecurityAndAnalysis_secret_scanning_non_provider_patterns) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetStatus() != nil {
cast := (*m.GetStatus()).String()
err := writer.WriteStringValue("status", &cast)
if err != nil {
return err
}
}
{
err := writer.WriteAdditionalData(m.GetAdditionalData())
if err != nil {
return err
}
}
return nil
}
// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *SecurityAndAnalysis_secret_scanning_non_provider_patterns) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetStatus sets the status property value. The status property
func (m *SecurityAndAnalysis_secret_scanning_non_provider_patterns) SetStatus(value *SecurityAndAnalysis_secret_scanning_non_provider_patterns_status)() {
m.status = value
}
type SecurityAndAnalysis_secret_scanning_non_provider_patternsable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetStatus()(*SecurityAndAnalysis_secret_scanning_non_provider_patterns_status)
SetStatus(value *SecurityAndAnalysis_secret_scanning_non_provider_patterns_status)()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package models
import (
"errors"
)
type SecurityAndAnalysis_secret_scanning_non_provider_patterns_status int

const (
ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_NON_PROVIDER_PATTERNS_STATUS SecurityAndAnalysis_secret_scanning_non_provider_patterns_status = iota
DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_NON_PROVIDER_PATTERNS_STATUS
)

func (i SecurityAndAnalysis_secret_scanning_non_provider_patterns_status) String() string {
return []string{"enabled", "disabled"}[i]
}
func ParseSecurityAndAnalysis_secret_scanning_non_provider_patterns_status(v string) (any, error) {
result := ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_NON_PROVIDER_PATTERNS_STATUS
switch v {
case "enabled":
result = ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_NON_PROVIDER_PATTERNS_STATUS
case "disabled":
result = DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_NON_PROVIDER_PATTERNS_STATUS
default:
return 0, errors.New("Unknown SecurityAndAnalysis_secret_scanning_non_provider_patterns_status value: " + v)
}
return &result, nil
}
func SerializeSecurityAndAnalysis_secret_scanning_non_provider_patterns_status(values []SecurityAndAnalysis_secret_scanning_non_provider_patterns_status) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i SecurityAndAnalysis_secret_scanning_non_provider_patterns_status) isMultiValue() bool {
return false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package configurations
import (
"errors"
)
// The enablement status of secret scanning validity checks
type ConfigurationsPostRequestBody_secret_scanning_validity_checks int

const (
ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS ConfigurationsPostRequestBody_secret_scanning_validity_checks = iota
DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS
NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS
)

func (i ConfigurationsPostRequestBody_secret_scanning_validity_checks) String() string {
return []string{"enabled", "disabled", "not_set"}[i]
}
func ParseConfigurationsPostRequestBody_secret_scanning_validity_checks(v string) (any, error) {
result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS
switch v {
case "enabled":
result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS
case "disabled":
result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS
case "not_set":
result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS
default:
return 0, errors.New("Unknown ConfigurationsPostRequestBody_secret_scanning_validity_checks value: " + v)
}
return &result, nil
}
func SerializeConfigurationsPostRequestBody_secret_scanning_validity_checks(values []ConfigurationsPostRequestBody_secret_scanning_validity_checks) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i ConfigurationsPostRequestBody_secret_scanning_validity_checks) isMultiValue() bool {
return false
}
Loading

0 comments on commit 8905485

Please sign in to comment.