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 Nov 22, 2024
1 parent d367d68 commit f61cf97
Show file tree
Hide file tree
Showing 24 changed files with 5,265 additions and 2,401 deletions.
4,744 changes: 2,344 additions & 2,400 deletions pkg/github/.kiota.log

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package item
// The audit log streaming provider. The name is case sensitive.
type WithStream_PutRequestBody_stream_type int

const (
AZUREBLOBSTORAGE_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE WithStream_PutRequestBody_stream_type = iota
AZUREEVENTHUBS_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
AMAZONS3_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
SPLUNK_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
HTTPSEVENTCOLLECTOR_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
GOOGLECLOUDSTORAGE_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
DATADOG_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
)

func (i WithStream_PutRequestBody_stream_type) String() string {
return []string{"Azure Blob Storage", "Azure Event Hubs", "Amazon S3", "Splunk", "HTTPS Event Collector", "Google Cloud Storage", "Datadog"}[i]
}
func ParseWithStream_PutRequestBody_stream_type(v string) (any, error) {
result := AZUREBLOBSTORAGE_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
switch v {
case "Azure Blob Storage":
result = AZUREBLOBSTORAGE_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
case "Azure Event Hubs":
result = AZUREEVENTHUBS_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
case "Amazon S3":
result = AMAZONS3_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
case "Splunk":
result = SPLUNK_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
case "HTTPS Event Collector":
result = HTTPSEVENTCOLLECTOR_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
case "Google Cloud Storage":
result = GOOGLECLOUDSTORAGE_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
case "Datadog":
result = DATADOG_WITHSTREAM_PUTREQUESTBODY_STREAM_TYPE
default:
return nil, nil
}
return &result, nil
}
func SerializeWithStream_PutRequestBody_stream_type(values []WithStream_PutRequestBody_stream_type) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i WithStream_PutRequestBody_stream_type) isMultiValue() bool {
return false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package streams
// The audit log streaming provider. The name is case sensitive.
type StreamsPostRequestBody_stream_type int

const (
AZUREBLOBSTORAGE_STREAMSPOSTREQUESTBODY_STREAM_TYPE StreamsPostRequestBody_stream_type = iota
AZUREEVENTHUBS_STREAMSPOSTREQUESTBODY_STREAM_TYPE
AMAZONS3_STREAMSPOSTREQUESTBODY_STREAM_TYPE
SPLUNK_STREAMSPOSTREQUESTBODY_STREAM_TYPE
HTTPSEVENTCOLLECTOR_STREAMSPOSTREQUESTBODY_STREAM_TYPE
GOOGLECLOUDSTORAGE_STREAMSPOSTREQUESTBODY_STREAM_TYPE
DATADOG_STREAMSPOSTREQUESTBODY_STREAM_TYPE
)

func (i StreamsPostRequestBody_stream_type) String() string {
return []string{"Azure Blob Storage", "Azure Event Hubs", "Amazon S3", "Splunk", "HTTPS Event Collector", "Google Cloud Storage", "Datadog"}[i]
}
func ParseStreamsPostRequestBody_stream_type(v string) (any, error) {
result := AZUREBLOBSTORAGE_STREAMSPOSTREQUESTBODY_STREAM_TYPE
switch v {
case "Azure Blob Storage":
result = AZUREBLOBSTORAGE_STREAMSPOSTREQUESTBODY_STREAM_TYPE
case "Azure Event Hubs":
result = AZUREEVENTHUBS_STREAMSPOSTREQUESTBODY_STREAM_TYPE
case "Amazon S3":
result = AMAZONS3_STREAMSPOSTREQUESTBODY_STREAM_TYPE
case "Splunk":
result = SPLUNK_STREAMSPOSTREQUESTBODY_STREAM_TYPE
case "HTTPS Event Collector":
result = HTTPSEVENTCOLLECTOR_STREAMSPOSTREQUESTBODY_STREAM_TYPE
case "Google Cloud Storage":
result = GOOGLECLOUDSTORAGE_STREAMSPOSTREQUESTBODY_STREAM_TYPE
case "Datadog":
result = DATADOG_STREAMSPOSTREQUESTBODY_STREAM_TYPE
default:
return nil, nil
}
return &result, nil
}
func SerializeStreamsPostRequestBody_stream_type(values []StreamsPostRequestBody_stream_type) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i StreamsPostRequestBody_stream_type) isMultiValue() bool {
return false
}
10 changes: 10 additions & 0 deletions pkg/github/enterprises/item_audit_log_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ func (m *ItemAuditLogRequestBuilder) Get(ctx context.Context, requestConfigurati
}
return val, nil
}
// StreamKey the streamKey property
// returns a *ItemAuditLogStreamKeyRequestBuilder when successful
func (m *ItemAuditLogRequestBuilder) StreamKey()(*ItemAuditLogStreamKeyRequestBuilder) {
return NewItemAuditLogStreamKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}
// Streams the streams property
// returns a *ItemAuditLogStreamsRequestBuilder when successful
func (m *ItemAuditLogRequestBuilder) Streams()(*ItemAuditLogStreamsRequestBuilder) {
return NewItemAuditLogStreamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}
// ToGetRequestInformation gets the audit log for an enterprise.This endpoint has a rate limit of 1,750 queries per hour per user and IP address. If your integration receives a rate limit error (typically a 403 or 429 response), it should wait before making another request to the GitHub API. For more information, see "[Rate limits for the REST API](https://docs.github.com/enterprise-cloud@latest//rest/using-the-rest-api/rate-limits-for-the-rest-api)" and "[Best practices for integrators](https://docs.github.com/enterprise-cloud@latest//rest/guides/best-practices-for-integrators)."The authenticated user must be an enterprise admin to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:audit_log` scope to use this endpoint.
// returns a *RequestInformation when successful
func (m *ItemAuditLogRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAuditLogRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package enterprises

import (
"context"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d "github.com/octokit/go-sdk-enterprise-cloud/pkg/github/models"
)

// ItemAuditLogStreamKeyRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\audit-log\stream-key
type ItemAuditLogStreamKeyRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// NewItemAuditLogStreamKeyRequestBuilderInternal instantiates a new ItemAuditLogStreamKeyRequestBuilder and sets the default values.
func NewItemAuditLogStreamKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAuditLogStreamKeyRequestBuilder) {
m := &ItemAuditLogStreamKeyRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/audit-log/stream-key", pathParameters),
}
return m
}
// NewItemAuditLogStreamKeyRequestBuilder instantiates a new ItemAuditLogStreamKeyRequestBuilder and sets the default values.
func NewItemAuditLogStreamKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAuditLogStreamKeyRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewItemAuditLogStreamKeyRequestBuilderInternal(urlParams, requestAdapter)
}
// Get retrieves the audit log streaming public key for encrypting secrets.When using this endpoint, you must encrypt the credentials following the same encryption steps as outlined in the guide on encrypting secrets. See "[Encrypting secrets for the REST API](/rest/guides/encrypting-secrets-for-the-rest-api)."
// returns a AuditLogStreamKeyable when successful
// [API method documentation]
//
// [API method documentation]: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets
func (m *ItemAuditLogStreamKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.AuditLogStreamKeyable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
return nil, err
}
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.CreateAuditLogStreamKeyFromDiscriminatorValue, nil)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.AuditLogStreamKeyable), nil
}
// ToGetRequestInformation retrieves the audit log streaming public key for encrypting secrets.When using this endpoint, you must encrypt the credentials following the same encryption steps as outlined in the guide on encrypting secrets. See "[Encrypting secrets for the REST API](/rest/guides/encrypting-secrets-for-the-rest-api)."
// returns a *RequestInformation when successful
func (m *ItemAuditLogStreamKeyRequestBuilder) 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
}
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
// returns a *ItemAuditLogStreamKeyRequestBuilder when successful
func (m *ItemAuditLogStreamKeyRequestBuilder) WithUrl(rawUrl string)(*ItemAuditLogStreamKeyRequestBuilder) {
return NewItemAuditLogStreamKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package enterprises

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

type ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// The errors property
errors []string
}
// NewItemAuditLogStreamsItemGetAuditLogStreamConfig422Error instantiates a new ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error and sets the default values.
func NewItemAuditLogStreamsItemGetAuditLogStreamConfig422Error()(*ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) {
m := &ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error{
ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(),
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateItemAuditLogStreamsItemGetAuditLogStreamConfig422ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateItemAuditLogStreamsItemGetAuditLogStreamConfig422ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewItemAuditLogStreamsItemGetAuditLogStreamConfig422Error(), nil
}
// Error the primary error message.
// returns a string when successful
func (m *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) Error()(string) {
return m.ApiError.Error()
}
// 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 *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetErrors gets the errors property value. The errors property
// returns a []string when successful
func (m *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) GetErrors()([]string) {
return m.errors
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfPrimitiveValues("string")
if err != nil {
return err
}
if val != nil {
res := make([]string, len(val))
for i, v := range val {
if v != nil {
res[i] = *(v.(*string))
}
}
m.SetErrors(res)
}
return nil
}
return res
}
// Serialize serializes information the current object
func (m *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetErrors() != nil {
err := writer.WriteCollectionOfStringValues("errors", m.GetErrors())
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 *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetErrors sets the errors property value. The errors property
func (m *ItemAuditLogStreamsItemGetAuditLogStreamConfig422Error) SetErrors(value []string)() {
m.errors = value
}
type ItemAuditLogStreamsItemGetAuditLogStreamConfig422Errorable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetErrors()([]string)
SetErrors(value []string)()
}
Loading

0 comments on commit f61cf97

Please sign in to comment.