Skip to content

Commit

Permalink
New updates to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
octokitbot committed Jan 25, 2025
1 parent f34f1e2 commit b557b2b
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 40 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": "10BD1E61E20F70F5BC4F47013FDDDB4FCC8FAA527DC4625CEFB906C01509A8EF6C4218808978E54E9F68A1CD4444F929ABA26AA0376D780F8EBD1D0C19013721",
"descriptionHash": "9314B3C73BC6A84364C771DC58616CEB1477AA0B63FE7E60B33CB5E9654FFF508F4F07D82D3339A176A68425383C9D18D39EAFB8D0F18F2A0CBAF16090D868EB",
"descriptionLocation": "../../../../../schemas/api.github.com.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.19.0",
Expand Down
23 changes: 23 additions & 0 deletions pkg/github/models/dependabot_alert_security_advisory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type DependabotAlertSecurityAdvisory struct {
cwes []DependabotAlertSecurityAdvisory_cwesable
// A long-form Markdown-supported description of the advisory.
description *string
// The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
epss SecurityAdvisoryEpssable
// The unique GitHub Security Advisory ID assigned to the advisory.
ghsa_id *string
// Values that identify this advisory among security information sources.
Expand Down Expand Up @@ -72,6 +74,11 @@ func (m *DependabotAlertSecurityAdvisory) GetCwes()([]DependabotAlertSecurityAdv
func (m *DependabotAlertSecurityAdvisory) GetDescription()(*string) {
return m.description
}
// GetEpss gets the epss property value. The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
// returns a SecurityAdvisoryEpssable when successful
func (m *DependabotAlertSecurityAdvisory) GetEpss()(SecurityAdvisoryEpssable) {
return m.epss
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *DependabotAlertSecurityAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
Expand Down Expand Up @@ -132,6 +139,16 @@ func (m *DependabotAlertSecurityAdvisory) GetFieldDeserializers()(map[string]fun
}
return nil
}
res["epss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateSecurityAdvisoryEpssFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetEpss(val.(SecurityAdvisoryEpssable))
}
return nil
}
res["ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
Expand Down Expand Up @@ -317,6 +334,10 @@ func (m *DependabotAlertSecurityAdvisory) SetCwes(value []DependabotAlertSecurit
func (m *DependabotAlertSecurityAdvisory) SetDescription(value *string)() {
m.description = value
}
// SetEpss sets the epss property value. The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
func (m *DependabotAlertSecurityAdvisory) SetEpss(value SecurityAdvisoryEpssable)() {
m.epss = value
}
// SetGhsaId sets the ghsa_id property value. The unique GitHub Security Advisory ID assigned to the advisory.
func (m *DependabotAlertSecurityAdvisory) SetGhsaId(value *string)() {
m.ghsa_id = value
Expand Down Expand Up @@ -360,6 +381,7 @@ type DependabotAlertSecurityAdvisoryable interface {
GetCvssSeverities()(CvssSeveritiesable)
GetCwes()([]DependabotAlertSecurityAdvisory_cwesable)
GetDescription()(*string)
GetEpss()(SecurityAdvisoryEpssable)
GetGhsaId()(*string)
GetIdentifiers()([]DependabotAlertSecurityAdvisory_identifiersable)
GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
Expand All @@ -374,6 +396,7 @@ type DependabotAlertSecurityAdvisoryable interface {
SetCvssSeverities(value CvssSeveritiesable)()
SetCwes(value []DependabotAlertSecurityAdvisory_cwesable)()
SetDescription(value *string)()
SetEpss(value SecurityAdvisoryEpssable)()
SetGhsaId(value *string)()
SetIdentifiers(value []DependabotAlertSecurityAdvisory_identifiersable)()
SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
Expand Down
28 changes: 11 additions & 17 deletions pkg/github/models/global_advisory.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalAdvisory struct {
cwes []GlobalAdvisory_cwesable
// A detailed description of what the advisory entails.
description *string
// The epss property
epss GlobalAdvisory_epssable
// The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
epss SecurityAdvisoryEpssable
// The GitHub Security Advisory ID.
ghsa_id *string
// The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format.
Expand Down Expand Up @@ -95,9 +95,9 @@ func (m *GlobalAdvisory) GetCwes()([]GlobalAdvisory_cwesable) {
func (m *GlobalAdvisory) GetDescription()(*string) {
return m.description
}
// GetEpss gets the epss property value. The epss property
// returns a GlobalAdvisory_epssable when successful
func (m *GlobalAdvisory) GetEpss()(GlobalAdvisory_epssable) {
// GetEpss gets the epss property value. The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
// returns a SecurityAdvisoryEpssable when successful
func (m *GlobalAdvisory) GetEpss()(SecurityAdvisoryEpssable) {
return m.epss
}
// GetFieldDeserializers the deserialization information for the current model
Expand Down Expand Up @@ -177,12 +177,12 @@ func (m *GlobalAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89
return nil
}
res["epss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateGlobalAdvisory_epssFromDiscriminatorValue)
val, err := n.GetObjectValue(CreateSecurityAdvisoryEpssFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetEpss(val.(GlobalAdvisory_epssable))
m.SetEpss(val.(SecurityAdvisoryEpssable))
}
return nil
}
Expand Down Expand Up @@ -478,12 +478,6 @@ func (m *GlobalAdvisory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a
return err
}
}
{
err := writer.WriteObjectValue("epss", m.GetEpss())
if err != nil {
return err
}
}
if m.GetReferences() != nil {
err := writer.WriteCollectionOfStringValues("references", m.GetReferences())
if err != nil {
Expand Down Expand Up @@ -547,8 +541,8 @@ func (m *GlobalAdvisory) SetCwes(value []GlobalAdvisory_cwesable)() {
func (m *GlobalAdvisory) SetDescription(value *string)() {
m.description = value
}
// SetEpss sets the epss property value. The epss property
func (m *GlobalAdvisory) SetEpss(value GlobalAdvisory_epssable)() {
// SetEpss sets the epss property value. The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
func (m *GlobalAdvisory) SetEpss(value SecurityAdvisoryEpssable)() {
m.epss = value
}
// SetGhsaId sets the ghsa_id property value. The GitHub Security Advisory ID.
Expand Down Expand Up @@ -623,7 +617,7 @@ type GlobalAdvisoryable interface {
GetCvssSeverities()(CvssSeveritiesable)
GetCwes()([]GlobalAdvisory_cwesable)
GetDescription()(*string)
GetEpss()(GlobalAdvisory_epssable)
GetEpss()(SecurityAdvisoryEpssable)
GetGhsaId()(*string)
GetGithubReviewedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetHtmlUrl()(*string)
Expand All @@ -646,7 +640,7 @@ type GlobalAdvisoryable interface {
SetCvssSeverities(value CvssSeveritiesable)()
SetCwes(value []GlobalAdvisory_cwesable)()
SetDescription(value *string)()
SetEpss(value GlobalAdvisory_epssable)()
SetEpss(value SecurityAdvisoryEpssable)()
SetGhsaId(value *string)()
SetGithubReviewedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetHtmlUrl(value *string)()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,35 @@ import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

type GlobalAdvisory_epss struct {
// SecurityAdvisoryEpss the EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss).
type SecurityAdvisoryEpss 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 percentage property
percentage *float64
// The percentile property
percentile *float64
}
// NewGlobalAdvisory_epss instantiates a new GlobalAdvisory_epss and sets the default values.
func NewGlobalAdvisory_epss()(*GlobalAdvisory_epss) {
m := &GlobalAdvisory_epss{
// NewSecurityAdvisoryEpss instantiates a new SecurityAdvisoryEpss and sets the default values.
func NewSecurityAdvisoryEpss()(*SecurityAdvisoryEpss) {
m := &SecurityAdvisoryEpss{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateGlobalAdvisory_epssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// CreateSecurityAdvisoryEpssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateGlobalAdvisory_epssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewGlobalAdvisory_epss(), nil
func CreateSecurityAdvisoryEpssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewSecurityAdvisoryEpss(), 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 *GlobalAdvisory_epss) GetAdditionalData()(map[string]any) {
func (m *SecurityAdvisoryEpss) 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 *GlobalAdvisory_epss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
func (m *SecurityAdvisoryEpss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["percentage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetFloat64Value()
Expand All @@ -57,16 +58,16 @@ func (m *GlobalAdvisory_epss) GetFieldDeserializers()(map[string]func(i878a80d23
}
// GetPercentage gets the percentage property value. The percentage property
// returns a *float64 when successful
func (m *GlobalAdvisory_epss) GetPercentage()(*float64) {
func (m *SecurityAdvisoryEpss) GetPercentage()(*float64) {
return m.percentage
}
// GetPercentile gets the percentile property value. The percentile property
// returns a *float64 when successful
func (m *GlobalAdvisory_epss) GetPercentile()(*float64) {
func (m *SecurityAdvisoryEpss) GetPercentile()(*float64) {
return m.percentile
}
// Serialize serializes information the current object
func (m *GlobalAdvisory_epss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
func (m *SecurityAdvisoryEpss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteFloat64Value("percentage", m.GetPercentage())
if err != nil {
Expand All @@ -88,18 +89,18 @@ func (m *GlobalAdvisory_epss) Serialize(writer i878a80d2330e89d26896388a3f487eef
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 *GlobalAdvisory_epss) SetAdditionalData(value map[string]any)() {
func (m *SecurityAdvisoryEpss) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetPercentage sets the percentage property value. The percentage property
func (m *GlobalAdvisory_epss) SetPercentage(value *float64)() {
func (m *SecurityAdvisoryEpss) SetPercentage(value *float64)() {
m.percentage = value
}
// SetPercentile sets the percentile property value. The percentile property
func (m *GlobalAdvisory_epss) SetPercentile(value *float64)() {
func (m *SecurityAdvisoryEpss) SetPercentile(value *float64)() {
m.percentile = value
}
type GlobalAdvisory_epssable interface {
type SecurityAdvisoryEpssable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetPercentage()(*float64)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewItemSettingsNetworkConfigurationsRequestBuilder(rawUrl string, requestAd
// returns a ItemSettingsNetworkConfigurationsGetResponseable when successful
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/settings/network-configurations#list-hosted-compute-network-configurations-for-an-organization
// [API method documentation]: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization
func (m *ItemSettingsNetworkConfigurationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSettingsNetworkConfigurationsRequestBuilderGetQueryParameters])(ItemSettingsNetworkConfigurationsGetResponseable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
Expand All @@ -65,7 +65,7 @@ func (m *ItemSettingsNetworkConfigurationsRequestBuilder) Get(ctx context.Contex
// returns a NetworkConfigurationable when successful
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/settings/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization
// [API method documentation]: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization
func (m *ItemSettingsNetworkConfigurationsRequestBuilder) Post(ctx context.Context, body ItemSettingsNetworkConfigurationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.NetworkConfigurationable, error) {
requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration);
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewItemSettingsNetworkConfigurationsWithNetwork_configuration_ItemRequestBu
// Delete deletes a hosted compute network configuration from an organization.OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint.
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/settings/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization
// [API method documentation]: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization
func (m *ItemSettingsNetworkConfigurationsWithNetwork_configuration_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) {
requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);
if err != nil {
Expand All @@ -42,7 +42,7 @@ func (m *ItemSettingsNetworkConfigurationsWithNetwork_configuration_ItemRequestB
// returns a NetworkConfigurationable when successful
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/settings/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization
// [API method documentation]: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization
func (m *ItemSettingsNetworkConfigurationsWithNetwork_configuration_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.NetworkConfigurationable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
Expand All @@ -61,7 +61,7 @@ func (m *ItemSettingsNetworkConfigurationsWithNetwork_configuration_ItemRequestB
// returns a NetworkConfigurationable when successful
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/settings/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization
// [API method documentation]: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization
func (m *ItemSettingsNetworkConfigurationsWithNetwork_configuration_ItemRequestBuilder) Patch(ctx context.Context, body ItemSettingsNetworkConfigurationsItemWithNetwork_configuration_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.NetworkConfigurationable, error) {
requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration);
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewItemSettingsNetworkSettingsWithNetwork_settings_ItemRequestBuilder(rawUr
// returns a NetworkSettingsable when successful
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/settings/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization
// [API method documentation]: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization
func (m *ItemSettingsNetworkSettingsWithNetwork_settings_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.NetworkSettingsable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
Expand Down

0 comments on commit b557b2b

Please sign in to comment.