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 Dec 5, 2023
1 parent b5eaa0a commit 2877f72
Show file tree
Hide file tree
Showing 768 changed files with 7,444 additions and 10,037 deletions.
21 changes: 9 additions & 12 deletions github/octokit/advisories/advisories_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package advisories

import (
"context"
i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e "github.com/octokit/go-sdk/github/octokit/models"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035 "github.com/octokit/go-sdk/github/octokit/models"
)

// AdvisoriesRequestBuilder builds and executes requests for operations under \advisories
Expand Down Expand Up @@ -69,7 +69,7 @@ type AdvisoriesRequestBuilderGetRequestConfiguration struct {
// Request query parameters
QueryParameters *AdvisoriesRequestBuilderGetQueryParameters
}
// ByGhsa_id gets an item from the octokit.advisories.item collection
// ByGhsa_id gets an item from the github.com/octokit/go-sdk/github/octokit/.advisories.item collection
func (m *AdvisoriesRequestBuilder) ByGhsa_id(ghsa_id string)(*WithGhsa_ItemRequestBuilder) {
urlTplParams := make(map[string]string)
for idx, item := range m.BaseRequestBuilder.PathParameters {
Expand Down Expand Up @@ -97,40 +97,37 @@ func NewAdvisoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories
func (m *AdvisoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *AdvisoriesRequestBuilderGetRequestConfiguration)([]i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.GlobalAdvisoryable, error) {
func (m *AdvisoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *AdvisoriesRequestBuilderGetRequestConfiguration)([]i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.GlobalAdvisoryable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"422": i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.CreateValidationErrorSimpleFromDiscriminatorValue,
"429": i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.CreateBasicErrorFromDiscriminatorValue,
"422": i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.CreateValidationErrorSimpleFromDiscriminatorValue,
"429": i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.CreateBasicErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping)
res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
val := make([]i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.GlobalAdvisoryable, len(res))
val := make([]i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.GlobalAdvisoryable, len(res))
for i, v := range res {
if v != nil {
val[i] = v.(i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.GlobalAdvisoryable)
val[i] = v.(i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.GlobalAdvisoryable)
}
}
return val, nil
}
// ToGetRequestInformation lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)."
func (m *AdvisoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AdvisoriesRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
if requestConfiguration.QueryParameters != nil {
requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))
}
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate
requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET
requestInfo.Headers.TryAdd("Accept", "application/json")
return requestInfo, nil
}
Expand Down
15 changes: 6 additions & 9 deletions github/octokit/advisories/with_ghsa_item_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package advisories

import (
"context"
i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e "github.com/octokit/go-sdk/github/octokit/models"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035 "github.com/octokit/go-sdk/github/octokit/models"
)

// WithGhsa_ItemRequestBuilder builds and executes requests for operations under \advisories\{ghsa_id}
Expand Down Expand Up @@ -34,33 +34,30 @@ func NewWithGhsa_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory
func (m *WithGhsa_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *WithGhsa_ItemRequestBuilderGetRequestConfiguration)(i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.GlobalAdvisoryable, error) {
func (m *WithGhsa_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *WithGhsa_ItemRequestBuilderGetRequestConfiguration)(i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.GlobalAdvisoryable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"404": i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.CreateBasicErrorFromDiscriminatorValue,
"404": i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.CreateBasicErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping)
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(i8bb20811a612dd15efa26f086111481a68f72cd9ac5da7a939a417131078d77e.GlobalAdvisoryable), nil
return res.(i000736ae6dd74f01081193e4f903216bc2bd2954ed818433b986f45d581ed035.GlobalAdvisoryable), nil
}
// ToGetRequestInformation gets a global security advisory using its GitHub Security Advisory (GHSA) identifier.
func (m *WithGhsa_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *WithGhsa_ItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate
requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET
requestInfo.Headers.TryAdd("Accept", "application/json")
return requestInfo, nil
}
Expand Down
Loading

0 comments on commit 2877f72

Please sign in to comment.