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: Kiota v1.17.0 upgrade #21

Merged
merged 7 commits into from
Aug 30, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.21.5

require (
github.com/kfcampbell/ghinstallation v0.0.6
github.com/microsoft/kiota-abstractions-go v1.6.0
github.com/microsoft/kiota-http-go v1.3.3
github.com/microsoft/kiota-abstractions-go v1.6.1
github.com/microsoft/kiota-http-go v1.4.3
github.com/microsoft/kiota-serialization-form-go v1.0.0
github.com/microsoft/kiota-serialization-json-go v1.0.7
github.com/microsoft/kiota-serialization-multipart-go v1.0.0
Expand All @@ -21,7 +21,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/octokit/go-sdk v0.0.13 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/std-uritemplate/std-uritemplate/go v0.0.55 // indirect
github.com/std-uritemplate/std-uritemplate/go v0.0.57 // indirect
github.com/stretchr/testify v1.9.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/microsoft/kiota-abstractions-go v1.6.0 h1:qbGBNMU0/o5myKbikCBXJFohVCFrrpx2cO15Rta2WyA=
github.com/microsoft/kiota-abstractions-go v1.6.0/go.mod h1:7YH20ZbRWXGfHSSvdHkdztzgCB9mRdtFx13+hrYIEpo=
github.com/microsoft/kiota-http-go v1.3.3 h1:FKjK5BLFONu5eIBxtrkirkixFQmcPwitZ8iwZHKbESo=
github.com/microsoft/kiota-http-go v1.3.3/go.mod h1:IWw/PwtBs/GYz+Pa75gPW7MFNFv0aKPFsLw5WqzL1SE=
github.com/microsoft/kiota-abstractions-go v1.6.1 h1:NXK50S3BwJn9Wj6bO0YFuAig7y2WVgdQ/ie1ktMl2J4=
github.com/microsoft/kiota-abstractions-go v1.6.1/go.mod h1:FI1I2OHg0E7bK5t8DPnw+9C/CHVyLP6XeqDBT+95pTE=
github.com/microsoft/kiota-http-go v1.4.3 h1:BVviWZSZCm2nr9qySbhSXa8jlrLvCcC2/uV4p45Ow0I=
github.com/microsoft/kiota-http-go v1.4.3/go.mod h1:Kup5nMDD3a9sjdgRKHCqZWqtrv3FbprjcPaGjLR6FzM=
github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjblsyVgifS11b3WCx+eFEsAI=
github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA=
github.com/microsoft/kiota-serialization-json-go v1.0.7 h1:yMbckSTPrjZdM4EMXgzLZSA3CtDaUBI350u0VoYRz7Y=
Expand All @@ -35,8 +35,8 @@ github.com/octokit/go-sdk v0.0.13 h1:DdJfWFeGUoFRHY82dxquRdBl9GvE1Vk7g2dVOjMyGpQ
github.com/octokit/go-sdk v0.0.13/go.mod h1:T65KGdB1QQvRbvd9MmuNGieldRyxMj45omX1vizOUu4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/std-uritemplate/std-uritemplate/go v0.0.55 h1:muSH037g97K7U2f94G9LUuE8tZlJsoSSrPsO9V281WY=
github.com/std-uritemplate/std-uritemplate/go v0.0.55/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc=
github.com/std-uritemplate/std-uritemplate/go v0.0.57 h1:GHGjptrsmazP4IVDlUprssiEf9ESVkbjx15xQXXzvq4=
github.com/std-uritemplate/std-uritemplate/go v0.0.57/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
Expand Down
4,755 changes: 2,539 additions & 2,216 deletions pkg/github/.kiota.log

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion pkg/github/advisories/advisories_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ type AdvisoriesRequestBuilderGetQueryParameters struct {
Direction *GetDirectionQueryParameterType `uriparametername:"direction"`
// If specified, only advisories for these ecosystems will be returned.
Ecosystem *i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.SecurityAdvisoryEcosystems `uriparametername:"ecosystem"`
// If specified, only return advisories that have an EPSS percentage score that matches the provided value.The EPSS percentage represents the likelihood of a CVE being exploited.
Epss_percentage *string `uriparametername:"epss_percentage"`
// If specified, only return advisories that have an EPSS percentile score that matches the provided value.The EPSS percentile represents the relative rank of the CVE's likelihood of being exploited compared to other CVEs.
Epss_percentile *string `uriparametername:"epss_percentile"`
// If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned.
Ghsa_id *string `uriparametername:"ghsa_id"`
// Whether to only return advisories that have been withdrawn.
Expand Down Expand Up @@ -60,7 +64,7 @@ func (m *AdvisoriesRequestBuilder) ByGhsa_id(ghsa_id string)(*WithGhsa_ItemReque
// NewAdvisoriesRequestBuilderInternal instantiates a new AdvisoriesRequestBuilder and sets the default values.
func NewAdvisoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdvisoriesRequestBuilder) {
m := &AdvisoriesRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/advisories{?affects*,after*,before*,cve_id*,cwes*,direction*,ecosystem*,ghsa_id*,is_withdrawn*,modified*,per_page*,published*,severity*,sort*,type*,updated*}", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/advisories{?affects*,after*,before*,cve_id*,cwes*,direction*,ecosystem*,epss_percentage*,epss_percentile*,ghsa_id*,is_withdrawn*,modified*,per_page*,published*,severity*,sort*,type*,updated*}", pathParameters),
}
return m
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/github/advisories/get_direction_query_parameter_type.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package advisories
import (
"errors"
)
type GetDirectionQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetDirectionQueryParameterType(v string) (any, error) {
case "desc":
result = DESC_GETDIRECTIONQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/github/advisories/get_severity_query_parameter_type.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package advisories
import (
"errors"
)
type GetSeverityQueryParameterType int

const (
Expand Down Expand Up @@ -29,7 +26,7 @@ func ParseGetSeverityQueryParameterType(v string) (any, error) {
case "critical":
result = CRITICAL_GETSEVERITYQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetSeverityQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/github/advisories/get_sort_query_parameter_type.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package advisories
import (
"errors"
)
type GetSortQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetSortQueryParameterType(v string) (any, error) {
case "published":
result = PUBLISHED_GETSORTQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetSortQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/github/advisories/get_type_query_parameter_type.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package advisories
import (
"errors"
)
type GetTypeQueryParameterType int

const (
Expand All @@ -23,7 +20,7 @@ func ParseGetTypeQueryParameterType(v string) (any, error) {
case "unreviewed":
result = UNREVIEWED_GETTYPEQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetTypeQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@ import (
i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d "github.com/octokit/go-sdk-enterprise-cloud/pkg/github/models"
)

type ItemConversionsPostResponse struct {
type ItemConversionsIntegration struct {
i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.Integration
}
// NewItemConversionsPostResponse instantiates a new ItemConversionsPostResponse and sets the default values.
func NewItemConversionsPostResponse()(*ItemConversionsPostResponse) {
m := &ItemConversionsPostResponse{
// NewItemConversionsIntegration instantiates a new ItemConversionsIntegration and sets the default values.
func NewItemConversionsIntegration()(*ItemConversionsIntegration) {
m := &ItemConversionsIntegration{
Integration: *i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.NewIntegration(),
}
return m
}
// CreateItemConversionsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// CreateItemConversionsIntegrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateItemConversionsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewItemConversionsPostResponse(), nil
func CreateItemConversionsIntegrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewItemConversionsIntegration(), nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ItemConversionsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
func (m *ItemConversionsIntegration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Integration.GetFieldDeserializers()
return res
}
// Serialize serializes information the current object
func (m *ItemConversionsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
func (m *ItemConversionsIntegration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Integration.Serialize(writer)
if err != nil {
return err
}
return nil
}
type ItemConversionsPostResponseable interface {
type ItemConversionsIntegrationable interface {
i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.Integrationable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
}
8 changes: 4 additions & 4 deletions pkg/github/appmanifests/item_conversions_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ func NewItemConversionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7da
return NewItemConversionsRequestBuilderInternal(urlParams, requestAdapter)
}
// Post use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/enterprise-cloud@latest//apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.
// returns a ItemConversionsPostResponseable when successful
// returns a ItemConversionsIntegrationable when successful
// returns a BasicError error when the service returns a 404 status code
// returns a ValidationErrorSimple error when the service returns a 422 status code
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/enterprise-cloud@latest//rest/apps/apps#create-a-github-app-from-a-manifest
func (m *ItemConversionsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemConversionsPostResponseable, error) {
func (m *ItemConversionsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemConversionsIntegrationable, error) {
requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
Expand All @@ -39,14 +39,14 @@ func (m *ItemConversionsRequestBuilder) Post(ctx context.Context, requestConfigu
"404": i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.CreateBasicErrorFromDiscriminatorValue,
"422": i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.CreateValidationErrorSimpleFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemConversionsPostResponseFromDiscriminatorValue, errorMapping)
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemConversionsIntegrationFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(ItemConversionsPostResponseable), nil
return res.(ItemConversionsIntegrationable), nil
}
// ToPostRequestInformation use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/enterprise-cloud@latest//apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.
// returns a *RequestInformation when successful
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package item
import (
"errors"
)
// Visibility of a runner group. You can select all organizations or select individual organizations.
type WithRunner_group_PatchRequestBody_visibility int

Expand All @@ -21,7 +18,7 @@ func ParseWithRunner_group_PatchRequestBody_visibility(v string) (any, error) {
case "all":
result = ALL_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY
default:
return 0, errors.New("Unknown WithRunner_group_PatchRequestBody_visibility value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package runnergroups
import (
"errors"
)
// Visibility of a runner group. You can select all organizations or select individual organization.
type RunnerGroupsPostRequestBody_visibility int

Expand All @@ -21,7 +18,7 @@ func ParseRunnerGroupsPostRequestBody_visibility(v string) (any, error) {
case "all":
result = ALL_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY
default:
return 0, errors.New("Unknown RunnerGroupsPostRequestBody_visibility value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package auditlog
import (
"errors"
)
type GetIncludeQueryParameterType int

const (
Expand All @@ -23,7 +20,7 @@ func ParseGetIncludeQueryParameterType(v string) (any, error) {
case "all":
result = ALL_GETINCLUDEQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetIncludeQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package auditlog
import (
"errors"
)
type GetOrderQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetOrderQueryParameterType(v string) (any, error) {
case "asc":
result = ASC_GETORDERQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package alerts
import (
"errors"
)
type GetDirectionQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetDirectionQueryParameterType(v string) (any, error) {
case "desc":
result = DESC_GETDIRECTIONQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package alerts
import (
"errors"
)
type GetSortQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetSortQueryParameterType(v string) (any, error) {
case "updated":
result = UPDATED_GETSORTQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetSortQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package alerts
import (
"errors"
)
type GetDirectionQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetDirectionQueryParameterType(v string) (any, error) {
case "desc":
result = DESC_GETDIRECTIONQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package alerts
import (
"errors"
)
type GetScopeQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetScopeQueryParameterType(v string) (any, error) {
case "runtime":
result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetScopeQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package alerts
import (
"errors"
)
type GetSortQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetSortQueryParameterType(v string) (any, error) {
case "updated":
result = UPDATED_GETSORTQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetSortQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package alerts
import (
"errors"
)
type GetDirectionQueryParameterType int

const (
Expand All @@ -20,7 +17,7 @@ func ParseGetDirectionQueryParameterType(v string) (any, error) {
case "desc":
result = DESC_GETDIRECTIONQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v)
return nil, nil
}
return &result, nil
}
Expand Down
Loading
Loading