diff --git a/go.mod b/go.mod index 800d9b67..87784957 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/octokit/go-sdk go 1.21.5 require ( - github.com/microsoft/kiota-abstractions-go v1.5.6 - github.com/microsoft/kiota-http-go v1.3.2 + github.com/microsoft/kiota-abstractions-go v1.6.0 + github.com/microsoft/kiota-http-go v1.3.3 github.com/microsoft/kiota-serialization-form-go v1.0.0 - github.com/microsoft/kiota-serialization-json-go v1.0.6 + github.com/microsoft/kiota-serialization-json-go v1.0.7 github.com/microsoft/kiota-serialization-multipart-go v1.0.0 github.com/microsoft/kiota-serialization-text-go v1.0.0 ) @@ -18,8 +18,8 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/std-uritemplate/std-uritemplate/go v0.0.50 // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/std-uritemplate/std-uritemplate/go v0.0.55 // indirect + github.com/stretchr/testify v1.9.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect diff --git a/go.sum b/go.sum index 50ce8675..296304ad 100644 --- a/go.sum +++ b/go.sum @@ -15,24 +15,24 @@ github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/microsoft/kiota-abstractions-go v1.5.6 h1:3hd1sACWB2B9grv8KG1T8g/gGQ4A8kTLv91OUxHSxkE= -github.com/microsoft/kiota-abstractions-go v1.5.6/go.mod h1:2WX7Oh8V9SAdZ80OGeE53rcbdys54Pd38rAeDUghrpM= -github.com/microsoft/kiota-http-go v1.3.2 h1:HSrbw6MDMmgLaqU1qT3SgdmD/18KPW2usfyUtE017Lw= -github.com/microsoft/kiota-http-go v1.3.2/go.mod h1:pEs3eLpCJBhsesjtvM/3T4ODKCofPgDlDsGHHetau2g= +github.com/microsoft/kiota-abstractions-go v1.6.0 h1:qbGBNMU0/o5myKbikCBXJFohVCFrrpx2cO15Rta2WyA= +github.com/microsoft/kiota-abstractions-go v1.6.0/go.mod h1:7YH20ZbRWXGfHSSvdHkdztzgCB9mRdtFx13+hrYIEpo= +github.com/microsoft/kiota-http-go v1.3.3 h1:FKjK5BLFONu5eIBxtrkirkixFQmcPwitZ8iwZHKbESo= +github.com/microsoft/kiota-http-go v1.3.3/go.mod h1:IWw/PwtBs/GYz+Pa75gPW7MFNFv0aKPFsLw5WqzL1SE= github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjblsyVgifS11b3WCx+eFEsAI= github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA= -github.com/microsoft/kiota-serialization-json-go v1.0.6 h1:8v8IXMGurLCRYZs1l0Ck75lN0wzKDLko69mNdQGVWeQ= -github.com/microsoft/kiota-serialization-json-go v1.0.6/go.mod h1:I0CiXKgvKDFOO35lQ5VpYmd2nFLXHdJUsHnG8z/TX7A= +github.com/microsoft/kiota-serialization-json-go v1.0.7 h1:yMbckSTPrjZdM4EMXgzLZSA3CtDaUBI350u0VoYRz7Y= +github.com/microsoft/kiota-serialization-json-go v1.0.7/go.mod h1:1krrY7DYl3ivPIzl4xTaBpew6akYNa8/Tal8g+kb0cc= github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs= github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA= github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/std-uritemplate/std-uritemplate/go v0.0.50 h1:LAE6WYRmLlDXPtEzr152BnD/MHxGCKmcp5D2Pw0NvmU= -github.com/std-uritemplate/std-uritemplate/go v0.0.50/go.mod h1:CLZ1543WRCuUQQjK0BvPM4QrG2toY8xNZUm8Vbt7vTc= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/std-uritemplate/std-uritemplate/go v0.0.55 h1:muSH037g97K7U2f94G9LUuE8tZlJsoSSrPsO9V281WY= +github.com/std-uritemplate/std-uritemplate/go v0.0.55/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 3164cc9a..4c28b3e1 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,8 +1,8 @@ { - "descriptionHash": "DA6E75F17989092BF227D8F9183FC5A5F9B42B6C1168C39791EC5B3139F8746ABF842849DA6BA11C182C2EBE67F95FCA9B2A028275F16F6C4453ADFB0EE36A95", + "descriptionHash": "0DBCC4A4B322A39DBB2C9A0CDC70BFA5C0343176D1FD8245BB0A37391405F13D9F82DACA14AF8D750C70A6335D4FCE9A9E724A151E2AE2ABE634A0958869061B", "descriptionLocation": "../../../source-generator/schemas/downloaded.json", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.12.0", + "kiotaVersion": "1.13.0-preview.202403210001", "clientClassName": "ApiClient", "clientNamespaceName": "github.com/octokit/go-sdk/pkg/github/", "language": "Go", diff --git a/pkg/github/markdown/markdown_request_builder.go b/pkg/github/markdown/markdown_request_builder.go index 06ff5b19..26068d9a 100644 --- a/pkg/github/markdown/markdown_request_builder.go +++ b/pkg/github/markdown/markdown_request_builder.go @@ -23,23 +23,19 @@ func NewMarkdownRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26337 return NewMarkdownRequestBuilderInternal(urlParams, requestAdapter) } // Post render a Markdown document -// returns a []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document -func (m *MarkdownRequestBuilder) Post(ctx context.Context, body MarkdownPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *MarkdownRequestBuilder) Post(ctx context.Context, body MarkdownPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err - } - if res == nil { - return nil, nil + return err } - return res.([]byte), nil + return nil } // Raw the raw property // returns a *RawRequestBuilder when successful diff --git a/pkg/github/markdown/raw_request_builder.go b/pkg/github/markdown/raw_request_builder.go index 9533de76..952132ee 100644 --- a/pkg/github/markdown/raw_request_builder.go +++ b/pkg/github/markdown/raw_request_builder.go @@ -23,23 +23,19 @@ func NewRawRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c return NewRawRequestBuilderInternal(urlParams, requestAdapter) } // Post you must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. -// returns a []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode -func (m *RawRequestBuilder) Post(ctx context.Context, body *string, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *RawRequestBuilder) Post(ctx context.Context, body *string, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err + return err } - if res == nil { - return nil, nil - } - return res.([]byte), nil + return nil } // ToPostRequestInformation you must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. // returns a *RequestInformation when successful diff --git a/pkg/github/models/base_gist.go b/pkg/github/models/base_gist.go index 98370763..87644a4f 100644 --- a/pkg/github/models/base_gist.go +++ b/pkg/github/models/base_gist.go @@ -21,12 +21,16 @@ type BaseGist struct { description *string // The files property files BaseGist_filesable + // The forks property + forks i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable // The forks_url property forks_url *string // The git_pull_url property git_pull_url *string // The git_push_url property git_push_url *string + // The history property + history i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable // The html_url property html_url *string // The id property @@ -152,6 +156,16 @@ func (m *BaseGist) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896 } return nil } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetForks(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -182,6 +196,16 @@ func (m *BaseGist) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896 } return nil } + res["history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHistory(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -279,6 +303,11 @@ func (m *BaseGist) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896 func (m *BaseGist) GetFiles()(BaseGist_filesable) { return m.files } +// GetForks gets the forks property value. The forks property +// returns a UntypedNodeable when successful +func (m *BaseGist) GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.forks +} // GetForksUrl gets the forks_url property value. The forks_url property // returns a *string when successful func (m *BaseGist) GetForksUrl()(*string) { @@ -294,6 +323,11 @@ func (m *BaseGist) GetGitPullUrl()(*string) { func (m *BaseGist) GetGitPushUrl()(*string) { return m.git_push_url } +// GetHistory gets the history property value. The history property +// returns a UntypedNodeable when successful +func (m *BaseGist) GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.history +} // GetHtmlUrl gets the html_url property value. The html_url property // returns a *string when successful func (m *BaseGist) GetHtmlUrl()(*string) { @@ -377,6 +411,12 @@ func (m *BaseGist) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c01 return err } } + { + err := writer.WriteObjectValue("forks", m.GetForks()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("forks_url", m.GetForksUrl()) if err != nil { @@ -395,6 +435,12 @@ func (m *BaseGist) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c01 return err } } + { + err := writer.WriteObjectValue("history", m.GetHistory()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) if err != nil { @@ -485,6 +531,10 @@ func (m *BaseGist) SetDescription(value *string)() { func (m *BaseGist) SetFiles(value BaseGist_filesable)() { m.files = value } +// SetForks sets the forks property value. The forks property +func (m *BaseGist) SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.forks = value +} // SetForksUrl sets the forks_url property value. The forks_url property func (m *BaseGist) SetForksUrl(value *string)() { m.forks_url = value @@ -497,6 +547,10 @@ func (m *BaseGist) SetGitPullUrl(value *string)() { func (m *BaseGist) SetGitPushUrl(value *string)() { m.git_push_url = value } +// SetHistory sets the history property value. The history property +func (m *BaseGist) SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.history = value +} // SetHtmlUrl sets the html_url property value. The html_url property func (m *BaseGist) SetHtmlUrl(value *string)() { m.html_url = value @@ -542,9 +596,11 @@ type BaseGistable interface { GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) GetDescription()(*string) GetFiles()(BaseGist_filesable) + GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) GetForksUrl()(*string) GetGitPullUrl()(*string) GetGitPushUrl()(*string) + GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) GetHtmlUrl()(*string) GetId()(*string) GetNodeId()(*string) @@ -560,9 +616,11 @@ type BaseGistable interface { SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() SetDescription(value *string)() SetFiles(value BaseGist_filesable)() + SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() SetForksUrl(value *string)() SetGitPullUrl(value *string)() SetGitPushUrl(value *string)() + SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() SetHtmlUrl(value *string)() SetId(value *string)() SetNodeId(value *string)() diff --git a/pkg/github/models/gist_simple_fork_of.go b/pkg/github/models/gist_simple_fork_of.go index e153efcc..2971159b 100644 --- a/pkg/github/models/gist_simple_fork_of.go +++ b/pkg/github/models/gist_simple_fork_of.go @@ -21,12 +21,16 @@ type GistSimple_fork_of struct { description *string // The files property files GistSimple_fork_of_filesable + // The forks property + forks i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable // The forks_url property forks_url *string // The git_pull_url property git_pull_url *string // The git_push_url property git_push_url *string + // The history property + history i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable // The html_url property html_url *string // The id property @@ -152,6 +156,16 @@ func (m *GistSimple_fork_of) GetFieldDeserializers()(map[string]func(i878a80d233 } return nil } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetForks(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -182,6 +196,16 @@ func (m *GistSimple_fork_of) GetFieldDeserializers()(map[string]func(i878a80d233 } return nil } + res["history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHistory(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -279,6 +303,11 @@ func (m *GistSimple_fork_of) GetFieldDeserializers()(map[string]func(i878a80d233 func (m *GistSimple_fork_of) GetFiles()(GistSimple_fork_of_filesable) { return m.files } +// GetForks gets the forks property value. The forks property +// returns a UntypedNodeable when successful +func (m *GistSimple_fork_of) GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.forks +} // GetForksUrl gets the forks_url property value. The forks_url property // returns a *string when successful func (m *GistSimple_fork_of) GetForksUrl()(*string) { @@ -294,6 +323,11 @@ func (m *GistSimple_fork_of) GetGitPullUrl()(*string) { func (m *GistSimple_fork_of) GetGitPushUrl()(*string) { return m.git_push_url } +// GetHistory gets the history property value. The history property +// returns a UntypedNodeable when successful +func (m *GistSimple_fork_of) GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.history +} // GetHtmlUrl gets the html_url property value. The html_url property // returns a *string when successful func (m *GistSimple_fork_of) GetHtmlUrl()(*string) { @@ -377,6 +411,12 @@ func (m *GistSimple_fork_of) Serialize(writer i878a80d2330e89d26896388a3f487eef2 return err } } + { + err := writer.WriteObjectValue("forks", m.GetForks()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("forks_url", m.GetForksUrl()) if err != nil { @@ -395,6 +435,12 @@ func (m *GistSimple_fork_of) Serialize(writer i878a80d2330e89d26896388a3f487eef2 return err } } + { + err := writer.WriteObjectValue("history", m.GetHistory()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) if err != nil { @@ -485,6 +531,10 @@ func (m *GistSimple_fork_of) SetDescription(value *string)() { func (m *GistSimple_fork_of) SetFiles(value GistSimple_fork_of_filesable)() { m.files = value } +// SetForks sets the forks property value. The forks property +func (m *GistSimple_fork_of) SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.forks = value +} // SetForksUrl sets the forks_url property value. The forks_url property func (m *GistSimple_fork_of) SetForksUrl(value *string)() { m.forks_url = value @@ -497,6 +547,10 @@ func (m *GistSimple_fork_of) SetGitPullUrl(value *string)() { func (m *GistSimple_fork_of) SetGitPushUrl(value *string)() { m.git_push_url = value } +// SetHistory sets the history property value. The history property +func (m *GistSimple_fork_of) SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.history = value +} // SetHtmlUrl sets the html_url property value. The html_url property func (m *GistSimple_fork_of) SetHtmlUrl(value *string)() { m.html_url = value @@ -542,9 +596,11 @@ type GistSimple_fork_ofable interface { GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) GetDescription()(*string) GetFiles()(GistSimple_fork_of_filesable) + GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) GetForksUrl()(*string) GetGitPullUrl()(*string) GetGitPushUrl()(*string) + GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) GetHtmlUrl()(*string) GetId()(*string) GetNodeId()(*string) @@ -560,9 +616,11 @@ type GistSimple_fork_ofable interface { SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() SetDescription(value *string)() SetFiles(value GistSimple_fork_of_filesable)() + SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() SetForksUrl(value *string)() SetGitPullUrl(value *string)() SetGitPushUrl(value *string)() + SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() SetHtmlUrl(value *string)() SetId(value *string)() SetNodeId(value *string)() diff --git a/pkg/github/models/gpg_key_subkeys.go b/pkg/github/models/gpg_key_subkeys.go index bd935138..a00d1781 100644 --- a/pkg/github/models/gpg_key_subkeys.go +++ b/pkg/github/models/gpg_key_subkeys.go @@ -33,6 +33,8 @@ type GpgKey_subkeys struct { raw_key *string // The revoked property revoked *bool + // The subkeys property + subkeys i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable } // NewGpgKey_subkeys instantiates a new GpgKey_subkeys and sets the default values. func NewGpgKey_subkeys()(*GpgKey_subkeys) { @@ -226,6 +228,16 @@ func (m *GpgKey_subkeys) GetFieldDeserializers()(map[string]func(i878a80d2330e89 } return nil } + res["subkeys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSubkeys(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } return res } // GetId gets the id property value. The id property @@ -258,6 +270,11 @@ func (m *GpgKey_subkeys) GetRawKey()(*string) { func (m *GpgKey_subkeys) GetRevoked()(*bool) { return m.revoked } +// GetSubkeys gets the subkeys property value. The subkeys property +// returns a UntypedNodeable when successful +func (m *GpgKey_subkeys) GetSubkeys()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.subkeys +} // Serialize serializes information the current object func (m *GpgKey_subkeys) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { { @@ -344,6 +361,12 @@ func (m *GpgKey_subkeys) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a return err } } + { + err := writer.WriteObjectValue("subkeys", m.GetSubkeys()) + if err != nil { + return err + } + } { err := writer.WriteAdditionalData(m.GetAdditionalData()) if err != nil { @@ -408,6 +431,10 @@ func (m *GpgKey_subkeys) SetRawKey(value *string)() { func (m *GpgKey_subkeys) SetRevoked(value *bool)() { m.revoked = value } +// SetSubkeys sets the subkeys property value. The subkeys property +func (m *GpgKey_subkeys) SetSubkeys(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.subkeys = value +} type GpgKey_subkeysable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable @@ -424,6 +451,7 @@ type GpgKey_subkeysable interface { GetPublicKey()(*string) GetRawKey()(*string) GetRevoked()(*bool) + GetSubkeys()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) SetCanCertify(value *bool)() SetCanEncryptComms(value *bool)() SetCanEncryptStorage(value *bool)() @@ -437,4 +465,5 @@ type GpgKey_subkeysable interface { SetPublicKey(value *string)() SetRawKey(value *string)() SetRevoked(value *bool)() + SetSubkeys(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() } diff --git a/pkg/github/models/root.go b/pkg/github/models/root.go index 2e9fa727..6f327934 100644 --- a/pkg/github/models/root.go +++ b/pkg/github/models/root.go @@ -34,6 +34,7 @@ type Root struct { // The gists_url property gists_url *string // The hub_url property + // Deprecated: hub_url *string // The issue_search_url property issue_search_url *string @@ -493,6 +494,7 @@ func (m *Root) GetGistsUrl()(*string) { return m.gists_url } // GetHubUrl gets the hub_url property value. The hub_url property +// Deprecated: // returns a *string when successful func (m *Root) GetHubUrl()(*string) { return m.hub_url @@ -857,6 +859,7 @@ func (m *Root) SetGistsUrl(value *string)() { m.gists_url = value } // SetHubUrl sets the hub_url property value. The hub_url property +// Deprecated: func (m *Root) SetHubUrl(value *string)() { m.hub_url = value } diff --git a/pkg/github/models/secret_scanning_location.go b/pkg/github/models/secret_scanning_location.go index 76b683d7..bc5f454a 100644 --- a/pkg/github/models/secret_scanning_location.go +++ b/pkg/github/models/secret_scanning_location.go @@ -12,7 +12,7 @@ type SecretScanningLocation struct { // The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. typeEscaped *SecretScanningLocation_type } -// SecretScanningLocation_SecretScanningLocation_details composed type wrapper for classes SecretScanningLocationCommitable, SecretScanningLocationDiscussionBodyable, SecretScanningLocationDiscussionCommentable, SecretScanningLocationDiscussionTitleable, SecretScanningLocationIssueBodyable, SecretScanningLocationIssueCommentable, SecretScanningLocationIssueTitleable, SecretScanningLocationPullRequestBodyable, SecretScanningLocationPullRequestCommentable, SecretScanningLocationPullRequestReviewable, SecretScanningLocationPullRequestReviewCommentable, SecretScanningLocationPullRequestTitleable +// SecretScanningLocation_SecretScanningLocation_details composed type wrapper for classes SecretScanningLocationCommitable, SecretScanningLocationDiscussionBodyable, SecretScanningLocationDiscussionCommentable, SecretScanningLocationDiscussionTitleable, SecretScanningLocationIssueBodyable, SecretScanningLocationIssueCommentable, SecretScanningLocationIssueTitleable, SecretScanningLocationPullRequestBodyable, SecretScanningLocationPullRequestCommentable, SecretScanningLocationPullRequestReviewable, SecretScanningLocationPullRequestReviewCommentable, SecretScanningLocationPullRequestTitleable, SecretScanningLocationWikiCommitable type SecretScanningLocation_SecretScanningLocation_details struct { // Composed type representation for type SecretScanningLocationCommitable secretScanningLocationCommit SecretScanningLocationCommitable @@ -38,6 +38,8 @@ type SecretScanningLocation_SecretScanningLocation_details struct { secretScanningLocationPullRequestReviewComment SecretScanningLocationPullRequestReviewCommentable // Composed type representation for type SecretScanningLocationPullRequestTitleable secretScanningLocationPullRequestTitle SecretScanningLocationPullRequestTitleable + // Composed type representation for type SecretScanningLocationWikiCommitable + secretScanningLocationWikiCommit SecretScanningLocationWikiCommitable } // NewSecretScanningLocation_SecretScanningLocation_details instantiates a new SecretScanningLocation_SecretScanningLocation_details and sets the default values. func NewSecretScanningLocation_SecretScanningLocation_details()(*SecretScanningLocation_SecretScanningLocation_details) { @@ -135,6 +137,11 @@ func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScannin func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestTitle()(SecretScanningLocationPullRequestTitleable) { return m.secretScanningLocationPullRequestTitle } +// GetSecretScanningLocationWikiCommit gets the secretScanningLocationWikiCommit property value. Composed type representation for type SecretScanningLocationWikiCommitable +// returns a SecretScanningLocationWikiCommitable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationWikiCommit()(SecretScanningLocationWikiCommitable) { + return m.secretScanningLocationWikiCommit +} // Serialize serializes information the current object func (m *SecretScanningLocation_SecretScanningLocation_details) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { if m.GetSecretScanningLocationCommit() != nil { @@ -197,6 +204,11 @@ func (m *SecretScanningLocation_SecretScanningLocation_details) Serialize(writer if err != nil { return err } + } else if m.GetSecretScanningLocationWikiCommit() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationWikiCommit()) + if err != nil { + return err + } } return nil } @@ -248,6 +260,10 @@ func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScannin func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestTitle(value SecretScanningLocationPullRequestTitleable)() { m.secretScanningLocationPullRequestTitle = value } +// SetSecretScanningLocationWikiCommit sets the secretScanningLocationWikiCommit property value. Composed type representation for type SecretScanningLocationWikiCommitable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationWikiCommit(value SecretScanningLocationWikiCommitable)() { + m.secretScanningLocationWikiCommit = value +} type SecretScanningLocation_SecretScanningLocation_detailsable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetSecretScanningLocationCommit()(SecretScanningLocationCommitable) @@ -262,6 +278,7 @@ type SecretScanningLocation_SecretScanningLocation_detailsable interface { GetSecretScanningLocationPullRequestReview()(SecretScanningLocationPullRequestReviewable) GetSecretScanningLocationPullRequestReviewComment()(SecretScanningLocationPullRequestReviewCommentable) GetSecretScanningLocationPullRequestTitle()(SecretScanningLocationPullRequestTitleable) + GetSecretScanningLocationWikiCommit()(SecretScanningLocationWikiCommitable) SetSecretScanningLocationCommit(value SecretScanningLocationCommitable)() SetSecretScanningLocationDiscussionBody(value SecretScanningLocationDiscussionBodyable)() SetSecretScanningLocationDiscussionComment(value SecretScanningLocationDiscussionCommentable)() @@ -274,6 +291,7 @@ type SecretScanningLocation_SecretScanningLocation_detailsable interface { SetSecretScanningLocationPullRequestReview(value SecretScanningLocationPullRequestReviewable)() SetSecretScanningLocationPullRequestReviewComment(value SecretScanningLocationPullRequestReviewCommentable)() SetSecretScanningLocationPullRequestTitle(value SecretScanningLocationPullRequestTitleable)() + SetSecretScanningLocationWikiCommit(value SecretScanningLocationWikiCommitable)() } // NewSecretScanningLocation instantiates a new SecretScanningLocation and sets the default values. func NewSecretScanningLocation()(*SecretScanningLocation) { diff --git a/pkg/github/models/secret_scanning_location_type.go b/pkg/github/models/secret_scanning_location_type.go index 3fe5632f..f5ba61cd 100644 --- a/pkg/github/models/secret_scanning_location_type.go +++ b/pkg/github/models/secret_scanning_location_type.go @@ -7,6 +7,7 @@ type SecretScanningLocation_type int const ( COMMIT_SECRETSCANNINGLOCATION_TYPE SecretScanningLocation_type = iota + WIKI_COMMIT_SECRETSCANNINGLOCATION_TYPE ISSUE_TITLE_SECRETSCANNINGLOCATION_TYPE ISSUE_BODY_SECRETSCANNINGLOCATION_TYPE ISSUE_COMMENT_SECRETSCANNINGLOCATION_TYPE @@ -21,13 +22,15 @@ const ( ) func (i SecretScanningLocation_type) String() string { - return []string{"commit", "issue_title", "issue_body", "issue_comment", "discussion_title", "discussion_body", "discussion_comment", "pull_request_title", "pull_request_body", "pull_request_comment", "pull_request_review", "pull_request_review_comment"}[i] + return []string{"commit", "wiki_commit", "issue_title", "issue_body", "issue_comment", "discussion_title", "discussion_body", "discussion_comment", "pull_request_title", "pull_request_body", "pull_request_comment", "pull_request_review", "pull_request_review_comment"}[i] } func ParseSecretScanningLocation_type(v string) (any, error) { result := COMMIT_SECRETSCANNINGLOCATION_TYPE switch v { case "commit": result = COMMIT_SECRETSCANNINGLOCATION_TYPE + case "wiki_commit": + result = WIKI_COMMIT_SECRETSCANNINGLOCATION_TYPE case "issue_title": result = ISSUE_TITLE_SECRETSCANNINGLOCATION_TYPE case "issue_body": diff --git a/pkg/github/models/secret_scanning_location_wiki_commit.go b/pkg/github/models/secret_scanning_location_wiki_commit.go new file mode 100644 index 00000000..14032fbf --- /dev/null +++ b/pkg/github/models/secret_scanning_location_wiki_commit.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationWikiCommit represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki. +type SecretScanningLocationWikiCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // SHA-1 hash ID of the associated blob + blob_sha *string + // SHA-1 hash ID of the associated commit + commit_sha *string + // The GitHub URL to get the associated wiki commit + commit_url *string + // The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. + end_column *float64 + // Line number at which the secret ends in the file + end_line *float64 + // The GitHub URL to get the associated wiki page + page_url *string + // The file path of the wiki page + path *string + // The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. + start_column *float64 + // Line number at which the secret starts in the file + start_line *float64 +} +// NewSecretScanningLocationWikiCommit instantiates a new SecretScanningLocationWikiCommit and sets the default values. +func NewSecretScanningLocationWikiCommit()(*SecretScanningLocationWikiCommit) { + m := &SecretScanningLocationWikiCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationWikiCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationWikiCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationWikiCommit(), 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 *SecretScanningLocationWikiCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlobSha gets the blob_sha property value. SHA-1 hash ID of the associated blob +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetBlobSha()(*string) { + return m.blob_sha +} +// GetCommitSha gets the commit_sha property value. SHA-1 hash ID of the associated commit +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetCommitSha()(*string) { + return m.commit_sha +} +// GetCommitUrl gets the commit_url property value. The GitHub URL to get the associated wiki commit +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetCommitUrl()(*string) { + return m.commit_url +} +// GetEndColumn gets the end_column property value. The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetEndColumn()(*float64) { + return m.end_column +} +// GetEndLine gets the end_line property value. Line number at which the secret ends in the file +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetEndLine()(*float64) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationWikiCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["blob_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobSha(val) + } + return nil + } + res["commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSha(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(val) + } + return nil + } + res["page_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPageUrl(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["start_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetPageUrl gets the page_url property value. The GitHub URL to get the associated wiki page +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetPageUrl()(*string) { + return m.page_url +} +// GetPath gets the path property value. The file path of the wiki page +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetPath()(*string) { + return m.path +} +// GetStartColumn gets the start_column property value. The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetStartColumn()(*float64) { + return m.start_column +} +// GetStartLine gets the start_line property value. Line number at which the secret starts in the file +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetStartLine()(*float64) { + return m.start_line +} +// Serialize serializes information the current object +func (m *SecretScanningLocationWikiCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("blob_sha", m.GetBlobSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("page_url", m.GetPageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("start_line", m.GetStartLine()) + 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 *SecretScanningLocationWikiCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlobSha sets the blob_sha property value. SHA-1 hash ID of the associated blob +func (m *SecretScanningLocationWikiCommit) SetBlobSha(value *string)() { + m.blob_sha = value +} +// SetCommitSha sets the commit_sha property value. SHA-1 hash ID of the associated commit +func (m *SecretScanningLocationWikiCommit) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetCommitUrl sets the commit_url property value. The GitHub URL to get the associated wiki commit +func (m *SecretScanningLocationWikiCommit) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetEndColumn sets the end_column property value. The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. +func (m *SecretScanningLocationWikiCommit) SetEndColumn(value *float64)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. Line number at which the secret ends in the file +func (m *SecretScanningLocationWikiCommit) SetEndLine(value *float64)() { + m.end_line = value +} +// SetPageUrl sets the page_url property value. The GitHub URL to get the associated wiki page +func (m *SecretScanningLocationWikiCommit) SetPageUrl(value *string)() { + m.page_url = value +} +// SetPath sets the path property value. The file path of the wiki page +func (m *SecretScanningLocationWikiCommit) SetPath(value *string)() { + m.path = value +} +// SetStartColumn sets the start_column property value. The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. +func (m *SecretScanningLocationWikiCommit) SetStartColumn(value *float64)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. Line number at which the secret starts in the file +func (m *SecretScanningLocationWikiCommit) SetStartLine(value *float64)() { + m.start_line = value +} +type SecretScanningLocationWikiCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlobSha()(*string) + GetCommitSha()(*string) + GetCommitUrl()(*string) + GetEndColumn()(*float64) + GetEndLine()(*float64) + GetPageUrl()(*string) + GetPath()(*string) + GetStartColumn()(*float64) + GetStartLine()(*float64) + SetBlobSha(value *string)() + SetCommitSha(value *string)() + SetCommitUrl(value *string)() + SetEndColumn(value *float64)() + SetEndLine(value *float64)() + SetPageUrl(value *string)() + SetPath(value *string)() + SetStartColumn(value *float64)() + SetStartLine(value *float64)() +} diff --git a/pkg/github/orgs/item_hooks_item_config_request_builder.go b/pkg/github/orgs/item_hooks_item_config_request_builder.go index ff01875d..b0191a77 100644 --- a/pkg/github/orgs/item_hooks_item_config_request_builder.go +++ b/pkg/github/orgs/item_hooks_item_config_request_builder.go @@ -23,7 +23,7 @@ func NewItemHooksItemConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187 urlParams["request-raw-url"] = rawUrl return NewItemHooksItemConfigRequestBuilderInternal(urlParams, requestAdapter) } -// Get returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint. +// Get returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a WebhookConfigable when successful // [API method documentation] // @@ -42,7 +42,7 @@ func (m *ItemHooksItemConfigRequestBuilder) Get(ctx context.Context, requestConf } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable), nil } -// Patch updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint. +// Patch updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a WebhookConfigable when successful // [API method documentation] // @@ -61,7 +61,7 @@ func (m *ItemHooksItemConfigRequestBuilder) Patch(ctx context.Context, body Item } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable), nil } -// ToGetRequestInformation returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint. +// ToGetRequestInformation returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksItemConfigRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -69,7 +69,7 @@ func (m *ItemHooksItemConfigRequestBuilder) ToGetRequestInformation(ctx context. requestInfo.Headers.TryAdd("Accept", "application/json") return requestInfo, nil } -// ToPatchRequestInformation updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint. +// ToPatchRequestInformation updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksItemConfigRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemHooksItemConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go b/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go index f41b96a7..fb38be9e 100644 --- a/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go +++ b/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go @@ -23,7 +23,7 @@ func NewItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl string, request urlParams["request-raw-url"] = rawUrl return NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) } -// Post redeliver a delivery for a webhook configured in an organization. +// Post redeliver a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a ItemHooksItemDeliveriesItemAttemptsPostResponseable when successful // returns a BasicError error when the service returns a 400 status code // returns a ValidationError error when the service returns a 422 status code @@ -48,7 +48,7 @@ func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Con } return res.(ItemHooksItemDeliveriesItemAttemptsPostResponseable), nil } -// ToPostRequestInformation redeliver a delivery for a webhook configured in an organization. +// ToPostRequestInformation redeliver a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go b/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go index f774f9e3..d2939fe4 100644 --- a/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go +++ b/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go @@ -11,7 +11,7 @@ import ( type ItemHooksItemDeliveriesRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemHooksItemDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for a webhook configured in an organization. +// ItemHooksItemDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. type ItemHooksItemDeliveriesRequestBuilderGetQueryParameters struct { // Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. Cursor *string `uriparametername:"cursor"` @@ -42,7 +42,7 @@ func NewItemHooksItemDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae urlParams["request-raw-url"] = rawUrl return NewItemHooksItemDeliveriesRequestBuilderInternal(urlParams, requestAdapter) } -// Get returns a list of webhook deliveries for a webhook configured in an organization. +// Get returns a list of webhook deliveries for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a []HookDeliveryItemable when successful // returns a BasicError error when the service returns a 400 status code // returns a ValidationError error when the service returns a 422 status code @@ -70,7 +70,7 @@ func (m *ItemHooksItemDeliveriesRequestBuilder) Get(ctx context.Context, request } return val, nil } -// ToGetRequestInformation returns a list of webhook deliveries for a webhook configured in an organization. +// ToGetRequestInformation returns a list of webhook deliveries for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksItemDeliveriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksItemDeliveriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go b/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go index ba2b8084..ac1b439b 100644 --- a/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go +++ b/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go @@ -28,7 +28,7 @@ func NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, re urlParams["request-raw-url"] = rawUrl return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get returns a delivery for a webhook configured in an organization. +// Get returns a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a HookDeliveryable when successful // returns a BasicError error when the service returns a 400 status code // returns a ValidationError error when the service returns a 422 status code @@ -53,7 +53,7 @@ func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable), nil } -// ToGetRequestInformation returns a delivery for a webhook configured in an organization. +// ToGetRequestInformation returns a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_hooks_item_pings_request_builder.go b/pkg/github/orgs/item_hooks_item_pings_request_builder.go index 1ef6651f..c497aafb 100644 --- a/pkg/github/orgs/item_hooks_item_pings_request_builder.go +++ b/pkg/github/orgs/item_hooks_item_pings_request_builder.go @@ -23,7 +23,7 @@ func NewItemHooksItemPingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f urlParams["request-raw-url"] = rawUrl return NewItemHooksItemPingsRequestBuilderInternal(urlParams, requestAdapter) } -// Post this will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. +// Post this will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)to be sent to the hook.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a BasicError error when the service returns a 404 status code // [API method documentation] // @@ -42,7 +42,7 @@ func (m *ItemHooksItemPingsRequestBuilder) Post(ctx context.Context, requestConf } return nil } -// ToPostRequestInformation this will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. +// ToPostRequestInformation this will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)to be sent to the hook.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksItemPingsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_hooks_request_builder.go b/pkg/github/orgs/item_hooks_request_builder.go index 8adca6a5..df0b48e5 100644 --- a/pkg/github/orgs/item_hooks_request_builder.go +++ b/pkg/github/orgs/item_hooks_request_builder.go @@ -11,7 +11,7 @@ import ( type ItemHooksRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemHooksRequestBuilderGetQueryParameters list organization webhooks +// ItemHooksRequestBuilderGetQueryParameters you must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. type ItemHooksRequestBuilderGetQueryParameters 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"` @@ -41,7 +41,7 @@ func NewItemHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee2633 urlParams["request-raw-url"] = rawUrl return NewItemHooksRequestBuilderInternal(urlParams, requestAdapter) } -// Get list organization webhooks +// Get you must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a []OrgHookable when successful // returns a BasicError error when the service returns a 404 status code // [API method documentation] @@ -67,7 +67,7 @@ func (m *ItemHooksRequestBuilder) Get(ctx context.Context, requestConfiguration } return val, nil } -// Post here's how you can create a hook that posts payloads in JSON format: +// Post create a hook that posts payloads in JSON format.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a OrgHookable when successful // returns a BasicError error when the service returns a 404 status code // returns a ValidationError error when the service returns a 422 status code @@ -92,6 +92,7 @@ func (m *ItemHooksRequestBuilder) Post(ctx context.Context, body ItemHooksPostRe } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable), nil } +// ToGetRequestInformation you must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -99,7 +100,7 @@ func (m *ItemHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, r requestInfo.Headers.TryAdd("Accept", "application/json") return requestInfo, nil } -// ToPostRequestInformation here's how you can create a hook that posts payloads in JSON format: +// ToPostRequestInformation create a hook that posts payloads in JSON format.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, "{+baseurl}/orgs/{org}/hooks", m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go b/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go index 194df5b4..6fceff62 100644 --- a/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go +++ b/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go @@ -28,7 +28,7 @@ func NewItemHooksWithHook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4 urlParams["request-raw-url"] = rawUrl return NewItemHooksWithHook_ItemRequestBuilderInternal(urlParams, requestAdapter) } -// Delete delete an organization webhook +// Delete you must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a BasicError error when the service returns a 404 status code // [API method documentation] // @@ -52,7 +52,7 @@ func (m *ItemHooksWithHook_ItemRequestBuilder) Delete(ctx context.Context, reque func (m *ItemHooksWithHook_ItemRequestBuilder) Deliveries()(*ItemHooksItemDeliveriesRequestBuilder) { return NewItemHooksItemDeliveriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization)." +// Get returns a webhook configured in an organization. To get only the webhook`config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a OrgHookable when successful // returns a BasicError error when the service returns a 404 status code // [API method documentation] @@ -75,7 +75,7 @@ func (m *ItemHooksWithHook_ItemRequestBuilder) Get(ctx context.Context, requestC } return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable), nil } -// Patch updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)." +// Patch updates a webhook configured in an organization. When you update a webhook,the `secret` will be overwritten. If you previously had a `secret` set, you mustprovide the same `secret` or set a new `secret` or the secret will be removed. Ifyou are only updating individual webhook `config` properties, use "[Update a webhookconfiguration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a OrgHookable when successful // returns a BasicError error when the service returns a 404 status code // returns a ValidationError error when the service returns a 422 status code @@ -105,6 +105,7 @@ func (m *ItemHooksWithHook_ItemRequestBuilder) Patch(ctx context.Context, body I func (m *ItemHooksWithHook_ItemRequestBuilder) Pings()(*ItemHooksItemPingsRequestBuilder) { return NewItemHooksItemPingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// ToDeleteRequestInformation you must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksWithHook_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -112,7 +113,7 @@ func (m *ItemHooksWithHook_ItemRequestBuilder) ToDeleteRequestInformation(ctx co requestInfo.Headers.TryAdd("Accept", "application/json") return requestInfo, nil } -// ToGetRequestInformation returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization)." +// ToGetRequestInformation returns a webhook configured in an organization. To get only the webhook`config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksWithHook_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -120,7 +121,7 @@ func (m *ItemHooksWithHook_ItemRequestBuilder) ToGetRequestInformation(ctx conte requestInfo.Headers.TryAdd("Accept", "application/json") return requestInfo, nil } -// ToPatchRequestInformation updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)." +// ToPatchRequestInformation updates a webhook configured in an organization. When you update a webhook,the `secret` will be overwritten. If you previously had a `secret` set, you mustprovide the same `secret` or set a new `secret` or the secret will be removed. Ifyou are only updating individual webhook `config` properties, use "[Update a webhookconfiguration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. // returns a *RequestInformation when successful func (m *ItemHooksWithHook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemHooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/pkg/github/orgs/item_migrations_item_archive_request_builder.go b/pkg/github/orgs/item_migrations_item_archive_request_builder.go index b3603865..77f28f38 100644 --- a/pkg/github/orgs/item_migrations_item_archive_request_builder.go +++ b/pkg/github/orgs/item_migrations_item_archive_request_builder.go @@ -43,27 +43,23 @@ func (m *ItemMigrationsItemArchiveRequestBuilder) Delete(ctx context.Context, re return nil } // Get fetches the URL to a migration archive. -// returns a []byte when successful // returns a BasicError error when the service returns a 404 status code // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive -func (m *ItemMigrationsItemArchiveRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemMigrationsItemArchiveRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) if err != nil { - return nil, err - } - if res == nil { - return nil, nil + return err } - return res.([]byte), nil + return nil } // ToDeleteRequestInformation deletes a previous migration archive. Migration archives are automatically deleted after seven days. // returns a *RequestInformation when successful diff --git a/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go b/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go index ca5144e9..6e4b80dd 100644 --- a/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go +++ b/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go @@ -24,27 +24,23 @@ func NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder(rawUrl return NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(urlParams, requestAdapter) } // Get gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` inthe response header to find the URL for the download. The `:archive_format` must be `zip`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. -// returns a []byte when successful // returns a BasicError error when the service returns a 410 status code // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/actions/artifacts#download-an-artifact -func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) if err != nil { - return nil, err + return err } - if res == nil { - return nil, nil - } - return res.([]byte), nil + return nil } // ToGetRequestInformation gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` inthe response header to find the URL for the download. The `:archive_format` must be `zip`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. // returns a *RequestInformation when successful diff --git a/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go b/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go index b025a265..ed5e38e4 100644 --- a/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go +++ b/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go @@ -23,23 +23,19 @@ func NewItemItemActionsJobsItemLogsRequestBuilder(rawUrl string, requestAdapter return NewItemItemActionsJobsItemLogsRequestBuilderInternal(urlParams, requestAdapter) } // Get gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Lookfor `Location:` in the response header to find the URL for the download.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 []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run -func (m *ItemItemActionsJobsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemItemActionsJobsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err + return err } - if res == nil { - return nil, nil - } - return res.([]byte), nil + return nil } // ToGetRequestInformation gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Lookfor `Location:` in the response header to find the URL for the download.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 diff --git a/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go index 6502b475..efb7801e 100644 --- a/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go +++ b/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go @@ -23,23 +23,19 @@ func NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder(rawUrl string, req return NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal(urlParams, requestAdapter) } // Get gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after1 minute. Look for `Location:` in the response header to find the URL for the download.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 []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs -func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err + return err } - if res == nil { - return nil, nil - } - return res.([]byte), nil + return nil } // ToGetRequestInformation gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after1 minute. Look for `Location:` in the response header to find the URL for the download.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 diff --git a/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go index b064e0b3..16ea12de 100644 --- a/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go +++ b/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go @@ -45,23 +45,19 @@ func (m *ItemItemActionsRunsItemLogsRequestBuilder) Delete(ctx context.Context, return nil } // Get gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for`Location:` in the response header to find the URL for the download.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 []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs -func (m *ItemItemActionsRunsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemItemActionsRunsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err - } - if res == nil { - return nil, nil + return err } - return res.([]byte), nil + return nil } // ToDeleteRequestInformation deletes all logs for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. // returns a *RequestInformation when successful diff --git a/pkg/github/repos/item_item_dispatches_request_builder.go b/pkg/github/repos/item_item_dispatches_request_builder.go index ed64ce18..923b3132 100644 --- a/pkg/github/repos/item_item_dispatches_request_builder.go +++ b/pkg/github/repos/item_item_dispatches_request_builder.go @@ -24,6 +24,7 @@ func NewItemItemDispatchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f return NewItemItemDispatchesRequestBuilderInternal(urlParams, requestAdapter) } // Post you can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)."The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.This input example shows how you can use the `client_payload` as a test to debug your workflow.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code // returns a ValidationError error when the service returns a 422 status code // [API method documentation] // @@ -34,6 +35,7 @@ func (m *ItemItemDispatchesRequestBuilder) Post(ctx context.Context, body ItemIt return err } errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, } err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) diff --git a/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go b/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go index 56062578..7ddba5f3 100644 --- a/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go +++ b/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go @@ -23,23 +23,19 @@ func NewItemItemTarballWithRefItemRequestBuilder(rawUrl string, requestAdapter i return NewItemItemTarballWithRefItemRequestBuilderInternal(urlParams, requestAdapter) } // Get gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.**Note**: For private repositories, these links are temporary and expire after five minutes. -// returns a []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar -func (m *ItemItemTarballWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemItemTarballWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err + return err } - if res == nil { - return nil, nil - } - return res.([]byte), nil + return nil } // ToGetRequestInformation gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.**Note**: For private repositories, these links are temporary and expire after five minutes. // returns a *RequestInformation when successful diff --git a/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go b/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go index 2d9a5723..f7000cb5 100644 --- a/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go +++ b/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go @@ -23,23 +23,19 @@ func NewItemItemZipballWithRefItemRequestBuilder(rawUrl string, requestAdapter i return NewItemItemZipballWithRefItemRequestBuilderInternal(urlParams, requestAdapter) } // Get gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.**Note**: For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect. -// returns a []byte when successful // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip -func (m *ItemItemZipballWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *ItemItemZipballWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) if err != nil { - return nil, err + return err } - if res == nil { - return nil, nil - } - return res.([]byte), nil + return nil } // ToGetRequestInformation gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.**Note**: For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect. // returns a *RequestInformation when successful diff --git a/pkg/github/user/migrations_item_archive_request_builder.go b/pkg/github/user/migrations_item_archive_request_builder.go index 6e015390..6fcde9e6 100644 --- a/pkg/github/user/migrations_item_archive_request_builder.go +++ b/pkg/github/user/migrations_item_archive_request_builder.go @@ -47,29 +47,25 @@ func (m *MigrationsItemArchiveRequestBuilder) Delete(ctx context.Context, reques return nil } // Get fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:* attachments* bases* commit\_comments* issue\_comments* issue\_events* issues* milestones* organizations* projects* protected\_branches* pull\_request\_reviews* pull\_requests* releases* repositories* review\_comments* schema* usersThe archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. -// returns a []byte when successful // returns a BasicError error when the service returns a 401 status code // returns a BasicError error when the service returns a 403 status code // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive -func (m *MigrationsItemArchiveRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { +func (m *MigrationsItemArchiveRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { - return nil, err + return err } errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) if err != nil { - return nil, err - } - if res == nil { - return nil, nil + return err } - return res.([]byte), nil + return nil } // ToDeleteRequestInformation deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/migrations/users#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/migrations/users#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. // returns a *RequestInformation when successful