Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in generated code #22

Merged
merged 1 commit into from Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/github/kiota-lock.json
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "2679598123F08632A2FFC114750AED6269533BD439F3CA2487A054C8703177A95EE1ACCA7514CF91EB0672BDF9DF2275CCBDED4DAB6C8BE2F024F037132DF4AA",
"descriptionLocation": "../../../source-generator/schemas/downloaded.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.9.0",
"kiotaVersion": "1.9.1",
"clientClassName": "ApiClient",
"clientNamespaceName": "github.com/octokit/go-sdk/pkg/github/",
"language": "Go",
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 OwnerPatchRequestBody_merge_commit_message int

const (
PR_BODY_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE OwnerPatchRequestBody_merge_commit_message = iota
PR_TITLE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
BLANK_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
)

func (i OwnerPatchRequestBody_merge_commit_message) String() string {
return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i]
}
func ParseOwnerPatchRequestBody_merge_commit_message(v string) (any, error) {
result := PR_BODY_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
switch v {
case "PR_BODY":
result = PR_BODY_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
case "PR_TITLE":
result = PR_TITLE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
case "BLANK":
result = BLANK_OWNERPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE
default:
return 0, errors.New("Unknown OwnerPatchRequestBody_merge_commit_message value: " + v)
}
return &result, nil
}
func SerializeOwnerPatchRequestBody_merge_commit_message(values []OwnerPatchRequestBody_merge_commit_message) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i OwnerPatchRequestBody_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 OwnerPatchRequestBody_merge_commit_title int

const (
PR_TITLE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_TITLE OwnerPatchRequestBody_merge_commit_title = iota
MERGE_MESSAGE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_TITLE
)

func (i OwnerPatchRequestBody_merge_commit_title) String() string {
return []string{"PR_TITLE", "MERGE_MESSAGE"}[i]
}
func ParseOwnerPatchRequestBody_merge_commit_title(v string) (any, error) {
result := PR_TITLE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_TITLE
switch v {
case "PR_TITLE":
result = PR_TITLE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_TITLE
case "MERGE_MESSAGE":
result = MERGE_MESSAGE_OWNERPATCHREQUESTBODY_MERGE_COMMIT_TITLE
default:
return 0, errors.New("Unknown OwnerPatchRequestBody_merge_commit_title value: " + v)
}
return &result, nil
}
func SerializeOwnerPatchRequestBody_merge_commit_title(values []OwnerPatchRequestBody_merge_commit_title) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i OwnerPatchRequestBody_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 OwnerPatchRequestBody_squash_merge_commit_message int

const (
PR_BODY_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE OwnerPatchRequestBody_squash_merge_commit_message = iota
COMMIT_MESSAGES_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
BLANK_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
)

func (i OwnerPatchRequestBody_squash_merge_commit_message) String() string {
return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i]
}
func ParseOwnerPatchRequestBody_squash_merge_commit_message(v string) (any, error) {
result := PR_BODY_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
switch v {
case "PR_BODY":
result = PR_BODY_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
case "COMMIT_MESSAGES":
result = COMMIT_MESSAGES_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
case "BLANK":
result = BLANK_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE
default:
return 0, errors.New("Unknown OwnerPatchRequestBody_squash_merge_commit_message value: " + v)
}
return &result, nil
}
func SerializeOwnerPatchRequestBody_squash_merge_commit_message(values []OwnerPatchRequestBody_squash_merge_commit_message) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i OwnerPatchRequestBody_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 OwnerPatchRequestBody_squash_merge_commit_title int

const (
PR_TITLE_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE OwnerPatchRequestBody_squash_merge_commit_title = iota
COMMIT_OR_PR_TITLE_OWNERPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE
)

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

const (
PUBLIC_OWNERPATCHREQUESTBODY_VISIBILITY OwnerPatchRequestBody_visibility = iota
PRIVATE_OWNERPATCHREQUESTBODY_VISIBILITY
)

func (i OwnerPatchRequestBody_visibility) String() string {
return []string{"public", "private"}[i]
}
func ParseOwnerPatchRequestBody_visibility(v string) (any, error) {
result := PUBLIC_OWNERPATCHREQUESTBODY_VISIBILITY
switch v {
case "public":
result = PUBLIC_OWNERPATCHREQUESTBODY_VISIBILITY
case "private":
result = PRIVATE_OWNERPATCHREQUESTBODY_VISIBILITY
default:
return 0, errors.New("Unknown OwnerPatchRequestBody_visibility value: " + v)
}
return &result, nil
}
func SerializeOwnerPatchRequestBody_visibility(values []OwnerPatchRequestBody_visibility) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i OwnerPatchRequestBody_visibility) isMultiValue() bool {
return false
}