diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index c9471c13..ea7643d0 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,8 +1,8 @@ { - "descriptionHash": "8972B77B95704170D9F0484AF18AF0A61D49C58B6549AE22A3797042A1CAB79646A14C5F8877A33DFCFBF9039B4F9CAEE2BF593D5A956DDD4DD452F749497FBE", + "descriptionHash": "DE060A6CF9EFEE14358028B28C66A421969687F96C8EBF96933E452D3043303AB97B244EA2E3B9800382F90BBFF2A8EBB158D61A852738284C655FD2A387E3C8", "descriptionLocation": "../../../source-generator/schemas/downloaded.json", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.12.0-preview.202402290001", + "kiotaVersion": "1.12.0", "clientClassName": "ApiClient", "clientNamespaceName": "github.com/octokit/go-sdk/pkg/github/", "language": "Go", diff --git a/pkg/github/repos/item_item_environments_item_secrets_get_response.go b/pkg/github/repos/item_item_environments_item_secrets_get_response.go new file mode 100644 index 00000000..fc38ea28 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemSecretsGetResponse 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 secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemEnvironmentsItemSecretsGetResponse instantiates a new ItemItemEnvironmentsItemSecretsGetResponse and sets the default values. +func NewItemItemEnvironmentsItemSecretsGetResponse()(*ItemItemEnvironmentsItemSecretsGetResponse) { + m := &ItemItemEnvironmentsItemSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemSecretsGetResponse(), 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 *ItemItemEnvironmentsItemSecretsGetResponse) 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 *ItemItemEnvironmentsItemSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + 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 *ItemItemEnvironmentsItemSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_name_put_request_body.go b/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 00000000..e3573cbe --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody()(*ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody(), 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 *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + 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 *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go b/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go new file mode 100644 index 00000000..9ec3340c --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\public-key +type ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable), nil +} +// ToGetRequestInformation get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) 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 *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_request_builder.go b/pkg/github/repos/item_item_environments_item_secrets_request_builder.go new file mode 100644 index 00000000..408c991a --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsItemSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets +type ItemItemEnvironmentsItemSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github/.repos.item.item.environments.item.secrets.item collection +// returns a *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemSecretsRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemEnvironmentsItemSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-environment-secrets +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) PublicKey()(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(*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 *ItemItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_with_secret_name_item_request_builder.go b/pkg/github/repos/item_item_environments_item_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 00000000..7eb8ac8d --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\{secret_name} +type ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable), nil +} +// Put creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) 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 creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + 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 *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_variables_get_response.go b/pkg/github/repos/item_item_environments_item_variables_get_response.go new file mode 100644 index 00000000..9efcf000 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemVariablesGetResponse 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 total_count property + total_count *int32 + // The variables property + variables []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable +} +// NewItemItemEnvironmentsItemVariablesGetResponse instantiates a new ItemItemEnvironmentsItemVariablesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemVariablesGetResponse()(*ItemItemEnvironmentsItemVariablesGetResponse) { + m := &ItemItemEnvironmentsItemVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesGetResponse(), 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 *ItemItemEnvironmentsItemVariablesGetResponse) 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 *ItemItemEnvironmentsItemVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", cast) + 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 *ItemItemEnvironmentsItemVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() { + m.variables = value +} +type ItemItemEnvironmentsItemVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() +} diff --git a/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go b/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go new file mode 100644 index 00000000..4e6e9317 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody 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 name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody instantiates a new ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody()(*ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) { + m := &ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody(), 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 *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) 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 *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/repos/item_item_environments_item_variables_post_request_body.go b/pkg/github/repos/item_item_environments_item_variables_post_request_body.go new file mode 100644 index 00000000..dff25b31 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemVariablesPostRequestBody 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 name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemEnvironmentsItemVariablesPostRequestBody instantiates a new ItemItemEnvironmentsItemVariablesPostRequestBody and sets the default values. +func NewItemItemEnvironmentsItemVariablesPostRequestBody()(*ItemItemEnvironmentsItemVariablesPostRequestBody) { + m := &ItemItemEnvironmentsItemVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesPostRequestBody(), 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 *ItemItemEnvironmentsItemVariablesPostRequestBody) 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 *ItemItemEnvironmentsItemVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ItemItemEnvironmentsItemVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemEnvironmentsItemVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/repos/item_item_environments_item_variables_request_builder.go b/pkg/github/repos/item_item_environments_item_variables_request_builder.go new file mode 100644 index 00000000..b2148ec9 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables +type ItemItemEnvironmentsItemVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github/.repos.item.item.environments.item.variables.item collection +// returns a *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ByName(name string)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemVariablesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + m := &ItemItemEnvironmentsItemVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemVariablesRequestBuilder instantiates a new ItemItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemEnvironmentsItemVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-environment-variables +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemVariablesGetResponseable), nil +} +// Post create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#create-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) Post(ctx context.Context, body ItemItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(*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 +} +// ToPostRequestInformation create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + 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 *ItemItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go b/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go new file mode 100644 index 00000000..b25a674f --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go @@ -0,0 +1,105 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables\{name} +type ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + m := &ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables/{name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder instantiates a new ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#get-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable), nil +} +// Patch updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#update-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) 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 +} +// ToPatchRequestInformation updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + 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 *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go b/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go index 4e4d6fbd..1f73138b 100644 --- a/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go +++ b/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go @@ -90,6 +90,11 @@ func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Put(ctx con } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable), nil } +// Secrets the secrets property +// returns a *ItemItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Secrets()(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} // ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. // returns a *RequestInformation when successful func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { @@ -117,6 +122,11 @@ func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) ToPutReques } return requestInfo, nil } +// Variables the variables property +// returns a *ItemItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Variables()(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} // WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. // returns a *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder when successful func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { diff --git a/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go b/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go index e0216325..7c87a82b 100644 --- a/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go +++ b/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go @@ -23,7 +23,7 @@ func NewItemItemGitRefsWithRefItemRequestBuilder(rawUrl string, requestAdapter i urlParams["request-raw-url"] = rawUrl return NewItemItemGitRefsWithRefItemRequestBuilderInternal(urlParams, requestAdapter) } -// Delete delete a reference +// Delete deletes the provided reference. // returns a ValidationError error when the service returns a 422 status code // [API method documentation] // @@ -42,7 +42,7 @@ func (m *ItemItemGitRefsWithRefItemRequestBuilder) Delete(ctx context.Context, r } return nil } -// Patch update a reference +// Patch updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. // returns a GitRefable when successful // returns a ValidationError error when the service returns a 422 status code // [API method documentation] @@ -65,6 +65,7 @@ func (m *ItemItemGitRefsWithRefItemRequestBuilder) Patch(ctx context.Context, bo } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable), nil } +// ToDeleteRequestInformation deletes the provided reference. // returns a *RequestInformation when successful func (m *ItemItemGitRefsWithRefItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -72,6 +73,7 @@ func (m *ItemItemGitRefsWithRefItemRequestBuilder) ToDeleteRequestInformation(ct requestInfo.Headers.TryAdd("Accept", "application/json") return requestInfo, nil } +// ToPatchRequestInformation updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. // returns a *RequestInformation when successful func (m *ItemItemGitRefsWithRefItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemGitRefsItemWithRefPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/repos/item_item_private_vulnerability_reporting_get_response.go b/pkg/github/repos/item_item_private_vulnerability_reporting_get_response.go new file mode 100644 index 00000000..1734e928 --- /dev/null +++ b/pkg/github/repos/item_item_private_vulnerability_reporting_get_response.go @@ -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)() +} diff --git a/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go b/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go index 17ad41f6..99781927 100644 --- a/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go +++ b/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go @@ -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] @@ -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) { diff --git a/pkg/github/repositories/repositories_request_builder.go b/pkg/github/repositories/repositories_request_builder.go index 9e7e6ec5..44dd1655 100644 --- a/pkg/github/repositories/repositories_request_builder.go +++ b/pkg/github/repositories/repositories_request_builder.go @@ -2,7 +2,6 @@ package repositories import ( "context" - i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" ) @@ -16,16 +15,6 @@ type RepositoriesRequestBuilderGetQueryParameters struct { // A repository ID. Only return repositories with an ID greater than this ID. Since *int32 `uriparametername:"since"` } -// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github/.repositories.item collection -// returns a *WithRepository_ItemRequestBuilder when successful -func (m *RepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*WithRepository_ItemRequestBuilder) { - urlTplParams := make(map[string]string) - for idx, item := range m.BaseRequestBuilder.PathParameters { - urlTplParams[idx] = item - } - urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) - return NewWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) -} // NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { m := &RepositoriesRequestBuilder{