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 Mar 8, 2024
1 parent eace742 commit 14bc04e
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/github/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "728430A700C1A6B37AA3A767B0FDF1A6C56A311E37615AFFFF2E17557A73D3F2F98242BE97554E6D7667A9E748060FC914162082ADE8B04924A1DB371FC1F8B9",
"descriptionHash": "DE060A6CF9EFEE14358028B28C66A421969687F96C8EBF96933E452D3043303AB97B244EA2E3B9800382F90BBFF2A8EBB158D61A852738284C655FD2A387E3C8",
"descriptionLocation": "../../../source-generator/schemas/downloaded.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0-preview.202403040006",
"kiotaVersion": "1.12.0",
"clientClassName": "ApiClient",
"clientNamespaceName": "github.com/octokit/go-sdk/pkg/github/",
"language": "Go",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package repos

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

type ItemItemPrivateVulnerabilityReportingGetResponse struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// Whether or not private vulnerability reporting is enabled for the repository.
enabled *bool
}
// NewItemItemPrivateVulnerabilityReportingGetResponse instantiates a new ItemItemPrivateVulnerabilityReportingGetResponse and sets the default values.
func NewItemItemPrivateVulnerabilityReportingGetResponse()(*ItemItemPrivateVulnerabilityReportingGetResponse) {
m := &ItemItemPrivateVulnerabilityReportingGetResponse{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateItemItemPrivateVulnerabilityReportingGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateItemItemPrivateVulnerabilityReportingGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewItemItemPrivateVulnerabilityReportingGetResponse(), 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 *ItemItemPrivateVulnerabilityReportingGetResponse) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetEnabled gets the enabled property value. Whether or not private vulnerability reporting is enabled for the repository.
// returns a *bool when successful
func (m *ItemItemPrivateVulnerabilityReportingGetResponse) GetEnabled()(*bool) {
return m.enabled
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ItemItemPrivateVulnerabilityReportingGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetEnabled(val)
}
return nil
}
return res
}
// Serialize serializes information the current object
func (m *ItemItemPrivateVulnerabilityReportingGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteBoolValue("enabled", m.GetEnabled())
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 *ItemItemPrivateVulnerabilityReportingGetResponse) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetEnabled sets the enabled property value. Whether or not private vulnerability reporting is enabled for the repository.
func (m *ItemItemPrivateVulnerabilityReportingGetResponse) SetEnabled(value *bool)() {
m.enabled = value
}
type ItemItemPrivateVulnerabilityReportingGetResponseable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetEnabled()(*bool)
SetEnabled(value *bool)()
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,29 @@ func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) Delete(ctx context
}
return nil
}
// Get returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)".
// returns a ItemItemPrivateVulnerabilityReportingGetResponseable when successful
// returns a BasicError error when the service returns a 422 status code
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository
func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemPrivateVulnerabilityReportingGetResponseable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemPrivateVulnerabilityReportingGetResponseFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(ItemItemPrivateVulnerabilityReportingGetResponseable), nil
}
// Put enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)."
// returns a BasicError error when the service returns a 422 status code
// [API method documentation]
Expand Down Expand Up @@ -69,6 +92,14 @@ func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) ToDeleteRequestInf
requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json")
return requestInfo, nil
}
// ToGetRequestInformation returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)".
// returns a *RequestInformation when successful
func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration)
requestInfo.Headers.TryAdd("Accept", "application/json")
return requestInfo, nil
}
// ToPutRequestInformation enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)."
// returns a *RequestInformation when successful
func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
Expand Down

0 comments on commit 14bc04e

Please sign in to comment.