Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Changes in generated code #87

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "28892E7C7251AFE384B0BAF35F819C673A641FDA8EF33344D143E8081DBF2FE16C643E7DE09D2722ADEF7664B15C22F0315ACE2A63E7A80AA54D8F1B6DDA5D78",
"descriptionHash": "25CBDDF87B5D7FAED3AFBA18614FCE9BC696E3AA892C3A9253E5E733130804713C08A3F3D7360A24961AF443C24518812E497A7D6C8EE8FFAC1A003073730BEE",
"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 @@ -23,6 +23,8 @@ type CodeSecurityConfiguration struct {
dependency_graph *CodeSecurityConfiguration_dependency_graph
// A description of the code security configuration
description *string
// The enforcement status for a security configuration
enforcement *CodeSecurityConfiguration_enforcement
// The URL of the configuration
html_url *string
// The ID of the code security configuration
Expand Down Expand Up @@ -96,6 +98,11 @@ func (m *CodeSecurityConfiguration) GetDependencyGraph()(*CodeSecurityConfigurat
func (m *CodeSecurityConfiguration) GetDescription()(*string) {
return m.description
}
// GetEnforcement gets the enforcement property value. The enforcement status for a security configuration
// returns a *CodeSecurityConfiguration_enforcement when successful
func (m *CodeSecurityConfiguration) GetEnforcement()(*CodeSecurityConfiguration_enforcement) {
return m.enforcement
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *CodeSecurityConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
Expand Down Expand Up @@ -170,6 +177,16 @@ func (m *CodeSecurityConfiguration) GetFieldDeserializers()(map[string]func(i878
}
return nil
}
res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_enforcement)
if err != nil {
return err
}
if val != nil {
m.SetEnforcement(val.(*CodeSecurityConfiguration_enforcement))
}
return nil
}
res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
Expand Down Expand Up @@ -371,6 +388,13 @@ func (m *CodeSecurityConfiguration) Serialize(writer i878a80d2330e89d26896388a3f
return err
}
}
if m.GetEnforcement() != nil {
cast := (*m.GetEnforcement()).String()
err := writer.WriteStringValue("enforcement", &cast)
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("html_url", m.GetHtmlUrl())
if err != nil {
Expand Down Expand Up @@ -476,6 +500,10 @@ func (m *CodeSecurityConfiguration) SetDependencyGraph(value *CodeSecurityConfig
func (m *CodeSecurityConfiguration) SetDescription(value *string)() {
m.description = value
}
// SetEnforcement sets the enforcement property value. The enforcement status for a security configuration
func (m *CodeSecurityConfiguration) SetEnforcement(value *CodeSecurityConfiguration_enforcement)() {
m.enforcement = value
}
// SetHtmlUrl sets the html_url property value. The URL of the configuration
func (m *CodeSecurityConfiguration) SetHtmlUrl(value *string)() {
m.html_url = value
Expand Down Expand Up @@ -526,6 +554,7 @@ type CodeSecurityConfigurationable interface {
GetDependabotSecurityUpdates()(*CodeSecurityConfiguration_dependabot_security_updates)
GetDependencyGraph()(*CodeSecurityConfiguration_dependency_graph)
GetDescription()(*string)
GetEnforcement()(*CodeSecurityConfiguration_enforcement)
GetHtmlUrl()(*string)
GetId()(*int32)
GetName()(*string)
Expand All @@ -543,6 +572,7 @@ type CodeSecurityConfigurationable interface {
SetDependabotSecurityUpdates(value *CodeSecurityConfiguration_dependabot_security_updates)()
SetDependencyGraph(value *CodeSecurityConfiguration_dependency_graph)()
SetDescription(value *string)()
SetEnforcement(value *CodeSecurityConfiguration_enforcement)()
SetHtmlUrl(value *string)()
SetId(value *int32)()
SetName(value *string)()
Expand Down
37 changes: 37 additions & 0 deletions pkg/github/models/code_security_configuration_enforcement.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package models
import (
"errors"
)
// The enforcement status for a security configuration
type CodeSecurityConfiguration_enforcement int

const (
ENFORCED_CODESECURITYCONFIGURATION_ENFORCEMENT CodeSecurityConfiguration_enforcement = iota
UNENFORCED_CODESECURITYCONFIGURATION_ENFORCEMENT
)

func (i CodeSecurityConfiguration_enforcement) String() string {
return []string{"enforced", "unenforced"}[i]
}
func ParseCodeSecurityConfiguration_enforcement(v string) (any, error) {
result := ENFORCED_CODESECURITYCONFIGURATION_ENFORCEMENT
switch v {
case "enforced":
result = ENFORCED_CODESECURITYCONFIGURATION_ENFORCEMENT
case "unenforced":
result = UNENFORCED_CODESECURITYCONFIGURATION_ENFORCEMENT
default:
return 0, errors.New("Unknown CodeSecurityConfiguration_enforcement value: " + v)
}
return &result, nil
}
func SerializeCodeSecurityConfiguration_enforcement(values []CodeSecurityConfiguration_enforcement) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i CodeSecurityConfiguration_enforcement) isMultiValue() bool {
return false
}
Loading
Loading