Skip to content

Commit

Permalink
New updates to generated code (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Octokit Bot <octokitbot@martynus.net>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
  • Loading branch information
3 people committed Mar 4, 2024
1 parent 610dce6 commit a3d0893
Show file tree
Hide file tree
Showing 328 changed files with 2,665 additions and 671 deletions.
4 changes: 2 additions & 2 deletions pkg/github/kiota-lock.json
@@ -1,8 +1,8 @@
{
"descriptionHash": "A1B7C373B4D1E9519AE4255139AFA918280FCDC9FC716B326D9F7FF3E1D35841E07461776C449533C9502D021E138C7EC038E47A19879C71618D05A494C135C9",
"descriptionHash": "8972B77B95704170D9F0484AF18AF0A61D49C58B6549AE22A3797042A1CAB79646A14C5F8877A33DFCFBF9039B4F9CAEE2BF593D5A956DDD4DD452F749497FBE",
"descriptionLocation": "../../../source-generator/schemas/downloaded.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0-preview.202402220002",
"kiotaVersion": "1.12.0-preview.202402290001",
"clientClassName": "ApiClient",
"clientNamespaceName": "github.com/octokit/go-sdk/pkg/github/",
"language": "Go",
Expand Down
@@ -0,0 +1,34 @@
package migrations
import (
"errors"
)
// Allowed values that can be passed to the exclude param.
type GetExcludeQueryParameterType int

const (
REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE GetExcludeQueryParameterType = iota
)

func (i GetExcludeQueryParameterType) String() string {
return []string{"repositories"}[i]
}
func ParseGetExcludeQueryParameterType(v string) (any, error) {
result := REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE
switch v {
case "repositories":
result = REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetExcludeQueryParameterType value: " + v)
}
return &result, nil
}
func SerializeGetExcludeQueryParameterType(values []GetExcludeQueryParameterType) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i GetExcludeQueryParameterType) isMultiValue() bool {
return false
}
@@ -0,0 +1,34 @@
package item
import (
"errors"
)
// Allowed values that can be passed to the exclude param.
type GetExcludeQueryParameterType int

const (
REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE GetExcludeQueryParameterType = iota
)

func (i GetExcludeQueryParameterType) String() string {
return []string{"repositories"}[i]
}
func ParseGetExcludeQueryParameterType(v string) (any, error) {
result := REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE
switch v {
case "repositories":
result = REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE
default:
return 0, errors.New("Unknown GetExcludeQueryParameterType value: " + v)
}
return &result, nil
}
func SerializeGetExcludeQueryParameterType(values []GetExcludeQueryParameterType) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i GetExcludeQueryParameterType) isMultiValue() bool {
return false
}
3 changes: 2 additions & 1 deletion pkg/github/orgs/item_migrations_request_builder.go
Expand Up @@ -5,6 +5,7 @@ import (
i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models"
i010f80164593e67edac379301caa66f6c3b0369d2d666ed5683626e52e3f25fb "github.com/octokit/go-sdk/pkg/github/orgs/item/migrations"
)

// ItemMigrationsRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations
Expand All @@ -14,7 +15,7 @@ type ItemMigrationsRequestBuilder struct {
// ItemMigrationsRequestBuilderGetQueryParameters lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations.
type ItemMigrationsRequestBuilderGetQueryParameters struct {
// Exclude attributes from the API response to improve performance
Exclude []string `uriparametername:"exclude"`
Exclude []i010f80164593e67edac379301caa66f6c3b0369d2d666ed5683626e52e3f25fb.GetExcludeQueryParameterType `uriparametername:"exclude"`
// 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)."
Expand Down
Expand Up @@ -4,6 +4,7 @@ import (
"context"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models"
i399c3da064b81c83d30565b554a09039c3bc9dc0590affc1306cb54f75cd8e0d "github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/item"
)

// ItemMigrationsWithMigration_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}
Expand All @@ -13,7 +14,7 @@ type ItemMigrationsWithMigration_ItemRequestBuilder struct {
// ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed.
type ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters struct {
// Exclude attributes from the API response to improve performance
Exclude []string `uriparametername:"exclude"`
Exclude []i399c3da064b81c83d30565b554a09039c3bc9dc0590affc1306cb54f75cd8e0d.GetExcludeQueryParameterType `uriparametername:"exclude"`
}
// Archive the archive property
// returns a *ItemMigrationsItemArchiveRequestBuilder when successful
Expand Down
@@ -0,0 +1,40 @@
package item
import (
"errors"
)
// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message.
type RepoPatchRequestBody_merge_commit_message int

const (
PR_BODY_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE RepoPatchRequestBody_merge_commit_message = iota
PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
BLANK_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
)

func (i RepoPatchRequestBody_merge_commit_message) String() string {
return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i]
}
func ParseRepoPatchRequestBody_merge_commit_message(v string) (any, error) {
result := PR_BODY_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
switch v {
case "PR_BODY":
result = PR_BODY_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
case "PR_TITLE":
result = PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
case "BLANK":
result = BLANK_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
default:
return 0, errors.New("Unknown RepoPatchRequestBody_merge_commit_message value: " + v)
}
return &result, nil
}
func SerializeRepoPatchRequestBody_merge_commit_message(values []RepoPatchRequestBody_merge_commit_message) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i RepoPatchRequestBody_merge_commit_message) isMultiValue() bool {
return false
}
@@ -0,0 +1,37 @@
package item
import (
"errors"
)
// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
type RepoPatchRequestBody_merge_commit_title int

const (
PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE RepoPatchRequestBody_merge_commit_title = iota
MERGE_MESSAGE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE
)

func (i RepoPatchRequestBody_merge_commit_title) String() string {
return []string{"PR_TITLE", "MERGE_MESSAGE"}[i]
}
func ParseRepoPatchRequestBody_merge_commit_title(v string) (any, error) {
result := PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE
switch v {
case "PR_TITLE":
result = PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE
case "MERGE_MESSAGE":
result = MERGE_MESSAGE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE
default:
return 0, errors.New("Unknown RepoPatchRequestBody_merge_commit_title value: " + v)
}
return &result, nil
}
func SerializeRepoPatchRequestBody_merge_commit_title(values []RepoPatchRequestBody_merge_commit_title) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i RepoPatchRequestBody_merge_commit_title) isMultiValue() bool {
return false
}
@@ -0,0 +1,40 @@
package item
import (
"errors"
)
// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message.
type RepoPatchRequestBody_squash_merge_commit_message int

const (
PR_BODY_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE RepoPatchRequestBody_squash_merge_commit_message = iota
COMMIT_MESSAGES_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
BLANK_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
)

func (i RepoPatchRequestBody_squash_merge_commit_message) String() string {
return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i]
}
func ParseRepoPatchRequestBody_squash_merge_commit_message(v string) (any, error) {
result := PR_BODY_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
switch v {
case "PR_BODY":
result = PR_BODY_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
case "COMMIT_MESSAGES":
result = COMMIT_MESSAGES_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
case "BLANK":
result = BLANK_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
default:
return 0, errors.New("Unknown RepoPatchRequestBody_squash_merge_commit_message value: " + v)
}
return &result, nil
}
func SerializeRepoPatchRequestBody_squash_merge_commit_message(values []RepoPatchRequestBody_squash_merge_commit_message) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i RepoPatchRequestBody_squash_merge_commit_message) isMultiValue() bool {
return false
}
@@ -0,0 +1,37 @@
package item
import (
"errors"
)
// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
type RepoPatchRequestBody_squash_merge_commit_title int

const (
PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE RepoPatchRequestBody_squash_merge_commit_title = iota
COMMIT_OR_PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE
)

func (i RepoPatchRequestBody_squash_merge_commit_title) String() string {
return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i]
}
func ParseRepoPatchRequestBody_squash_merge_commit_title(v string) (any, error) {
result := PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE
switch v {
case "PR_TITLE":
result = PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE
case "COMMIT_OR_PR_TITLE":
result = COMMIT_OR_PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE
default:
return 0, errors.New("Unknown RepoPatchRequestBody_squash_merge_commit_title value: " + v)
}
return &result, nil
}
func SerializeRepoPatchRequestBody_squash_merge_commit_title(values []RepoPatchRequestBody_squash_merge_commit_title) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i RepoPatchRequestBody_squash_merge_commit_title) isMultiValue() bool {
return false
}
37 changes: 37 additions & 0 deletions pkg/github/repos/item/item/repo_patch_request_body_visibility.go
@@ -0,0 +1,37 @@
package item
import (
"errors"
)
// The visibility of the repository.
type RepoPatchRequestBody_visibility int

const (
PUBLIC_REPOPATCHREQUESTBODY_VISIBILITY RepoPatchRequestBody_visibility = iota
PRIVATE_REPOPATCHREQUESTBODY_VISIBILITY
)

func (i RepoPatchRequestBody_visibility) String() string {
return []string{"public", "private"}[i]
}
func ParseRepoPatchRequestBody_visibility(v string) (any, error) {
result := PUBLIC_REPOPATCHREQUESTBODY_VISIBILITY
switch v {
case "public":
result = PUBLIC_REPOPATCHREQUESTBODY_VISIBILITY
case "private":
result = PRIVATE_REPOPATCHREQUESTBODY_VISIBILITY
default:
return 0, errors.New("Unknown RepoPatchRequestBody_visibility value: " + v)
}
return &result, nil
}
func SerializeRepoPatchRequestBody_visibility(values []RepoPatchRequestBody_visibility) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i RepoPatchRequestBody_visibility) isMultiValue() bool {
return false
}
Expand Up @@ -6,14 +6,14 @@ import (
i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models"
)

// ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\actions\artifacts\{artifact_id}\{archive_format}
// ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts\{artifact_id}\{archive_format}
type ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal instantiates a new ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder and sets the default values.
func NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) {
m := &ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/actions/artifacts/{artifact_id}/{archive_format}", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts/{artifact_id}/{archive_format}", pathParameters),
}
return m
}
Expand Down
Expand Up @@ -6,7 +6,7 @@ import (
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
)

// ItemItemActionsArtifactsRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\actions\artifacts
// ItemItemActionsArtifactsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts
type ItemItemActionsArtifactsRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
Expand All @@ -32,7 +32,7 @@ func (m *ItemItemActionsArtifactsRequestBuilder) ByArtifact_id(artifact_id int32
// NewItemItemActionsArtifactsRequestBuilderInternal instantiates a new ItemItemActionsArtifactsRequestBuilder and sets the default values.
func NewItemItemActionsArtifactsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsRequestBuilder) {
m := &ItemItemActionsArtifactsRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/actions/artifacts{?name*,page*,per_page*}", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts{?name*,page*,per_page*}", pathParameters),
}
return m
}
Expand Down
Expand Up @@ -6,7 +6,7 @@ import (
i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models"
)

// ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\actions\artifacts\{artifact_id}
// ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts\{artifact_id}
type ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
Expand All @@ -25,7 +25,7 @@ func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) ByArchive_form
// NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal instantiates a new ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder and sets the default values.
func NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) {
m := &ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/actions/artifacts/{artifact_id}", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts/{artifact_id}", pathParameters),
}
return m
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/github/repos/item_item_actions_cache_request_builder.go
Expand Up @@ -4,14 +4,14 @@ import (
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
)

// ItemItemActionsCacheRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\actions\cache
// ItemItemActionsCacheRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\cache
type ItemItemActionsCacheRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// NewItemItemActionsCacheRequestBuilderInternal instantiates a new ItemItemActionsCacheRequestBuilder and sets the default values.
func NewItemItemActionsCacheRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheRequestBuilder) {
m := &ItemItemActionsCacheRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/actions/cache", pathParameters),
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/cache", pathParameters),
}
return m
}
Expand Down

0 comments on commit a3d0893

Please sign in to comment.